package reason

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Reason_parser.MenhirInterpreter

include MenhirLib.IncrementalEngine.INCREMENTAL_ENGINE with type token = token
type token = token
type production

A value of type production is (an index for) a production. The start productions (which do not exist in an .mly file, but are constructed by Menhir internally) are not part of this type.

type 'a env

A value of type 'a env represents a configuration of the automaton: current state, stack, lookahead token, etc. The parameter 'a is the type of the semantic value that will eventually be produced if the parser succeeds.

In normal operation, the parser works with checkpoints: see the functions offer and resume. However, it is also possible to work directly with environments (see the functions pop, force_reduction, and feed) and to reconstruct a checkpoint out of an environment (see input_needed). This is considered advanced functionality; its purpose is to allow error recovery strategies to be programmed by the user.

type 'a checkpoint = private
  1. | InputNeeded of 'a env
  2. | Shifting of 'a env * 'a env * bool
  3. | AboutToReduce of 'a env * production
  4. | HandlingError of 'a env
  5. | Accepted of 'a
  6. | Rejected

The type 'a checkpoint represents an intermediate or final state of the parser. An intermediate checkpoint is a suspension: it records the parser's current state, and allows parsing to be resumed. The parameter 'a is the type of the semantic value that will eventually be produced if the parser succeeds.

Accepted and Rejected are final checkpoints. Accepted carries a semantic value.

InputNeeded is an intermediate checkpoint. It means that the parser wishes to read one token before continuing.

Shifting is an intermediate checkpoint. It means that the parser is taking a shift transition. It exposes the state of the parser before and after the transition. The Boolean parameter tells whether the parser intends to request a new token after this transition. (It always does, except when it is about to accept.)

AboutToReduce is an intermediate checkpoint. It means that the parser is about to perform a reduction step. It exposes the parser's current state as well as the production that is about to be reduced.

HandlingError is an intermediate checkpoint. It means that the parser has detected an error and is currently handling it, in several steps.

offer allows the user to resume the parser after it has suspended itself with a checkpoint of the form InputNeeded env. offer expects the old checkpoint as well as a new token and produces a new checkpoint. It does not raise any exception.

type strategy = [
  1. | `Legacy
  2. | `Simplified
]

The optional argument strategy influences the manner in which resume deals with checkpoints of the form HandlingError _. Its default value is `Legacy. It can be briefly described as follows:

  • If the error token is used only to report errors (that is, if the error token appears only at the end of a production, whose semantic action raises an exception) then the simplified strategy should be preferred. (This includes the case where the error token does not appear at all in the grammar.)
  • If the error token is used to recover after an error, or if perfect backward compatibility is required, the legacy strategy should be selected.

More details on strategies appear in the file Engine.ml.

val resume : ?strategy:strategy -> 'a checkpoint -> 'a checkpoint

resume allows the user to resume the parser after it has suspended itself with a checkpoint of the form Shifting _, AboutToReduce _, or HandlingError _. resume expects the old checkpoint and produces a new checkpoint. It does not raise any exception.

A token supplier is a function of no arguments which delivers a new token (together with its start and end positions) every time it is called.

val lexer_lexbuf_to_supplier : (Lexing.lexbuf -> token) -> Lexing.lexbuf -> supplier

A pair of a lexer and a lexing buffer can be turned into a supplier.

The functions offer and resume are sufficient to write a parser loop. One can imagine many variations (which is why we expose these functions in the first place!). Here, we expose a few variations of the main loop, ready for use.

val loop : ?strategy:strategy -> supplier -> 'a checkpoint -> 'a

loop supplier checkpoint begins parsing from checkpoint, reading tokens from supplier. It continues parsing until it reaches a checkpoint of the form Accepted v or Rejected. In the former case, it returns v. In the latter case, it raises the exception Error. The optional argument strategy, whose default value is Legacy, is passed to resume and influences the error-handling strategy.

val loop_handle : ('a -> 'answer) -> ('a checkpoint -> 'answer) -> supplier -> 'a checkpoint -> 'answer

loop_handle succeed fail supplier checkpoint begins parsing from checkpoint, reading tokens from supplier. It continues parsing until it reaches a checkpoint of the form Accepted v or HandlingError env (or Rejected, but that should not happen, as HandlingError _ will be observed first). In the former case, it calls succeed v. In the latter case, it calls fail with this checkpoint. It cannot raise Error.

This means that Menhir's error-handling procedure does not get a chance to run. For this reason, there is no strategy parameter. Instead, the user can implement her own error handling code, in the fail continuation.

val loop_handle_undo : ('a -> 'answer) -> ('a checkpoint -> 'a checkpoint -> 'answer) -> supplier -> 'a checkpoint -> 'answer

loop_handle_undo is analogous to loop_handle, except it passes a pair of checkpoints to the failure continuation.

The first (and oldest) checkpoint is the last InputNeeded checkpoint that was encountered before the error was detected. The second (and newest) checkpoint is where the error was detected, as in loop_handle. Going back to the first checkpoint can be thought of as undoing any reductions that were performed after seeing the problematic token. (These reductions must be default reductions or spurious reductions.)

loop_handle_undo must initially be applied to an InputNeeded checkpoint. The parser's initial checkpoints satisfy this constraint.

val shifts : 'a checkpoint -> 'a env option

shifts checkpoint assumes that checkpoint has been obtained by submitting a token to the parser. It runs the parser from checkpoint, through an arbitrary number of reductions, until the parser either accepts this token (i.e., shifts) or rejects it (i.e., signals an error). If the parser decides to shift, then Some env is returned, where env is the parser's state just before shifting. Otherwise, None is returned.

It is desirable that the semantic actions be side-effect free, or that their side-effects be harmless (replayable).

val acceptable : 'a checkpoint -> token -> MenhirLib.IncrementalEngine.position -> bool

The function acceptable allows testing, after an error has been detected, which tokens would have been accepted at this point. It is implemented using shifts. Its argument should be an InputNeeded checkpoint.

For completeness, one must undo any spurious reductions before carrying out this test -- that is, one must apply acceptable to the FIRST checkpoint that is passed by loop_handle_undo to its failure continuation.

This test causes some semantic actions to be run! The semantic actions should be side-effect free, or their side-effects should be harmless.

The position pos is used as the start and end positions of the hypothetical token, and may be picked up by the semantic actions. We suggest using the position where the error was detected.

type 'a lr1state

The abstract type 'a lr1state describes the non-initial states of the LR(1) automaton. The index 'a represents the type of the semantic value associated with this state's incoming symbol.

val number : _ lr1state -> int

The states of the LR(1) automaton are numbered (from 0 and up).

val production_index : production -> int

production_index maps a production to its integer index.

val find_production : int -> production

find_production maps a production index to a production. Its argument must be a valid index; use with care.

An element is a pair of a non-initial state s and a semantic value v associated with the incoming symbol of this state. The idea is, the value v was pushed onto the stack just before the state s was entered. Thus, for some type 'a, the state s has type 'a lr1state and the value v has type 'a. In other words, the type element is an existential type.

The parser's stack is (or, more precisely, can be viewed as) a stream of elements. The functions top and pop offer access to this stream.

val top : 'a env -> element option

top env returns the parser's top stack element. The state contained in this stack element is the current state of the automaton. If the stack is empty, None is returned. In that case, the current state of the automaton must be an initial state.

val pop_many : int -> 'a env -> 'a env option

pop_many i env pops i cells off the automaton's stack. This is done via i successive invocations of pop. Thus, pop_many 1 is pop. The index i must be nonnegative. The time complexity is O(i).

val get : int -> 'a env -> element option

get i env returns the parser's i-th stack element. The index i is 0-based: thus, get 0 is top. If i is greater than or equal to the number of elements in the stack, None is returned. The time complexity is O(i).

val current_state_number : 'a env -> int

current_state_number env is (the integer number of) the automaton's current state. This works even if the automaton's stack is empty, in which case the current state is an initial state. This number can be passed as an argument to a message function generated by menhir --compile-errors.

val equal : 'a env -> 'a env -> bool

equal env1 env2 tells whether the parser configurations env1 and env2 are equal in the sense that the automaton's current state is the same in env1 and env2 and the stack is *physically* the same in env1 and env2. If equal env1 env2 is true, then the sequence of the stack elements, as observed via pop and top, must be the same in env1 and env2. Also, if equal env1 env2 holds, then the checkpoints input_needed env1 and input_needed env2 must be equivalent. The function equal has time complexity O(1).

positions env returns the start and end positions of the current lookahead token. In an initial state, a pair of twice the initial position is returned.

val env_has_default_reduction : 'a env -> bool

When applied to an environment taken from a checkpoint of the form AboutToReduce (env, prod), the function env_has_default_reduction tells whether the reduction that is about to take place is a default reduction.

val state_has_default_reduction : _ lr1state -> bool

state_has_default_reduction s tells whether the state s has a default reduction. This includes the case where s is an accepting state.

val pop : 'a env -> 'a env option

pop env returns a new environment, where the parser's top stack cell has been popped off. (If the stack is empty, None is returned.) This amounts to pretending that the (terminal or nonterminal) symbol that corresponds to this stack cell has not been read.

val force_reduction : production -> 'a env -> 'a env

force_reduction prod env should be called only if in the state env the parser is capable of reducing the production prod. If this condition is satisfied, then this production is reduced, which means that its semantic action is executed (this can have side effects!) and the automaton makes a goto (nonterminal) transition. If this condition is not satisfied, Invalid_argument _ is raised.

val input_needed : 'a env -> 'a checkpoint

input_needed env returns InputNeeded env. That is, out of an env that might have been obtained via a series of calls to the functions pop, force_reduction, feed, etc., it produces a checkpoint, which can be used to resume normal parsing, by supplying this checkpoint as an argument to offer.

This function should be used with some care. It could "mess up the lookahead" in the sense that it allows parsing to resume in an arbitrary state s with an arbitrary lookahead symbol t, even though Menhir's reachability analysis (menhir --list-errors) might well think that it is impossible to reach this particular configuration. If one is using Menhir's new error reporting facility, this could cause the parser to reach an error state for which no error message has been prepared.

type _ terminal =
  1. | T_error : unit terminal
  2. | T_WITH : unit terminal
  3. | T_WHILE : unit terminal
  4. | T_WHEN : unit terminal
  5. | T_VIRTUAL : unit terminal
  6. | T_VAL : unit terminal
  7. | T_UNDERSCORE : unit terminal
  8. | T_UIDENT : string terminal
  9. | T_TYPE : unit terminal
  10. | T_TRY : unit terminal
  11. | T_TRUE : unit terminal
  12. | T_TO : unit terminal
  13. | T_TILDE : unit terminal
  14. | T_THEN : unit terminal
  15. | T_SWITCH : unit terminal
  16. | T_STRUCT : unit terminal
  17. | T_STRING : (string * string option * string option) terminal
  18. | T_STAR : unit terminal
  19. | T_SLASHGREATER : unit terminal
  20. | T_SIG : unit terminal
  21. | T_SHARPOP : string terminal
  22. | T_SHARPEQUAL : unit terminal
  23. | T_SHARP : unit terminal
  24. | T_SEMISEMI : unit terminal
  25. | T_SEMI : unit terminal
  26. | T_RPAREN : unit terminal
  27. | T_REC : unit terminal
  28. | T_RBRACKET : unit terminal
  29. | T_RBRACE : unit terminal
  30. | T_QUOTE : unit terminal
  31. | T_QUESTION : unit terminal
  32. | T_PUB : unit terminal
  33. | T_PRI : unit terminal
  34. | T_PREFIXOP : string terminal
  35. | T_POSTFIXOP : string terminal
  36. | T_PLUSEQ : unit terminal
  37. | T_PLUSDOT : unit terminal
  38. | T_PLUS : unit terminal
  39. | T_PERCENT : unit terminal
  40. | T_OR : unit terminal
  41. | T_OPEN : unit terminal
  42. | T_OF : unit terminal
  43. | T_OBJECT : unit terminal
  44. | T_NONREC : unit terminal
  45. | T_NEW : unit terminal
  46. | T_NATIVEINT : nativeint terminal
  47. | T_MUTABLE : unit terminal
  48. | T_MODULE : unit terminal
  49. | T_MINUSGREATER : unit terminal
  50. | T_MINUSDOT : unit terminal
  51. | T_MINUS : unit terminal
  52. | T_LPAREN : unit terminal
  53. | T_LIDENT : string terminal
  54. | T_LETOP : string terminal
  55. | T_LET : unit terminal
  56. | T_LESSUIDENT : string terminal
  57. | T_LESSSLASHIDENTGREATER : string terminal
  58. | T_LESSSLASHGREATER : unit terminal
  59. | T_LESSIDENT : string terminal
  60. | T_LESSGREATER : unit terminal
  61. | T_LESSDOTDOTGREATER : unit terminal
  62. | T_LESS : unit terminal
  63. | T_LBRACKETPERCENTPERCENT : unit terminal
  64. | T_LBRACKETPERCENT : unit terminal
  65. | T_LBRACKETLESS : unit terminal
  66. | T_LBRACKETGREATER : unit terminal
  67. | T_LBRACKETBAR : unit terminal
  68. | T_LBRACKETAT : unit terminal
  69. | T_LBRACKET : unit terminal
  70. | T_LBRACELESS : unit terminal
  71. | T_LBRACE : unit terminal
  72. | T_LAZY : unit terminal
  73. | T_INT : (string * char option) terminal
  74. | T_INITIALIZER : unit terminal
  75. | T_INHERIT : unit terminal
  76. | T_INFIXOP4 : string terminal
  77. | T_INFIXOP3 : string terminal
  78. | T_INFIXOP2 : string terminal
  79. | T_INFIXOP1 : string terminal
  80. | T_INFIXOP0 : string terminal
  81. | T_INCLUDE : unit terminal
  82. | T_IN : unit terminal
  83. | T_IF : unit terminal
  84. | T_GREATERRBRACE : unit terminal
  85. | T_GREATERDOTDOTDOT : unit terminal
  86. | T_GREATER : unit terminal
  87. | T_FUNCTOR : unit terminal
  88. | T_FUNCTION : unit terminal
  89. | T_FUN : unit terminal
  90. | T_FOR : unit terminal
  91. | T_FLOAT : (string * char option) terminal
  92. | T_FALSE : unit terminal
  93. | T_EXTERNAL : unit terminal
  94. | T_EXCEPTION : unit terminal
  95. | T_ES6_FUN : unit terminal
  96. | T_EQUALGREATER : unit terminal
  97. | T_EQUAL : unit terminal
  98. | T_EOL : unit terminal
  99. | T_EOF : unit terminal
  100. | T_END : unit terminal
  101. | T_ELSE : unit terminal
  102. | T_DOWNTO : unit terminal
  103. | T_DOTDOTDOT : unit terminal
  104. | T_DOTDOT : unit terminal
  105. | T_DOT : unit terminal
  106. | T_DONE : unit terminal
  107. | T_DOCSTRING : string terminal
  108. | T_DO : unit terminal
  109. | T_CONSTRAINT : unit terminal
  110. | T_COMMENT : (string * Location.t) terminal
  111. | T_COMMA : unit terminal
  112. | T_COLONGREATER : unit terminal
  113. | T_COLONEQUAL : unit terminal
  114. | T_COLONCOLON : unit terminal
  115. | T_COLON : unit terminal
  116. | T_CLASS : unit terminal
  117. | T_CHAR : char terminal
  118. | T_BEGIN : unit terminal
  119. | T_BARRBRACKET : unit terminal
  120. | T_BARBAR : unit terminal
  121. | T_BAR : unit terminal
  122. | T_BANG : unit terminal
  123. | T_BACKQUOTE : unit terminal
  124. | T_ASSERT : unit terminal
  125. | T_AS : unit terminal
  126. | T_ANDOP : string terminal
  127. | T_AND : unit terminal
  128. | T_AMPERSAND : unit terminal
  129. | T_AMPERAMPER : unit terminal
type _ nonterminal =
  1. | N_with_constraint : Reason_omp.Ast_411.Parsetree.with_constraint nonterminal
  2. | N_virtual_flag : Reason_omp.Ast_411.Asttypes.virtual_flag nonterminal
  3. | N_value_type : (string Location.loc * Reason_omp.Ast_411.Asttypes.mutable_flag * Reason_omp.Ast_411.Asttypes.virtual_flag * Reason_omp.Ast_411.Parsetree.core_type) nonterminal
  4. | N_value : (string Location.loc * Reason_omp.Ast_411.Asttypes.mutable_flag * Reason_omp.Ast_411.Parsetree.class_field_kind) nonterminal
  5. | N_val_longident : Longident.t nonterminal
  6. | N_val_ident : string nonterminal
  7. | N_use_file_no_mapper : Reason_omp.Ast_411.Parsetree.toplevel_phrase list nonterminal
  8. | N_use_file : Reason_omp.Ast_411.Parsetree.toplevel_phrase list nonterminal
  9. | N_unattributed_expr : Reason_omp.Ast_411.Parsetree.expression nonterminal
  10. | N_unattributed_core_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  11. | N_type_variance : Reason_omp.Ast_411.Asttypes.variance nonterminal
  12. | N_type_variables_with_variance_comma_list : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list nonterminal
  13. | N_type_variables_with_variance : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list nonterminal
  14. | N_type_variable_with_variance : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) nonterminal
  15. | N_type_variable : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  16. | N_type_subst_other_kind : (Reason_omp.Ast_411.Parsetree.type_kind * Reason_omp.Ast_411.Asttypes.private_flag * Reason_omp.Ast_411.Parsetree.core_type option) nonterminal
  17. | N_type_subst_kind : ((Reason_omp.Ast_411.Parsetree.type_kind * Reason_omp.Ast_411.Asttypes.private_flag * Reason_omp.Ast_411.Parsetree.core_type option) * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) list * Lexing.position * Reason_omp.Ast_411.Parsetree.type_declaration list) nonterminal
  18. | N_type_subst_declarations : Reason_omp.Ast_411.Parsetree.type_declaration list nonterminal
  19. | N_type_subst_constructor_declarations_aux : (Reason_omp.Ast_411.Parsetree.constructor_declaration list * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) list * Lexing.position * Reason_omp.Ast_411.Parsetree.type_declaration list) nonterminal
  20. | N_type_subst_constructor_declarations : (Reason_omp.Ast_411.Parsetree.constructor_declaration list * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) list * Lexing.position * Reason_omp.Ast_411.Parsetree.type_declaration list) nonterminal
  21. | N_type_parameters : Reason_omp.Ast_411.Parsetree.core_type list nonterminal
  22. | N_type_parameter : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) nonterminal
  23. | N_type_other_kind : (Reason_omp.Ast_411.Parsetree.type_kind * Reason_omp.Ast_411.Asttypes.private_flag * Reason_omp.Ast_411.Parsetree.core_type option) nonterminal
  24. | N_type_longident : Reason_omp.Ast_411.Ast_helper.lid nonterminal
  25. | N_type_declarations : (Reason_omp.Ast_411.Asttypes.rec_flag * Reason_omp.Ast_411.Parsetree.type_declaration list) nonterminal
  26. | N_type_declaration_kind : ((Reason_omp.Ast_411.Parsetree.type_kind * Reason_omp.Ast_411.Asttypes.private_flag * Reason_omp.Ast_411.Parsetree.core_type option) * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) list * Lexing.position * Reason_omp.Ast_411.Parsetree.type_declaration list) nonterminal
  27. | N_type_declaration_details : ((Reason_omp.Ast_411.Ast_helper.str * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) list * Reason_omp.Ast_411.Parsetree.type_kind * Reason_omp.Ast_411.Asttypes.private_flag * Reason_omp.Ast_411.Parsetree.core_type option) * Lexing.position * Reason_omp.Ast_411.Parsetree.type_declaration list) nonterminal
  28. | N_type_constraint : (Reason_omp.Ast_411.Parsetree.core_type option * Reason_omp.Ast_411.Parsetree.core_type option) nonterminal
  29. | N_toplevel_phrase : Reason_omp.Ast_411.Parsetree.toplevel_phrase nonterminal
  30. | N_toplevel_directive : Reason_omp.Ast_411.Parsetree.toplevel_phrase nonterminal
  31. | N_tag_field : Reason_omp.Ast_411.Parsetree.row_field nonterminal
  32. | N_structure_item : Reason_omp.OCaml_411.Ast.Parsetree.structure nonterminal
  33. | N_structure : Reason_omp.OCaml_411.Ast.Parsetree.structure nonterminal
  34. | N_string_literal_labels : Reason_omp.Ast_411.Parsetree.object_field list nonterminal
  35. | N_string_literal_label : Reason_omp.Ast_411.Parsetree.object_field nonterminal
  36. | N_string_literal_exprs_maybe_punned : (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.expression) list nonterminal
  37. | N_string_literal_expr_maybe_punned_with_comma : (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.expression) nonterminal
  38. | N_string_literal_expr_maybe_punned : (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.expression) nonterminal
  39. | N_str_type_extension : Reason_omp.Ast_411.Parsetree.type_extension nonterminal
  40. | N_str_exception_declaration : Reason_omp.Ast_411.Parsetree.extension_constructor nonterminal
  41. | N_single_attr_id : string nonterminal
  42. | N_simple_pattern_not_ident_ : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  43. | N_simple_pattern_not_ident : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  44. | N_simple_pattern_ident : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  45. | N_simple_pattern_direct_argument : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  46. | N_simple_pattern : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  47. | N_simple_module_type : Reason_omp.Ast_411.Parsetree.module_type nonterminal
  48. | N_simple_expr_template_constructor : Reason_omp.Ast_411.Parsetree.expression nonterminal
  49. | N_simple_expr_no_constructor : Reason_omp.Ast_411.Parsetree.expression nonterminal
  50. | N_simple_expr_no_call : Reason_omp.Ast_411.Parsetree.expression nonterminal
  51. | N_simple_expr_direct_argument : Reason_omp.Ast_411.Parsetree.expression nonterminal
  52. | N_simple_expr_call : (Reason_omp.Ast_411.Parsetree.expression * (Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.expression) list) nonterminal
  53. | N_signed_constant : (Reason_omp.Ast_411.Ast_helper.attrs * Reason_omp.Ast_411.Parsetree.constant) nonterminal
  54. | N_signature_items : Reason_omp.OCaml_411.Ast.Parsetree.signature nonterminal
  55. | N_signature_item : Reason_omp.Ast_411.Parsetree.signature_item_desc nonterminal
  56. | N_signature : Reason_omp.OCaml_411.Ast.Parsetree.signature nonterminal
  57. | N_sig_type_extension : Reason_omp.Ast_411.Parsetree.type_extension nonterminal
  58. | N_sig_exception_declaration : Reason_omp.Ast_411.Parsetree.type_exception nonterminal
  59. | N_seq_expr_no_seq : Reason_omp.Ast_411.Parsetree.expression nonterminal
  60. | N_seq_expr : Reason_omp.Ast_411.Parsetree.expression nonterminal
  61. | N_separated_nonempty_list_AMPERSAND_non_arrowed_simple_core_types_ : Reason_omp.Ast_411.Parsetree.core_type list nonterminal
  62. | N_row_field_list : Reason_omp.Ast_411.Parsetree.row_field list nonterminal
  63. | N_row_field : Reason_omp.Ast_411.Parsetree.row_field nonterminal
  64. | N_record_label_declaration : Reason_omp.Ast_411.Parsetree.label_declaration nonterminal
  65. | N_record_expr_with_string_keys : (Reason_omp.Ast_411.Parsetree.expression option * (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.expression) list) nonterminal
  66. | N_record_expr : (Reason_omp.Ast_411.Parsetree.expression option * (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.expression) list) nonterminal
  67. | N_record_declaration : Reason_omp.Ast_411.Parsetree.label_declaration list nonterminal
  68. | N_rec_flag : Reason_omp.Ast_411.Asttypes.rec_flag nonterminal
  69. | N_protected_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  70. | N_primitive_declaration : string list nonterminal
  71. | N_poly_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  72. | N_payload : Reason_omp.Ast_411.Parsetree.payload nonterminal
  73. | N_pattern_without_or : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  74. | N_pattern_optional_constraint : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  75. | N_pattern_constructor_argument : Reason_omp.Ast_411.Parsetree.pattern list nonterminal
  76. | N_pattern_comma_list_extension : (Reason_omp.Ast_411.Parsetree.pattern list * Reason_omp.Ast_411.Parsetree.pattern option) nonterminal
  77. | N_pattern : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  78. | N_parse_pattern : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  79. | N_parse_expression : Reason_omp.Ast_411.Parsetree.expression nonterminal
  80. | N_parse_core_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  81. | N_parenthesized_expr : Reason_omp.Ast_411.Parsetree.expression nonterminal
  82. | N_package_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  83. | N_override_flag : Reason_omp.Ast_411.Asttypes.override_flag nonterminal
  84. | N_optional_expr_extension : (Reason_omp.Ast_411.Parsetree.expression -> Reason_omp.Ast_411.Parsetree.expression) nonterminal
  85. | N_optional : (string -> Reason_omp.Ast_411.Asttypes.arg_label) nonterminal
  86. | N_option_type_constraint_ : (Reason_omp.Ast_411.Parsetree.core_type option * Reason_omp.Ast_411.Parsetree.core_type option) option nonterminal
  87. | N_option_preceded_WHEN_expr__ : Reason_omp.Ast_411.Parsetree.expression option nonterminal
  88. | N_option_preceded_COLONGREATER_core_type__ : Reason_omp.Ast_411.Parsetree.core_type option nonterminal
  89. | N_option_preceded_COLON_simple_module_type__ : Reason_omp.Ast_411.Parsetree.module_type option nonterminal
  90. | N_option_preceded_COLON_poly_type__ : Reason_omp.Ast_411.Parsetree.core_type option nonterminal
  91. | N_option_preceded_COLON_non_arrowed_core_type__ : Reason_omp.Ast_411.Parsetree.core_type option nonterminal
  92. | N_option_preceded_COLON_expr__ : Reason_omp.Ast_411.Parsetree.expression option nonterminal
  93. | N_option_preceded_COLON_core_type__ : Reason_omp.Ast_411.Parsetree.core_type option nonterminal
  94. | N_option_preceded_COLON_class_constructor_type__ : Reason_omp.Ast_411.Parsetree.class_type option nonterminal
  95. | N_option_item_extension_sugar_ : (Reason_omp.Ast_411.Ast_helper.attrs * string Location.loc) option nonterminal
  96. | N_option_constructor_arguments_ : Reason_omp.Ast_411.Parsetree.constructor_arguments option nonterminal
  97. | N_option_as_loc_preceded_AS_LIDENT___ : string Location.loc option nonterminal
  98. | N_option_SEMI_ : unit option nonterminal
  99. | N_option_OF_ : unit option nonterminal
  100. | N_option_MODULE_ : unit option nonterminal
  101. | N_option_LET_ : unit option nonterminal
  102. | N_option_DOTDOTDOT_ : unit option nonterminal
  103. | N_option_DOT_ : unit option nonterminal
  104. | N_option_COMMA_ : unit option nonterminal
  105. | N_opt_LET_MODULE_ident : Reason_omp.Ast_411.Ast_helper.str_opt nonterminal
  106. | N_opt_LET_MODULE_REC_ident : Reason_omp.Ast_411.Ast_helper.str_opt nonterminal
  107. | N_opt_LET_MODULE : unit nonterminal
  108. | N_operator : string nonterminal
  109. | N_open_description : Reason_omp.OCaml_411.Ast.Parsetree.open_description nonterminal
  110. | N_open_declaration : Reason_omp.Ast_411.Parsetree.module_expr Reason_omp.Ast_411.Parsetree.open_infos nonterminal
  111. | N_object_record_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  112. | N_object_label_declarations : Reason_omp.Ast_411.Parsetree.object_field list nonterminal
  113. | N_object_label_declaration : Reason_omp.Ast_411.Parsetree.object_field nonterminal
  114. | N_object_body_class_fields : Reason_omp.Ast_411.Parsetree.class_field list nonterminal
  115. | N_object_body : Reason_omp.Ast_411.Parsetree.class_structure nonterminal
  116. | N_nonrec_flag : Reason_omp.Ast_411.Asttypes.rec_flag nonterminal
  117. | N_nonempty_list_preceded_CONSTRAINT_constrain__ : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) list nonterminal
  118. | N_nonempty_list_name_tag_ : string list nonterminal
  119. | N_nonempty_list_attributed_ext_constructor_extension_constructor_declaration__ : Reason_omp.Ast_411.Parsetree.extension_constructor list nonterminal
  120. | N_nonempty_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ : Reason_omp.Ast_411.Parsetree.extension_constructor list nonterminal
  121. | N_nonempty_list_as_loc_preceded_QUOTE_ident___ : string Location.loc list nonterminal
  122. | N_nonempty_list_as_loc_attribute__ : Reason_omp.Ast_411.Parsetree.attribute Location.loc list nonterminal
  123. | N_nonempty_list_as_loc_LIDENT__ : string Location.loc list nonterminal
  124. | N_nonempty_list___anonymous_31_ : string list nonterminal
  125. | N_non_labeled_argument_list : Reason_omp.Ast_411.Parsetree.expression list nonterminal
  126. | N_non_arrowed_simple_core_types : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  127. | N_non_arrowed_simple_core_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  128. | N_non_arrowed_core_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  129. | N_mutable_or_virtual_flags : (Reason_omp.Ast_411.Asttypes.mutable_flag * Reason_omp.Ast_411.Asttypes.virtual_flag) nonterminal
  130. | N_mutable_flag : Reason_omp.Ast_411.Asttypes.mutable_flag nonterminal
  131. | N_mty_longident : Longident.t nonterminal
  132. | N_module_type_signature : Reason_omp.Ast_411.Parsetree.module_type nonterminal
  133. | N_module_type_body_EQUAL_ : Reason_omp.Ast_411.Parsetree.module_type nonterminal
  134. | N_module_type_body_COLON_ : Reason_omp.Ast_411.Parsetree.module_type nonterminal
  135. | N_module_type : Reason_omp.Ast_411.Parsetree.module_type nonterminal
  136. | N_module_parameter : Reason_omp.Ast_411.Parsetree.functor_parameter Location.loc nonterminal
  137. | N_module_expr_structure : Reason_omp.Ast_411.Parsetree.module_expr nonterminal
  138. | N_module_expr_body : Reason_omp.Ast_411.Parsetree.module_expr nonterminal
  139. | N_module_expr : Reason_omp.Ast_411.Parsetree.module_expr nonterminal
  140. | N_module_declaration : Reason_omp.Ast_411.Parsetree.module_type nonterminal
  141. | N_module_complex_expr : Reason_omp.Ast_411.Parsetree.module_expr nonterminal
  142. | N_module_binding_body : Reason_omp.Ast_411.Parsetree.module_expr nonterminal
  143. | N_module_arguments_comma_list : Reason_omp.Ast_411.Parsetree.module_expr list nonterminal
  144. | N_module_arguments : Reason_omp.Ast_411.Parsetree.module_expr list nonterminal
  145. | N_mod_longident : Longident.t nonterminal
  146. | N_mod_ident : string option nonterminal
  147. | N_mod_ext_longident : Longident.t nonterminal
  148. | N_mod_ext_lesslongident : Longident.t nonterminal
  149. | N_mod_ext_less_apply : Longident.t nonterminal
  150. | N_mod_ext_apply : Longident.t nonterminal
  151. | N_method_ : (string Location.loc * Reason_omp.Ast_411.Parsetree.class_field_kind) nonterminal
  152. | N_match_case_seq_expr_ : Reason_omp.Ast_411.Parsetree.case nonterminal
  153. | N_match_case_expr_ : Reason_omp.Ast_411.Parsetree.case nonterminal
  154. | N_lseparated_nonempty_list_aux_SEMI_class_sig_field_ : Reason_omp.Ast_411.Parsetree.class_type_field list list nonterminal
  155. | N_lseparated_nonempty_list_aux_SEMI_class_field_ : Reason_omp.Ast_411.Parsetree.class_field list list nonterminal
  156. | N_lseparated_nonempty_list_aux_COMMA_uncurried_labeled_expr_ : (Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.expression) list nonterminal
  157. | N_lseparated_nonempty_list_aux_COMMA_uncurried_arrow_type_parameter_ : ((Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.core_type) Location.loc * bool) list nonterminal
  158. | N_lseparated_nonempty_list_aux_COMMA_type_variable_with_variance_ : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list nonterminal
  159. | N_lseparated_nonempty_list_aux_COMMA_type_parameter_ : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list nonterminal
  160. | N_lseparated_nonempty_list_aux_COMMA_string_literal_label_ : Reason_omp.Ast_411.Parsetree.object_field list nonterminal
  161. | N_lseparated_nonempty_list_aux_COMMA_string_literal_expr_maybe_punned_ : (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.expression) list nonterminal
  162. | N_lseparated_nonempty_list_aux_COMMA_record_label_declaration_ : Reason_omp.Ast_411.Parsetree.label_declaration list nonterminal
  163. | N_lseparated_nonempty_list_aux_COMMA_protected_type_ : Reason_omp.Ast_411.Parsetree.core_type list nonterminal
  164. | N_lseparated_nonempty_list_aux_COMMA_pattern_optional_constraint_ : Reason_omp.Ast_411.Parsetree.pattern list nonterminal
  165. | N_lseparated_nonempty_list_aux_COMMA_opt_spread_pattern__ : (Warnings.loc option * Reason_omp.Ast_411.Parsetree.pattern) list nonterminal
  166. | N_lseparated_nonempty_list_aux_COMMA_opt_spread_lbl_expr__ : (Warnings.loc option * (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.expression)) list nonterminal
  167. | N_lseparated_nonempty_list_aux_COMMA_opt_spread_expr_optional_constraint__ : (Warnings.loc option * Reason_omp.Ast_411.Parsetree.expression) list nonterminal
  168. | N_lseparated_nonempty_list_aux_COMMA_object_label_declaration_ : Reason_omp.Ast_411.Parsetree.object_field list nonterminal
  169. | N_lseparated_nonempty_list_aux_COMMA_module_parameter_ : Reason_omp.Ast_411.Parsetree.functor_parameter Location.loc list nonterminal
  170. | N_lseparated_nonempty_list_aux_COMMA_module_complex_expr_ : Reason_omp.Ast_411.Parsetree.module_expr list nonterminal
  171. | N_lseparated_nonempty_list_aux_COMMA_mod_ext_longident_ : Longident.t list nonterminal
  172. | N_lseparated_nonempty_list_aux_COMMA_labeled_pattern_ : Reason_parser_def.labelled_parameter Location.loc list nonterminal
  173. | N_lseparated_nonempty_list_aux_COMMA_field_expr_ : (string Location.loc * Reason_omp.Ast_411.Parsetree.expression) list nonterminal
  174. | N_lseparated_nonempty_list_aux_COMMA_expr_optional_constraint_ : Reason_omp.Ast_411.Parsetree.expression list nonterminal
  175. | N_lseparated_nonempty_list_aux_COMMA_expr_ : Reason_omp.Ast_411.Parsetree.expression list nonterminal
  176. | N_lseparated_nonempty_list_aux_COMMA_core_type_ : Reason_omp.Ast_411.Parsetree.core_type list nonterminal
  177. | N_lseparated_nonempty_list_aux_AND_with_constraint_ : Reason_omp.Ast_411.Parsetree.with_constraint list nonterminal
  178. | N_loption_type_parameters_ : Reason_omp.Ast_411.Parsetree.core_type list nonterminal
  179. | N_loption_terminated_pattern_comma_list_option_COMMA___ : Reason_omp.Ast_411.Parsetree.pattern list nonterminal
  180. | N_loption_row_field_list_ : Reason_omp.Ast_411.Parsetree.row_field list nonterminal
  181. | N_loption_preceded_GREATER_nonempty_list_name_tag___ : string list nonterminal
  182. | N_loption_parenthesized_type_variables_with_variance_comma_list__ : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list nonterminal
  183. | N_loption_parenthesized_class_type_arguments_comma_list__ : Reason_omp.Ast_411.Parsetree.core_type list nonterminal
  184. | N_loption_object_label_declarations_ : Reason_omp.Ast_411.Parsetree.object_field list nonterminal
  185. | N_loption_located_attributes_ : Reason_omp.Ast_411.Parsetree.attribute Location.loc list nonterminal
  186. | N_loption_functor_parameters_ : Reason_omp.Ast_411.Parsetree.functor_parameter Location.loc list nonterminal
  187. | N_loption_class_type_parameters_ : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list nonterminal
  188. | N_longident_type_constraint : (Longident.t Location.loc * (Reason_omp.Ast_411.Parsetree.core_type option * Reason_omp.Ast_411.Parsetree.core_type option) option) nonterminal
  189. | N_llist_aux_preceded_COMMA_opt_spread_lbl_expr___ : (Warnings.loc option * (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.expression)) list nonterminal
  190. | N_llist_aux_match_case_seq_expr__ : Reason_omp.Ast_411.Parsetree.case list nonterminal
  191. | N_llist_aux_match_case_expr__ : Reason_omp.Ast_411.Parsetree.case list nonterminal
  192. | N_list_simple_expr_no_call_ : Reason_omp.Ast_411.Parsetree.expression list nonterminal
  193. | N_list_bar_row_field_ : Reason_omp.Ast_411.Parsetree.row_field list nonterminal
  194. | N_list_attributed_ext_constructor_extension_constructor_declaration__ : Reason_omp.Ast_411.Parsetree.extension_constructor list nonterminal
  195. | N_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ : Reason_omp.Ast_411.Parsetree.extension_constructor list nonterminal
  196. | N_list_and_module_rec_declaration_ : Reason_omp.Ast_411.Parsetree.module_declaration list nonterminal
  197. | N_list_and_module_bindings_ : Reason_omp.Ast_411.Parsetree.module_binding list nonterminal
  198. | N_list_and_let_binding_ : Reason_omp.Ast_411.Parsetree.value_binding list nonterminal
  199. | N_list_and_class_type_declaration_ : Reason_omp.OCaml_411.Ast.Parsetree.class_type_declaration list nonterminal
  200. | N_list_and_class_description_ : Reason_omp.OCaml_411.Ast.Parsetree.class_description list nonterminal
  201. | N_list_and_class_declaration_ : Reason_omp.OCaml_411.Ast.Parsetree.class_declaration list nonterminal
  202. | N_letop_bindings : (Reason_omp.Ast_411.Parsetree.pattern * Reason_omp.Ast_411.Parsetree.expression * Reason_omp.Ast_411.Parsetree.binding_op list) nonterminal
  203. | N_letop_binding_body : (Reason_omp.Ast_411.Parsetree.pattern * Reason_omp.Ast_411.Parsetree.expression) nonterminal
  204. | N_let_bindings : Reason_parser_def.let_bindings nonterminal
  205. | N_let_binding_body : (Reason_omp.Ast_411.Parsetree.pattern * Reason_omp.Ast_411.Parsetree.expression) nonterminal
  206. | N_let_binding : Reason_parser_def.let_bindings nonterminal
  207. | N_lbl_pattern : (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.pattern) nonterminal
  208. | N_labelled_arrow_type_parameter_optional : (Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.core_type) nonterminal
  209. | N_labeled_pattern_constraint : (string Location.loc -> Reason_omp.Ast_411.Parsetree.pattern) nonterminal
  210. | N_labeled_pattern : Reason_parser_def.labelled_parameter Location.loc nonterminal
  211. | N_labeled_expr_constraint : (Longident.t Location.loc -> Reason_omp.Ast_411.Parsetree.expression) nonterminal
  212. | N_labeled_expr : (Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.expression) nonterminal
  213. | N_labeled_arguments : (Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.expression) list nonterminal
  214. | N_label_longident : Longident.t nonterminal
  215. | N_jsx_without_leading_less : Reason_omp.Ast_411.Parsetree.expression nonterminal
  216. | N_jsx_start_tag_and_args_without_leading_less : (((Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.expression) list -> Warnings.loc -> Reason_omp.Ast_411.Parsetree.expression) * Longident.t) nonterminal
  217. | N_jsx_start_tag_and_args : (((Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.expression) list -> Warnings.loc -> Reason_omp.Ast_411.Parsetree.expression) * Longident.t) nonterminal
  218. | N_jsx_arguments : (Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.expression) list nonterminal
  219. | N_jsx : Reason_omp.Ast_411.Parsetree.expression nonterminal
  220. | N_item_extension_sugar : (Reason_omp.Ast_411.Ast_helper.attrs * string Location.loc) nonterminal
  221. | N_item_extension : Reason_omp.OCaml_411.Ast.Parsetree.extension nonterminal
  222. | N_interface : Reason_omp.Ast_411.Parsetree.signature nonterminal
  223. | N_implementation : Reason_omp.Ast_411.Parsetree.structure nonterminal
  224. | N_ident : string nonterminal
  225. | N_greater_spread : string nonterminal
  226. | N_generalized_constructor_arguments : (Reason_omp.Ast_411.Parsetree.constructor_arguments * Reason_omp.Ast_411.Parsetree.core_type option) nonterminal
  227. | N_functor_parameters : Reason_omp.Ast_411.Parsetree.functor_parameter Location.loc list nonterminal
  228. | N_fun_def_EQUALGREATER_non_arrowed_core_type_ : Reason_omp.Ast_411.Parsetree.expression nonterminal
  229. | N_fun_def_EQUAL_core_type_ : Reason_omp.Ast_411.Parsetree.expression nonterminal
  230. | N_field_expr : (string Location.loc * Reason_omp.Ast_411.Parsetree.expression) nonterminal
  231. | N_extension_constructor_rebind : Reason_omp.Ast_411.Parsetree.extension_constructor nonterminal
  232. | N_extension_constructor_declaration : Reason_omp.Ast_411.Parsetree.extension_constructor nonterminal
  233. | N_extension : Reason_omp.OCaml_411.Ast.Parsetree.extension nonterminal
  234. | N_expr_optional_constraint : Reason_omp.Ast_411.Parsetree.expression nonterminal
  235. | N_expr_list : Reason_omp.Ast_411.Parsetree.expression list nonterminal
  236. | N_expr_comma_seq_extension : (Reason_omp.Ast_411.Parsetree.expression list * Reason_omp.Ast_411.Parsetree.expression option) nonterminal
  237. | N_expr : Reason_omp.Ast_411.Parsetree.expression nonterminal
  238. | N_es6_parameters : (Reason_parser_def.labelled_parameter Location.loc list * bool) nonterminal
  239. | N_embedded_private_flag_ : Reason_omp.Ast_411.Asttypes.private_flag nonterminal
  240. | N_embedded___anonymous_39_ : Reason_omp.Ast_411.Parsetree.directive_argument_desc option nonterminal
  241. | N_embedded___anonymous_32_ : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) nonterminal
  242. | N_embedded___anonymous_1_ : Reason_omp.Ast_411.Parsetree.toplevel_phrase list nonterminal
  243. | N_embedded___anonymous_0_ : Reason_omp.Ast_411.Parsetree.toplevel_phrase nonterminal
  244. | N_either_preceded_EQUALGREATER_expr__braced_expr_ : Reason_omp.Ast_411.Parsetree.expression nonterminal
  245. | N_either_preceded_EQUAL_expr__braced_expr_ : Reason_omp.Ast_411.Parsetree.expression nonterminal
  246. | N_either_preceded_EQUAL_class_instance_type__class_type_body_ : Reason_omp.Ast_411.Parsetree.class_type nonterminal
  247. | N_either_preceded_EQUAL_class_expr__class_body_expr_ : Reason_omp.Ast_411.Parsetree.class_expr nonterminal
  248. | N_either_parenthesized_longident_type_constraint__longident_type_constraint_ : (Longident.t Location.loc * (Reason_omp.Ast_411.Parsetree.core_type option * Reason_omp.Ast_411.Parsetree.core_type option) option) nonterminal
  249. | N_either_extension_constructor_declaration_extension_constructor_rebind_ : Reason_omp.Ast_411.Parsetree.extension_constructor nonterminal
  250. | N_either_constructor_declaration_bar_constructor_declaration_ : Reason_omp.Ast_411.Parsetree.constructor_declaration nonterminal
  251. | N_either___anonymous_11___anonymous_12_ : Reason_omp.Ast_411.Asttypes.private_flag nonterminal
  252. | N_either_ES6_FUN_FUN_ : unit nonterminal
  253. | N_direction_flag : Reason_omp.Ast_411.Asttypes.direction_flag nonterminal
  254. | N_core_type2 : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  255. | N_core_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  256. | N_constructor_declarations_aux : (Reason_omp.Ast_411.Parsetree.constructor_declaration list * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) list * Lexing.position * Reason_omp.Ast_411.Parsetree.type_declaration list) nonterminal
  257. | N_constructor_declarations : (Reason_omp.Ast_411.Parsetree.constructor_declaration list * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) list * Lexing.position * Reason_omp.Ast_411.Parsetree.type_declaration list) nonterminal
  258. | N_constructor_declaration : Reason_omp.Ast_411.Parsetree.constructor_declaration nonterminal
  259. | N_constructor_arguments_comma_list : Reason_omp.Ast_411.Parsetree.core_type list nonterminal
  260. | N_constructor_arguments : Reason_omp.Ast_411.Parsetree.constructor_arguments nonterminal
  261. | N_constrain_field : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type) nonterminal
  262. | N_constrain : (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Parsetree.core_type * Warnings.loc) nonterminal
  263. | N_constr_longident : Longident.t nonterminal
  264. | N_constant : (Reason_omp.Ast_411.Ast_helper.attrs * Reason_omp.Ast_411.Parsetree.constant) nonterminal
  265. | N_clty_longident : Longident.t nonterminal
  266. | N_class_type_declarations : Reason_omp.OCaml_411.Ast.Parsetree.class_type_declaration list nonterminal
  267. | N_class_type_declaration_details : (Reason_omp.Ast_411.Ast_helper.str * Reason_omp.Ast_411.Parsetree.class_type * Reason_omp.Ast_411.Asttypes.virtual_flag * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list) nonterminal
  268. | N_class_type_body : Reason_omp.Ast_411.Parsetree.class_type nonterminal
  269. | N_class_type_arguments_comma_list : Reason_omp.Ast_411.Parsetree.core_type list nonterminal
  270. | N_class_simple_expr : Reason_omp.Ast_411.Parsetree.class_expr nonterminal
  271. | N_class_sig_field : Reason_omp.Ast_411.Parsetree.class_type_field list nonterminal
  272. | N_class_sig_body_fields : Reason_omp.Ast_411.Parsetree.class_type_field list nonterminal
  273. | N_class_sig_body_cty : Reason_omp.Ast_411.Parsetree.class_type_desc nonterminal
  274. | N_class_sig_body : Reason_omp.Ast_411.Parsetree.class_signature nonterminal
  275. | N_class_self_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  276. | N_class_self_expr : Reason_omp.Ast_411.Parsetree.pattern nonterminal
  277. | N_class_longident : Longident.t nonterminal
  278. | N_class_instance_type : Reason_omp.Ast_411.Parsetree.class_type nonterminal
  279. | N_class_field : Reason_omp.Ast_411.Parsetree.class_field list nonterminal
  280. | N_class_expr_lets_and_rest : Reason_omp.Ast_411.Parsetree.class_expr nonterminal
  281. | N_class_expr : Reason_omp.Ast_411.Parsetree.class_expr nonterminal
  282. | N_class_descriptions : Reason_omp.OCaml_411.Ast.Parsetree.class_description list nonterminal
  283. | N_class_description_details : (Reason_omp.Ast_411.Ast_helper.str * Reason_omp.Ast_411.Parsetree.class_type * Reason_omp.Ast_411.Asttypes.virtual_flag * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list) nonterminal
  284. | N_class_declaration_details : (Reason_omp.Ast_411.Ast_helper.str * Reason_omp.Ast_411.Parsetree.class_expr * Reason_omp.Ast_411.Asttypes.virtual_flag * (Reason_omp.Ast_411.Parsetree.core_type * Reason_omp.Ast_411.Asttypes.variance) list) nonterminal
  285. | N_class_declaration_body : Reason_omp.Ast_411.Parsetree.class_expr nonterminal
  286. | N_class_constructor_type : Reason_omp.Ast_411.Parsetree.class_type nonterminal
  287. | N_braced_expr : Reason_omp.Ast_411.Parsetree.expression nonterminal
  288. | N_boption_AMPERSAND_ : bool nonterminal
  289. | N_basic_core_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  290. | N_bar_row_field : Reason_omp.Ast_411.Parsetree.row_field nonterminal
  291. | N_bar_constructor_declaration : Reason_omp.Ast_411.Parsetree.constructor_declaration nonterminal
  292. | N_attributed_ext_constructors_extension_constructor_declaration_ : Reason_omp.Ast_411.Parsetree.extension_constructor list nonterminal
  293. | N_attributed_ext_constructors_either_extension_constructor_declaration_extension_constructor_rebind__ : Reason_omp.Ast_411.Parsetree.extension_constructor list nonterminal
  294. | N_attribute : Reason_omp.Ast_411.Parsetree.attribute nonterminal
  295. | N_attr_id : string Location.loc nonterminal
  296. | N_arrowed_simple_core_type : Reason_omp.Ast_411.Parsetree.core_type nonterminal
  297. | N_arrow_type_parameters : ((Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.core_type) Location.loc * bool) list nonterminal
  298. | N_arrow_type_parameter : (Reason_omp.Ast_411.Asttypes.arg_label * Reason_omp.Ast_411.Parsetree.core_type) nonterminal
  299. | N_and_type_subst_declaration : Reason_omp.Ast_411.Parsetree.type_declaration list nonterminal
  300. | N_and_type_declaration : Reason_omp.Ast_411.Parsetree.type_declaration list nonterminal
  301. | N_and_module_rec_declaration : Reason_omp.Ast_411.Parsetree.module_declaration nonterminal
  302. | N_and_module_bindings : Reason_omp.Ast_411.Parsetree.module_binding nonterminal
  303. | N_and_class_type_declaration : Reason_omp.OCaml_411.Ast.Parsetree.class_type_declaration nonterminal
  304. | N_and_class_description : Reason_omp.OCaml_411.Ast.Parsetree.class_description nonterminal
  305. | N_and_class_declaration : Reason_omp.Ast_411.Parsetree.class_expr Reason_omp.Ast_411.Parsetree.class_infos nonterminal
  306. | N__lbl_pattern_list : ((Warnings.loc option * (Longident.t Location.loc * Reason_omp.Ast_411.Parsetree.pattern)) list * Reason_omp.Ast_411.Asttypes.closed_flag) nonterminal
include MenhirLib.IncrementalEngine.INSPECTION with type 'a lr1state := 'a lr1state with type production := production with type 'a terminal := 'a terminal with type 'a nonterminal := 'a nonterminal with type 'a env := 'a env
include MenhirLib.IncrementalEngine.SYMBOLS with type 'a terminal := 'a terminal with type 'a nonterminal := 'a nonterminal
type 'a symbol =
  1. | T : 'a terminal -> 'a symbol
  2. | N : 'a nonterminal -> 'a symbol

The type 'a symbol represents a terminal or nonterminal symbol. It is the disjoint union of the types 'a terminal and 'a nonterminal.

type xsymbol =
  1. | X : 'a symbol -> xsymbol

The type xsymbol is an existentially quantified version of the type 'a symbol. This type is useful in situations where 'a is not statically known.

type item = production * int

An LR(0) item is a pair of a production prod and a valid index i into this production. That is, if the length of rhs prod is n, then i is comprised between 0 and n, inclusive.

The following are total ordering functions.

val compare_terminals : _ terminal -> _ terminal -> int
val compare_nonterminals : _ nonterminal -> _ nonterminal -> int
val compare_symbols : xsymbol -> xsymbol -> int
val compare_productions : production -> production -> int
val compare_items : item -> item -> int
val incoming_symbol : 'a lr1state -> 'a symbol

incoming_symbol s is the incoming symbol of the state s, that is, the symbol that the parser must recognize before (has recognized when) it enters the state s. This function gives access to the semantic value v stored in a stack element Element (s, v, _, _). Indeed, by case analysis on the symbol incoming_symbol s, one discovers the type 'a of the value v.

val items : _ lr1state -> item list

items s is the set of the LR(0) items in the LR(0) core of the LR(1) state s. This set is not epsilon-closed. This set is presented as a list, in an arbitrary order.

val lhs : production -> xsymbol

lhs prod is the left-hand side of the production prod. This is always a non-terminal symbol.

val rhs : production -> xsymbol list

rhs prod is the right-hand side of the production prod. This is a (possibly empty) sequence of (terminal or nonterminal) symbols.

val nullable : _ nonterminal -> bool

nullable nt tells whether the non-terminal symbol nt is nullable. That is, it is true if and only if this symbol produces the empty word epsilon.

val first : _ nonterminal -> _ terminal -> bool

first nt t tells whether the FIRST set of the nonterminal symbol nt contains the terminal symbol t. That is, it is true if and only if nt produces a word that begins with t.

val xfirst : xsymbol -> _ terminal -> bool

xfirst is analogous to first, but expects a first argument of type xsymbol instead of _ terminal.

val foreach_terminal : (xsymbol -> 'a -> 'a) -> 'a -> 'a

foreach_terminal enumerates the terminal symbols, including error.

val foreach_terminal_but_error : (xsymbol -> 'a -> 'a) -> 'a -> 'a

foreach_terminal_but_error enumerates the terminal symbols, excluding error.

feed symbol startp semv endp env causes the parser to consume the (terminal or nonterminal) symbol symbol, accompanied with the semantic value semv and with the start and end positions startp and endp. Thus, the automaton makes a transition, and reaches a new state. The stack grows by one cell. This operation is permitted only if the current state (as determined by env) has an outgoing transition labeled with symbol. Otherwise, Invalid_argument _ is raised.