package catala
Compiler and library for the literate programming language for tax code specification
Install
Dune Dependency
Authors
Maintainers
Sources
0.7.0.tar.gz
md5=6dbbc2f50c23693f26ab6f048e78172f
sha512=a5701e14932d8a866e2aa3731f76df85ff2a68b4fa943fd510c535913573274d66eaec1ae6fcae17f20b475876048a9ab196ef6d8c23d4ea6b90b986aa0a6daa
doc/catala.desugared/Desugared/Ast/index.html
Module Desugared.Ast
Source
Abstract syntax tree of the desugared representation
Names, Maps and Keys
Inside a scope, a definition can refer either to a scope def, or a subscope def
AST
Source
type location =
| ScopeVar of ScopeVar.t Utils.Marked.pos * StateName.t option
| SubScopeVar of Scopelang.Ast.ScopeName.t * Scopelang.Ast.SubScopeName.t Utils.Marked.pos * ScopeVar.t Utils.Marked.pos
Expressions
The expressions use the Bindlib library, based on higher-order abstract syntax
Source
and expr =
| ELocation of location
| EVar of expr Bindlib.var
| EStruct of Scopelang.Ast.StructName.t * marked_expr Scopelang.Ast.StructFieldMap.t
| EStructAccess of marked_expr * Scopelang.Ast.StructFieldName.t * Scopelang.Ast.StructName.t
| EEnumInj of marked_expr * Scopelang.Ast.EnumConstructor.t * Scopelang.Ast.EnumName.t
| EMatch of marked_expr * Scopelang.Ast.EnumName.t * marked_expr Scopelang.Ast.EnumConstructorMap.t
| ELit of Dcalc.Ast.lit
| EAbs of (expr, marked_expr) Bindlib.mbinder * Scopelang.Ast.typ Utils.Marked.pos list
| EApp of marked_expr * marked_expr list
| EOp of Dcalc.Ast.operator
| EDefault of marked_expr list * marked_expr * marked_expr
| EIfThenElse of marked_expr * marked_expr * marked_expr
| EArray of marked_expr list
| ErrorOnEmpty of marked_expr
Variable helpers
Source
val make_abs :
vars ->
expr Utils.Marked.pos Bindlib.box ->
Scopelang.Ast.typ Utils.Marked.pos list ->
Utils.Pos.t ->
expr Utils.Marked.pos Bindlib.box
Source
val make_app :
expr Utils.Marked.pos Bindlib.box ->
expr Utils.Marked.pos Bindlib.box list ->
Utils.Pos.t ->
expr Utils.Marked.pos Bindlib.box
Source
val make_let_in :
Var.t ->
Scopelang.Ast.typ Utils.Marked.pos ->
expr Utils.Marked.pos Bindlib.box ->
expr Utils.Marked.pos Bindlib.box ->
expr Utils.Marked.pos Bindlib.box
Rules and scopes
Source
type exception_situation =
| BaseCase
| ExceptionToLabel of LabelName.t Utils.Marked.pos
| ExceptionToRule of RuleName.t Utils.Marked.pos
Source
type rule = {
rule_id : RuleName.t;
rule_just : expr Utils.Marked.pos Bindlib.box;
rule_cons : expr Utils.Marked.pos Bindlib.box;
rule_parameter : (Var.t * Scopelang.Ast.typ Utils.Marked.pos) option;
rule_exception : exception_situation;
rule_label : label_situation;
}
Source
type meta_assertion =
| FixedBy of reference_typ Utils.Marked.pos
| VariesWith of unit * variation_typ Utils.Marked.pos option
Source
type scope_def = {
scope_def_rules : rule RuleMap.t;
scope_def_typ : Scopelang.Ast.typ Utils.Marked.pos;
scope_def_is_condition : bool;
scope_def_io : Scopelang.Ast.io;
}
Source
type scope = {
scope_vars : var_or_states ScopeVarMap.t;
scope_sub_scopes : Scopelang.Ast.ScopeName.t Scopelang.Ast.SubScopeMap.t;
scope_uid : Scopelang.Ast.ScopeName.t;
scope_defs : scope_def ScopeDefMap.t;
scope_assertions : assertion list;
scope_meta_assertions : meta_assertion list;
}
Source
type program = {
program_scopes : scope Scopelang.Ast.ScopeMap.t;
program_enums : Scopelang.Ast.enum_ctx;
program_structs : Scopelang.Ast.struct_ctx;
}
Helpers
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page