Scalc.Ast
module D = Dcalc.Ast
module L = Lcalc.Ast
module FuncName : sig ... end
module VarName : sig ... end
type operator = Shared_ast.lcalc Shared_ast.operator
type expr = naked_expr Catala_utils.Mark.pos
and naked_expr =
| EVar of VarName.t
| EFunc of FuncName.t
| EStruct of {
fields : expr Shared_ast.StructField.Map.t;
name : Shared_ast.StructName.t;
}
| EStructFieldAccess of {
e1 : expr;
field : Shared_ast.StructField.t;
name : Shared_ast.StructName.t;
}
| ETuple of expr list
| ETupleAccess of {
e1 : expr;
index : int;
typ : Shared_ast.typ;
}
| EInj of {
e1 : expr;
cons : Shared_ast.EnumConstructor.t;
name : Shared_ast.EnumName.t;
expr_typ : Shared_ast.typ;
}
| EArray of expr list
| ELit of Shared_ast.lit
| EPosLit
| EApp of {
}
| EAppOp of {
op : operator Catala_utils.Mark.pos;
args : expr list;
tys : Shared_ast.typ list;
}
| EExternal of {
modname : VarName.t Catala_utils.Mark.pos;
name : string Catala_utils.Mark.pos;
}
type stmt =
| SInnerFuncDef of {
name : VarName.t Catala_utils.Mark.pos;
func : func;
}
| SLocalDecl of {
name : VarName.t Catala_utils.Mark.pos;
typ : Shared_ast.typ;
}
| SLocalInit of {
name : VarName.t Catala_utils.Mark.pos;
typ : Shared_ast.typ;
expr : expr;
}
| SLocalDef of {
name : VarName.t Catala_utils.Mark.pos;
typ : Shared_ast.typ;
expr : expr;
}
| SFatalError of {
pos_expr : expr;
error : Shared_ast.Runtime.error;
}
pos_expr
here is the position reified into an expression
| SIfThenElse of {
}
| SSwitch of {
switch_var : VarName.t;
switch_var_typ : Shared_ast.typ;
enum_name : Shared_ast.EnumName.t;
switch_cases : switch_case list;
}
| SReturn of expr
| SAssert of {
}
pos_expr
here is the position reified into an expression
| SSpecialOp of special_operator
and block = stmt Catala_utils.Mark.pos list
and switch_case = {
case_block : block;
payload_var_name : VarName.t;
payload_var_typ : Shared_ast.typ;
}
and func = {
func_params : (VarName.t Catala_utils.Mark.pos * Shared_ast.typ) list;
func_body : block;
func_return_typ : Shared_ast.typ;
}
type scope_body = {
scope_body_name : Shared_ast.ScopeName.t;
scope_body_var : FuncName.t;
scope_body_func : func;
scope_body_visibility : Shared_ast.visibility;
}
type code_item =
| SVar of {
var : VarName.t;
expr : expr;
typ : Shared_ast.typ;
visibility : Shared_ast.visibility;
}
| SFunc of {
var : FuncName.t;
func : func;
visibility : Shared_ast.visibility;
}
| SScope of scope_body
type program = {
ctx : ctx;
code_items : code_item list;
module_name : (Shared_ast.ModuleName.t * Shared_ast.module_intf_id) option;
}