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 = [ `Str of string | `StrTemplate of string ] 
type 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_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_seq of regexp_t * regexp_t (*concatenation*)
| REGEXP_alt of regexp_t * regexp_t (*alternation*)
| REGEXP_aster of regexp_t (*Kleene closure*)
| REGEXP_name of qualified_name_t (*lookup regular definition*)
| REGEXP_string of string (*concatenation of chars of string*)
| REGEXP_epsilon (*epsilon: null string*)
| REGEXP_sentinel (*end marker*)
| REGEXP_code of expr_t (*associated code*)
| REGEXP_group of string * regexp_t (*named group*)
type of a regular expression
type typecode_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
| `TYP_apply of typecode_t * typecode_t
| `TYP_array of typecode_t * typecode_t
| `TYP_as of typecode_t * string
| `TYP_case_arg of int * 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_lvalue of typecode_t
| `TYP_none
| `TYP_pointer of typecode_t
| `TYP_proj of int * typecode_t
| `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 * (tpattern_t * typecode_t) list
| `TYP_type_tuple of typecode_t list
| `TYP_typefun of
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 ]
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 vs_list_t = (id_t * tpattern_t) list 
type ivs_list_t = (id_t * int * tpattern_t) list 
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 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_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 * id_t)
| `AST_ellipsis of range_srcref
| `AST_expr of range_srcref * string * typecode_t
| `AST_get_n of range_srcref * (int * expr_t)
| `AST_index of range_srcref * string * int
| `AST_lambda of
range_srcref *
(params_t list * typecode_t * statement_t list)
| `AST_letin of
range_srcref *
(pattern_t * expr_t * expr_t)
| `AST_literal of range_srcref * literal_t
| `AST_lookup of
range_srcref *
(expr_t * string * typecode_t list)
| `AST_lvalue of range_srcref * expr_t
| `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)
| `AST_name of range_srcref * string * typecode_t list
| `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_product of range_srcref * expr_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_strexpr of range_srcref * expr_t
| `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 * (tpattern_t * typecode_t) list)
| `AST_typed_case of range_srcref * int * typecode_t
| `AST_typeof of range_srcref * expr_t
| `AST_void of range_srcref ]

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_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 parameter_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 = [ `Function | `InlineFunction | `NoInlineFunction | `Object ] 
type 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 ]
type type_qual_t = [ `GC_pointer | `Incomplete | `Pod ] 
type requirement_t = [ `Body_req of c_t
| `Header_req of c_t
| `Named_req of qualified_name_t
| `Property_req of string ]
type ikind_t = [ `Body | `Header ] 
type requirements_t = requirement_t list 
type named_reqs_t = qualified_name_t list 
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 * typecode_t * c_t option
| `MemberFun of id_t * typecode_t * c_t option
| `MemberProc of id_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 statement_t = [ `AST_abs_decl of
range_srcref * id_t * vs_list_t *
type_qual_t list * c_t * requirements_t
| `AST_assert of range_srcref * expr_t
| `AST_assign of
range_srcref * string * tlvalue_t * expr_t
| `AST_call of range_srcref * expr_t * 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_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 * requirements_t
| `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 * requirements_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 *
requirements_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_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_inject_module of range_srcref * qualified_name_t
| `AST_insert of
range_srcref * id_t * vs_list_t * c_t *
ikind_t * requirements_t
| `AST_jump of range_srcref * expr_t * expr_t
| `AST_label of range_srcref * id_t
| `AST_loop of range_srcref * id_t * expr_t
| `AST_macro_assign of range_srcref * id_t * expr_t
| `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 * expr_t
| `AST_macro_vals of
range_srcref * id_t * expr_t list
| `AST_macro_var of range_srcref * id_t * expr_t
| `AST_macro_vfor of
range_srcref * id_t * expr_t list *
statement_t list
| `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 * qualified_name_t
| `AST_private of range_srcref * statement_t
| `AST_proc_return of range_srcref
| `AST_public of range_srcref * string * statement_t
| `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_union of
range_srcref * id_t * vs_list_t *
(id_t * typecode_t) list
| `AST_until of
range_srcref * expr_t * statement_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_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_whilst of
range_srcref * expr_t * statement_t list ]
type exe_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_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 ]
type sexe_t = range_srcref * exe_t 
type compilation_unit_t = statement_t list