sig
type unop = Ast.unop
type binop = Ast.binop
type constant = Ast.constant
type incdec = Ast.incdec
type function_ = {
fn_name : string;
fn_params : Tast.var list;
fn_typ : Tast.typ list;
}
and structure = {
s_name : string;
s_fields : (string, Tast.field) Stdlib.Hashtbl.t;
mutable s_list : Tast.field list;
mutable s_size : int;
}
and typ =
Tint
| Tbool
| Tstring
| Tstruct of Tast.structure
| Tptr of Tast.typ
| Tnil
| Tmany of Tast.typ list
and var = {
v_name : string;
v_id : int;
v_loc : Ast.location;
v_typ : Tast.typ;
mutable v_used : bool;
mutable v_addr : bool;
mutable v_ofs : int;
}
and field = { f_name : string; f_typ : Tast.typ; mutable f_ofs : int; }
and expr = { expr_desc : Tast.expr_desc; expr_typ : Tast.typ; }
and expr_desc =
TEskip
| TEconstant of Tast.constant
| TEbinop of Tast.binop * Tast.expr * Tast.expr
| TEunop of Tast.unop * Tast.expr
| TEnil
| TEnew of Tast.typ
| TEcall of Tast.function_ * Tast.expr list
| TEident of Tast.var
| TEdot of Tast.expr * Tast.field
| TEassign of Tast.expr list * Tast.expr list
| TEvars of Tast.var list
| TEif of Tast.expr * Tast.expr * Tast.expr
| TEreturn of Tast.expr list
| TEblock of Tast.expr list
| TEfor of Tast.expr * Tast.expr
| TEprint of Tast.expr list
| TEincdec of Tast.expr * Tast.incdec
type tdecl =
TDfunction of Tast.function_ * Tast.expr
| TDstruct of Tast.structure
type tfile = Tast.tdecl list
end