Module Flx_ast


module Flx_ast: sig .. end
Types used in the Felix compiler

type srcref = string * int * int * int 
type of a position in the original sources
type range_srcref = string * int * int * int * int 
type of a span between two positions in one file
type bigint = Big_int.big_int 
type id_t = string 
type bid_t = int 
type index_map_t = (int, int) Hashtbl.t 
type c_t = [ `Identity | `Str of string | `StrTemplate of string | `Virtual ] 
type base_type_qual_t = [ `GC_pointer | `Incomplete | `Pod ] 
type qualified_name_t = [ `AST_callback of range_srcref * qualified_name_t
| `AST_case_tag of range_srcref * int
| `AST_index of range_srcref * string * int
| `AST_lookup of
range_srcref *
(expr_t * string * typecode_t list)
| `AST_name of range_srcref * string * typecode_t list
| `AST_the of range_srcref * qualified_name_t
| `AST_typed_case of range_srcref * int * typecode_t
| `AST_void of range_srcref ]
type of a qualified name
type suffixed_name_t = [ `AST_callback of range_srcref * qualified_name_t
| `AST_case_tag of range_srcref * int
| `AST_index of range_srcref * string * int
| `AST_lookup of
range_srcref *
(expr_t * string * typecode_t list)
| `AST_name of range_srcref * string * typecode_t list
| `AST_suffix of
range_srcref * (qualified_name_t * typecode_t)
| `AST_the of range_srcref * qualified_name_t
| `AST_typed_case of range_srcref * int * typecode_t
| `AST_void of range_srcref ]
type of a suffixed name
type regexp_t = [ `REGEXP_alt of regexp_t * regexp_t
| `REGEXP_aster of regexp_t
| `REGEXP_code of expr_t
| `REGEXP_epsilon
| `REGEXP_group of string * regexp_t
| `REGEXP_name of qualified_name_t
| `REGEXP_sentinel
| `REGEXP_seq of regexp_t * regexp_t
| `REGEXP_string of string ]
type of a regular expression
type typecode_t = [ `AST_callback of range_srcref * qualified_name_t
| `AST_case_tag of range_srcref * int
| `AST_index of range_srcref * string * int
| `AST_lookup of
range_srcref *
(expr_t * string * typecode_t list)
| `AST_name of range_srcref * string * typecode_t list
| `AST_patany of range_srcref
| `AST_patvar of range_srcref * string
| `AST_suffix of
range_srcref * (qualified_name_t * typecode_t)
| `AST_the of range_srcref * qualified_name_t
| `AST_typed_case of range_srcref * int * typecode_t
| `AST_void of range_srcref
| `TYP_apply of typecode_t * typecode_t
| `TYP_array of typecode_t * typecode_t
| `TYP_as of typecode_t * string
| `TYP_case of typecode_t * string list * typecode_t
| `TYP_case_arg of int * typecode_t
| `TYP_cfunction of typecode_t * typecode_t
| `TYP_cod of typecode_t
| `TYP_dom of typecode_t
| `TYP_dual of typecode_t
| `TYP_ellipsis
| `TYP_function of typecode_t * typecode_t
| `TYP_glr_attr_type of qualified_name_t
| `TYP_intersect of typecode_t list
| `TYP_isin of typecode_t * typecode_t
| `TYP_lift of typecode_t
| `TYP_lvalue of typecode_t
| `TYP_none
| `TYP_pointer of typecode_t
| `TYP_proj of int * typecode_t
| `TYP_record of (string * typecode_t) list
| `TYP_setintersection of typecode_t list
| `TYP_setunion of typecode_t list
| `TYP_sum of typecode_t list
| `TYP_tuple of typecode_t list
| `TYP_type
| `TYP_type_match of
typecode_t * (typecode_t * typecode_t) list
| `TYP_type_tuple of typecode_t list
| `TYP_typefun of
simple_parameter_t list * typecode_t * typecode_t
| `TYP_typeof of expr_t
| `TYP_typeset of typecode_t list
| `TYP_unitsum of int
| `TYP_var of int
| `TYP_variant of (string * typecode_t) list ]
type of a type
type tpattern_t = [ `TPAT_any
| `TPAT_as of tpattern_t * string
| `TPAT_function of tpattern_t * tpattern_t
| `TPAT_name of string * tpattern_t list
| `TPAT_pointer of tpattern_t
| `TPAT_sum of tpattern_t list
| `TPAT_tuple of tpattern_t list
| `TPAT_type_tuple of tpattern_t list
| `TPAT_unitsum of int
| `TPAT_var of string
| `TPAT_void ]
type raw_typeclass_insts_t = qualified_name_t list 

type vs_aux_t = {
   raw_type_constraint : typecode_t;
   raw_typeclass_reqs : raw_typeclass_insts_t;
}
type plain_vs_list_t = (id_t * typecode_t) list 
type plain_ivs_list_t = (id_t * int * typecode_t) list 
type vs_list_t = plain_vs_list_t * vs_aux_t 
type ivs_list_t = plain_ivs_list_t * vs_aux_t 
type literal_t = [ `AST_cstring of string
| `AST_float of string * string
| `AST_int of string * bigint
| `AST_string of string
| `AST_ustring of string
| `AST_wstring of string ]
type axiom_kind_t = [ `Axiom | `Lemma ] 
type axiom_method_t = [ `Equation of expr_t * expr_t | `Predicate of expr_t ] 
type expr_t = [ `AST_andlist of range_srcref * expr_t list
| `AST_apply of range_srcref * (expr_t * expr_t)
| `AST_arrayof of range_srcref * expr_t list
| `AST_arrow of range_srcref * (expr_t * expr_t)
| `AST_as of range_srcref * (expr_t * string)
| `AST_callback of range_srcref * qualified_name_t
| `AST_case of
range_srcref * expr_t * string list * expr_t
| `AST_case_arg of range_srcref * (int * expr_t)
| `AST_case_index of range_srcref * expr_t
| `AST_case_tag of range_srcref * int
| `AST_coercion of
range_srcref * (expr_t * typecode_t)
| `AST_cond of
range_srcref * (expr_t * expr_t * expr_t)
| `AST_ctor_arg of
range_srcref * (qualified_name_t * expr_t)
| `AST_deref of range_srcref * expr_t
| `AST_dot of range_srcref * (expr_t * expr_t)
| `AST_ellipsis of range_srcref
| `AST_expr of range_srcref * string * typecode_t
| `AST_get_n of range_srcref * (int * expr_t)
| `AST_get_named_method of
range_srcref *
(string * int * typecode_t list * expr_t)
| `AST_get_named_variable of range_srcref * (string * expr_t)
| `AST_index of range_srcref * string * int
| `AST_interpolate of range_srcref * string
| `AST_lambda of
range_srcref *
(vs_list_t * params_t list * typecode_t *
statement_t list)
| `AST_letin of
range_srcref *
(pattern_t * expr_t * expr_t)
| `AST_lift of range_srcref * expr_t
| `AST_literal of range_srcref * literal_t
| `AST_longarrow of range_srcref * (expr_t * expr_t)
| `AST_lookup of
range_srcref *
(expr_t * string * typecode_t list)
| `AST_lvalue of range_srcref * expr_t
| `AST_macro_ctor of range_srcref * (string * expr_t)
| `AST_macro_statements of range_srcref * statement_t list
| `AST_map of range_srcref * expr_t * expr_t
| `AST_match of
range_srcref *
(expr_t * (pattern_t * expr_t) list)
| `AST_match_case of range_srcref * (int * expr_t)
| `AST_match_ctor of
range_srcref * (qualified_name_t * expr_t)
| `AST_method_apply of
range_srcref *
(id_t * expr_t * typecode_t list)
| `AST_name of range_srcref * string * typecode_t list
| `AST_new of range_srcref * expr_t
| `AST_noexpand of range_srcref * expr_t
| `AST_orlist of range_srcref * expr_t list
| `AST_parse of
range_srcref * expr_t *
(range_srcref * production_t * expr_t) list
| `AST_patany of range_srcref
| `AST_patvar of range_srcref * string
| `AST_product of range_srcref * expr_t list
| `AST_record of range_srcref * (string * expr_t) list
| `AST_record_type of
range_srcref * (string * typecode_t) list
| `AST_ref of range_srcref * expr_t
| `AST_reglex of
range_srcref *
(expr_t * expr_t *
(regexp_t * expr_t) list)
| `AST_regmatch of
range_srcref *
(expr_t * expr_t *
(regexp_t * expr_t) list)
| `AST_setintersection of range_srcref * expr_t list
| `AST_setunion of range_srcref * expr_t list
| `AST_sparse of range_srcref * expr_t * string * int list
| `AST_string_regmatch of
range_srcref *
(expr_t * (regexp_t * expr_t) list)
| `AST_suffix of
range_srcref * (qualified_name_t * typecode_t)
| `AST_sum of range_srcref * expr_t list
| `AST_superscript of
range_srcref * (expr_t * expr_t)
| `AST_the of range_srcref * qualified_name_t
| `AST_tuple of range_srcref * expr_t list
| `AST_type_match of
range_srcref *
(typecode_t * (typecode_t * typecode_t) list)
| `AST_typed_case of range_srcref * int * typecode_t
| `AST_typeof of range_srcref * expr_t
| `AST_variant of range_srcref * (string * expr_t)
| `AST_variant_type of
range_srcref * (string * typecode_t) list
| `AST_void of range_srcref
| `AST_vsprintf of range_srcref * string ]

type float_pat =
| Float_plus of string * string (*type, value*)
| Float_minus of string * string
| Float_inf (*infinity*)
| Float_minus_inf (*negative infinity*)
type pattern_t = [ `PAT_any of range_srcref
| `PAT_as of range_srcref * pattern_t * id_t
| `PAT_coercion of
range_srcref * pattern_t * typecode_t
| `PAT_const_ctor of range_srcref * qualified_name_t
| `PAT_float_range of
range_srcref * float_pat * float_pat
| `PAT_int of range_srcref * string * bigint
| `PAT_int_range of
range_srcref * string * bigint * string * bigint
| `PAT_name of range_srcref * id_t
| `PAT_nan of range_srcref
| `PAT_nonconst_ctor of
range_srcref * qualified_name_t * pattern_t
| `PAT_none of range_srcref
| `PAT_record of
range_srcref * (id_t * pattern_t) list
| `PAT_regexp of range_srcref * string * id_t list
| `PAT_string of range_srcref * string
| `PAT_string_range of range_srcref * string * string
| `PAT_tuple of range_srcref * pattern_t list
| `PAT_when of range_srcref * pattern_t * expr_t ]
type param_kind_t = [ `PFun | `PRef | `PVal | `PVar ] 
type simple_parameter_t = id_t * typecode_t 
type parameter_t = param_kind_t * id_t * typecode_t 

type macro_parameter_type_t =
| Ident
| Expr
| Stmt
type macro_parameter_t = id_t * macro_parameter_type_t 
type lvalue_t = [ `Expr of range_srcref * expr_t
| `List of tlvalue_t list
| `Name of range_srcref * string
| `Skip of range_srcref
| `Val of range_srcref * string
| `Var of range_srcref * string ]
type tlvalue_t = lvalue_t * typecode_t option 
type funkind_t = [ `CFunction
| `Ctor
| `Function
| `Generator
| `InlineFunction
| `NoInlineFunction
| `Object
| `Virtual ]
type property_t = [ `Cfun
| `Ctor
| `Explicit_closure
| `Generated of string
| `Generator
| `Heap_closure
| `Inline
| `Inlining_complete
| `Inlining_started
| `NoInline
| `Not_requires_ptf
| `Pure
| `Recursive
| `Requires_ptf
| `Stack_closure
| `Stackable
| `Unstackable
| `Uses_gc
| `Uses_global_var
| `Virtual
| `Yields ]
type type_qual_t = [ `GC_pointer | `Incomplete | `Pod | `Raw_needs_shape of typecode_t ] 
type requirement_t = [ `Body_req of c_t
| `Header_req of c_t
| `Named_req of qualified_name_t
| `Package_req of c_t
| `Property_req of string ]
type ikind_t = [ `Body | `Header | `Package ] 
type raw_req_expr_t = [ `RREQ_and of raw_req_expr_t * raw_req_expr_t
| `RREQ_atom of requirement_t
| `RREQ_false
| `RREQ_or of raw_req_expr_t * raw_req_expr_t
| `RREQ_true ]
type named_req_expr_t = [ `NREQ_and of named_req_expr_t * named_req_expr_t
| `NREQ_atom of qualified_name_t
| `NREQ_false
| `NREQ_or of named_req_expr_t * named_req_expr_t
| `NREQ_true ]
type prec_t = string 
type glr_term_t = [ `GLR_alt of glr_term_t list
| `GLR_ast of glr_term_t
| `GLR_name of qualified_name_t
| `GLR_opt of glr_term_t
| `GLR_plus of glr_term_t
| `GLR_seq of glr_term_t list ]
type glr_entry_t = string option * glr_term_t 
type production_t = glr_entry_t list 
type reduced_glr_entry_t = string option * qualified_name_t 
type reduced_production_t = reduced_glr_entry_t list 
type params_t = parameter_t list * expr_t option 
type class_member_t = [ `MemberCtor of
id_t * int option * typecode_t * c_t option
| `MemberFun of
id_t * int option * vs_list_t * typecode_t *
c_t option
| `MemberProc of
id_t * int option * vs_list_t * typecode_t *
c_t option
| `MemberVal of id_t * typecode_t * c_t option
| `MemberVar of id_t * typecode_t * c_t option ]
type ast_term_t = [ `Apply_term of ast_term_t * ast_term_t list
| `Expression_term of expr_t
| `Identifier_term of string
| `Keyword_term of string
| `Statement_term of statement_t
| `Statements_term of statement_t list ]
type statement_t = [ `AST_abs_decl of
range_srcref * id_t * vs_list_t *
type_qual_t list * c_t * raw_req_expr_t
| `AST_apply_ctor of
range_srcref * id_t * expr_t * expr_t
| `AST_assert of range_srcref * expr_t
| `AST_assign of
range_srcref * string * tlvalue_t * expr_t
| `AST_axiom of
range_srcref * id_t * vs_list_t *
params_t * axiom_method_t
| `AST_call of range_srcref * expr_t * expr_t
| `AST_callback_decl of
range_srcref * id_t * typecode_t list *
typecode_t * raw_req_expr_t
| `AST_cassign of range_srcref * expr_t * expr_t
| `AST_cclass of
range_srcref * id_t * vs_list_t *
class_member_t list
| `AST_class of
range_srcref * id_t * vs_list_t *
statement_t list
| `AST_code of range_srcref * c_t
| `AST_comment of string
| `AST_const_decl of
range_srcref * id_t * vs_list_t *
typecode_t * c_t * raw_req_expr_t
| `AST_cparse of range_srcref * string
| `AST_cstruct of
range_srcref * id_t * vs_list_t *
(id_t * typecode_t) list
| `AST_ctypes of
range_srcref * (srcref * id_t) list *
type_qual_t list * raw_req_expr_t
| `AST_curry of
range_srcref * id_t * vs_list_t *
params_t list * (typecode_t * expr_t option) *
funkind_t * statement_t list
| `AST_export_fun of range_srcref * suffixed_name_t * string
| `AST_export_type of range_srcref * typecode_t * string
| `AST_expr_macro of
range_srcref * id_t * macro_parameter_t list *
expr_t
| `AST_fun_decl of
range_srcref * id_t * vs_list_t *
typecode_t list * typecode_t * c_t *
raw_req_expr_t * prec_t
| `AST_fun_return of range_srcref * expr_t
| `AST_function of
range_srcref * id_t * vs_list_t *
params_t * (typecode_t * expr_t option) *
property_t list * statement_t list
| `AST_glr of
range_srcref * string * typecode_t *
(range_srcref * production_t * expr_t) list
| `AST_goto of range_srcref * id_t
| `AST_halt of range_srcref * string
| `AST_ifdo of
range_srcref * expr_t * statement_t list *
statement_t list
| `AST_ifgoto of range_srcref * expr_t * id_t
| `AST_ifnotgoto of range_srcref * expr_t * id_t
| `AST_ifreturn of range_srcref * expr_t
| `AST_include of range_srcref * string
| `AST_inherit of
range_srcref * id_t * vs_list_t *
qualified_name_t
| `AST_inherit_fun of
range_srcref * id_t * vs_list_t *
qualified_name_t
| `AST_init of range_srcref * id_t * expr_t
| `AST_inject_module of range_srcref * qualified_name_t
| `AST_insert of
range_srcref * id_t * vs_list_t * c_t *
ikind_t * raw_req_expr_t
| `AST_instance of
range_srcref * vs_list_t * qualified_name_t *
statement_t list
| `AST_jump of range_srcref * expr_t * expr_t
| `AST_label of range_srcref * id_t
| `AST_lazy_decl of
range_srcref * id_t * vs_list_t *
typecode_t option * expr_t option
| `AST_lemma of
range_srcref * id_t * vs_list_t *
params_t * axiom_method_t
| `AST_loop of range_srcref * id_t * expr_t
| `AST_macro_assign of
range_srcref * id_t list * expr_t
| `AST_macro_block of range_srcref * statement_t list
| `AST_macro_forget of range_srcref * id_t list
| `AST_macro_goto of range_srcref * id_t
| `AST_macro_ifgoto of range_srcref * expr_t * id_t
| `AST_macro_ifor of
range_srcref * id_t * id_t list *
statement_t list
| `AST_macro_label of range_srcref * id_t
| `AST_macro_name of range_srcref * id_t * id_t
| `AST_macro_names of range_srcref * id_t * id_t list
| `AST_macro_proc_return of range_srcref
| `AST_macro_val of range_srcref * id_t list * expr_t
| `AST_macro_vals of
range_srcref * id_t * expr_t list
| `AST_macro_var of range_srcref * id_t list * expr_t
| `AST_macro_vfor of
range_srcref * id_t list * expr_t *
statement_t list
| `AST_namespace of
range_srcref * id_t * vs_list_t *
statement_t list
| `AST_newtype of
range_srcref * id_t * vs_list_t *
typecode_t
| `AST_nop of range_srcref * string
| `AST_noreturn_code of range_srcref * c_t
| `AST_object of
range_srcref * id_t * vs_list_t *
params_t * statement_t list
| `AST_open of
range_srcref * vs_list_t * qualified_name_t
| `AST_private of range_srcref * statement_t
| `AST_proc_return of range_srcref
| `AST_reduce of
range_srcref * id_t * vs_list_t *
simple_parameter_t list * expr_t * expr_t
| `AST_ref_decl of
range_srcref * id_t * vs_list_t *
typecode_t option * expr_t option
| `AST_regdef of range_srcref * string * regexp_t
| `AST_seq of range_srcref * statement_t list
| `AST_stmt_macro of
range_srcref * id_t * macro_parameter_t list *
statement_t list
| `AST_struct of
range_srcref * id_t * vs_list_t *
(id_t * typecode_t) list
| `AST_svc of range_srcref * id_t
| `AST_type_alias of
range_srcref * id_t * vs_list_t *
typecode_t
| `AST_typeclass of
range_srcref * id_t * vs_list_t *
statement_t list
| `AST_union of
range_srcref * id_t * vs_list_t *
(id_t * int option * vs_list_t * typecode_t) list
| `AST_untyped_module of
range_srcref * id_t * vs_list_t *
statement_t list
| `AST_use of range_srcref * id_t * qualified_name_t
| `AST_user_statement of range_srcref * string * ast_term_t
| `AST_val_decl of
range_srcref * id_t * vs_list_t *
typecode_t option * expr_t option
| `AST_var_decl of
range_srcref * id_t * vs_list_t *
typecode_t option * expr_t option
| `AST_yield of range_srcref * expr_t ]
type exe_t = [ `EXE_apply_ctor of id_t * expr_t * expr_t
| `EXE_assert of expr_t
| `EXE_assign of expr_t * expr_t
| `EXE_call of expr_t * expr_t
| `EXE_code of c_t
| `EXE_comment of string
| `EXE_fun_return of expr_t
| `EXE_goto of string
| `EXE_halt of string
| `EXE_ifgoto of expr_t * string
| `EXE_ifnotgoto of expr_t * string
| `EXE_iinit of (id_t * int) * expr_t
| `EXE_init of id_t * expr_t
| `EXE_jump of expr_t * expr_t
| `EXE_label of string
| `EXE_loop of id_t * expr_t
| `EXE_nop of string
| `EXE_noreturn_code of c_t
| `EXE_proc_return
| `EXE_svc of id_t
| `EXE_yield of expr_t ]
type sexe_t = range_srcref * exe_t 
type compilation_unit_t = statement_t list