Docs GODI Archive
Projects Blog Link DB

Search GODI:


More options
File lib/felix/lib/flx_grammar.flx GODI Package apps-felix
 
   flx_grammar.flx  
include "std";
include "flx_token";

module flx_grammar
{
  open flx_token;

  nonterm top:compilation_unit_t =
    | _1:nt_compilation_unit =>  _1 
  ;

  union null_statement_t =
    | null_statement_1
  ;

  nonterm nt_null_statement : null_statement_t =
    |  TOK_SEMI
      => null_statement_1
  ;

  union ifgoto_stmt_t =
    | ifgoto_stmt_1 of expr_t * string
    | ifgoto_stmt_2 of expr_t
    | ifgoto_stmt_3 of expr_t * statement_aster_t * else_clause_t
    | ifgoto_stmt_4 of expr_t * statement_aster_t
  ;

  nonterm nt_ifgoto_stmt : ifgoto_stmt_t =
    |  TOK_IF _1:nt_expr TOK_GOTO _2:TOK_NAME TOK_SEMI
      => ifgoto_stmt_1(_1, _2)

    |  TOK_IF _1:nt_expr TOK_RETURN TOK_SEMI
      => ifgoto_stmt_2(_1)

    |  TOK_IF _1:nt_expr TOK_DO _2:nt_statement_aster _3:nt_else_clause TOK_DONE TOK_SEMI
      => ifgoto_stmt_3(_1, _2, _3)

    |  TOK_IF _1:nt_expr TOK_DO _2:nt_statement_aster TOK_DONE TOK_SEMI
      => ifgoto_stmt_4(_1, _2)
  ;

  union atom_t =
    | atom_1
    | atom_2 of type_match_expr_t
    | atom_3 of expr_code_prefix_t * string
    | atom_4 of expr_code_prefix_t * string
    | atom_5 of expr_t
    | atom_6 of expr_t
    | atom_7 of glr_parse_t
    | atom_8 of match_expr_t
    | atom_9 of regmatch_expr_t
    | atom_10 of compound_t
    | atom_11 of expr_t
    | atom_12
    | atom_13 of literal_t
    | atom_14 of cond_t
    | atom_15 of expr_t
  ;

  nonterm nt_atom : atom_t =
    |  TOK_DOTDOTDOT
      => atom_1

    |  _1:nt_type_match_expr
      => atom_2(_1)

    |  _1:nt_expr_code_prefix _2:TOK_NAME
      => atom_3(_1, _2)

    |  _1:nt_expr_code_prefix _2:TOK_STRING
      => atom_4(_1, _2)

    |  TOK_LSQBAR _1:nt_expr TOK_RSQBAR
      => atom_5(_1)

    |  TOK_LBRACE _1:nt_expr TOK_RBRACE
      => atom_6(_1)

    |  _1:nt_glr_parse
      => atom_7(_1)

    |  _1:nt_match_expr
      => atom_8(_1)

    |  _1:nt_regmatch_expr
      => atom_9(_1)

    |  _1:nt_compound
      => atom_10(_1)

    |  TOK_LPAR _1:nt_expr TOK_RPAR
      => atom_11(_1)

    |  TOK_LPAR TOK_RPAR
      => atom_12

    |  _1:nt_literal
      => atom_13(_1)

    |  _1:nt_cond
      => atom_14(_1)

    |  TOK_USERLB _1:nt_expr TOK_USERRB
      => atom_15(_1)
  ;

  union elif_t =
    | elif_1 of expr_t * expr_t
  ;

  nonterm nt_elif : elif_t =
    |  TOK_ELIF _1:nt_expr TOK_THEN _2:nt_expr
      => elif_1(_1, _2)
  ;

  union adjective_t =
    | adjective_1
    | adjective_2
  ;

  nonterm nt_adjective : adjective_t =
    |  TOK_INLINE
      => adjective_1

    |  TOK_NOINLINE
      => adjective_2
  ;

  union macro_names_t =
    | macro_names_1 of macro_name_list_t
    | macro_names_2
  ;

  nonterm nt_macro_names : macro_names_t =
    |  _1:nt_macro_name_list
      => macro_names_1(_1)

    |  
      => macro_names_2
  ;

  union opt_traint_eq_t =
    | opt_traint_eq_1 of expr_t
    | opt_traint_eq_2
  ;

  nonterm nt_opt_traint_eq : opt_traint_eq_t =
    |  TOK_EXPECT _1:nt_expr TOK_EQUAL
      => opt_traint_eq_1(_1)

    |  
      => opt_traint_eq_2
  ;

  union arrow_t =
    | arrow_1 of case_literal_t * arrow_t
    | arrow_2 of case_literal_t
  ;

  nonterm nt_arrow : arrow_t =
    |  _1:nt_case_literal TOK_RIGHTARROW _2:nt_arrow
      => arrow_1(_1, _2)

    |  _1:nt_case_literal
      => arrow_2(_1)
  ;

  union tvar_t =
    | tvar_1 of string
    | tvar_2 of string * tpattern_t
  ;

  nonterm nt_tvar : tvar_t =
    |  _1:TOK_NAME
      => tvar_1(_1)

    |  _1:TOK_NAME TOK_COLON _2:nt_tpattern
      => tvar_2(_1, _2)
  ;

  union opt_type_expr_t =
    | opt_type_expr_1 of expr_t * expr_t
    | opt_type_expr_2 of expr_t
    | opt_type_expr_3 of expr_t
    | opt_type_expr_4
  ;

  nonterm nt_opt_type_expr : opt_type_expr_t =
    |  TOK_COLON _1:nt_expr TOK_EXPECT _2:nt_expr
      => opt_type_expr_1(_1, _2)

    |  TOK_COLON _1:nt_expr
      => opt_type_expr_2(_1)

    |  TOK_EXPECT _1:nt_expr
      => opt_type_expr_3(_1)

    |  
      => opt_type_expr_4
  ;

  union assert_statement_t =
    | assert_statement_1 of expr_t
  ;

  nonterm nt_assert_statement : assert_statement_t =
    |  TOK_ASSERT _1:nt_expr TOK_SEMI
      => assert_statement_1(_1)
  ;

  union class_component_aster_t =
    | class_component_aster_1 of class_component_t * class_component_aster_t
    | class_component_aster_2
  ;

  nonterm nt_class_component_aster : class_component_aster_t =
    |  _1:nt_class_component _2:nt_class_component_aster
      => class_component_aster_1(_1, _2)

    |  
      => class_component_aster_2
  ;

  union tpattern_comma_list_t =
    | tpattern_comma_list_1 of tpattern_t * tpattern_comma_list_t
    | tpattern_comma_list_2 of tpattern_t
    | tpattern_comma_list_3
  ;

  nonterm nt_tpattern_comma_list : tpattern_comma_list_t =
    |  _1:nt_tpattern TOK_COMMA _2:nt_tpattern_comma_list
      => tpattern_comma_list_1(_1, _2)

    |  _1:nt_tpattern
      => tpattern_comma_list_2(_1)

    |  
      => tpattern_comma_list_3
  ;

  union prefixed_t =
    | prefixed_1 of power_t
    | prefixed_2 of power_t
    | prefixed_3 of power_t
    | prefixed_4 of power_t
    | prefixed_5 of power_t
  ;

  nonterm nt_prefixed : prefixed_t =
    |  TOK_LVAL _1:nt_power
      => prefixed_1(_1)

    |  TOK_PLUS _1:nt_power
      => prefixed_2(_1)

    |  TOK_MINUS _1:nt_power
      => prefixed_3(_1)

    |  TOK_TILDE _1:nt_power
      => prefixed_4(_1)

    |  _1:nt_power
      => prefixed_5(_1)
  ;

  union elif_clause_t =
    | elif_clause_1 of expr_t * statement_aster_t
    | elif_clause_2 of expr_t
    | elif_clause_3 of expr_t * string
  ;

  nonterm nt_elif_clause : elif_clause_t =
    |  TOK_ELIF _1:nt_expr TOK_DO _2:nt_statement_aster
      => elif_clause_1(_1, _2)

    |  TOK_ELIF _1:nt_expr TOK_RETURN TOK_SEMI
      => elif_clause_2(_1)

    |  TOK_ELIF _1:nt_expr TOK_GOTO _2:TOK_NAME TOK_SEMI
      => elif_clause_3(_1, _2)
  ;

  union tuple_t =
    | tuple_1 of or_condition_t * tuple_suffix_t
    | tuple_2 of or_condition_t
  ;

  nonterm nt_tuple : tuple_t =
    |  _1:nt_or_condition _2:nt_tuple_suffix
      => tuple_1(_1, _2)

    |  _1:nt_or_condition
      => tuple_2(_1)
  ;

  union opt_fun_args_t =
    | opt_fun_args_1 of fun_args_t
    | opt_fun_args_2
  ;

  nonterm nt_opt_fun_args : opt_fun_args_t =
    |  _1:nt_fun_args
      => opt_fun_args_1(_1)

    |  
      => opt_fun_args_2
  ;

  union glr_entries_t =
    | glr_entries_1 of glr_entry_t * glr_entries_t
    | glr_entries_2 of glr_entry_t
  ;

  nonterm nt_glr_entries : glr_entries_t =
    |  _1:nt_glr_entry _2:nt_glr_entries
      => glr_entries_1(_1, _2)

    |  _1:nt_glr_entry
      => glr_entries_2(_1)
  ;

  union charset0_t =
    | charset0_1 of (string * string) * (string * string)
    | charset0_2 of string * string
    | charset0_3 of string
    | charset0_4 of (string * string)
  ;

  nonterm nt_charset0 : charset0_t =
    |  _1:TOK_INTEGER TOK_MINUS _2:TOK_INTEGER
      => charset0_1(_1, _2)

    |  _1:TOK_STRING TOK_MINUS _2:TOK_STRING
      => charset0_2(_1, _2)

    |  _1:TOK_STRING
      => charset0_3(_1)

    |  _1:TOK_INTEGER
      => charset0_4(_1)
  ;

  union type_quals_t =
    | type_quals_1 of type_qual_t * type_quals_t
    | type_quals_2
  ;

  nonterm nt_type_quals : type_quals_t =
    |  _1:nt_type_qual _2:nt_type_quals
      => type_quals_1(_1, _2)

    |  
      => type_quals_2
  ;

  union glr_parse_t =
    | glr_parse_1 of expr_t * glr_matchings_t
  ;

  nonterm nt_glr_parse : glr_parse_t =
    |  TOK_PARSE _1:nt_expr TOK_WITH _2:nt_glr_matchings TOK_ENDMATCH
      => glr_parse_1(_1, _2)
  ;

  union mulpat_t =
    | mulpat_1 of tpat3_t * mulpat_t
    | mulpat_2 of tpat3_t
  ;

  nonterm nt_mulpat : mulpat_t =
    |  _1:nt_tpat3 TOK_STAR _2:nt_mulpat
      => mulpat_1(_1, _2)

    |  _1:nt_tpat3
      => mulpat_2(_1)
  ;

  union return_t =
    | return_1 of expr_t
    | return_2
  ;

  nonterm nt_return : return_t =
    |  TOK_RETURN _1:nt_expr TOK_SEMI
      => return_1(_1)

    |  TOK_RETURN TOK_SEMI
      => return_2
  ;

  union coercive_pattern_list_t =
    | coercive_pattern_list_1 of coercive_pattern_t * coercive_pattern_list_t
    | coercive_pattern_list_2 of coercive_pattern_t
  ;

  nonterm nt_coercive_pattern_list : coercive_pattern_list_t =
    |  _1:nt_coercive_pattern TOK_COMMA _2:nt_coercive_pattern_list
      => coercive_pattern_list_1(_1, _2)

    |  _1:nt_coercive_pattern
      => coercive_pattern_list_2(_1)
  ;

  union not_condition_t =
    | not_condition_1 of notop_t * not_condition_t
    | not_condition_2 of comparison_t
  ;

  nonterm nt_not_condition : not_condition_t =
    |  _1:nt_notop _2:nt_not_condition
      => not_condition_1(_1, _2)

    |  _1:nt_comparison
      => not_condition_2(_1)
  ;

  union setunion_list_t =
    | setunion_list_1 of user10_t * setunion_list_t
    | setunion_list_2 of user10_t
  ;

  nonterm nt_setunion_list : setunion_list_t =
    |  _1:nt_user10 TOK_VBARVBAR _2:nt_setunion_list
      => setunion_list_1(_1, _2)

    |  _1:nt_user10
      => setunion_list_2(_1)
  ;

  union compilation_unit_t =
    | compilation_unit_1 of statement_aster_t
  ;

  nonterm nt_compilation_unit : compilation_unit_t =
    |  _1:nt_statement_aster TOK_ENDMARKER
      => compilation_unit_1(_1)
  ;

  union else_part_t =
    | else_part_1 of elifs_t * expr_t
    | else_part_2 of expr_t
  ;

  nonterm nt_else_part : else_part_t =
    |  _1:nt_elifs TOK_ELSE _2:nt_expr
      => else_part_1(_1, _2)

    |  TOK_ELSE _1:nt_expr
      => else_part_2(_1)
  ;

  union band_t =
    | band_1 of band_t * shift_t
    | band_2 of shift_t
  ;

  nonterm nt_band : band_t =
    |  _1:nt_band TOK_SLOSHAMPER _2:nt_shift
      => band_1(_1, _2)

    |  _1:nt_shift
      => band_2(_1)
  ;

  union subtraction_t =
    | subtraction_1 of subtraction_t * product_t
    | subtraction_2 of product_t
  ;

  nonterm nt_subtraction : subtraction_t =
    |  _1:nt_subtraction TOK_MINUS _2:nt_product
      => subtraction_1(_1, _2)

    |  _1:nt_product
      => subtraction_2(_1)
  ;

  union compound_t =
    | compound_1 of statement_aster_t
  ;

  nonterm nt_compound : compound_t =
    |  TOK_LBRACE _1:nt_statement_aster TOK_RBRACE
      => compound_1(_1)
  ;

  union setintersection_t =
    | setintersection_1 of arrow_t * setintersection_list_t
    | setintersection_2 of arrow_t
  ;

  nonterm nt_setintersection : setintersection_t =
    |  _1:nt_arrow TOK_AMPERAMPER _2:nt_setintersection_list
      => setintersection_1(_1, _2)

    |  _1:nt_arrow
      => setintersection_2(_1)
  ;

  union struct_component_t =
    | struct_component_1 of string * expr_t
  ;

  nonterm nt_struct_component : struct_component_t =
    |  _1:TOK_NAME TOK_COLON _2:nt_expr TOK_SEMI
      => struct_component_1(_1, _2)
  ;

  union regdef_t =
    | regdef_1 of string * re1_t
  ;

  nonterm nt_regdef : regdef_t =
    |  TOK_REGEXP _1:TOK_NAME TOK_EQUAL _2:nt_re1 TOK_SEMI
      => regdef_1(_1, _2)
  ;

  union expr_code_prefix_t =
    | expr_code_prefix_1 of expr_t
  ;

  nonterm nt_expr_code_prefix : expr_code_prefix_t =
    |  TOK_CODE TOK_LSQB _1:nt_expr TOK_RSQB
      => expr_code_prefix_1(_1)
  ;

  union mac_args_t =
    | mac_args_1 of mac_arg_t * mac_args_t
    | mac_args_2 of mac_arg_t
  ;

  nonterm nt_mac_args : mac_args_t =
    |  _1:nt_mac_arg TOK_COMMA _2:nt_mac_args
      => mac_args_1(_1, _2)

    |  _1:nt_mac_arg
      => mac_args_2(_1)
  ;

  union term_t =
    | term_1 of term_t * power_t
    | term_2 of term_t * power_t
    | term_3 of prefixed_t
  ;

  nonterm nt_term : term_t =
    |  _1:nt_term TOK_SLASH _2:nt_power
      => term_1(_1, _2)

    |  _1:nt_term TOK_PERCENT _2:nt_power
      => term_2(_1, _2)

    |  _1:nt_prefixed
      => term_3(_1)
  ;

  union glr_production_t =
    | glr_production_1 of string * expr_t * glr_matchings_t
  ;

  nonterm nt_glr_production : glr_production_t =
    |  TOK_NONTERM _1:TOK_NAME TOK_COLON _2:nt_expr TOK_EQUAL _3:nt_glr_matchings TOK_SEMI
      => glr_production_1(_1, _2, _3)
  ;

  union cmp_item_t =
    | cmp_item_1 of chain_cmp_op_t * sum_t
  ;

  nonterm nt_cmp_item : cmp_item_t =
    |  _1:nt_chain_cmp_op _2:nt_sum
      => cmp_item_1(_1, _2)
  ;

  union as_pattern_t =
    | as_pattern_1 of variant_pattern_t * string
    | as_pattern_2 of variant_pattern_t
  ;

  nonterm nt_as_pattern : as_pattern_t =
    |  _1:nt_variant_pattern TOK_AS _2:TOK_NAME
      => as_pattern_1(_1, _2)

    |  _1:nt_variant_pattern
      => as_pattern_2(_1)
  ;

  union open_decl_t =
    | open_decl_1 of qualified_name_t
  ;

  nonterm nt_open_decl : open_decl_t =
    |  TOK_OPEN _1:nt_qualified_name TOK_SEMI
      => open_decl_1(_1)
  ;

  union expr_t =
    | expr_1 of pattern_t * expr_t * expr_t
    | expr_2 of rvalue_t
  ;

  nonterm nt_expr : expr_t =
    |  TOK_LET _1:nt_pattern TOK_EQUAL _2:nt_expr TOK_IN _3:nt_expr
      => expr_1(_1, _2, _3)

    |  _1:nt_rvalue
      => expr_2(_1)
  ;

  union ctor_name_t =
    | ctor_name_1 of simple_name_parts_t
    | ctor_name_2 of (string * string)
  ;

  nonterm nt_ctor_name : ctor_name_t =
    |  _1:nt_simple_name_parts
      => ctor_name_1(_1)

    |  TOK_CASE _1:TOK_INTEGER
      => ctor_name_2(_1)
  ;

  union requirement_t =
    | requirement_1 of qualified_name_t
    | requirement_2 of code_spec_t
    | requirement_3 of code_spec_t
    | requirement_4 of string
  ;

  nonterm nt_requirement : requirement_t =
    |  _1:nt_qualified_name
      => requirement_1(_1)

    |  TOK_BODY _1:nt_code_spec
      => requirement_2(_1)

    |  TOK_HEADER _1:nt_code_spec
      => requirement_3(_1)

    |  TOK_PROPERTY _1:TOK_STRING
      => requirement_4(_1)
  ;

  union matchings_t =
    | matchings_1 of matching_t * matchings_t
    | matchings_2 of matching_t
  ;

  nonterm nt_matchings : matchings_t =
    |  _1:nt_matching _2:nt_matchings
      => matchings_1(_1, _2)

    |  _1:nt_matching
      => matchings_2(_1)
  ;

  union tpatlist_t =
    | tpatlist_1 of tpattern_comma_list_t
    | tpatlist_2
  ;

  nonterm nt_tpatlist : tpatlist_t =
    |  TOK_LSQB _1:nt_tpattern_comma_list TOK_RSQB
      => tpatlist_1(_1)

    |  
      => tpatlist_2
  ;

  union lambda_fun_args_t =
    | lambda_fun_args_1 of lambda_fun_arg_t * lambda_fun_args_t
    | lambda_fun_args_2 of lambda_fun_arg_t
  ;

  nonterm nt_lambda_fun_args : lambda_fun_args_t =
    |  _1:nt_lambda_fun_arg _2:nt_lambda_fun_args
      => lambda_fun_args_1(_1, _2)

    |  _1:nt_lambda_fun_arg
      => lambda_fun_args_2(_1)
  ;

  union product_t =
    | product_1 of term_t * product_list_t
    | product_2 of term_t
  ;

  nonterm nt_product : product_t =
    |  _1:nt_term TOK_STAR _2:nt_product_list
      => product_1(_1, _2)

    |  _1:nt_term
      => product_2(_1)
  ;

  union dollar_name_t =
    | dollar_name_1 of qualified_name_t
    | dollar_name_2 of qualified_name_t
    | dollar_name_3 of qualified_name_t
    | dollar_name_4 of atom_t
  ;

  nonterm nt_dollar_name : dollar_name_t =
    |  TOK_NOEXPAND _1:nt_qualified_name
      => dollar_name_1(_1)

    |  TOK_THE _1:nt_qualified_name
      => dollar_name_2(_1)

    |  _1:nt_qualified_name
      => dollar_name_3(_1)

    |  _1:nt_atom
      => dollar_name_4(_1)
  ;

  union macro_name_list_t =
    | macro_name_list_1 of macro_name_list_t * string
    | macro_name_list_2 of string
  ;

  nonterm nt_macro_name_list : macro_name_list_t =
    |  _1:nt_macro_name_list _2:TOK_NAME
      => macro_name_list_1(_1, _2)

    |  _1:TOK_NAME
      => macro_name_list_2(_1)
  ;

  union goto_statement_t =
    | goto_statement_1 of string
  ;

  nonterm nt_goto_statement : goto_statement_t =
    |  TOK_GOTO _1:TOK_NAME TOK_SEMI
      => goto_statement_1(_1)
  ;

  union tuple_suffix_t =
    | tuple_suffix_1 of or_condition_t * tuple_suffix_t
    | tuple_suffix_2 of or_condition_t
  ;

  nonterm nt_tuple_suffix : tuple_suffix_t =
    |  TOK_COMMA _1:nt_or_condition _2:nt_tuple_suffix
      => tuple_suffix_1(_1, _2)

    |  TOK_COMMA _1:nt_or_condition
      => tuple_suffix_2(_1)
  ;

  union superscript_t =
    | superscript_1 of superscript_t * refr_t
    | superscript_2 of refr_t
  ;

  nonterm nt_superscript : superscript_t =
    |  _1:nt_superscript TOK_CIRCUMFLEX _2:nt_refr
      => superscript_1(_1, _2)

    |  _1:nt_refr
      => superscript_2(_1)
  ;

  union todo_t =
    | todo_1 of string
    | todo_2
  ;

  nonterm nt_todo : todo_t =
    |  TOK_TODO _1:TOK_STRING TOK_SEMI
      => todo_1(_1)

    |  TOK_TODO TOK_SEMI
      => todo_2
  ;

  union matching_t =
    | matching_1 of pattern_t * expr_t
    | matching_2 of expr_t
  ;

  nonterm nt_matching : matching_t =
    |  TOK_VBAR _1:nt_pattern TOK_EQRIGHTARROW _2:nt_expr
      => matching_1(_1, _2)

    |  TOK_VBAR TOK_EQRIGHTARROW _1:nt_expr
      => matching_2(_1)
  ;

  union tpat0_t =
    | tpat0_1 of tpat1_t * tpat0_t
    | tpat0_2 of tpat1_t
  ;

  nonterm nt_tpat0 : tpat0_t =
    |  _1:nt_tpat1 TOK_RIGHTARROW _2:nt_tpat0
      => tpat0_1(_1, _2)

    |  _1:nt_tpat1
      => tpat0_2(_1)
  ;

  union tpat1_t =
    | tpat1_1 of sumpat_t
  ;

  nonterm nt_tpat1 : tpat1_t =
    |  _1:nt_sumpat
      => tpat1_1(_1)
  ;

  union directive_t =
    | directive_1 of open_decl_t
    | directive_2 of use_decl_t
    | directive_3 of regdef_t
    | directive_4 of glr_production_t
    | directive_5 of macro_definition_t
  ;

  nonterm nt_directive : directive_t =
    |  _1:nt_open_decl
      => directive_1(_1)

    |  _1:nt_use_decl
      => directive_2(_1)

    |  _1:nt_regdef
      => directive_3(_1)

    |  _1:nt_glr_production
      => directive_4(_1)

    |  _1:nt_macro_definition
      => directive_5(_1)
  ;

  union tpat3_t =
    | tpat3_1 of string * tpatlist_t
    | tpat3_2 of tuple_tpattern_t
    | tpat3_3 of string
    | tpat3_4
    | tpat3_5
    | tpat3_6 of (string * string)
  ;

  nonterm nt_tpat3 : tpat3_t =
    |  _1:TOK_NAME _2:nt_tpatlist
      => tpat3_1(_1, _2)

    |  TOK_LPAR _1:nt_tuple_tpattern TOK_RPAR
      => tpat3_2(_1)

    |  TOK_QUEST _1:TOK_NAME
      => tpat3_3(_1)

    |  TOK_QUEST
      => tpat3_4

    |  TOK_UNDERSCORE
      => tpat3_5

    |  _1:TOK_INTEGER
      => tpat3_6(_1)
  ;

  union pattern_t =
    | pattern_1 of as_pattern_t * expr_t
    | pattern_2 of as_pattern_t
  ;

  nonterm nt_pattern : pattern_t =
    |  _1:nt_as_pattern TOK_WHEN _2:nt_expr
      => pattern_1(_1, _2)

    |  _1:nt_as_pattern
      => pattern_2(_1)
  ;

  union sum_t =
    | sum_1 of subtraction_t * sum_list_t
    | sum_2 of subtraction_t
  ;

  nonterm nt_sum : sum_t =
    |  _1:nt_subtraction TOK_PLUS _2:nt_sum_list
      => sum_1(_1, _2)

    |  _1:nt_subtraction
      => sum_2(_1)
  ;

  union opt_name_t =
    | opt_name_1 of string
    | opt_name_2
  ;

  nonterm nt_opt_name : opt_name_t =
    |  _1:TOK_NAME
      => opt_name_1(_1)

    |  
      => opt_name_2
  ;

  union macro_definition_t =
    | macro_definition_1 of string * expr_t
    | macro_definition_2 of string * expr_t * statement_aster_t
    | macro_definition_3 of string
    | macro_definition_4 of string * expr_t
    | macro_definition_5 of string * expr_t
    | macro_definition_6 of string * expr_t
    | macro_definition_7 of string * tuple_t
    | macro_definition_8 of string * mac_arg_list_t * expr_t
    | macro_definition_9 of string * mac_arg_list_t * compound_t
    | macro_definition_10 of macro_names_t
    | macro_definition_11 of string
    | macro_definition_12 of string
    | macro_definition_13 of expr_t * string
    | macro_definition_14 of string * tuple_t * statement_aster_t
  ;

  nonterm nt_macro_definition : macro_definition_t =
    |  TOK_MACRO _1:TOK_NAME TOK_IS _2:nt_expr TOK_SEMI
      => macro_definition_1(_1, _2)

    |  TOK_MACRO TOK_FOR _1:TOK_NAME TOK_IN _2:nt_expr TOK_DO _3:nt_statement_aster TOK_DONE TOK_SEMI
      => macro_definition_2(_1, _2, _3)

    |  TOK_MACRO _1:TOK_NAME TOK_IS TOK_NEW TOK_SEMI
      => macro_definition_3(_1)

    |  TOK_MACRO TOK_VAR _1:TOK_NAME TOK_EQUAL _2:nt_expr TOK_SEMI
      => macro_definition_4(_1, _2)

    |  TOK_MACRO _1:TOK_NAME TOK_EQUAL _2:nt_expr TOK_SEMI
      => macro_definition_5(_1, _2)

    |  TOK_MACRO TOK_VAL _1:TOK_NAME TOK_EQUAL _2:nt_expr TOK_SEMI
      => macro_definition_6(_1, _2)

    |  TOK_MACRO TOK_VAL _1:TOK_NAME TOK_IS _2:nt_tuple TOK_SEMI
      => macro_definition_7(_1, _2)

    |  TOK_MACRO TOK_FUNCTION _1:TOK_NAME _2:nt_mac_arg_list TOK_EQUAL _3:nt_expr TOK_SEMI
      => macro_definition_8(_1, _2, _3)

    |  TOK_MACRO TOK_PROCEDURE _1:TOK_NAME _2:nt_mac_arg_list _3:nt_compound
      => macro_definition_9(_1, _2, _3)

    |  TOK_MACRO TOK_FORGET _1:nt_macro_names TOK_SEMI
      => macro_definition_10(_1)

    |  TOK_MACRO TOK_GOTO _1:TOK_NAME TOK_SEMI
      => macro_definition_11(_1)

    |  TOK_MACRO _1:TOK_NAME TOK_COLONGREATER
      => macro_definition_12(_1)

    |  TOK_MACRO TOK_IF _1:nt_expr TOK_GOTO _2:TOK_NAME TOK_SEMI
      => macro_definition_13(_1, _2)

    |  TOK_MACRO TOK_FOR TOK_VAL _1:TOK_NAME TOK_IN _2:nt_tuple TOK_DO _3:nt_statement_aster TOK_DONE TOK_SEMI
      => macro_definition_14(_1, _2, _3)
  ;

  union publish_t =
    | publish_1 of string * binding_definition_t
    | publish_2 of string * declarative_t
    | publish_3 of declarative_t
    | publish_4 of binding_definition_t
  ;

  nonterm nt_publish : publish_t =
    |  TOK_PUBLISH _1:TOK_STRING _2:nt_binding_definition
      => publish_1(_1, _2)

    |  TOK_PUBLISH _1:TOK_STRING _2:nt_declarative
      => publish_2(_1, _2)

    |  TOK_PRIVATE _1:nt_declarative
      => publish_3(_1)

    |  TOK_PRIVATE _1:nt_binding_definition
      => publish_4(_1)
  ;

  union and_list_t =
    | and_list_1 of not_condition_t * and_list_t
    | and_list_2 of not_condition_t
  ;

  nonterm nt_and_list : and_list_t =
    |  _1:nt_not_condition TOK_AND _2:nt_and_list
      => and_list_1(_1, _2)

    |  _1:nt_not_condition
      => and_list_2(_1)
  ;

  union atomic_pattern_t =
    | atomic_pattern_1 of string
    | atomic_pattern_2 of integral_t
    | atomic_pattern_3
    | atomic_pattern_4 of string * string
    | atomic_pattern_5 of integral_t * integral_t
    | atomic_pattern_6 of floating_t * floating_t
    | atomic_pattern_7 of ctor_pattern_t
    | atomic_pattern_8 of string
    | atomic_pattern_9
    | atomic_pattern_10
    | atomic_pattern_11 of pattern_t
    | atomic_pattern_12 of string * basic_name_comma_list_t
  ;

  nonterm nt_atomic_pattern : atomic_pattern_t =
    |  _1:TOK_STRING
      => atomic_pattern_1(_1)

    |  _1:nt_integral
      => atomic_pattern_2(_1)

    |  TOK_NAN
      => atomic_pattern_3

    |  _1:TOK_STRING TOK_DOTDOT _2:TOK_STRING
      => atomic_pattern_4(_1, _2)

    |  _1:nt_integral TOK_DOTDOT _2:nt_integral
      => atomic_pattern_5(_1, _2)

    |  _1:nt_floating TOK_DOTDOT _2:nt_floating
      => atomic_pattern_6(_1, _2)

    |  _1:nt_ctor_pattern
      => atomic_pattern_7(_1)

    |  TOK_QUEST _1:TOK_NAME
      => atomic_pattern_8(_1)

    |  TOK_QUEST
      => atomic_pattern_9

    |  TOK_UNDERSCORE
      => atomic_pattern_10

    |  TOK_LPAR _1:nt_pattern TOK_RPAR
      => atomic_pattern_11(_1)

    |  TOK_REGEXP _1:TOK_STRING TOK_LPAR _2:nt_basic_name_comma_list TOK_RPAR
      => atomic_pattern_12(_1, _2)
  ;

  union regmatch_alternatives_t =
    | regmatch_alternatives_1 of regmatch_alternatives_t * regmatch_alternative_t
    | regmatch_alternatives_2 of regmatch_alternative_t
  ;

  nonterm nt_regmatch_alternatives : regmatch_alternatives_t =
    |  _1:nt_regmatch_alternatives _2:nt_regmatch_alternative
      => regmatch_alternatives_1(_1, _2)

    |  _1:nt_regmatch_alternative
      => regmatch_alternatives_2(_1)
  ;

  union setintersection_list_t =
    | setintersection_list_1 of arrow_t * setintersection_list_t
    | setintersection_list_2 of arrow_t
  ;

  nonterm nt_setintersection_list : setintersection_list_t =
    |  _1:nt_arrow TOK_AMPERAMPER _2:nt_setintersection_list
      => setintersection_list_1(_1, _2)

    |  _1:nt_arrow
      => setintersection_list_2(_1)
  ;

  union lelement_t =
    | lelement_1 of string
    | lelement_2 of string
    | lelement_3 of string
    | lelement_4
    | lelement_5 of lexprs_t
  ;

  nonterm nt_lelement : lelement_t =
    |  TOK_VAL _1:TOK_NAME
      => lelement_1(_1)

    |  TOK_VAR _1:TOK_NAME
      => lelement_2(_1)

    |  _1:TOK_NAME
      => lelement_3(_1)

    |  TOK_UNDERSCORE
      => lelement_4

    |  TOK_LPAR _1:nt_lexprs TOK_RPAR
      => lelement_5(_1)
  ;

  union tuple_tpattern_t =
    | tuple_tpattern_1 of tpattern_comma_list_t
  ;

  nonterm nt_tuple_tpattern : tuple_tpattern_t =
    |  _1:nt_tpattern_comma_list
      => tuple_tpattern_1(_1)
  ;

  union fun_args_t =
    | fun_args_1 of fun_arg_t * fun_args_t
    | fun_args_2 of fun_arg_t
  ;

  nonterm nt_fun_args : fun_args_t =
    |  _1:nt_fun_arg _2:nt_fun_args
      => fun_args_1(_1, _2)

    |  _1:nt_fun_arg
      => fun_args_2(_1)
  ;

  union glr_matching_t =
    | glr_matching_1 of glr_entries_t * expr_t
    | glr_matching_2 of expr_t
  ;

  nonterm nt_glr_matching : glr_matching_t =
    |  TOK_VBAR _1:nt_glr_entries TOK_EQRIGHTARROW _2:nt_expr
      => glr_matching_1(_1, _2)

    |  TOK_VBAR TOK_EQRIGHTARROW _1:nt_expr
      => glr_matching_2(_1)
  ;

  union power_t =
    | power_1 of superscript_t * prefixed_t
    | power_2 of superscript_t
  ;

  nonterm nt_power : power_t =
    |  _1:nt_superscript TOK_STARSTAR _2:nt_prefixed
      => power_1(_1, _2)

    |  _1:nt_superscript
      => power_2(_1)
  ;

  union regmatch_alternative_t =
    | regmatch_alternative_1 of re1_t * expr_t
  ;

  nonterm nt_regmatch_alternative : regmatch_alternative_t =
    |  TOK_VBAR _1:nt_re1 TOK_EQRIGHTARROW _2:nt_expr
      => regmatch_alternative_1(_1, _2)
  ;

  union tvar_comma_list_t =
    | tvar_comma_list_1 of tvar_t * tvar_comma_list_t
    | tvar_comma_list_2 of tvar_t
    | tvar_comma_list_3
  ;

  nonterm nt_tvar_comma_list : tvar_comma_list_t =
    |  _1:nt_tvar TOK_COMMA _2:nt_tvar_comma_list
      => tvar_comma_list_1(_1, _2)

    |  _1:nt_tvar
      => tvar_comma_list_2(_1)

    |  
      => tvar_comma_list_3
  ;

  union val_def_t =
    | val_def_1 of string * tvarlist_t * expr_t
    | val_def_2 of string * tvarlist_t * expr_t * expr_t
    | val_def_3 of string * tvarlist_t * expr_t
  ;

  nonterm nt_val_def : val_def_t =
    |  TOK_VAL _1:TOK_NAME _2:nt_tvarlist TOK_EQUAL _3:nt_expr TOK_SEMI
      => val_def_1(_1, _2, _3)

    |  TOK_VAL _1:TOK_NAME _2:nt_tvarlist TOK_COLON _3:nt_expr TOK_EQUAL _4:nt_expr TOK_SEMI
      => val_def_2(_1, _2, _3, _4)

    |  TOK_VAL _1:TOK_NAME _2:nt_tvarlist TOK_COLON _3:nt_expr TOK_SEMI
      => val_def_3(_1, _2, _3)
  ;

  union tpattern_t =
    | tpattern_1 of tpattern_t * string
    | tpattern_2 of tpat0_t
  ;

  nonterm nt_tpattern : tpattern_t =
    |  _1:nt_tpattern TOK_AS _2:TOK_NAME
      => tpattern_1(_1, _2)

    |  _1:nt_tpat0
      => tpattern_2(_1)
  ;

  union notop_t =
    | notop_1
  ;

  nonterm nt_notop : notop_t =
    |  TOK_NOT
      => notop_1
  ;

  union re_name_t =
    | re_name_1 of re_name_t * string
    | re_name_2 of string
  ;

  nonterm nt_re_name : re_name_t =
    |  _1:nt_re_name TOK_COLONCOLON _2:TOK_NAME
      => re_name_1(_1, _2)

    |  _1:TOK_NAME
      => re_name_2(_1)
  ;

  union bxor_t =
    | bxor_1 of bxor_t * band_t
    | bxor_2 of band_t
  ;

  nonterm nt_bxor : bxor_t =
    |  _1:nt_bxor TOK_SLOSHCIRCUMFLEX _2:nt_band
      => bxor_1(_1, _2)

    |  _1:nt_band
      => bxor_2(_1)
  ;

  union lambda_fun_arg_t =
    | lambda_fun_arg_1 of parameter_comma_list_t * expr_t
    | lambda_fun_arg_2 of parameter_comma_list_t
  ;

  nonterm nt_lambda_fun_arg : lambda_fun_arg_t =
    |  TOK_LPAR _1:nt_parameter_comma_list TOK_WHEN _2:nt_expr TOK_RPAR
      => lambda_fun_arg_1(_1, _2)

    |  TOK_LPAR _1:nt_parameter_comma_list TOK_RPAR
      => lambda_fun_arg_2(_1)
  ;

  union enum_item_t =
    | enum_item_1 of string
  ;

  nonterm nt_enum_item : enum_item_t =
    |  _1:TOK_NAME
      => enum_item_1(_1)
  ;

  union mac_arg_list_t =
    | mac_arg_list_1 of mac_args_t
    | mac_arg_list_2
  ;

  nonterm nt_mac_arg_list : mac_arg_list_t =
    |  TOK_LPAR _1:nt_mac_args TOK_RPAR
      => mac_arg_list_1(_1)

    |  TOK_LPAR TOK_RPAR
      => mac_arg_list_2
  ;

  union comparison_t =
    | comparison_1 of sum_t * cmp_op_t * sum_t * cmp_item_list_t
    | comparison_2 of sum_t * cmp_op_t * sum_t
    | comparison_3 of as_expr_t
  ;

  nonterm nt_comparison : comparison_t =
    |  _1:nt_sum _2:nt_cmp_op _3:nt_sum _4:nt_cmp_item_list
      => comparison_1(_1, _2, _3, _4)

    |  _1:nt_sum _2:nt_cmp_op _3:nt_sum
      => comparison_2(_1, _2, _3)

    |  _1:nt_as_expr
      => comparison_3(_1)
  ;

  union glr_matchings_t =
    | glr_matchings_1 of glr_matching_t * glr_matchings_t
    | glr_matchings_2 of glr_matching_t
  ;

  nonterm nt_glr_matchings : glr_matchings_t =
    |  _1:nt_glr_matching _2:nt_glr_matchings
      => glr_matchings_1(_1, _2)

    |  _1:nt_glr_matching
      => glr_matchings_2(_1)
  ;

  union re2_t =
    | re2_1 of re2_t * re3_t
    | re2_2 of re3_t
  ;

  nonterm nt_re2 : re2_t =
    |  _1:nt_re2 _2:nt_re3
      => re2_1(_1, _2)

    |  _1:nt_re3
      => re2_2(_1)
  ;

  union re3_t =
    | re3_1 of re4_t
    | re3_2 of re4_t
    | re3_3 of re4_t
    | re3_4 of re4_t
  ;

  nonterm nt_re3 : re3_t =
    |  _1:nt_re4 TOK_STAR
      => re3_1(_1)

    |  _1:nt_re4 TOK_PLUS
      => re3_2(_1)

    |  _1:nt_re4 TOK_QUEST
      => re3_3(_1)

    |  _1:nt_re4
      => re3_4(_1)
  ;

  union re0_t =
    | re0_1 of re1_t * string
    | re0_2 of re1_t
  ;

  nonterm nt_re0 : re0_t =
    |  _1:nt_re1 TOK_AS _2:TOK_NAME
      => re0_1(_1, _2)

    |  _1:nt_re1
      => re0_2(_1)
  ;

  union re1_t =
    | re1_1 of re1_t * re2_t
    | re1_2 of re2_t
  ;

  nonterm nt_re1 : re1_t =
    |  _1:nt_re1 TOK_VBAR _2:nt_re2
      => re1_1(_1, _2)

    |  _1:nt_re2
      => re1_2(_1)
  ;

  union re4_t =
    | re4_1 of string
    | re4_2
    | re4_3
    | re4_4 of re0_t
    | re4_5 of charset_t
    | re4_6 of charset_t
    | re4_7 of re_name_t
  ;

  nonterm nt_re4 : re4_t =
    |  _1:TOK_STRING
      => re4_1(_1)

    |  TOK_UNDERSCORE
      => re4_2

    |  TOK_DOT
      => re4_3

    |  TOK_LPAR _1:nt_re0 TOK_RPAR
      => re4_4(_1)

    |  TOK_LSQB _1:nt_charset TOK_RSQB
      => re4_5(_1)

    |  TOK_LSQB TOK_CIRCUMFLEX _1:nt_charset TOK_RSQB
      => re4_6(_1)

    |  _1:nt_re_name
      => re4_7(_1)
  ;

  union cmp_item_list_t =
    | cmp_item_list_1 of cmp_item_t * cmp_item_list_t
    | cmp_item_list_2 of cmp_item_t
  ;

  nonterm nt_cmp_item_list : cmp_item_list_t =
    |  _1:nt_cmp_item _2:nt_cmp_item_list
      => cmp_item_list_1(_1, _2)

    |  _1:nt_cmp_item
      => cmp_item_list_2(_1)
  ;

  union adjectives_t =
    | adjectives_1 of adjective_t * adjectives_t
    | adjectives_2
  ;

  nonterm nt_adjectives : adjectives_t =
    |  _1:nt_adjective _2:nt_adjectives
      => adjectives_1(_1, _2)

    |  
      => adjectives_2
  ;

  union whilst_stmt_t =
    | whilst_stmt_1 of expr_t * statement_aster_t
    | whilst_stmt_2 of expr_t * statement_aster_t
  ;

  nonterm nt_whilst_stmt : whilst_stmt_t =
    |  TOK_WHILST _1:nt_expr TOK_DO _2:nt_statement_aster TOK_DONE TOK_SEMI
      => whilst_stmt_1(_1, _2)

    |  TOK_UNTIL _1:nt_expr TOK_DO _2:nt_statement_aster TOK_DONE TOK_SEMI
      => whilst_stmt_2(_1, _2)
  ;

  union product_list_t =
    | product_list_1 of term_t * product_list_t
    | product_list_2 of term_t
  ;

  nonterm nt_product_list : product_list_t =
    |  _1:nt_term TOK_STAR _2:nt_product_list
      => product_list_1(_1, _2)

    |  _1:nt_term
      => product_list_2(_1)
  ;

  union match_expr_t =
    | match_expr_1 of expr_t * matchings_t
  ;

  nonterm nt_match_expr : match_expr_t =
    |  TOK_MATCH _1:nt_expr TOK_WITH _2:nt_matchings TOK_ENDMATCH
      => match_expr_1(_1, _2)
  ;

  union expression_t =
    | expression_1 of expr_t
  ;

  nonterm nt_expression : expression_t =
    |  _1:nt_expr TOK_ENDMARKER
      => expression_1(_1)
  ;

  union elif_clauses_t =
    | elif_clauses_1 of elif_clauses_t * elif_clause_t
    | elif_clauses_2 of elif_clause_t
  ;

  nonterm nt_elif_clauses : elif_clauses_t =
    |  _1:nt_elif_clauses _2:nt_elif_clause
      => elif_clauses_1(_1, _2)

    |  _1:nt_elif_clause
      => elif_clauses_2(_1)
  ;

  union lambda_t =
    | lambda_1 of dollar_apply_t
    | lambda_2 of adjectives_t * lambda_fun_args_t * opt_type_expr_t * compound_t
    | lambda_3 of adjectives_t * lambda_fun_args_t * opt_type_expr_t * expr_t
    | lambda_4 of lambda_fun_args_t * compound_t
    | lambda_5 of compound_t
  ;

  nonterm nt_lambda : lambda_t =
    |  _1:nt_dollar_apply
      => lambda_1(_1)

    |  _1:nt_adjectives TOK_FUNCTION _2:nt_lambda_fun_args _3:nt_opt_type_expr TOK_EQUAL _4:nt_compound
      => lambda_2(_1, _2, _3, _4)

    |  _1:nt_adjectives TOK_FUNCTION _2:nt_lambda_fun_args _3:nt_opt_type_expr TOK_EQRIGHTARROW _4:nt_expr
      => lambda_3(_1, _2, _3, _4)

    |  TOK_PROCEDURE _1:nt_lambda_fun_args _2:nt_compound
      => lambda_4(_1, _2)

    |  TOK_PROCEDURE _1:nt_compound
      => lambda_5(_1)
  ;

  union comment_t =
    | comment_1 of string
  ;

  nonterm nt_comment : comment_t =
    |  TOK_COMMENT_KEYWORD _1:TOK_STRING TOK_SEMI
      => comment_1(_1)
  ;

  union ctor_pattern_t =
    | ctor_pattern_1 of ctor_name_t * atomic_pattern_t
    | ctor_pattern_2 of ctor_name_t
  ;

  nonterm nt_ctor_pattern : ctor_pattern_t =
    |  _1:nt_ctor_name _2:nt_atomic_pattern
      => ctor_pattern_1(_1, _2)

    |  _1:nt_ctor_name
      => ctor_pattern_2(_1)
  ;

  union inclusion_t =
    | inclusion_1 of string
  ;

  nonterm nt_inclusion : inclusion_t =
    |  TOK_INCLUDE _1:TOK_STRING TOK_SEMI
      => inclusion_1(_1)
  ;

  union integral_t =
    | integral_1 of (string * string)
    | integral_2 of (string * string)
  ;

  nonterm nt_integral : integral_t =
    |  _1:TOK_INTEGER
      => integral_1(_1)

    |  TOK_MINUS _1:TOK_INTEGER
      => integral_2(_1)
  ;

  union tlelement_t =
    | tlelement_1 of lelement_t * factor_t
    | tlelement_2 of lelement_t
  ;

  nonterm nt_tlelement : tlelement_t =
    |  _1:nt_lelement TOK_COLON _2:nt_factor
      => tlelement_1(_1, _2)

    |  _1:nt_lelement
      => tlelement_2(_1)
  ;

  union factor_t =
    | factor_1 of dollar_name_t
    | factor_2 of factor_t * expr_t
    | factor_3 of factor_t * expr_t * expr_t
    | factor_4 of factor_t * expr_t
    | factor_5 of factor_t * expr_t
    | factor_6 of factor_t * string
    | factor_7 of factor_t * (string * string)
  ;

  nonterm nt_factor : factor_t =
    |  _1:nt_dollar_name
      => factor_1(_1)

    |  _1:nt_factor TOK_DOT TOK_LSQB _2:nt_expr TOK_RSQB
      => factor_2(_1, _2)

    |  _1:nt_factor TOK_DOT TOK_LSQB _2:nt_expr TOK_TO _3:nt_expr TOK_RSQB
      => factor_3(_1, _2, _3)

    |  _1:nt_factor TOK_DOT TOK_LSQB _2:nt_expr TOK_TO TOK_RSQB
      => factor_4(_1, _2)

    |  _1:nt_factor TOK_DOT TOK_LSQB TOK_TO _2:nt_expr TOK_RSQB
      => factor_5(_1, _2)

    |  _1:nt_factor TOK_DOT _2:TOK_NAME
      => factor_6(_1, _2)

    |  _1:nt_factor TOK_DOT TOK_LPAR _2:TOK_INTEGER TOK_RPAR
      => factor_7(_1, _2)
  ;

  union abstract_type_t =
    | abstract_type_1 of type_quals_t * basic_name_comma_list_t * requires_clause_t
    | abstract_type_2 of type_quals_t * string * tvarlist_t * code_spec_t * requires_clause_t
  ;

  nonterm nt_abstract_type : abstract_type_t =
    |  _1:nt_type_quals TOK_CTYPES _2:nt_basic_name_comma_list _3:nt_requires_clause TOK_SEMI
      => abstract_type_1(_1, _2, _3)

    |  _1:nt_type_quals TOK_TYPE _2:TOK_NAME _3:nt_tvarlist TOK_EQUAL _4:nt_code_spec _5:nt_requires_clause TOK_SEMI
      => abstract_type_2(_1, _2, _3, _4, _5)
  ;

  union struct_component_aster_t =
    | struct_component_aster_1 of struct_component_t * struct_component_aster_t
    | struct_component_aster_2
  ;

  nonterm nt_struct_component_aster : struct_component_aster_t =
    |  _1:nt_struct_component _2:nt_struct_component_aster
      => struct_component_aster_1(_1, _2)

    |  
      => struct_component_aster_2
  ;

  union binding_header_t =
    | binding_header_1 of code_spec_t * requires_clause_t
    | binding_header_2 of code_spec_t * requires_clause_t
    | binding_header_3 of code_spec_t * requires_clause_t
    | binding_header_4 of code_spec_t * requires_clause_t
    | binding_header_5 of string * tvarlist_t * code_spec_t * requires_clause_t
    | binding_header_6 of string * tvarlist_t * code_spec_t * requires_clause_t
    | binding_header_7 of requirements_t
    | binding_header_8 of string * requirements_t
  ;

  nonterm nt_binding_header : binding_header_t =
    |  TOK_HEADER _1:nt_code_spec _2:nt_requires_clause TOK_SEMI
      => binding_header_1(_1, _2)

    |  TOK_BODY _1:nt_code_spec _2:nt_requires_clause TOK_SEMI
      => binding_header_2(_1, _2)

    |  TOK_HEADER TOK_EQUAL _1:nt_code_spec _2:nt_requires_clause TOK_SEMI
      => binding_header_3(_1, _2)

    |  TOK_BODY TOK_EQUAL _1:nt_code_spec _2:nt_requires_clause TOK_SEMI
      => binding_header_4(_1, _2)

    |  TOK_HEADER _1:TOK_NAME _2:nt_tvarlist TOK_EQUAL _3:nt_code_spec _4:nt_requires_clause TOK_SEMI
      => binding_header_5(_1, _2, _3, _4)

    |  TOK_BODY _1:TOK_NAME _2:nt_tvarlist TOK_EQUAL _3:nt_code_spec _4:nt_requires_clause TOK_SEMI
      => binding_header_6(_1, _2, _3, _4)

    |  TOK_REQUIRES _1:nt_requirements TOK_SEMI
      => binding_header_7(_1)

    |  _1:TOK_NAME TOK_REQUIRES _2:nt_requirements TOK_SEMI
      => binding_header_8(_1, _2)
  ;

  union glr_seqs_t =
    | glr_seqs_1 of glr_term_t * glr_seqs_t
    | glr_seqs_2 of glr_term_t
  ;

  nonterm nt_glr_seqs : glr_seqs_t =
    |  _1:nt_glr_term _2:nt_glr_seqs
      => glr_seqs_1(_1, _2)

    |  _1:nt_glr_term
      => glr_seqs_2(_1)
  ;

  union module_definition_t =
    | module_definition_1 of string * tvarlist_t * compound_t
  ;

  nonterm nt_module_definition : module_definition_t =
    |  TOK_MODULE _1:TOK_NAME _2:nt_tvarlist _3:nt_compound
      => module_definition_1(_1, _2, _3)
  ;

  union executable_t =
    | executable_1 of var_def_t
    | executable_2 of val_def_t
    | executable_3 of call_t
    | executable_4 of svc_t
    | executable_5 of return_t
    | executable_6 of ifgoto_stmt_t
    | executable_7 of whilst_stmt_t
    | executable_8 of todo_t
    | executable_9 of assignment_t
    | executable_10 of inline_cpp_t
    | executable_11 of goto_statement_t
    | executable_12 of label_statement_t
    | executable_13 of assert_statement_t
  ;

  nonterm nt_executable : executable_t =
    |  _1:nt_var_def
      => executable_1(_1)

    |  _1:nt_val_def
      => executable_2(_1)

    |  _1:nt_call
      => executable_3(_1)

    |  _1:nt_svc
      => executable_4(_1)

    |  _1:nt_return
      => executable_5(_1)

    |  _1:nt_ifgoto_stmt
      => executable_6(_1)

    |  _1:nt_whilst_stmt
      => executable_7(_1)

    |  _1:nt_todo
      => executable_8(_1)

    |  _1:nt_assignment
      => executable_9(_1)

    |  _1:nt_inline_cpp
      => executable_10(_1)

    |  _1:nt_goto_statement
      => executable_11(_1)

    |  _1:nt_label_statement
      => executable_12(_1)

    |  _1:nt_assert_statement
      => executable_13(_1)
  ;

  union setunion_t =
    | setunion_1 of user10_t * setunion_list_t
    | setunion_2 of user10_t
  ;

  nonterm nt_setunion : setunion_t =
    |  _1:nt_user10 TOK_VBARVBAR _2:nt_setunion_list
      => setunion_1(_1, _2)

    |  _1:nt_user10