lambda/lexer.mll
Michael Zhang e82e05131c
assignment
2018-02-20 05:19:49 -06:00

16 lines
306 B
OCaml

{
open Parser
exception Eof
}
rule token = parse
| ' ' | '\t' { token lexbuf }
| '\n' { EOL }
| '=' { Equal }
| '\\' { Lambda }
| '(' { LParen }
| ')' { RParen }
| '.' { Dot }
| "let" { Let }
| ['a'-'z' 'A'-'Z'] ['a'-'z' 'A'-'Z' '0'-'9' '_']* as s { Ident(s) }
| eof { raise Eof }