-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathast.mli
More file actions
executable file
·61 lines (49 loc) · 1.7 KB
/
ast.mli
File metadata and controls
executable file
·61 lines (49 loc) · 1.7 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
type ('info, 'data) node = { node : 'data;
info : 'info; }
type 'info ident = ('info, string) node
type const =
Cint of Int32.t
| Cstring of string
| Cbool of bool
| Cnull
type typ =
Tboolean
| Tint
| Tclass of string
| Tvoid
| Tnull
type unop = Upost_inc | Upost_dec | Upre_inc | Upre_dec | Unot | Uneg
type binop = Beq | Bneq | Blt | Blte | Bgt | Bgte
| Badd | Bsub | Bmul | Bdiv | Bmod
| Band | Bor
type 'info expr = ('info, 'info expr_node) node
and 'info expr_node =
Econst of const
| Elval of 'info lvalue
| Eassign of 'info lvalue * 'info expr
| Ecall of 'info lvalue * 'info expr list
| Enew of 'info ident * 'info expr list
| Eunop of unop * 'info expr
| Ebinop of 'info expr * binop * 'info expr
| Ecast of typ * 'info expr
| Einstanceof of 'info expr * typ
and 'info lvalue =
Lident of 'info ident
| Laccess of 'info expr * 'info ident
type 'info instr = ('info, 'info instr_node) node
and 'info instr_node =
Iexpr of 'info expr
| Idecl of typ * 'info ident * ('info expr option)
| Iif of 'info expr * 'info instr * 'info instr
| Ifor of 'info expr option * 'info expr option * 'info expr option * 'info instr
| Iblock of ('info instr) list
| Ireturn of 'info expr option
type 'info class_decl =
Dfield of typ * 'info ident
| Dconstr of 'info ident * (typ * 'info ident) list * 'info instr
| Dmeth of typ * 'info ident * (typ * 'info ident) list * 'info instr
type 'info klass = 'info ident * 'info ident * 'info class_decl list
type 'info prog = 'info klass list * string * 'info instr
type position = Lexing.position * Lexing.position
type parsed_prog = position prog
type typed_prog = typ prog