This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
compilation/cours/cours-02/lexer.mll

16 lines
187 B
OCaml
Raw Permalink Normal View History

2023-09-27 18:49:08 +02:00
{
(* Prelude *)
open Parser
}
rule token = parse
| ['0'-'9']+ as x { INT (int_of_string x) }
| '+' { PLUS }
| '*' { STAR }
| ' ' { token lexbuf }
| eof { EOF }
{
(* Postlude *)
}