ocamllex is a Lexer generator for OCaml
ocamllex is the lexer generator for OCaml. It is based on lex (now better known as flex).
It is used within the OCaml compiler, and thus, it is installed by the official OCaml distribution. ocamllex is powerful and nicely integrated within OCaml.
For simple uses, a simple lexer generator is also available in the Genlex module of the standard library, and allows to lex files with a syntax similar to OCaml ( (..) for comments, same escape sequences in strings, etc.).
References:
See also:
ocaml ocamlyacc menhir lex flex-lexer yacc flex++ jflex ml-lex