diff options
Diffstat (limited to 'language/l2_parse.ml')
| -rw-r--r-- | language/l2_parse.ml | 133 |
1 files changed, 67 insertions, 66 deletions
diff --git a/language/l2_parse.ml b/language/l2_parse.ml index 8615faa6..92d00530 100644 --- a/language/l2_parse.ml +++ b/language/l2_parse.ml @@ -1,4 +1,4 @@ -(* generated by Ott 0.23 from: l2_parse.ott *) +(* generated by Ott 0.24 from: l2_parse.ott *) type text = string @@ -25,9 +25,8 @@ base_kind_aux = (* base kind *) type -id_aux = (* Identifier *) - Id of x - | DeIid of x (* remove infix status *) +base_kind = + BK_aux of base_kind_aux * l type @@ -47,13 +46,14 @@ base_effect_aux = (* effect *) type -base_kind = - BK_aux of base_kind_aux * l +id_aux = (* Identifier *) + Id of x + | DeIid of x (* remove infix status *) type -id = - Id_aux of id_aux * l +kind_aux = (* kinds *) + K_kind of (base_kind) list type @@ -67,8 +67,13 @@ base_effect = type -kind_aux = (* kinds *) - K_kind of (base_kind) list +id = + Id_aux of id_aux * l + + +type +kind = + K_aux of kind_aux * l type @@ -79,6 +84,7 @@ atyp_aux = (* expressions of all kinds, to be translated to types, nats, orders | ATyp_times of atyp * atyp (* product *) | ATyp_sum of atyp * atyp (* sum *) | ATyp_exp of atyp (* exponential *) + | ATyp_neg of atyp (* Internal (but not M as I want a datatype constructor) negative nexp *) | ATyp_inc (* increasing (little-endian) *) | ATyp_dec (* decreasing (big-endian) *) | ATyp_set of (base_effect) list (* effect set *) @@ -91,8 +97,9 @@ and atyp = type -kind = - K_aux of kind_aux * l +kinded_id_aux = (* optionally kind-annotated identifier *) + KOpt_none of kid (* identifier *) + | KOpt_kind of kind * kid (* kind-annotated variable *) type @@ -104,9 +111,8 @@ n_constraint_aux = (* constraint over kind $_$ *) type -kinded_id_aux = (* optionally kind-annotated identifier *) - KOpt_none of kid (* identifier *) - | KOpt_kind of kind * kid (* kind-annotated variable *) +kinded_id = + KOpt_aux of kinded_id_aux * l type @@ -115,11 +121,6 @@ n_constraint = type -kinded_id = - KOpt_aux of kinded_id_aux * l - - -type quant_item_aux = (* Either a kinded identifier or a nexp constraint for a typquant *) QI_id of kinded_id (* An optionally kinded identifier *) | QI_const of n_constraint (* A constraint for this type *) @@ -137,11 +138,6 @@ typquant_aux = (* type quantifiers and constraints *) type -typquant = - TypQ_aux of typquant_aux * l - - -type lit_aux = (* Literal constant *) L_unit (* $() : _$ *) | L_zero (* $_ : _$ *) @@ -156,8 +152,8 @@ lit_aux = (* Literal constant *) type -typschm_aux = (* type scheme *) - TypSchm_ts of typquant * atyp +typquant = + TypQ_aux of typquant_aux * l type @@ -166,8 +162,8 @@ lit = type -typschm = - TypSchm_aux of typschm_aux * l +typschm_aux = (* type scheme *) + TypSchm_ts of typquant * atyp type @@ -196,6 +192,11 @@ and fpat = type +typschm = + TypSchm_aux of typschm_aux * l + + +type exp_aux = (* Expression *) E_block of (exp) list (* block (parsing conflict with structs?) *) | E_id of id (* identifier *) @@ -251,21 +252,21 @@ and letbind = type -name_scm_opt_aux = (* Optional variable-naming-scheme specification for variables of defined type *) - Name_sect_none - | Name_sect_some of string - - -type type_union_aux = (* Type union constructors *) Tu_id of id | Tu_ty_id of atyp * id type -rec_opt_aux = (* Optional recursive annotation for functions *) - Rec_nonrec (* non-recursive *) - | Rec_rec (* recursive *) +name_scm_opt_aux = (* Optional variable-naming-scheme specification for variables of defined type *) + Name_sect_none + | Name_sect_some of string + + +type +effect_opt_aux = (* Optional effect annotation for functions *) + Effect_opt_pure (* sugar for empty effect set *) + | Effect_opt_effect of atyp type @@ -275,9 +276,9 @@ tannot_opt_aux = (* Optional type annotation for functions *) type -effect_opt_aux = (* Optional effect annotation for functions *) - Effect_opt_pure (* sugar for empty effect set *) - | Effect_opt_effect of atyp +rec_opt_aux = (* Optional recursive annotation for functions *) + Rec_nonrec (* non-recursive *) + | Rec_rec (* recursive *) type @@ -286,11 +287,6 @@ funcl_aux = (* Function clause *) type -name_scm_opt = - Name_sect_aux of name_scm_opt_aux * l - - -type index_range_aux = (* index specification, for bitfields in register types *) BF_single of int (* single index *) | BF_range of int * int (* index range *) @@ -306,8 +302,13 @@ type_union = type -rec_opt = - Rec_aux of rec_opt_aux * l +name_scm_opt = + Name_sect_aux of name_scm_opt_aux * l + + +type +effect_opt = + Effect_opt_aux of effect_opt_aux * l type @@ -316,8 +317,8 @@ tannot_opt = type -effect_opt = - Effect_opt_aux of effect_opt_aux * l +rec_opt = + Rec_aux of rec_opt_aux * l type @@ -335,6 +336,12 @@ type_def_aux = (* Type definition body *) type +default_typing_spec_aux = (* Default kinding or typing assumption *) + DT_kind of base_kind * kid + | DT_typ of typschm * id + + +type scattered_def_aux = (* Function and type union definitions that can be spread across a file. Each one must end in $_$ *) SD_scattered_function of rec_opt * tannot_opt * effect_opt * id (* scattered function definition header *) @@ -352,12 +359,6 @@ val_spec_aux = (* Value type specification *) type -default_typing_spec_aux = (* Default kinding or typing assumption *) - DT_kind of base_kind * kid - | DT_typ of typschm * id - - -type fundef_aux = (* Function definition *) FD_function of rec_opt * tannot_opt * effect_opt * (funcl) list @@ -368,6 +369,11 @@ type_def = type +default_typing_spec = + DT_aux of default_typing_spec_aux * l + + +type scattered_def = SD_aux of scattered_def_aux * l @@ -378,11 +384,6 @@ val_spec = type -default_typing_spec = - DT_aux of default_typing_spec_aux * l - - -type fundef = FD_aux of fundef_aux * l @@ -404,6 +405,11 @@ def = type +defs = (* Definition sequence *) + Defs of (def) list + + +type lexp_aux = (* lvalue expression *) LEXP_id of id (* identifier *) | LEXP_mem of id * (exp) list @@ -415,9 +421,4 @@ and lexp = LEXP_aux of lexp_aux * l -type -defs = (* Definition sequence *) - Defs of (def) list - - |
