sig
type srcref = string * int * int * int
type range_srcref = string * int * int * int * int
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 = [ `Str of string | `StrTemplate of string ]
type qualified_name_t =
[ `AST_case_tag of Flx_ast.range_srcref * int
| `AST_index of Flx_ast.range_srcref * string * int
| `AST_lookup of
Flx_ast.range_srcref *
(Flx_ast.expr_t * string * Flx_ast.typecode_t list)
| `AST_name of Flx_ast.range_srcref * string * Flx_ast.typecode_t list
| `AST_the of Flx_ast.range_srcref * Flx_ast.qualified_name_t
| `AST_typed_case of Flx_ast.range_srcref * int * Flx_ast.typecode_t
| `AST_void of Flx_ast.range_srcref ]
and suffixed_name_t =
[ `AST_case_tag of Flx_ast.range_srcref * int
| `AST_index of Flx_ast.range_srcref * string * int
| `AST_lookup of
Flx_ast.range_srcref *
(Flx_ast.expr_t * string * Flx_ast.typecode_t list)
| `AST_name of Flx_ast.range_srcref * string * Flx_ast.typecode_t list
| `AST_suffix of
Flx_ast.range_srcref *
(Flx_ast.qualified_name_t * Flx_ast.typecode_t)
| `AST_the of Flx_ast.range_srcref * Flx_ast.qualified_name_t
| `AST_typed_case of Flx_ast.range_srcref * int * Flx_ast.typecode_t
| `AST_void of Flx_ast.range_srcref ]
and regexp_t =
REGEXP_seq of Flx_ast.regexp_t * Flx_ast.regexp_t
| REGEXP_alt of Flx_ast.regexp_t * Flx_ast.regexp_t
| REGEXP_aster of Flx_ast.regexp_t
| REGEXP_name of Flx_ast.qualified_name_t
| REGEXP_string of string
| REGEXP_epsilon
| REGEXP_sentinel
| REGEXP_code of Flx_ast.expr_t
| REGEXP_group of string * Flx_ast.regexp_t
and typecode_t =
[ `AST_case_tag of Flx_ast.range_srcref * int
| `AST_index of Flx_ast.range_srcref * string * int
| `AST_lookup of
Flx_ast.range_srcref *
(Flx_ast.expr_t * string * Flx_ast.typecode_t list)
| `AST_name of Flx_ast.range_srcref * string * Flx_ast.typecode_t list
| `AST_suffix of
Flx_ast.range_srcref *
(Flx_ast.qualified_name_t * Flx_ast.typecode_t)
| `AST_the of Flx_ast.range_srcref * Flx_ast.qualified_name_t
| `AST_typed_case of Flx_ast.range_srcref * int * Flx_ast.typecode_t
| `AST_void of Flx_ast.range_srcref
| `TYP_apply of Flx_ast.typecode_t * Flx_ast.typecode_t
| `TYP_array of Flx_ast.typecode_t * Flx_ast.typecode_t
| `TYP_as of Flx_ast.typecode_t * string
| `TYP_case_arg of int * Flx_ast.typecode_t
| `TYP_cod of Flx_ast.typecode_t
| `TYP_dom of Flx_ast.typecode_t
| `TYP_dual of Flx_ast.typecode_t
| `TYP_ellipsis
| `TYP_function of Flx_ast.typecode_t * Flx_ast.typecode_t
| `TYP_glr_attr_type of Flx_ast.qualified_name_t
| `TYP_intersect of Flx_ast.typecode_t list
| `TYP_isin of Flx_ast.typecode_t * Flx_ast.typecode_t
| `TYP_lvalue of Flx_ast.typecode_t
| `TYP_none
| `TYP_pointer of Flx_ast.typecode_t
| `TYP_proj of int * Flx_ast.typecode_t
| `TYP_setintersection of Flx_ast.typecode_t list
| `TYP_setunion of Flx_ast.typecode_t list
| `TYP_sum of Flx_ast.typecode_t list
| `TYP_tuple of Flx_ast.typecode_t list
| `TYP_type
| `TYP_type_match of
Flx_ast.typecode_t * (Flx_ast.tpattern_t * Flx_ast.typecode_t) list
| `TYP_type_tuple of Flx_ast.typecode_t list
| `TYP_typefun of
Flx_ast.parameter_t list * Flx_ast.typecode_t * Flx_ast.typecode_t
| `TYP_typeof of Flx_ast.expr_t
| `TYP_typeset of Flx_ast.typecode_t list
| `TYP_unitsum of int
| `TYP_var of int ]
and tpattern_t =
[ `TPAT_any
| `TPAT_as of Flx_ast.tpattern_t * string
| `TPAT_function of Flx_ast.tpattern_t * Flx_ast.tpattern_t
| `TPAT_name of string * Flx_ast.tpattern_t list
| `TPAT_pointer of Flx_ast.tpattern_t
| `TPAT_sum of Flx_ast.tpattern_t list
| `TPAT_tuple of Flx_ast.tpattern_t list
| `TPAT_type_tuple of Flx_ast.tpattern_t list
| `TPAT_unitsum of int
| `TPAT_var of string
| `TPAT_void ]
and vs_list_t = (Flx_ast.id_t * Flx_ast.tpattern_t) list
and ivs_list_t = (Flx_ast.id_t * int * Flx_ast.tpattern_t) list
and literal_t =
[ `AST_cstring of string
| `AST_float of string * string
| `AST_int of string * Flx_ast.bigint
| `AST_string of string
| `AST_ustring of string
| `AST_wstring of string ]
and expr_t =
[ `AST_andlist of Flx_ast.range_srcref * Flx_ast.expr_t list
| `AST_apply of
Flx_ast.range_srcref * (Flx_ast.expr_t * Flx_ast.expr_t)
| `AST_arrayof of Flx_ast.range_srcref * Flx_ast.expr_t list
| `AST_arrow of
Flx_ast.range_srcref * (Flx_ast.expr_t * Flx_ast.expr_t)
| `AST_as of Flx_ast.range_srcref * (Flx_ast.expr_t * string)
| `AST_case_arg of Flx_ast.range_srcref * (int * Flx_ast.expr_t)
| `AST_case_index of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_case_tag of Flx_ast.range_srcref * int
| `AST_coercion of
Flx_ast.range_srcref * (Flx_ast.expr_t * Flx_ast.typecode_t)
| `AST_cond of
Flx_ast.range_srcref *
(Flx_ast.expr_t * Flx_ast.expr_t * Flx_ast.expr_t)
| `AST_ctor_arg of
Flx_ast.range_srcref * (Flx_ast.qualified_name_t * Flx_ast.expr_t)
| `AST_deref of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_dot of Flx_ast.range_srcref * (Flx_ast.expr_t * Flx_ast.id_t)
| `AST_ellipsis of Flx_ast.range_srcref
| `AST_expr of Flx_ast.range_srcref * string * Flx_ast.typecode_t
| `AST_get_n of Flx_ast.range_srcref * (int * Flx_ast.expr_t)
| `AST_index of Flx_ast.range_srcref * string * int
| `AST_lambda of
Flx_ast.range_srcref *
(Flx_ast.params_t list * Flx_ast.typecode_t *
Flx_ast.statement_t list)
| `AST_letin of
Flx_ast.range_srcref *
(Flx_ast.pattern_t * Flx_ast.expr_t * Flx_ast.expr_t)
| `AST_literal of Flx_ast.range_srcref * Flx_ast.literal_t
| `AST_lookup of
Flx_ast.range_srcref *
(Flx_ast.expr_t * string * Flx_ast.typecode_t list)
| `AST_lvalue of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_map of Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.expr_t
| `AST_match of
Flx_ast.range_srcref *
(Flx_ast.expr_t * (Flx_ast.pattern_t * Flx_ast.expr_t) list)
| `AST_match_case of Flx_ast.range_srcref * (int * Flx_ast.expr_t)
| `AST_match_ctor of
Flx_ast.range_srcref * (Flx_ast.qualified_name_t * Flx_ast.expr_t)
| `AST_method_apply of
Flx_ast.range_srcref * (Flx_ast.id_t * Flx_ast.expr_t)
| `AST_name of Flx_ast.range_srcref * string * Flx_ast.typecode_t list
| `AST_noexpand of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_orlist of Flx_ast.range_srcref * Flx_ast.expr_t list
| `AST_parse of
Flx_ast.range_srcref * Flx_ast.expr_t *
(Flx_ast.range_srcref * Flx_ast.production_t * Flx_ast.expr_t) list
| `AST_product of Flx_ast.range_srcref * Flx_ast.expr_t list
| `AST_ref of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_reglex of
Flx_ast.range_srcref *
(Flx_ast.expr_t * Flx_ast.expr_t *
(Flx_ast.regexp_t * Flx_ast.expr_t) list)
| `AST_regmatch of
Flx_ast.range_srcref *
(Flx_ast.expr_t * Flx_ast.expr_t *
(Flx_ast.regexp_t * Flx_ast.expr_t) list)
| `AST_setintersection of Flx_ast.range_srcref * Flx_ast.expr_t list
| `AST_setunion of Flx_ast.range_srcref * Flx_ast.expr_t list
| `AST_sparse of
Flx_ast.range_srcref * Flx_ast.expr_t * string * int list
| `AST_strexpr of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_string_regmatch of
Flx_ast.range_srcref *
(Flx_ast.expr_t * (Flx_ast.regexp_t * Flx_ast.expr_t) list)
| `AST_suffix of
Flx_ast.range_srcref *
(Flx_ast.qualified_name_t * Flx_ast.typecode_t)
| `AST_sum of Flx_ast.range_srcref * Flx_ast.expr_t list
| `AST_superscript of
Flx_ast.range_srcref * (Flx_ast.expr_t * Flx_ast.expr_t)
| `AST_the of Flx_ast.range_srcref * Flx_ast.qualified_name_t
| `AST_tuple of Flx_ast.range_srcref * Flx_ast.expr_t list
| `AST_type_match of
Flx_ast.range_srcref *
(Flx_ast.typecode_t *
(Flx_ast.tpattern_t * Flx_ast.typecode_t) list)
| `AST_typed_case of Flx_ast.range_srcref * int * Flx_ast.typecode_t
| `AST_typeof of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_void of Flx_ast.range_srcref ]
and float_pat =
Float_plus of string * string
| Float_minus of string * string
| Float_inf
| Float_minus_inf
and pattern_t =
[ `PAT_any of Flx_ast.range_srcref
| `PAT_as of Flx_ast.range_srcref * Flx_ast.pattern_t * Flx_ast.id_t
| `PAT_coercion of
Flx_ast.range_srcref * Flx_ast.pattern_t * Flx_ast.typecode_t
| `PAT_const_ctor of Flx_ast.range_srcref * Flx_ast.qualified_name_t
| `PAT_float_range of
Flx_ast.range_srcref * Flx_ast.float_pat * Flx_ast.float_pat
| `PAT_int of Flx_ast.range_srcref * string * Flx_ast.bigint
| `PAT_int_range of
Flx_ast.range_srcref * string * Flx_ast.bigint * string *
Flx_ast.bigint
| `PAT_name of Flx_ast.range_srcref * Flx_ast.id_t
| `PAT_nan of Flx_ast.range_srcref
| `PAT_nonconst_ctor of
Flx_ast.range_srcref * Flx_ast.qualified_name_t * Flx_ast.pattern_t
| `PAT_none of Flx_ast.range_srcref
| `PAT_regexp of Flx_ast.range_srcref * string * Flx_ast.id_t list
| `PAT_string of Flx_ast.range_srcref * string
| `PAT_string_range of Flx_ast.range_srcref * string * string
| `PAT_tuple of Flx_ast.range_srcref * Flx_ast.pattern_t list
| `PAT_when of
Flx_ast.range_srcref * Flx_ast.pattern_t * Flx_ast.expr_t ]
and parameter_t = Flx_ast.id_t * Flx_ast.typecode_t
and macro_parameter_type_t = Ident | Expr | Stmt
and macro_parameter_t = Flx_ast.id_t * Flx_ast.macro_parameter_type_t
and lvalue_t =
[ `Expr of Flx_ast.range_srcref * Flx_ast.expr_t
| `List of Flx_ast.tlvalue_t list
| `Name of Flx_ast.range_srcref * string
| `Skip of Flx_ast.range_srcref
| `Val of Flx_ast.range_srcref * string
| `Var of Flx_ast.range_srcref * string ]
and tlvalue_t = Flx_ast.lvalue_t * Flx_ast.typecode_t option
and funkind_t =
[ `Function | `InlineFunction | `NoInlineFunction | `Object ]
and property_t =
[ `Explicit_closure
| `Generated of string
| `Heap_closure
| `Inline
| `Inlining_complete
| `Inlining_started
| `NoInline
| `Not_requires_ptf
| `Pure
| `Recursive
| `Requires_ptf
| `Stackable
| `Uses_gc
| `Uses_global_var ]
and type_qual_t = [ `GC_pointer | `Incomplete | `Pod ]
and requirement_t =
[ `Body_req of Flx_ast.c_t
| `Header_req of Flx_ast.c_t
| `Named_req of Flx_ast.qualified_name_t
| `Property_req of string ]
and ikind_t = [ `Body | `Header ]
and requirements_t = Flx_ast.requirement_t list
and named_reqs_t = Flx_ast.qualified_name_t list
and prec_t = string
and glr_term_t =
[ `GLR_alt of Flx_ast.glr_term_t list
| `GLR_ast of Flx_ast.glr_term_t
| `GLR_name of Flx_ast.qualified_name_t
| `GLR_opt of Flx_ast.glr_term_t
| `GLR_plus of Flx_ast.glr_term_t
| `GLR_seq of Flx_ast.glr_term_t list ]
and glr_entry_t = string option * Flx_ast.glr_term_t
and production_t = Flx_ast.glr_entry_t list
and reduced_glr_entry_t = string option * Flx_ast.qualified_name_t
and reduced_production_t = Flx_ast.reduced_glr_entry_t list
and params_t = Flx_ast.parameter_t list * Flx_ast.expr_t option
and class_member_t =
[ `MemberCtor of Flx_ast.id_t * Flx_ast.typecode_t * Flx_ast.c_t option
| `MemberFun of Flx_ast.id_t * Flx_ast.typecode_t * Flx_ast.c_t option
| `MemberProc of Flx_ast.id_t * Flx_ast.typecode_t * Flx_ast.c_t option
| `MemberVal of Flx_ast.id_t * Flx_ast.typecode_t * Flx_ast.c_t option
| `MemberVar of Flx_ast.id_t * Flx_ast.typecode_t * Flx_ast.c_t option ]
and statement_t =
[ `AST_abs_decl of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.type_qual_t list * Flx_ast.c_t * Flx_ast.requirements_t
| `AST_assert of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_assign of
Flx_ast.range_srcref * string * Flx_ast.tlvalue_t * Flx_ast.expr_t
| `AST_call of Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.expr_t
| `AST_cassign of
Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.expr_t
| `AST_cclass of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.class_member_t list
| `AST_code of Flx_ast.range_srcref * Flx_ast.c_t
| `AST_comment of string
| `AST_const_decl of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.typecode_t * Flx_ast.c_t * Flx_ast.requirements_t
| `AST_cstruct of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
(Flx_ast.id_t * Flx_ast.typecode_t) list
| `AST_ctypes of
Flx_ast.range_srcref * (Flx_ast.srcref * Flx_ast.id_t) list *
Flx_ast.type_qual_t list * Flx_ast.requirements_t
| `AST_curry of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.params_t list *
(Flx_ast.typecode_t * Flx_ast.expr_t option) * Flx_ast.funkind_t *
Flx_ast.statement_t list
| `AST_export_fun of
Flx_ast.range_srcref * Flx_ast.suffixed_name_t * string
| `AST_export_type of
Flx_ast.range_srcref * Flx_ast.typecode_t * string
| `AST_expr_macro of
Flx_ast.range_srcref * Flx_ast.id_t *
Flx_ast.macro_parameter_t list * Flx_ast.expr_t
| `AST_fun_decl of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.typecode_t list * Flx_ast.typecode_t * Flx_ast.c_t *
Flx_ast.requirements_t * Flx_ast.prec_t
| `AST_fun_return of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_function of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.params_t * (Flx_ast.typecode_t * Flx_ast.expr_t option) *
Flx_ast.property_t list * Flx_ast.statement_t list
| `AST_glr of
Flx_ast.range_srcref * string * Flx_ast.typecode_t *
(Flx_ast.range_srcref * Flx_ast.production_t * Flx_ast.expr_t) list
| `AST_goto of Flx_ast.range_srcref * Flx_ast.id_t
| `AST_ifdo of
Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.statement_t list *
Flx_ast.statement_t list
| `AST_ifgoto of Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.id_t
| `AST_ifnotgoto of
Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.id_t
| `AST_ifreturn of Flx_ast.range_srcref * Flx_ast.expr_t
| `AST_include of Flx_ast.range_srcref * string
| `AST_inherit of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.qualified_name_t
| `AST_inherit_fun of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.qualified_name_t
| `AST_inject_module of Flx_ast.range_srcref * Flx_ast.qualified_name_t
| `AST_insert of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.c_t * Flx_ast.ikind_t * Flx_ast.requirements_t
| `AST_jump of Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.expr_t
| `AST_label of Flx_ast.range_srcref * Flx_ast.id_t
| `AST_loop of Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.expr_t
| `AST_macro_assign of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.expr_t
| `AST_macro_forget of Flx_ast.range_srcref * Flx_ast.id_t list
| `AST_macro_goto of Flx_ast.range_srcref * Flx_ast.id_t
| `AST_macro_ifgoto of
Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.id_t
| `AST_macro_ifor of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.id_t list *
Flx_ast.statement_t list
| `AST_macro_label of Flx_ast.range_srcref * Flx_ast.id_t
| `AST_macro_name of Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.id_t
| `AST_macro_names of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.id_t list
| `AST_macro_proc_return of Flx_ast.range_srcref
| `AST_macro_val of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.expr_t
| `AST_macro_vals of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.expr_t list
| `AST_macro_var of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.expr_t
| `AST_macro_vfor of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.expr_t list *
Flx_ast.statement_t list
| `AST_nop of Flx_ast.range_srcref * string
| `AST_noreturn_code of Flx_ast.range_srcref * Flx_ast.c_t
| `AST_object of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.params_t * Flx_ast.statement_t list
| `AST_open of Flx_ast.range_srcref * Flx_ast.qualified_name_t
| `AST_private of Flx_ast.range_srcref * Flx_ast.statement_t
| `AST_proc_return of Flx_ast.range_srcref
| `AST_public of Flx_ast.range_srcref * string * Flx_ast.statement_t
| `AST_regdef of Flx_ast.range_srcref * string * Flx_ast.regexp_t
| `AST_seq of Flx_ast.range_srcref * Flx_ast.statement_t list
| `AST_stmt_macro of
Flx_ast.range_srcref * Flx_ast.id_t *
Flx_ast.macro_parameter_t list * Flx_ast.statement_t list
| `AST_struct of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
(Flx_ast.id_t * Flx_ast.typecode_t) list
| `AST_svc of Flx_ast.range_srcref * Flx_ast.id_t
| `AST_type_alias of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.typecode_t
| `AST_union of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
(Flx_ast.id_t * Flx_ast.typecode_t) list
| `AST_until of
Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.statement_t list
| `AST_untyped_module of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.statement_t list
| `AST_use of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.qualified_name_t
| `AST_val_decl of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.typecode_t option * Flx_ast.expr_t option
| `AST_var_decl of
Flx_ast.range_srcref * Flx_ast.id_t * Flx_ast.vs_list_t *
Flx_ast.typecode_t option * Flx_ast.expr_t option
| `AST_whilst of
Flx_ast.range_srcref * Flx_ast.expr_t * Flx_ast.statement_t list ]
and exe_t =
[ `EXE_assert of Flx_ast.expr_t
| `EXE_assign of Flx_ast.expr_t * Flx_ast.expr_t
| `EXE_call of Flx_ast.expr_t * Flx_ast.expr_t
| `EXE_code of Flx_ast.c_t
| `EXE_comment of string
| `EXE_fun_return of Flx_ast.expr_t
| `EXE_goto of string
| `EXE_ifgoto of Flx_ast.expr_t * string
| `EXE_ifnotgoto of Flx_ast.expr_t * string
| `EXE_iinit of (Flx_ast.id_t * int) * Flx_ast.expr_t
| `EXE_init of Flx_ast.id_t * Flx_ast.expr_t
| `EXE_jump of Flx_ast.expr_t * Flx_ast.expr_t
| `EXE_label of string
| `EXE_loop of Flx_ast.id_t * Flx_ast.expr_t
| `EXE_nop of string
| `EXE_noreturn_code of Flx_ast.c_t
| `EXE_proc_return
| `EXE_svc of Flx_ast.id_t ]
type sexe_t = Flx_ast.range_srcref * Flx_ast.exe_t
type compilation_unit_t = Flx_ast.statement_t list
end