Am Mittwoch, den 25.11.2015, 22:04 +0800 schrieb 沈胜宇: > Dear all: > > I am using ocamllex to write a lexer, the language I am analyzing have > "include" mechanism that refer to another file. > > So how can I open the refered file and switch to it in ocamllex? Just open it with Lexing.from_file, and recursively call the lexer from itself. Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------