-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsast.mli
54 lines (44 loc) · 1.06 KB
/
sast.mli
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
open Ast
type scope =
NodeScope
| DFAScope
| StateScope
type sident =
SIdent of ident * scope
type sval =
SExprVal of sexpr
and sexpr =
SIntLit of int * datatype
| SFloatLit of float * datatype
| SStringLit of string * datatype
| SVariable of sident * datatype
| SUnop of unop * sexpr * datatype
| SBinop of sexpr * binop * sexpr * datatype
| SCall of sident * sexpr list * datatype
| SPeek of sident * datatype
| SPop of sident * datatype
| SPush of sident * sexpr * datatype
| SEosLit
type sdecl =
SVarDecl of datatype * sident
| SVarAssignDecl of datatype * sident * sval
type sstmt =
SBlock of sstmt list
| SSExpr of sexpr
| SReturn of sexpr
| SDeclaration of sdecl
| SAssign of sident * sexpr
| STransition of sident * sexpr
type snode =
SNode of sident * sstmt
type sdfastr = {
sreturn: datatype;
sdfaname : ident;
sformals : formal list;
svar_body : sstmt list;
snode_body: snode list;
}
type sdfa_decl =
SDfa_Decl of sdfastr * datatype
type sprogram =
Prog of sdfa_decl list