1 #ifndef SETL_abstract_syntax_h
2 #define SETL_abstract_syntax_h
4 #include "foundation.ph"
6 datatype Exp :: collectable
11 | RECORDexp (LabeledExps)
14 | IFexp (Exp, Exp, Exp)
20 and Prim :: collectable
21 = "+" | "-" | "*" | "/" | ":="
22 | "=" | "<" | ">" | ">=" | "<="
23 | "/=" | "#" | "arb" | "div" | "mod"
26 and Decl :: collectable
27 = TYPEdecl (Id, Ids, Ty)
28 | DATATYPEdecl (Id, Ids, Terms)
30 and Term :: collectable = TERM (Id, Ty)
32 and Ty :: collectable =
36 and LabeledExp :: collectable = LABELEDexp{ id : Id, exp : Exp }
38 and Literal :: collectable
41 | STRINGlit (const char *)
44 where type Ids = List<Id>
45 and Literals = List<Literal>
47 and LabeledExps = List<LabeledExp>
48 and Decls = List<Decl>
49 and Terms = List<Term>