spooky/lib/lexer.mli

46 lines
525 B
OCaml

type token =
| TIntKw
| TBoolKw
| TVoidKw
| TStructKw
| TIf
| TElse
| TFor
| TEach
| TForEach
| TIn
| TReturn
| TTrue
| TFalse
| TIdent of string
| TIntLit of int
| TLParen
| TRParen
| TLBrace
| TRBrace
| TLBracket
| TRBracket
| TSemicolon
| TComma
| TDot
| TAssign
| TPlus
| TMinus
| TStar
| TSlash
| TPercent
| TAndAnd
| TOrOr
| TBang
| TEqEq
| TNe
| TLt
| TLe
| TGt
| TGe
| TEOF
exception Lex_error of string
val lex : string -> token list