forked from iamumairs/twtl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lexer.mll
27 lines (26 loc) · 869 Bytes
/
lexer.mll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
open Parser
}
rule lex = parse
| "True" { TRUE }
| "False" { FALSE }
| "&" { AND }
| "|" { OR }
| ['~' '!'] { NOT }
| ['-' '='] '>' { IMPL }
| "holds_for" { HOLD }
| "notholds_for" { NHOLD }
| "within" { WITHIN }
| '*' { CONCAT }
| ['0'-'9']+ as lxm { INT(int_of_string lxm) }
(*| ['A'-'Z' 'a'-'z']['0'-'9' 'A'-'Z' 'a'-'z']* as s { ID (s) }*)
| ['0'-'9' 'A'-'Z' 'a'-'z']* as s { ID (s) }
| "_" { UNDER }
| "," { COMMA }
| "." { DOT }
| [' ' '\t' '\n'] { lex lexbuf }
| "[" { OPEN }
| "]" { CLOSE }
| "(" { OP }
| ")" { CL }
| eof { EOF }