-
Notifications
You must be signed in to change notification settings - Fork 0
/
aast.ml
15 lines (13 loc) · 816 Bytes
/
aast.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
type annotation = A of Lexing.position (* starting character position *)
type aast =
| LET of annotation * aast * aast * aast (* let x:u32 = 5 *)
| DECLARE of annotation * aast * aast (* let x:u32 *)
| ASSIGN of annotation * aast * aast (* x = 5 *)
| SEQ of annotation * (aast list) (* {thing1; thing2;} (last semicolon optional)*)
| INT of annotation * int (* 5 *)
| BOOL of annotation * bool (* true *)
| IDENT of annotation * string (* x *)
| TYPE_IDENT of annotation * Ast.types (* u32 *)
| INFIX of annotation * aast * Ast.infix_operations * aast (* x+3 or a<<1 etc..*)
| IF of annotation * aast * aast * aast (* if condition then seq1 else seq2*)
| WHILE of annotation * aast * aast (* while condition seq *)