Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Notion of lexer state in ocamllex?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Van Horn <dvanhorn@c...>
Subject: [Caml-list] Notion of lexer state in ocamllex?
I'm new to ocamllex and I am trying to translate a lexer written using CUP
(for Java), but I don't understand how parser state is accomplished in
ocamllex.  For example, I have:

<YYINITIAL>"/*" { yybegin(INCOMMENT); }
<INCOMMENT>"*/" { yybegin(YYINITIAL); }
<INCOMMENT>[^\*]+    { }

Any ideas how to do this in ocamllex?  Thanks.

-d

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners