caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* I don t get the lexer
@ 2006-02-12 17:33 jean-david hsu
  2006-02-14  7:55 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 2+ messages in thread
From: jean-david hsu @ 2006-02-12 17:33 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-14  7:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-12 17:33 I don t get the lexer jean-david hsu
2006-02-14  7:55 ` [Caml-list] " Nicolas Pouillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).