package catala

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Scopelang.AstSource

Abstract syntax tree of the scope language

Sourcemodule Pos = Utils.Pos
Sourcemodule Uid = Utils.Uid

Identifiers

Sourcemodule ScopeMap : Map.S with type key = ScopeName.t
Sourcemodule ScopeVarSet : Set.S with type elt = ScopeVar.t
Sourcemodule ScopeVarMap : Map.S with type key = ScopeVar.t
Sourcemodule StructMap : Map.S with type key = StructName.t
Sourcemodule EnumMap : Map.S with type key = EnumName.t
Sourcetype location =
  1. | ScopeVar of ScopeVar.t Pos.marked
  2. | SubScopeVar of ScopeName.t * SubScopeName.t Pos.marked * ScopeVar.t Pos.marked

Abstract syntax tree

Sourcetype typ =
  1. | TLit of Dcalc.Ast.typ_lit
  2. | TStruct of StructName.t
  3. | TEnum of EnumName.t
  4. | TArrow of typ Pos.marked * typ Pos.marked
Sourcetype expr =
  1. | ELocation of location
  2. | EVar of expr Bindlib.var Pos.marked
  3. | EStruct of StructName.t * expr Pos.marked StructFieldMap.t
  4. | EStructAccess of expr Pos.marked * StructFieldName.t * StructName.t
  5. | EEnumInj of expr Pos.marked * EnumConstructor.t * EnumName.t
  6. | EMatch of expr Pos.marked * EnumName.t * expr Pos.marked EnumConstructorMap.t
  7. | ELit of Dcalc.Ast.lit
  8. | EAbs of Pos.t * (expr, expr Pos.marked) Bindlib.mbinder * typ Pos.marked list
  9. | EApp of expr Pos.marked * expr Pos.marked list
  10. | EOp of Dcalc.Ast.operator
  11. | EDefault of expr Pos.marked list * expr Pos.marked * expr Pos.marked
  12. | EIfThenElse of expr Pos.marked * expr Pos.marked * expr Pos.marked

The expressions use the Bindlib library, based on higher-order abstract syntax

Sourceval locations_used : expr Pos.marked -> LocationSet.t
Sourcetype rule =
  1. | Definition of location Pos.marked * typ Pos.marked * expr Pos.marked
  2. | Assertion of expr Pos.marked
  3. | Call of ScopeName.t * SubScopeName.t
Sourcetype scope_decl = {
  1. scope_decl_name : ScopeName.t;
  2. scope_sig : typ Pos.marked ScopeVarMap.t;
  3. scope_decl_rules : rule list;
}
Sourcetype program = {
  1. program_scopes : scope_decl ScopeMap.t;
  2. program_enums : enum_ctx;
  3. program_structs : struct_ctx;
}

Variable helpers

Sourcemodule Var : sig ... end
Sourcetype vars = expr Bindlib.mvar
Sourceval make_var : Var.t Pos.marked -> expr Pos.marked Bindlib.box
Sourceval make_abs : vars -> expr Pos.marked Bindlib.box -> Pos.t -> typ Pos.marked list -> Pos.t -> expr Pos.marked Bindlib.box
Sourceval make_app : expr Pos.marked Bindlib.box -> expr Pos.marked Bindlib.box list -> Pos.t -> expr Pos.marked Bindlib.box
Sourcemodule VarMap : sig ... end
OCaml

Innovation. Community. Security.