sig
type location = Stdlib.Lexing.position * Stdlib.Lexing.position
type ident = { loc : Ast.location; id : string; }
type unop = Uneg | Unot | Uamp | Ustar
type binop =
Badd
| Bsub
| Bmul
| Bdiv
| Bmod
| Beq
| Bne
| Blt
| Ble
| Bgt
| Bge
| Band
| Bor
type constant = Cbool of bool | Cint of int64 | Cstring of string
type ptyp = PTident of Ast.ident | PTptr of Ast.ptyp
type incdec = Inc | Dec
type pexpr = { pexpr_desc : Ast.pexpr_desc; pexpr_loc : Ast.location; }
and pexpr_desc =
PEskip
| PEconstant of Ast.constant
| PEbinop of Ast.binop * Ast.pexpr * Ast.pexpr
| PEunop of Ast.unop * Ast.pexpr
| PEnil
| PEcall of Ast.ident * Ast.pexpr list
| PEident of Ast.ident
| PEdot of Ast.pexpr * Ast.ident
| PEassign of Ast.pexpr list * Ast.pexpr list
| PEvars of Ast.ident list * Ast.ptyp option * Ast.pexpr list
| PEif of Ast.pexpr * Ast.pexpr * Ast.pexpr
| PEreturn of Ast.pexpr list
| PEblock of Ast.pexpr list
| PEfor of Ast.pexpr * Ast.pexpr
| PEincdec of Ast.pexpr * Ast.incdec
and pparam = Ast.ident * Ast.ptyp
type pfunc = {
pf_name : Ast.ident;
pf_params : Ast.pparam list;
pf_typ : Ast.ptyp list;
pf_body : Ast.pexpr;
}
type pfield = Ast.ident * Ast.ptyp
type pstruct = { ps_name : Ast.ident; ps_fields : Ast.pfield list; }
type pdecl = PDfunction of Ast.pfunc | PDstruct of Ast.pstruct
type import_fmt = bool
type pfile = Ast.import_fmt * Ast.pdecl list
end