Version française
Home     About     Download     Resources     Contact us    
Browse thread
I don t get the lexer
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: jean-david hsu <jhsu1@e...>
Subject: I don t get the lexer
Hello everyone
how come my lexer does not break "?!" both defined as keywords but puts 
"." aside?


# let lexer = make_lexer [".";"!";"?"];;
val lexer : char Stream.t -> Genlex.token Stream.t = <fun>
# let token_stream = lexer(Stream.of_string "hello! but ?! but!?. . jhg.");;
val token_stream : Genlex.token Stream.t = <abstr>
# Stream.next token_stream;;
- : Genlex.token = Ident "hello"
# Stream.next token_stream;;
- : Genlex.token = Kwd "!"
# Stream.next token_stream;;
- : Genlex.token = Ident "but"
# Stream.next token_stream;;
- : Genlex.token = Ident "?!"
# Stream.next token_stream;;
- : Genlex.token = Ident "but"
# Stream.next token_stream;;
- : Genlex.token = Ident "!?"
# Stream.next token_stream;;
- : Genlex.token = Kwd "."
# Stream.next token_stream;;
- : Genlex.token = Kwd "."
# Stream.next token_stream;;
- : Genlex.token = Ident "jhg"
# Stream.next token_stream;;
- : Genlex.token = Kwd "."

JD

	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com