Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exception Error = Parsing.Parse_error
- type token =
- | UID of (string Positions.located)
- | TYPE
- | TOKEN
- | START
- | STAR
- | RPAREN
- | RIGHT
- | QUESTION
- | PUBLIC
- | PREC
- | PLUS
- | PERCENTPERCENT of (string Lazy.t)
- | PARAMETER
- | OCAMLTYPE of (Stretch.ocamltype)
- | NONASSOC
- | LPAREN
- | LID of (string Positions.located)
- | LEFT
- | INLINE
- | HEADER of (Stretch.t)
- | EQUAL
- | EOF
- | COMMA
- | COLON
- | BAR
- | ACTION of (Action.t)
- and _menhir_env = {
- _menhir_lexer: Lexing.lexbuf -> token;
- _menhir_lexbuf: Lexing.lexbuf;
- _menhir_token: token;
- mutable _menhir_error: bool
- }
- and _menhir_state =
- | MenhirState127
- | MenhirState119
- | MenhirState118
- | MenhirState115
- | MenhirState113
- | MenhirState110
- | MenhirState107
- | MenhirState103
- | MenhirState99
- | MenhirState98
- | MenhirState95
- | MenhirState88
- | MenhirState86
- | MenhirState84
- | MenhirState82
- | MenhirState76
- | MenhirState71
- | MenhirState70
- | MenhirState68
- | MenhirState52
- | MenhirState51
- | MenhirState49
- | MenhirState48
- | MenhirState44
- | MenhirState43
- | MenhirState41
- | MenhirState39
- | MenhirState37
- | MenhirState35
- | MenhirState27
- | MenhirState19
- | MenhirState17
- | MenhirState13
- | MenhirState12
- | MenhirState9
- | MenhirState8
- | MenhirState4
- | MenhirState0
- open Keyword
- open ConcreteSyntax
- open Syntax
- open Positions
- let _eRR =
- Error
- let rec _menhir_reduce44 : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.symbol Positions.located) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s x ->
- (* Reducing production option(modifier) -> modifier *)
- let _v : (Syntax.symbol Positions.located option) = ( Some x ) in
- _menhir_goto_option_modifier_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce33 : _menhir_env -> ('ttv_tail * _menhir_state) * _menhir_state * (Syntax.parameters) -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production loption(delimited(LPAREN,separated_nonempty_list(COMMA,actual_parameter),RPAREN)) -> LPAREN separated_nonempty_list(COMMA,actual_parameter) RPAREN *)
- let ((_menhir_stack, _menhir_s), _, x0) = _menhir_stack in
- let _v : (Syntax.parameters) = let x =
- let x = x0 in
- ( x )
- in
- ( x ) in
- _menhir_goto_loption_delimited_LPAREN_separated_nonempty_list_COMMA_actual_parameter__RPAREN__ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce47 : _menhir_env -> 'ttv_tail -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production optional_bar -> *)
- let _v : (unit) = ( () ) in
- _menhir_goto_optional_bar _menhir_env _menhir_stack _v
- and _menhir_goto_optional_bar : _menhir_env -> 'ttv_tail -> (unit) -> 'ttv_return =
- fun _menhir_env _menhir_stack _v ->
- let _menhir_stack = (_menhir_stack, _v) in
- (* State should be MenhirState93 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run95 *)
- (* State 95: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState95
- else
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | LID _v ->
- (* Shifting (LID) to state 102 *)
- _menhir_run102 _menhir_env (Obj.magic _menhir_stack) MenhirState95 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState95 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | ACTION _ | BAR | PREC ->
- _menhir_reduce28 _menhir_env (Obj.magic _menhir_stack) MenhirState95
- | _ ->
- (assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState95)
- and _menhir_goto_option_COMMA_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (unit option) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState35 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run37 *)
- (* State 37: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 7 *)
- _menhir_run7 _menhir_env (Obj.magic _menhir_stack) MenhirState37 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 6 *)
- _menhir_run6 _menhir_env (Obj.magic _menhir_stack) MenhirState37 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState37)
- | MenhirState43 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run44 *)
- (* State 44: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | UID _v ->
- (* Shifting (UID) to state 43 *)
- _menhir_run43 _menhir_env (Obj.magic _menhir_stack) MenhirState44 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState44)
- | MenhirState51 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run52 *)
- (* State 52: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 51 *)
- _menhir_run51 _menhir_env (Obj.magic _menhir_stack) MenhirState52 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState52)
- | MenhirState70 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run71 *)
- (* State 71: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 7 *)
- _menhir_run7 _menhir_env (Obj.magic _menhir_stack) MenhirState71 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 6 *)
- _menhir_run6 _menhir_env (Obj.magic _menhir_stack) MenhirState71 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState71)
- | _ ->
- _menhir_fail ()
- and _menhir_goto_modifier : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.symbol Positions.located) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- match _menhir_s with
- | MenhirState19 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run24 *)
- (* State 24: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at ACTION _ | BAR | COMMA | LID _ | PREC | RPAREN | UID _ *)
- _menhir_reduce44 _menhir_env (Obj.magic _menhir_stack) _menhir_s _v
- | MenhirState27 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run32 *)
- (* State 32: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | UID _ | error *)
- _menhir_reduce44 _menhir_env (Obj.magic _menhir_stack) _menhir_s _v
- | _ ->
- _menhir_fail ()
- and _menhir_goto_producer : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.producer) -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos) in
- (* State should be MenhirState95 | MenhirState110 | MenhirState115 | MenhirState113 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run115 *)
- (* State 115: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | LID _v ->
- (* Shifting (LID) to state 102 *)
- _menhir_run102 _menhir_env (Obj.magic _menhir_stack) MenhirState115 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState115 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | ACTION _ | BAR | PREC ->
- _menhir_reduce28 _menhir_env (Obj.magic _menhir_stack) MenhirState115
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState115
- and _menhir_goto_separated_nonempty_list_COMMA_actual_parameter_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.parameters) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState13 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run14 *)
- (* State 14: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | RPAREN ->
- (* Shifting (RPAREN) to state 15 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run15 *)
- (* State 15: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at ACTION _ | BAR | COMMA | LID _ | PLUS | PREC | QUESTION | RPAREN | STAR | UID _ *)
- _menhir_reduce33 _menhir_env (Obj.magic _menhir_stack)
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error14 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s)
- | MenhirState17 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run18 *)
- (* State 18: *)
- (* Reducing without looking ahead at RPAREN *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce69 *)
- (* Reducing production separated_nonempty_list(COMMA,actual_parameter) -> actual_parameter COMMA separated_nonempty_list(COMMA,actual_parameter) *)
- let ((_menhir_stack, _menhir_s, x, _startpos_x_), _, xs) = _menhir_stack in
- let _v : (Syntax.parameters) = ( x :: xs ) in
- _menhir_goto_separated_nonempty_list_COMMA_actual_parameter_ _menhir_env _menhir_stack _menhir_s _v
- | MenhirState9 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run25 *)
- (* State 25: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | RPAREN ->
- (* Shifting (RPAREN) to state 26 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run26 *)
- (* State 26: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | NONASSOC | PARAMETER | PERCENTPERCENT _ | PLUS | PUBLIC | QUESTION | RIGHT | STAR | START | TOKEN | TYPE | UID _ | error *)
- _menhir_reduce33 _menhir_env (Obj.magic _menhir_stack)
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error25 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s)
- | _ ->
- _menhir_fail ()
- and _menhir_error16 : _menhir_env -> 'ttv_tail * _menhir_state * (Syntax.parameter) * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- let (_menhir_stack, _menhir_s, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- and _menhir_goto_separated_nonempty_list_BAR_production_group_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.parameterized_branch list list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- match _menhir_s with
- | MenhirState95 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run105 *)
- (* State 105: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let prods = _v in
- (* _menhir_reduce58 *)
- (* Reducing production rule -> flags symbol loption(delimited(LPAREN,separated_nonempty_list(COMMA,symbol),RPAREN)) COLON optional_bar separated_nonempty_list(BAR,production_group) *)
- let (((((_menhir_stack, _menhir_s, flags), _, symbol, _startpos_symbol_, _endpos_symbol_), params0), _startpos__4_, _endpos__4_), _) = _menhir_stack in
- let _v : (Syntax.parameterized_rule list) = let params =
- let params = params0 in
- ( params )
- in
- (
- let public, inline = flags in
- [
- {
- pr_public_flag = public;
- pr_inline_flag = inline;
- pr_nt = Positions.value symbol;
- pr_positions = [ Positions.position symbol ];
- pr_parameters = List.map Positions.value params;
- pr_branches = List.flatten prods
- }
- ]
- ) in
- _menhir_goto_rule _menhir_env _menhir_stack _menhir_s _v
- | MenhirState110 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run111 *)
- (* State 111: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let xs = _v in
- (* _menhir_reduce67 *)
- (* Reducing production separated_nonempty_list(BAR,production_group) -> production_group BAR separated_nonempty_list(BAR,production_group) *)
- let (_menhir_stack, _menhir_s, x) = _menhir_stack in
- let _v : (Syntax.parameterized_branch list list) = ( x :: xs ) in
- _menhir_goto_separated_nonempty_list_BAR_production_group_ _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- _menhir_fail ()
- and _menhir_goto_list_producer_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.producer list) -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos) in
- match _menhir_s with
- | MenhirState115 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run116 *)
- (* State 116: *)
- (* Reducing without looking ahead at ACTION _ | BAR | PREC *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce29 *)
- (* Reducing production list(producer) -> producer list(producer) *)
- let ((_menhir_stack, _menhir_s, x, _startpos_x_), _, xs, _startpos_xs_) = _menhir_stack in
- let _startpos = _startpos_x_ in
- let _v : (Syntax.producer list) = ( x :: xs ) in
- _menhir_goto_list_producer_ _menhir_env _menhir_stack _menhir_s _v _startpos
- | MenhirState95 | MenhirState110 | MenhirState113 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run118 *)
- (* State 118: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | PREC ->
- (* Shifting (PREC) to state 119 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState118 in
- (* _menhir_run119 *)
- (* State 119: *)
- let _menhir_stack = (_menhir_stack, _menhir_s) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 11 *)
- _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState119 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState119 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState119)
- | ACTION _ | BAR ->
- _menhir_reduce45 _menhir_env (Obj.magic _menhir_stack) MenhirState118
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState118)
- | _ ->
- _menhir_fail ()
- and _menhir_goto_trailer : _menhir_env -> 'ttv_tail -> (Syntax.trailer option) -> 'ttv_return =
- fun _menhir_env _menhir_stack _v ->
- (* State should be MenhirState122 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run125 *)
- (* State 125: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at # *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let t = _v in
- (* _menhir_reduce25 *)
- (* Reducing production grammar -> list(declaration) PERCENTPERCENT list(rule) trailer *)
- let (((_menhir_stack, _menhir_s, ds), _), _, rs) = _menhir_stack in
- let _v : (ConcreteSyntax.grammar) = (
- {
- pg_filename = ""; (* filled in by the caller *)
- pg_declarations = List.flatten ds;
- pg_rules = List.flatten rs;
- pg_trailer = t
- }
- ) in
- (* _menhir_goto_grammar *)
- (* State should be MenhirState0 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run126 *)
- (* State 126: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at # *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _1 = _v in
- (* _menhir_reduce0 *)
- (* Accepting *)
- Obj.magic _1
- and _menhir_reduce46 : _menhir_env -> ('ttv_tail * _menhir_state) * _menhir_state * (Syntax.symbol Positions.located) * Lexing.position * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production option(precedence) -> PREC symbol *)
- let ((_menhir_stack, _menhir_s), _, symbol0, _startpos_symbol0_, _endpos_symbol0_) = _menhir_stack in
- let _endpos = _endpos_symbol0_ in
- let _v : (Syntax.symbol Positions.located option) = let x =
- let symbol = symbol0 in
- ( symbol )
- in
- ( Some x ) in
- _menhir_goto_option_precedence_ _menhir_env _menhir_stack _menhir_s _v _endpos
- and _menhir_goto_separated_nonempty_list_COMMA_symbol_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.symbol Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState88 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run89 *)
- (* State 89: *)
- (* Reducing without looking ahead at RPAREN *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce71 *)
- (* Reducing production separated_nonempty_list(COMMA,symbol) -> symbol COMMA separated_nonempty_list(COMMA,symbol) *)
- let ((_menhir_stack, _menhir_s, x, _startpos_x_, _endpos_x_), _, xs) = _menhir_stack in
- let _v : (Syntax.symbol Positions.located list) = ( x :: xs ) in
- _menhir_goto_separated_nonempty_list_COMMA_symbol_ _menhir_env _menhir_stack _menhir_s _v
- | MenhirState86 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run90 *)
- (* State 90: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | RPAREN ->
- (* Shifting (RPAREN) to state 91 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run91 *)
- (* State 91: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce35 *)
- (* Reducing production loption(delimited(LPAREN,separated_nonempty_list(COMMA,symbol),RPAREN)) -> LPAREN separated_nonempty_list(COMMA,symbol) RPAREN *)
- let (_menhir_stack, _, x0) = _menhir_stack in
- let _v : (Syntax.symbol Positions.located list) = let x =
- let x = x0 in
- ( x )
- in
- ( x ) in
- _menhir_goto_loption_delimited_LPAREN_separated_nonempty_list_COMMA_symbol__RPAREN__ _menhir_env _menhir_stack _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error90 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s)
- | _ ->
- _menhir_fail ()
- and _menhir_error87 : _menhir_env -> 'ttv_tail * _menhir_state * (Syntax.symbol Positions.located) * Lexing.position * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- let (_menhir_stack, _menhir_s, _, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- and _menhir_goto_loption_delimited_LPAREN_separated_nonempty_list_COMMA_symbol__RPAREN__ : _menhir_env -> 'ttv_tail -> (Syntax.symbol Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _v ->
- let _menhir_stack = (_menhir_stack, _v) in
- (* State should be MenhirState85 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run92 *)
- (* State 92: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | COLON ->
- (* Shifting (COLON) to state 93 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run93 *)
- (* State 93: *)
- let _menhir_stack = (_menhir_stack, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | BAR ->
- (* Shifting (BAR) to state 94 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run94 *)
- (* State 94: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at ACTION _ | BAR | LID _ | PREC | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce48 *)
- (* Reducing production optional_bar -> BAR *)
- let _v : (unit) = ( () ) in
- _menhir_goto_optional_bar _menhir_env _menhir_stack _v
- | ACTION _ | LID _ | PREC | UID _ ->
- _menhir_reduce47 _menhir_env (Obj.magic _menhir_stack)
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error93 *)
- (* Handling error in state 93 *)
- _menhir_reduce47 _menhir_env (Obj.magic _menhir_stack))
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error92 *)
- let ((_menhir_stack, _menhir_s, _, _, _), _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- and _menhir_error85 : _menhir_env -> ('ttv_tail * _menhir_state * (bool * bool)) * _menhir_state * (Syntax.symbol Positions.located) * Lexing.position * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- let (_menhir_stack, _menhir_s, _, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- and _menhir_run11 : _menhir_env -> 'ttv_tail -> _menhir_state -> (string Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State 11: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at ACTION _ | BAR | COLON | COMMA | LID _ | LPAREN | PLUS | PREC | QUESTION | RPAREN | STAR | UID _ *)
- _menhir_reduce80 _menhir_env (Obj.magic _menhir_stack)
- and _menhir_reduce39 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production option(COMMA) -> *)
- let _v : (unit option) = ( None ) in
- _menhir_goto_option_COMMA_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_run36 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* State 36: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at LID _ | UID _ *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce40 *)
- (* Reducing production option(COMMA) -> COMMA *)
- let x = () in
- let _v : (unit option) = ( Some x ) in
- _menhir_goto_option_COMMA_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce38 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos__1_ _endpos__1_ ->
- (* Reducing production modifier -> STAR *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.symbol Positions.located) = ( with_poss _startpos _endpos "list" ) in
- _menhir_goto_modifier _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce36 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos__1_ _endpos__1_ ->
- (* Reducing production modifier -> QUESTION *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.symbol Positions.located) = ( with_poss _startpos _endpos "option" ) in
- _menhir_goto_modifier _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce37 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos__1_ _endpos__1_ ->
- (* Reducing production modifier -> PLUS *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.symbol Positions.located) = ( with_poss _startpos _endpos "nonempty_list" ) in
- _menhir_goto_modifier _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce1 : _menhir_env -> ('ttv_tail * _menhir_state * (Syntax.symbol Positions.located) * Lexing.position * Lexing.position) * _menhir_state * (Syntax.parameters) -> _menhir_state -> (Syntax.symbol Positions.located option) -> 'ttv_return =
- fun _menhir_env _menhir_stack _ modifier ->
- (* Reducing production actual_parameter -> symbol loption(delimited(LPAREN,separated_nonempty_list(COMMA,actual_parameter),RPAREN)) option(modifier) *)
- let ((_menhir_stack, _menhir_s, symbol, _startpos_symbol_, _endpos_symbol_), _, params0) = _menhir_stack in
- let _startpos = _startpos_symbol_ in
- let _v : (Syntax.parameter) = let actuals =
- let params = params0 in
- ( params )
- in
- ( Parameters.oapp1 modifier (Parameters.app symbol actuals) ) in
- (* _menhir_goto_actual_parameter *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos) in
- match _menhir_s with
- | MenhirState9 | MenhirState17 | MenhirState13 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run16 *)
- (* State 16: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_error16 _menhir_env (Obj.magic _menhir_stack)
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | COMMA ->
- (* Shifting (COMMA) to state 17 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run17 *)
- (* State 17: *)
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 11 *)
- _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState17 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState17 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState17)
- | RPAREN ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce68 *)
- (* Reducing production separated_nonempty_list(COMMA,actual_parameter) -> actual_parameter *)
- let (_menhir_stack, _menhir_s, x, _startpos_x_) = _menhir_stack in
- let _v : (Syntax.parameters) = ( [ x ] ) in
- _menhir_goto_separated_nonempty_list_COMMA_actual_parameter_ _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_error16 _menhir_env (Obj.magic _menhir_stack))
- | MenhirState37 | MenhirState4 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run35 *)
- (* State 35: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState35
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | COMMA ->
- (* Shifting (COMMA) to state 36 *)
- _menhir_run36 _menhir_env (Obj.magic _menhir_stack) MenhirState35
- | COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE ->
- _menhir_reduce72 _menhir_env (Obj.magic _menhir_stack)
- | LID _ | UID _ ->
- _menhir_reduce39 _menhir_env (Obj.magic _menhir_stack) MenhirState35
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState35)
- | MenhirState103 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run104 *)
- (* State 104: *)
- (* Reducing without looking ahead at ACTION _ | BAR | LID _ | PREC | UID _ *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce53 *)
- (* Reducing production producer -> LID EQUAL actual_parameter *)
- let ((_menhir_stack, _menhir_s, x00, _startpos_x00_, _endpos_x00_), _, p, _startpos_p_) = _menhir_stack in
- let _startpos = _startpos_x00_ in
- let _v : (Syntax.producer) = let id =
- let x0 = x00 in
- let x =
- let x = x0 in
- ( x )
- in
- ( Some x )
- in
- ( id, p ) in
- _menhir_goto_producer _menhir_env _menhir_stack _menhir_s _v _startpos
- | MenhirState95 | MenhirState110 | MenhirState113 | MenhirState115 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run117 *)
- (* State 117: *)
- (* Reducing without looking ahead at ACTION _ | BAR | LID _ | PREC | UID _ *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce52 *)
- (* Reducing production producer -> actual_parameter *)
- let (_menhir_stack, _menhir_s, p, _startpos_p_) = _menhir_stack in
- let _startpos = _startpos_p_ in
- let _v : (Syntax.producer) = let id =
- ( None )
- in
- ( id, p ) in
- _menhir_goto_producer _menhir_env _menhir_stack _menhir_s _v _startpos
- | _ ->
- _menhir_fail ()
- and _menhir_error33 : _menhir_env -> (('ttv_tail * _menhir_state * Lexing.position) * (Stretch.ocamltype) * Lexing.position) * _menhir_state * (Syntax.parameter list) -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Handling error in state 33 *)
- (* Shifting (error) to state 34 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run34 *)
- (* State 34: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__4_ = _startpos in
- let _endpos__4_ = _endpos in
- (* _menhir_reduce10 *)
- (* Reducing production declaration -> TYPE OCAMLTYPE separated_nonempty_list(option(COMMA),actual_parameter) error *)
- let (((_menhir_stack, _menhir_s, _startpos__1_), _, _endpos__2_), _, xs0) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__4_ in
- let _v : (Syntax.declaration Positions.located list) = let _3 =
- let xs = xs0 in
- ( xs )
- in
- ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a %type declaration.";
- "Here are sample valid declarations:";
- " %type <Syntax.expression> expression";
- " %type <int> date time";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_error46 : _menhir_env -> (('ttv_tail * _menhir_state * Lexing.position) * _menhir_state * (Stretch.ocamltype option)) * _menhir_state * (Syntax.terminal Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Handling error in state 46 *)
- (* Shifting (error) to state 47 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run47 *)
- (* State 47: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__4_ = _startpos in
- let _endpos__4_ = _endpos in
- (* _menhir_reduce4 *)
- (* Reducing production declaration -> TOKEN option(OCAMLTYPE) separated_nonempty_list(option(COMMA),terminal) error *)
- let (((_menhir_stack, _menhir_s, _startpos__1_), _, _), _, xs0) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__4_ in
- let _v : (Syntax.declaration Positions.located list) = let _3 =
- let xs = xs0 in
- ( xs )
- in
- ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a %token declaration.";
- "Here are sample valid declarations:";
- " %token DOT SEMICOLON";
- " %token <string> LID UID";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_error54 : _menhir_env -> (('ttv_tail * _menhir_state * Lexing.position) * _menhir_state * (Stretch.ocamltype option)) * _menhir_state * (Syntax.nonterminal Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Handling error in state 54 *)
- (* Shifting (error) to state 55 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run55 *)
- (* State 55: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__4_ = _startpos in
- let _endpos__4_ = _endpos in
- (* _menhir_reduce7 *)
- (* Reducing production declaration -> START option(OCAMLTYPE) separated_nonempty_list(option(COMMA),nonterminal) error *)
- let (((_menhir_stack, _menhir_s, _startpos__1_), _, _), _, xs0) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__4_ in
- let _v : (Syntax.declaration Positions.located list) = let _3 =
- let xs = xs0 in
- ( xs )
- in
- ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a %start declaration.";
- "Here are sample valid declarations:";
- " %start expression phrase";
- " %start <int> date time";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_error73 : _menhir_env -> ('ttv_tail * _menhir_state * (Syntax.token_associativity) * Lexing.position * Lexing.position) * _menhir_state * (Syntax.symbol Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Handling error in state 73 *)
- (* Shifting (error) to state 74 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run74 *)
- (* State 74: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__3_ = _startpos in
- let _endpos__3_ = _endpos in
- (* _menhir_reduce14 *)
- (* Reducing production declaration -> priority_keyword separated_nonempty_list(option(COMMA),symbol) error *)
- let ((_menhir_stack, _menhir_s, _, _startpos__1_, _endpos__1_), _, xs0) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__3_ in
- let _v : (Syntax.declaration Positions.located list) = let _2 =
- let xs = xs0 in
- ( xs )
- in
- ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a precedence declaration.";
- "Here are sample valid declarations:";
- " %left PLUS TIMES";
- " %nonassoc unary_minus";
- " %right CONCAT";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_goto_separated_nonempty_list_BAR_production_ : _menhir_env -> 'ttv_tail -> _menhir_state -> ((Syntax.producer list * Syntax.symbol Positions.located option *
- Syntax.branch_reduce_precedence * Positions.t)
- list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState110 | MenhirState95 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run106 *)
- (* State 106: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | ACTION _v ->
- (* Shifting (ACTION) to state 107 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run107 *)
- (* State 107: *)
- let _menhir_stack = (_menhir_stack, _v, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | PREC ->
- (* Shifting (PREC) to state 99 *)
- _menhir_run99 _menhir_env (Obj.magic _menhir_stack) MenhirState107
- | BAR | EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ ->
- _menhir_reduce45 _menhir_env (Obj.magic _menhir_stack) MenhirState107
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState107)
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error106 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s)
- | MenhirState113 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run114 *)
- (* State 114: *)
- (* Reducing without looking ahead at ACTION _ *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce65 *)
- (* Reducing production separated_nonempty_list(BAR,production) -> production BAR separated_nonempty_list(BAR,production) *)
- let ((_menhir_stack, _menhir_s, x), _, xs) = _menhir_stack in
- let _v : ((Syntax.producer list * Syntax.symbol Positions.located option *
- Syntax.branch_reduce_precedence * Positions.t)
- list) = ( x :: xs ) in
- _menhir_goto_separated_nonempty_list_BAR_production_ _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- _menhir_fail ()
- and _menhir_reduce66 : _menhir_env -> 'ttv_tail * _menhir_state * (Syntax.parameterized_branch list) -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production separated_nonempty_list(BAR,production_group) -> production_group *)
- let (_menhir_stack, _menhir_s, x) = _menhir_stack in
- let _v : (Syntax.parameterized_branch list list) = ( [ x ] ) in
- _menhir_goto_separated_nonempty_list_BAR_production_group_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce28 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production list(producer) -> *)
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _v : (Syntax.producer list) = ( [] ) in
- _menhir_goto_list_producer_ _menhir_env _menhir_stack _menhir_s _v _startpos
- and _menhir_run10 : _menhir_env -> 'ttv_tail -> _menhir_state -> (string Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State 10: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at ACTION _ | BAR | COLON | COMMA | LID _ | LPAREN | PLUS | PREC | QUESTION | RPAREN | STAR | UID _ *)
- _menhir_reduce81 _menhir_env (Obj.magic _menhir_stack) _menhir_s _v _startpos _endpos
- and _menhir_run102 : _menhir_env -> 'ttv_tail -> _menhir_state -> (string Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State 102: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | EQUAL ->
- (* Shifting (EQUAL) to state 103 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run103 *)
- (* State 103: *)
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 11 *)
- _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState103 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState103 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState103)
- | ACTION _ | BAR | LID _ | LPAREN | PLUS | PREC | QUESTION | STAR | UID _ ->
- _menhir_reduce80 _menhir_env (Obj.magic _menhir_stack)
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error102 *)
- let (_menhir_stack, _menhir_s, _, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- and _menhir_error109 : _menhir_env -> 'ttv_tail * _menhir_state * (Syntax.parameterized_branch list) -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Handling error in state 109 *)
- _menhir_reduce66 _menhir_env (Obj.magic _menhir_stack)
- and _menhir_goto_list_rule_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.parameterized_rule list list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState82 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run83 *)
- (* State 83: *)
- (* Reducing without looking ahead at EOF | PERCENTPERCENT _ *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce31 *)
- (* Reducing production list(rule) -> rule list(rule) *)
- let ((_menhir_stack, _menhir_s, x), _, xs) = _menhir_stack in
- let _v : (Syntax.parameterized_rule list list) = ( x :: xs ) in
- _menhir_goto_list_rule_ _menhir_env _menhir_stack _menhir_s _v
- | MenhirState76 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run122 *)
- (* State 122: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | EOF ->
- (* Shifting (EOF) to state 124 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run124 *)
- (* State 124: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at # *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce82 *)
- (* Reducing production trailer -> EOF *)
- let _v : (Syntax.trailer option) = ( None ) in
- _menhir_goto_trailer _menhir_env _menhir_stack _v
- | PERCENTPERCENT _v ->
- (* Shifting (PERCENTPERCENT) to state 123 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run123 *)
- (* State 123: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at # *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let p = _v in
- (* _menhir_reduce83 *)
- (* Reducing production trailer -> PERCENTPERCENT *)
- let _v : (Syntax.trailer option) = ( Some (Lazy.force p) ) in
- _menhir_goto_trailer _menhir_env _menhir_stack _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error122 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s)
- | _ ->
- _menhir_fail ()
- and _menhir_goto_flags : _menhir_env -> 'ttv_tail -> _menhir_state -> (bool * bool) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- (* State should be MenhirState76 | MenhirState82 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run84 *)
- (* State 84: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | LID _v ->
- (* Shifting (LID) to state 11 *)
- _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState84 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState84 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState84
- and _menhir_goto_symbol : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.symbol Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos, _endpos) in
- match _menhir_s with
- | MenhirState37 | MenhirState4 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run8 *)
- (* State 8: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState8
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LPAREN ->
- (* Shifting (LPAREN) to state 9 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState8 in
- (* _menhir_run9 *)
- (* State 9: *)
- let _menhir_stack = (_menhir_stack, _menhir_s) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 11 *)
- _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState9 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState9 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState9)
- | COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | NONASSOC | PARAMETER | PERCENTPERCENT _ | PLUS | PUBLIC | QUESTION | RIGHT | STAR | START | TOKEN | TYPE | UID _ ->
- _menhir_reduce32 _menhir_env (Obj.magic _menhir_stack) MenhirState8
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState8)
- | MenhirState115 | MenhirState113 | MenhirState110 | MenhirState95 | MenhirState103 | MenhirState17 | MenhirState13 | MenhirState9 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run12 *)
- (* State 12: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState12
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LPAREN ->
- (* Shifting (LPAREN) to state 13 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState12 in
- (* _menhir_run13 *)
- (* State 13: *)
- let _menhir_stack = (_menhir_stack, _menhir_s) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 11 *)
- _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState13 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState13 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState13)
- | ACTION _ | BAR | COMMA | LID _ | PLUS | PREC | QUESTION | RPAREN | STAR | UID _ ->
- _menhir_reduce32 _menhir_env (Obj.magic _menhir_stack) MenhirState12
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState12)
- | MenhirState71 | MenhirState68 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run70 *)
- (* State 70: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState70
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | COMMA ->
- (* Shifting (COMMA) to state 36 *)
- _menhir_run36 _menhir_env (Obj.magic _menhir_stack) MenhirState70
- | COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE ->
- _menhir_reduce76 _menhir_env (Obj.magic _menhir_stack)
- | LID _ | UID _ ->
- _menhir_reduce39 _menhir_env (Obj.magic _menhir_stack) MenhirState70
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState70)
- | MenhirState84 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run85 *)
- (* State 85: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_error85 _menhir_env (Obj.magic _menhir_stack)
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LPAREN ->
- (* Shifting (LPAREN) to state 86 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run86 *)
- (* State 86: *)
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 11 *)
- _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState86 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState86 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState86)
- | COLON ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce34 *)
- (* Reducing production loption(delimited(LPAREN,separated_nonempty_list(COMMA,symbol),RPAREN)) -> *)
- let _v : (Syntax.symbol Positions.located list) = ( [] ) in
- _menhir_goto_loption_delimited_LPAREN_separated_nonempty_list_COMMA_symbol__RPAREN__ _menhir_env _menhir_stack _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_error85 _menhir_env (Obj.magic _menhir_stack))
- | MenhirState88 | MenhirState86 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run87 *)
- (* State 87: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_error87 _menhir_env (Obj.magic _menhir_stack)
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | COMMA ->
- (* Shifting (COMMA) to state 88 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run88 *)
- (* State 88: *)
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 11 *)
- _menhir_run11 _menhir_env (Obj.magic _menhir_stack) MenhirState88 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState88 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState88)
- | RPAREN ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce70 *)
- (* Reducing production separated_nonempty_list(COMMA,symbol) -> symbol *)
- let (_menhir_stack, _menhir_s, x, _startpos_x_, _endpos_x_) = _menhir_stack in
- let _v : (Syntax.symbol Positions.located list) = ( [ x ] ) in
- _menhir_goto_separated_nonempty_list_COMMA_symbol_ _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_error87 _menhir_env (Obj.magic _menhir_stack))
- | MenhirState99 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run100 *)
- (* State 100: *)
- (* Reducing without looking ahead at BAR | EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ | error *)
- _menhir_reduce46 _menhir_env (Obj.magic _menhir_stack)
- | MenhirState119 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run120 *)
- (* State 120: *)
- (* Reducing without looking ahead at ACTION _ | BAR *)
- _menhir_reduce46 _menhir_env (Obj.magic _menhir_stack)
- | _ ->
- _menhir_fail ()
- and _menhir_run51 : _menhir_env -> 'ttv_tail -> _menhir_state -> (string Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State 51: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | COMMA ->
- (* Shifting (COMMA) to state 36 *)
- _menhir_run36 _menhir_env (Obj.magic _menhir_stack) MenhirState51
- | COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE ->
- _menhir_reduce74 _menhir_env (Obj.magic _menhir_stack)
- | LID _ ->
- _menhir_reduce39 _menhir_env (Obj.magic _menhir_stack) MenhirState51
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState51
- and _menhir_run43 : _menhir_env -> 'ttv_tail -> _menhir_state -> (string Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State 43: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | COMMA ->
- (* Shifting (COMMA) to state 36 *)
- _menhir_run36 _menhir_env (Obj.magic _menhir_stack) MenhirState43
- | COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE ->
- _menhir_reduce78 _menhir_env (Obj.magic _menhir_stack)
- | UID _ ->
- _menhir_reduce39 _menhir_env (Obj.magic _menhir_stack) MenhirState43
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState43
- and _menhir_goto_loption_delimited_LPAREN_separated_nonempty_list_COMMA_actual_parameter__RPAREN__ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.parameters) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState12 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run19 *)
- (* State 19: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState19
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | PLUS ->
- (* Shifting (PLUS) to state 22 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState19 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run22 *)
- (* State 22: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at ACTION _ | BAR | COMMA | LID _ | PREC | RPAREN | UID _ *)
- _menhir_reduce37 _menhir_env (Obj.magic _menhir_stack) _menhir_s _startpos _endpos
- | QUESTION ->
- (* Shifting (QUESTION) to state 21 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState19 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run21 *)
- (* State 21: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at ACTION _ | BAR | COMMA | LID _ | PREC | RPAREN | UID _ *)
- _menhir_reduce36 _menhir_env (Obj.magic _menhir_stack) _menhir_s _startpos _endpos
- | STAR ->
- (* Shifting (STAR) to state 20 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState19 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run20 *)
- (* State 20: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at ACTION _ | BAR | COMMA | LID _ | PREC | RPAREN | UID _ *)
- _menhir_reduce38 _menhir_env (Obj.magic _menhir_stack) _menhir_s _startpos _endpos
- | ACTION _ | BAR | COMMA | LID _ | PREC | RPAREN | UID _ ->
- _menhir_reduce43 _menhir_env (Obj.magic _menhir_stack) MenhirState19
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState19)
- | MenhirState8 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run27 *)
- (* State 27: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState27
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | PLUS ->
- (* Shifting (PLUS) to state 30 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState27 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run30 *)
- (* State 30: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | UID _ | error *)
- _menhir_reduce37 _menhir_env (Obj.magic _menhir_stack) _menhir_s _startpos _endpos
- | QUESTION ->
- (* Shifting (QUESTION) to state 29 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState27 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run29 *)
- (* State 29: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | UID _ | error *)
- _menhir_reduce36 _menhir_env (Obj.magic _menhir_stack) _menhir_s _startpos _endpos
- | STAR ->
- (* Shifting (STAR) to state 28 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState27 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run28 *)
- (* State 28: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | UID _ | error *)
- _menhir_reduce38 _menhir_env (Obj.magic _menhir_stack) _menhir_s _startpos _endpos
- | COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | UID _ ->
- _menhir_reduce43 _menhir_env (Obj.magic _menhir_stack) MenhirState27
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState27)
- | _ ->
- _menhir_fail ()
- and _menhir_goto_option_modifier_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.symbol Positions.located option) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- match _menhir_s with
- | MenhirState19 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run23 *)
- (* State 23: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at ACTION _ | BAR | COMMA | LID _ | PREC | RPAREN | UID _ *)
- _menhir_reduce1 _menhir_env (Obj.magic _menhir_stack) _menhir_s _v
- | MenhirState27 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run31 *)
- (* State 31: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | UID _ | error *)
- _menhir_reduce1 _menhir_env (Obj.magic _menhir_stack) _menhir_s _v
- | _ ->
- _menhir_fail ()
- and _menhir_goto_separated_nonempty_list_option_COMMA__actual_parameter_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.parameter list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState4 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run33 *)
- (* State 33: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_error33 _menhir_env (Obj.magic _menhir_stack)
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce9 *)
- (* Reducing production declaration -> TYPE OCAMLTYPE separated_nonempty_list(option(COMMA),actual_parameter) *)
- let (((_menhir_stack, _menhir_s, _startpos__1_), t, _endpos_t_), _, xs0) = _menhir_stack in
- let _v : (Syntax.declaration Positions.located list) = let ss =
- let xs = xs0 in
- ( xs )
- in
- ( List.map (Positions.map (fun nt -> DType (t, nt)))
- (List.map Parameters.with_pos ss) ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_error33 _menhir_env (Obj.magic _menhir_stack))
- | MenhirState37 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run38 *)
- (* State 38: *)
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce73 *)
- (* Reducing production separated_nonempty_list(option(COMMA),actual_parameter) -> actual_parameter option(COMMA) separated_nonempty_list(option(COMMA),actual_parameter) *)
- let (((_menhir_stack, _menhir_s, x, _startpos_x_), _, _), _, xs) = _menhir_stack in
- let _v : (Syntax.parameter list) = ( x :: xs ) in
- _menhir_goto_separated_nonempty_list_option_COMMA__actual_parameter_ _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- _menhir_fail ()
- and _menhir_goto_separated_nonempty_list_option_COMMA__terminal_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.terminal Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState44 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run45 *)
- (* State 45: *)
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce79 *)
- (* Reducing production separated_nonempty_list(option(COMMA),terminal) -> UID option(COMMA) separated_nonempty_list(option(COMMA),terminal) *)
- let (((_menhir_stack, _menhir_s, id0, _startpos_id0_, _endpos_id0_), _, _), _, xs) = _menhir_stack in
- let _v : (Syntax.terminal Positions.located list) = let x =
- let id = id0 in
- ( id )
- in
- ( x :: xs ) in
- _menhir_goto_separated_nonempty_list_option_COMMA__terminal_ _menhir_env _menhir_stack _menhir_s _v
- | MenhirState41 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run46 *)
- (* State 46: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_error46 _menhir_env (Obj.magic _menhir_stack)
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce3 *)
- (* Reducing production declaration -> TOKEN option(OCAMLTYPE) separated_nonempty_list(option(COMMA),terminal) *)
- let (((_menhir_stack, _menhir_s, _startpos__1_), _, t), _, xs0) = _menhir_stack in
- let _v : (Syntax.declaration Positions.located list) = let ts =
- let xs = xs0 in
- ( xs )
- in
- ( List.map (Positions.map (fun terminal -> DToken (t, terminal))) ts ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_error46 _menhir_env (Obj.magic _menhir_stack))
- | _ ->
- _menhir_fail ()
- and _menhir_goto_separated_nonempty_list_option_COMMA__nonterminal_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.nonterminal Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState52 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run53 *)
- (* State 53: *)
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce75 *)
- (* Reducing production separated_nonempty_list(option(COMMA),nonterminal) -> LID option(COMMA) separated_nonempty_list(option(COMMA),nonterminal) *)
- let (((_menhir_stack, _menhir_s, id0, _startpos_id0_, _endpos_id0_), _, _), _, xs) = _menhir_stack in
- let _v : (Syntax.nonterminal Positions.located list) = let x =
- let id = id0 in
- ( id )
- in
- ( x :: xs ) in
- _menhir_goto_separated_nonempty_list_option_COMMA__nonterminal_ _menhir_env _menhir_stack _menhir_s _v
- | MenhirState49 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run54 *)
- (* State 54: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_error54 _menhir_env (Obj.magic _menhir_stack)
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce6 *)
- (* Reducing production declaration -> START option(OCAMLTYPE) separated_nonempty_list(option(COMMA),nonterminal) *)
- let (((_menhir_stack, _menhir_s, _startpos__1_), _, t), _, xs0) = _menhir_stack in
- let _v : (Syntax.declaration Positions.located list) = let nts =
- let xs = xs0 in
- ( xs )
- in
- (
- match t with
- | None ->
- List.map (Positions.map (fun nonterminal -> DStart nonterminal)) nts
- | Some t ->
- Misc.mapd (fun ntloc ->
- Positions.mapd (fun nt -> DStart nt, DType (t, ParameterVar ntloc)) ntloc) nts
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_error54 _menhir_env (Obj.magic _menhir_stack))
- | _ ->
- _menhir_fail ()
- and _menhir_goto_separated_nonempty_list_option_COMMA__symbol_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.symbol Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState71 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run72 *)
- (* State 72: *)
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce77 *)
- (* Reducing production separated_nonempty_list(option(COMMA),symbol) -> symbol option(COMMA) separated_nonempty_list(option(COMMA),symbol) *)
- let (((_menhir_stack, _menhir_s, x, _startpos_x_, _endpos_x_), _, _), _, xs) = _menhir_stack in
- let _v : (Syntax.symbol Positions.located list) = ( x :: xs ) in
- _menhir_goto_separated_nonempty_list_option_COMMA__symbol_ _menhir_env _menhir_stack _menhir_s _v
- | MenhirState68 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run73 *)
- (* State 73: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_error73 _menhir_env (Obj.magic _menhir_stack)
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce13 *)
- (* Reducing production declaration -> priority_keyword separated_nonempty_list(option(COMMA),symbol) *)
- let ((_menhir_stack, _menhir_s, k, _startpos_k_, _endpos_k_), _, xs0) = _menhir_stack in
- let _v : (Syntax.declaration Positions.located list) = let ss =
- let xs = xs0 in
- ( xs )
- in
- ( let prec = ParserAux.current_token_precedence _startpos_k_ _endpos_k_ in
- List.map (Positions.map (fun symbol -> DTokenProperties (symbol, k, prec))) ss ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_error73 _menhir_env (Obj.magic _menhir_stack))
- | _ ->
- _menhir_fail ()
- and _menhir_goto_rule : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.parameterized_rule list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- (* State should be MenhirState82 | MenhirState76 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run82 *)
- (* State 82: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState82
- else
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | INLINE ->
- (* Shifting (INLINE) to state 80 *)
- _menhir_run80 _menhir_env (Obj.magic _menhir_stack) MenhirState82 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | PUBLIC ->
- (* Shifting (PUBLIC) to state 78 *)
- _menhir_run78 _menhir_env (Obj.magic _menhir_stack) MenhirState82 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | EOF | PERCENTPERCENT _ ->
- _menhir_reduce30 _menhir_env (Obj.magic _menhir_stack) MenhirState82
- | LID _ | UID _ ->
- _menhir_reduce20 _menhir_env (Obj.magic _menhir_stack) MenhirState82
- | _ ->
- (assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState82)
- and _menhir_goto_option_precedence_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.symbol Positions.located option) -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _endpos ->
- match _menhir_s with
- | MenhirState98 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run101 *)
- (* State 101: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at BAR | EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _endpos__3_ = _endpos in
- (* _menhir_reduce56 *)
- (* Reducing production production_group -> error ACTION option(precedence) *)
- let ((_menhir_stack, _menhir_s, _startpos__1_, _endpos__1_), _, _startpos__2_, _endpos__2_) = _menhir_stack in
- let _v : (Syntax.parameterized_branch list) = ( Error.error (Positions.two _startpos__1_ _endpos__1_) "syntax error inside a production." ) in
- _menhir_goto_production_group _menhir_env _menhir_stack _menhir_s _v
- | MenhirState107 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run108 *)
- (* State 108: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at BAR | EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let oprec2 = _v in
- let _endpos_oprec2_ = _endpos in
- (* _menhir_reduce55 *)
- (* Reducing production production_group -> separated_nonempty_list(BAR,production) ACTION option(precedence) *)
- let ((_menhir_stack, _menhir_s, productions), action, _startpos_action_, _endpos_action_) = _menhir_stack in
- let _v : (Syntax.parameterized_branch list) = (
- ParserAux.check_production_group
- productions
- _startpos_action_ _endpos_action_ action;
- List.map (fun (producers, oprec1, rprec, pos) -> {
- pr_producers = producers;
- pr_action = action;
- pr_branch_shift_precedence = ParserAux.override pos oprec1 oprec2;
- pr_branch_reduce_precedence = rprec;
- pr_branch_position = pos
- }) productions
- ) in
- _menhir_goto_production_group _menhir_env _menhir_stack _menhir_s _v
- | MenhirState118 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run121 *)
- (* State 121: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at ACTION _ | BAR *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let oprec = _v in
- let _endpos_oprec_ = _endpos in
- (* _menhir_reduce54 *)
- (* Reducing production production -> list(producer) option(precedence) *)
- let (_menhir_stack, _menhir_s, producers, _startpos_producers_) = _menhir_stack in
- let _startpos = _startpos_producers_ in
- let _endpos = _endpos_oprec_ in
- let _v : (Syntax.producer list * Syntax.symbol Positions.located option *
- Syntax.branch_reduce_precedence * Positions.t) = ( producers,
- oprec,
- ParserAux.current_reduce_precedence(),
- Positions.lex_join _startpos _endpos
- ) in
- (* _menhir_goto_production *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- (* State should be MenhirState95 | MenhirState113 | MenhirState110 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run112 *)
- (* State 112: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | BAR ->
- (* Shifting (BAR) to state 113 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run113 *)
- (* State 113: *)
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 102 *)
- _menhir_run102 _menhir_env (Obj.magic _menhir_stack) MenhirState113 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState113 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | ACTION _ | BAR | PREC ->
- _menhir_reduce28 _menhir_env (Obj.magic _menhir_stack) MenhirState113
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState113)
- | ACTION _ ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce64 *)
- (* Reducing production separated_nonempty_list(BAR,production) -> production *)
- let (_menhir_stack, _menhir_s, x) = _menhir_stack in
- let _v : ((Syntax.producer list * Syntax.symbol Positions.located option *
- Syntax.branch_reduce_precedence * Positions.t)
- list) = ( [ x ] ) in
- _menhir_goto_separated_nonempty_list_BAR_production_ _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error112 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s)
- | _ ->
- _menhir_fail ()
- and _menhir_goto_production_group : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.parameterized_branch list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- (* State should be MenhirState110 | MenhirState95 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run109 *)
- (* State 109: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_error109 _menhir_env (Obj.magic _menhir_stack)
- else
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | BAR ->
- (* Shifting (BAR) to state 110 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run110 *)
- (* State 110: *)
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 102 *)
- _menhir_run102 _menhir_env (Obj.magic _menhir_stack) MenhirState110 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 10 *)
- _menhir_run10 _menhir_env (Obj.magic _menhir_stack) MenhirState110 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | ACTION _ | BAR | PREC ->
- _menhir_reduce28 _menhir_env (Obj.magic _menhir_stack) MenhirState110
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState110)
- | EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ ->
- _menhir_reduce66 _menhir_env (Obj.magic _menhir_stack)
- | _ ->
- (assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_error109 _menhir_env (Obj.magic _menhir_stack))
- and _menhir_run99 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* State 99: *)
- let _menhir_stack = (_menhir_stack, _menhir_s) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | LID _v ->
- (* Shifting (LID) to state 7 *)
- _menhir_run7 _menhir_env (Obj.magic _menhir_stack) MenhirState99 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 6 *)
- _menhir_run6 _menhir_env (Obj.magic _menhir_stack) MenhirState99 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState99
- and _menhir_fail : unit -> 'a =
- fun () ->
- Printf.fprintf Pervasives.stderr "Internal failure -- please contact the parser generator's developers.\n%!";
- assert false
- and _menhir_reduce20 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production flags -> *)
- let _v : (bool * bool) = ( false, false ) in
- _menhir_goto_flags _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce30 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production list(rule) -> *)
- let _v : (Syntax.parameterized_rule list list) = ( [] ) in
- _menhir_goto_list_rule_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_run78 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 78: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | INLINE ->
- (* Shifting (INLINE) to state 79 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run79 *)
- (* State 79: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at LID _ | UID _ *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__2_ = _startpos in
- let _endpos__2_ = _endpos in
- (* _menhir_reduce23 *)
- (* Reducing production flags -> PUBLIC INLINE *)
- let (_menhir_stack, _menhir_s, _startpos__1_, _endpos__1_) = _menhir_stack in
- let _v : (bool * bool) = ( true, true ) in
- _menhir_goto_flags _menhir_env _menhir_stack _menhir_s _v
- | LID _ | UID _ ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce21 *)
- (* Reducing production flags -> PUBLIC *)
- let (_menhir_stack, _menhir_s, _startpos__1_, _endpos__1_) = _menhir_stack in
- let _v : (bool * bool) = ( true, false ) in
- _menhir_goto_flags _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error78 *)
- let (_menhir_stack, _menhir_s, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- and _menhir_run80 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 80: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | PUBLIC ->
- (* Shifting (PUBLIC) to state 81 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run81 *)
- (* State 81: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at LID _ | UID _ *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__2_ = _startpos in
- let _endpos__2_ = _endpos in
- (* _menhir_reduce24 *)
- (* Reducing production flags -> INLINE PUBLIC *)
- let (_menhir_stack, _menhir_s, _startpos__1_, _endpos__1_) = _menhir_stack in
- let _v : (bool * bool) = ( true, true ) in
- _menhir_goto_flags _menhir_env _menhir_stack _menhir_s _v
- | LID _ | UID _ ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce22 *)
- (* Reducing production flags -> INLINE *)
- let (_menhir_stack, _menhir_s, _startpos__1_, _endpos__1_) = _menhir_stack in
- let _v : (bool * bool) = ( false, true ) in
- _menhir_goto_flags _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error80 *)
- let (_menhir_stack, _menhir_s, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- and _menhir_reduce81 : _menhir_env -> 'ttv_tail -> _menhir_state -> (string Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s id _startpos_id_ _endpos_id_ ->
- (* Reducing production symbol -> UID *)
- let _startpos = _startpos_id_ in
- let _endpos = _endpos_id_ in
- let _v : (Syntax.symbol Positions.located) = ( id ) in
- _menhir_goto_symbol _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_reduce80 : _menhir_env -> 'ttv_tail * _menhir_state * (string Positions.located) * Lexing.position * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production symbol -> LID *)
- let (_menhir_stack, _menhir_s, id, _startpos_id_, _endpos_id_) = _menhir_stack in
- let _startpos = _startpos_id_ in
- let _endpos = _endpos_id_ in
- let _v : (Syntax.symbol Positions.located) = ( id ) in
- _menhir_goto_symbol _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_goto_option_OCAMLTYPE_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Stretch.ocamltype option) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState39 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run41 *)
- (* State 41: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState41
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | UID _v ->
- (* Shifting (UID) to state 43 *)
- _menhir_run43 _menhir_env (Obj.magic _menhir_stack) MenhirState41 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState41)
- | MenhirState48 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run49 *)
- (* State 49: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState49
- else
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 51 *)
- _menhir_run51 _menhir_env (Obj.magic _menhir_stack) MenhirState49 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState49)
- | _ ->
- _menhir_fail ()
- and _menhir_reduce32 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production loption(delimited(LPAREN,separated_nonempty_list(COMMA,actual_parameter),RPAREN)) -> *)
- let _v : (Syntax.parameters) = ( [] ) in
- _menhir_goto_loption_delimited_LPAREN_separated_nonempty_list_COMMA_actual_parameter__RPAREN__ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce43 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production option(modifier) -> *)
- let _v : (Syntax.symbol Positions.located option) = ( None ) in
- _menhir_goto_option_modifier_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce72 : _menhir_env -> 'ttv_tail * _menhir_state * (Syntax.parameter) * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production separated_nonempty_list(option(COMMA),actual_parameter) -> actual_parameter *)
- let (_menhir_stack, _menhir_s, x, _startpos_x_) = _menhir_stack in
- let _v : (Syntax.parameter list) = ( [ x ] ) in
- _menhir_goto_separated_nonempty_list_option_COMMA__actual_parameter_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce78 : _menhir_env -> 'ttv_tail * _menhir_state * (string Positions.located) * Lexing.position * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production separated_nonempty_list(option(COMMA),terminal) -> UID *)
- let (_menhir_stack, _menhir_s, id0, _startpos_id0_, _endpos_id0_) = _menhir_stack in
- let _v : (Syntax.terminal Positions.located list) = let x =
- let id = id0 in
- ( id )
- in
- ( [ x ] ) in
- _menhir_goto_separated_nonempty_list_option_COMMA__terminal_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce74 : _menhir_env -> 'ttv_tail * _menhir_state * (string Positions.located) * Lexing.position * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production separated_nonempty_list(option(COMMA),nonterminal) -> LID *)
- let (_menhir_stack, _menhir_s, id0, _startpos_id0_, _endpos_id0_) = _menhir_stack in
- let _v : (Syntax.nonterminal Positions.located list) = let x =
- let id = id0 in
- ( id )
- in
- ( [ x ] ) in
- _menhir_goto_separated_nonempty_list_option_COMMA__nonterminal_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce76 : _menhir_env -> 'ttv_tail * _menhir_state * (Syntax.symbol Positions.located) * Lexing.position * Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack ->
- (* Reducing production separated_nonempty_list(option(COMMA),symbol) -> symbol *)
- let (_menhir_stack, _menhir_s, x, _startpos_x_, _endpos_x_) = _menhir_stack in
- let _v : (Syntax.symbol Positions.located list) = ( [ x ] ) in
- _menhir_goto_separated_nonempty_list_option_COMMA__symbol_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_run77 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 77: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce59 *)
- (* Reducing production rule -> error *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.parameterized_rule list) = ( Error.error (Positions.two _startpos _endpos) "syntax error inside the definition of a nonterminal symbol." ) in
- _menhir_goto_rule _menhir_env _menhir_stack _menhir_s _v
- and _menhir_reduce45 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production option(precedence) -> *)
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _v : (Syntax.symbol Positions.located option) = ( None ) in
- _menhir_goto_option_precedence_ _menhir_env _menhir_stack _menhir_s _v _endpos
- and _menhir_run96 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 96: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | ACTION _v ->
- (* Shifting (ACTION) to state 98 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run98 *)
- (* State 98: *)
- let _menhir_stack = (_menhir_stack, _v, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | PREC ->
- (* Shifting (PREC) to state 99 *)
- _menhir_run99 _menhir_env (Obj.magic _menhir_stack) MenhirState98
- | BAR | EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ ->
- _menhir_reduce45 _menhir_env (Obj.magic _menhir_stack) MenhirState98
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState98)
- | EOF ->
- (* Shifting (EOF) to state 97 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run97 *)
- (* State 97: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at BAR | EOF | INLINE | LID _ | PERCENTPERCENT _ | PUBLIC | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__2_ = _startpos in
- let _endpos__2_ = _endpos in
- (* _menhir_reduce57 *)
- (* Reducing production production_group -> error EOF *)
- let (_menhir_stack, _menhir_s, _startpos__1_, _endpos__1_) = _menhir_stack in
- let _v : (Syntax.parameterized_branch list) = ( Error.error (Positions.two _startpos__1_ _endpos__1_) "syntax error inside a production." ) in
- _menhir_goto_production_group _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error96 *)
- let (_menhir_stack, _menhir_s, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- and _menhir_run1 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 1: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce18 *)
- (* Reducing production declaration -> error *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.declaration Positions.located list) = ( Error.error (Positions.two _startpos _endpos) "syntax error inside a declaration." ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_goto_list_declaration_ : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.declaration Positions.located list list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- match _menhir_s with
- | MenhirState0 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run75 *)
- (* State 75: *)
- assert (not _menhir_env._menhir_error);
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | PERCENTPERCENT _v ->
- (* Shifting (PERCENTPERCENT) to state 76 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run76 *)
- (* State 76: *)
- let _menhir_stack = (_menhir_stack, _v) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | INLINE ->
- (* Shifting (INLINE) to state 80 *)
- _menhir_run80 _menhir_env (Obj.magic _menhir_stack) MenhirState76 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | PUBLIC ->
- (* Shifting (PUBLIC) to state 78 *)
- _menhir_run78 _menhir_env (Obj.magic _menhir_stack) MenhirState76 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | EOF | PERCENTPERCENT _ ->
- _menhir_reduce30 _menhir_env (Obj.magic _menhir_stack) MenhirState76
- | LID _ | UID _ ->
- _menhir_reduce20 _menhir_env (Obj.magic _menhir_stack) MenhirState76
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState76)
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error75 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s)
- | MenhirState127 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run128 *)
- (* State 128: *)
- (* Reducing without looking ahead at PERCENTPERCENT _ *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_reduce27 *)
- (* Reducing production list(declaration) -> declaration list(declaration) *)
- let ((_menhir_stack, _menhir_s, x), _, xs) = _menhir_stack in
- let _v : (Syntax.declaration Positions.located list list) = ( x :: xs ) in
- _menhir_goto_list_declaration_ _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- _menhir_fail ()
- and _menhir_run6 : _menhir_env -> 'ttv_tail -> _menhir_state -> (string Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State 6: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at BAR | COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | LPAREN | NONASSOC | PARAMETER | PERCENTPERCENT _ | PLUS | PUBLIC | QUESTION | RIGHT | STAR | START | TOKEN | TYPE | UID _ | error *)
- _menhir_reduce81 _menhir_env (Obj.magic _menhir_stack) _menhir_s _v _startpos _endpos
- and _menhir_run7 : _menhir_env -> 'ttv_tail -> _menhir_state -> (string Positions.located) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State 7: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at BAR | COLON | COMMA | EOF | HEADER _ | INLINE | LEFT | LID _ | LPAREN | NONASSOC | PARAMETER | PERCENTPERCENT _ | PLUS | PUBLIC | QUESTION | RIGHT | STAR | START | TOKEN | TYPE | UID _ | error *)
- _menhir_reduce80 _menhir_env (Obj.magic _menhir_stack)
- and _menhir_reduce41 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production option(OCAMLTYPE) -> *)
- let _v : (Stretch.ocamltype option) = ( None ) in
- _menhir_goto_option_OCAMLTYPE_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_run40 : _menhir_env -> 'ttv_tail -> _menhir_state -> (Stretch.ocamltype) -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _endpos ->
- (* State 40: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at LID _ | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let x = _v in
- let _endpos_x_ = _endpos in
- (* _menhir_reduce42 *)
- (* Reducing production option(OCAMLTYPE) -> OCAMLTYPE *)
- let _v : (Stretch.ocamltype option) = ( Some x ) in
- _menhir_goto_option_OCAMLTYPE_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_goto_priority_keyword : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.token_associativity) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v, _startpos, _endpos) in
- (* State should be MenhirState127 | MenhirState0 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run68 *)
- (* State 68: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState68
- else
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | LID _v ->
- (* Shifting (LID) to state 7 *)
- _menhir_run7 _menhir_env (Obj.magic _menhir_stack) MenhirState68 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 6 *)
- _menhir_run6 _menhir_env (Obj.magic _menhir_stack) MenhirState68 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- (assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState68)
- and _menhir_goto_declaration : _menhir_env -> 'ttv_tail -> _menhir_state -> (Syntax.declaration Positions.located list) -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v ->
- let _menhir_stack = (_menhir_stack, _menhir_s, _v) in
- (* State should be MenhirState127 | MenhirState0 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run127 *)
- (* State 127: *)
- if _menhir_env._menhir_error then
- (* Resuming error handling *)
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState127
- else
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | COLON ->
- (* Shifting (COLON) to state 66 *)
- _menhir_run66 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | EOF ->
- (* Shifting (EOF) to state 65 *)
- _menhir_run65 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | HEADER _v ->
- (* Shifting (HEADER) to state 64 *)
- _menhir_run64 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | INLINE ->
- (* Shifting (INLINE) to state 63 *)
- _menhir_run63 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | LEFT ->
- (* Shifting (LEFT) to state 62 *)
- _menhir_run62 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | NONASSOC ->
- (* Shifting (NONASSOC) to state 61 *)
- _menhir_run61 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | PARAMETER ->
- (* Shifting (PARAMETER) to state 58 *)
- _menhir_run58 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p
- | PUBLIC ->
- (* Shifting (PUBLIC) to state 57 *)
- _menhir_run57 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | RIGHT ->
- (* Shifting (RIGHT) to state 56 *)
- _menhir_run56 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | START ->
- (* Shifting (START) to state 48 *)
- _menhir_run48 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p
- | TOKEN ->
- (* Shifting (TOKEN) to state 39 *)
- _menhir_run39 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p
- | TYPE ->
- (* Shifting (TYPE) to state 2 *)
- _menhir_run2 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p
- | PERCENTPERCENT _ ->
- _menhir_reduce26 _menhir_env (Obj.magic _menhir_stack) MenhirState127
- | _ ->
- (assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState127)
- and _menhir_goto_rule_specific_token : _menhir_env -> 'ttv_tail -> _menhir_state -> (unit) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State should be MenhirState127 | MenhirState0 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_run67 *)
- (* State 67: *)
- (* Not allocating top stack cell *)
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce19 *)
- (* Reducing production declaration -> rule_specific_token *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.declaration Positions.located list) = (
- Error.error (Positions.two _startpos _endpos)
- "syntax error inside a declaration.\n\
- Did you perhaps forget the %% that separates declarations and rules?"
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_errorcase : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- match _menhir_s with
- | MenhirState127 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error127 *)
- (* Handling error in state 127 *)
- (* Shifting (error) to state 1 *)
- _menhir_run1 _menhir_env (Obj.magic _menhir_stack) MenhirState127 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | MenhirState119 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error119 *)
- let (_menhir_stack, _menhir_s) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState118 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error118 *)
- let (_menhir_stack, _menhir_s, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState115 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error115 *)
- let (_menhir_stack, _menhir_s, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState113 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error113 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState110 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error110 *)
- (* Handling error in state 110 *)
- (* Shifting (error) to state 96 *)
- _menhir_run96 _menhir_env (Obj.magic _menhir_stack) MenhirState110 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | MenhirState107 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error107 *)
- (* Handling error in state 107 *)
- _menhir_reduce45 _menhir_env (Obj.magic _menhir_stack) MenhirState107
- | MenhirState103 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error103 *)
- let (_menhir_stack, _menhir_s, _, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState99 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error99 *)
- let (_menhir_stack, _menhir_s) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState98 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error98 *)
- (* Handling error in state 98 *)
- _menhir_reduce45 _menhir_env (Obj.magic _menhir_stack) MenhirState98
- | MenhirState95 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error95 *)
- (* Handling error in state 95 *)
- (* Shifting (error) to state 96 *)
- _menhir_run96 _menhir_env (Obj.magic _menhir_stack) MenhirState95 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | MenhirState88 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error88 *)
- let (_menhir_stack, _menhir_s, _, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState86 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error86 *)
- raise _eRR
- | MenhirState84 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error84 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState82 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error82 *)
- (* Handling error in state 82 *)
- (* Shifting (error) to state 77 *)
- _menhir_run77 _menhir_env (Obj.magic _menhir_stack) MenhirState82 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | MenhirState76 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error76 *)
- (* Handling error in state 76 *)
- (* Shifting (error) to state 77 *)
- _menhir_run77 _menhir_env (Obj.magic _menhir_stack) MenhirState76 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | MenhirState71 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error71 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState70 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error70 *)
- (* Handling error in state 70 *)
- _menhir_reduce76 _menhir_env (Obj.magic _menhir_stack)
- | MenhirState68 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error68 *)
- (* Handling error in state 68 *)
- (* Shifting (error) to state 69 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState68 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run69 *)
- (* State 69: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__2_ = _startpos in
- let _endpos__2_ = _endpos in
- (* _menhir_reduce15 *)
- (* Reducing production declaration -> priority_keyword error *)
- let (_menhir_stack, _menhir_s, _, _startpos__1_, _endpos__1_) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__2_ in
- let _v : (Syntax.declaration Positions.located list) = ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a precedence declaration.";
- "Here are sample valid declarations:";
- " %left PLUS TIMES";
- " %nonassoc unary_minus";
- " %right CONCAT";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | MenhirState52 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error52 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState51 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error51 *)
- (* Handling error in state 51 *)
- _menhir_reduce74 _menhir_env (Obj.magic _menhir_stack)
- | MenhirState49 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error49 *)
- (* Handling error in state 49 *)
- (* Shifting (error) to state 50 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState49 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run50 *)
- (* State 50: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__3_ = _startpos in
- let _endpos__3_ = _endpos in
- (* _menhir_reduce8 *)
- (* Reducing production declaration -> START option(OCAMLTYPE) error *)
- let ((_menhir_stack, _menhir_s, _startpos__1_), _, _) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__3_ in
- let _v : (Syntax.declaration Positions.located list) = ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a %start declaration.";
- "Here are sample valid declarations:";
- " %start expression phrase";
- " %start <int> date time";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | MenhirState48 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error48 *)
- (* Handling error in state 48 *)
- _menhir_reduce41 _menhir_env (Obj.magic _menhir_stack) MenhirState48
- | MenhirState44 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error44 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState43 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error43 *)
- (* Handling error in state 43 *)
- _menhir_reduce78 _menhir_env (Obj.magic _menhir_stack)
- | MenhirState41 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error41 *)
- (* Handling error in state 41 *)
- (* Shifting (error) to state 42 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState41 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run42 *)
- (* State 42: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__3_ = _startpos in
- let _endpos__3_ = _endpos in
- (* _menhir_reduce5 *)
- (* Reducing production declaration -> TOKEN option(OCAMLTYPE) error *)
- let ((_menhir_stack, _menhir_s, _startpos__1_), _, _) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__3_ in
- let _v : (Syntax.declaration Positions.located list) = ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a %token declaration.";
- "Here are sample valid declarations:";
- " %token DOT SEMICOLON";
- " %token <string> LID UID";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | MenhirState39 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error39 *)
- (* Handling error in state 39 *)
- _menhir_reduce41 _menhir_env (Obj.magic _menhir_stack) MenhirState39
- | MenhirState37 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error37 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState35 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error35 *)
- (* Handling error in state 35 *)
- _menhir_reduce72 _menhir_env (Obj.magic _menhir_stack)
- | MenhirState27 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error27 *)
- (* Handling error in state 27 *)
- _menhir_reduce43 _menhir_env (Obj.magic _menhir_stack) MenhirState27
- | MenhirState19 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error19 *)
- let (_menhir_stack, _menhir_s, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState17 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error17 *)
- let (_menhir_stack, _menhir_s, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState13 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error13 *)
- let (_menhir_stack, _menhir_s) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState12 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error12 *)
- let (_menhir_stack, _menhir_s, _, _, _) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState9 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error9 *)
- let (_menhir_stack, _menhir_s) = _menhir_stack in
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) _menhir_s
- | MenhirState8 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error8 *)
- (* Handling error in state 8 *)
- _menhir_reduce32 _menhir_env (Obj.magic _menhir_stack) MenhirState8
- | MenhirState4 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error4 *)
- (* Handling error in state 4 *)
- (* Shifting (error) to state 5 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _menhir_s = MenhirState4 in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run5 *)
- (* State 5: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__3_ = _startpos in
- let _endpos__3_ = _endpos in
- (* _menhir_reduce11 *)
- (* Reducing production declaration -> TYPE OCAMLTYPE error *)
- let ((_menhir_stack, _menhir_s, _startpos__1_), _, _endpos__2_) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__3_ in
- let _v : (Syntax.declaration Positions.located list) = ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a %type declaration.";
- "Here are sample valid declarations:";
- " %type <Syntax.expression> expression";
- " %type <int> date time";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | MenhirState0 ->
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error0 *)
- (* Handling error in state 0 *)
- (* Shifting (error) to state 1 *)
- _menhir_run1 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- and _menhir_reduce26 : _menhir_env -> 'ttv_tail -> _menhir_state -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s ->
- (* Reducing production list(declaration) -> *)
- let _v : (Syntax.declaration Positions.located list list) = ( [] ) in
- _menhir_goto_list_declaration_ _menhir_env _menhir_stack _menhir_s _v
- and _menhir_run2 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos ->
- (* State 2: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _startpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | OCAMLTYPE _v ->
- (* Shifting (OCAMLTYPE) to state 4 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run4 *)
- (* State 4: *)
- let _menhir_stack = (_menhir_stack, _v, _endpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- (match _tok with
- | LID _v ->
- (* Shifting (LID) to state 7 *)
- _menhir_run7 _menhir_env (Obj.magic _menhir_stack) MenhirState4 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _v ->
- (* Shifting (UID) to state 6 *)
- _menhir_run6 _menhir_env (Obj.magic _menhir_stack) MenhirState4 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState4)
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error2 *)
- (* Handling error in state 2 *)
- (* Shifting (error) to state 3 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run3 *)
- (* State 3: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__2_ = _startpos in
- let _endpos__2_ = _endpos in
- (* _menhir_reduce12 *)
- (* Reducing production declaration -> TYPE error *)
- let (_menhir_stack, _menhir_s, _startpos__1_) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__2_ in
- let _v : (Syntax.declaration Positions.located list) = ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a %type declaration.";
- "Here are sample valid declarations:";
- " %type <Syntax.expression> expression";
- " %type <int> date time";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_run39 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos ->
- (* State 39: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _startpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | OCAMLTYPE _v ->
- (* Shifting (OCAMLTYPE) to state 40 *)
- _menhir_run40 _menhir_env (Obj.magic _menhir_stack) MenhirState39 _v _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | UID _ ->
- _menhir_reduce41 _menhir_env (Obj.magic _menhir_stack) MenhirState39
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState39
- and _menhir_run48 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos ->
- (* State 48: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _startpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | OCAMLTYPE _v ->
- (* Shifting (OCAMLTYPE) to state 40 *)
- _menhir_run40 _menhir_env (Obj.magic _menhir_stack) MenhirState48 _v _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | LID _ ->
- _menhir_reduce41 _menhir_env (Obj.magic _menhir_stack) MenhirState48
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState48
- and _menhir_run56 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 56: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at LID _ | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce50 *)
- (* Reducing production priority_keyword -> RIGHT *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.token_associativity) = ( RightAssoc ) in
- _menhir_goto_priority_keyword _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_run57 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 57: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce60 *)
- (* Reducing production rule_specific_token -> PUBLIC *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (unit) = ( () ) in
- _menhir_goto_rule_specific_token _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_run58 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos ->
- (* State 58: *)
- let _menhir_stack = (_menhir_stack, _menhir_s, _startpos) in
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | OCAMLTYPE _v ->
- (* Shifting (OCAMLTYPE) to state 60 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run60 *)
- (* State 60: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let t = _v in
- let _endpos_t_ = _endpos in
- (* _menhir_reduce16 *)
- (* Reducing production declaration -> PARAMETER OCAMLTYPE *)
- let (_menhir_stack, _menhir_s, _startpos__1_) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos_t_ in
- let _v : (Syntax.declaration Positions.located list) = ( [ with_poss _startpos _endpos (DParameter t) ] ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- let _menhir_stack = Obj.magic _menhir_stack in
- (* _menhir_error58 *)
- (* Handling error in state 58 *)
- (* Shifting (error) to state 59 *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos = _menhir_env._menhir_lexbuf.Lexing.lex_start_p in
- let _endpos = _menhir_env._menhir_lexbuf.Lexing.lex_curr_p in
- (* _menhir_run59 *)
- (* State 59: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__2_ = _startpos in
- let _endpos__2_ = _endpos in
- (* _menhir_reduce17 *)
- (* Reducing production declaration -> PARAMETER error *)
- let (_menhir_stack, _menhir_s, _startpos__1_) = _menhir_stack in
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__2_ in
- let _v : (Syntax.declaration Positions.located list) = ( Error.error (Positions.two _startpos _endpos) (String.concat "\n" [
- "syntax error in a %parameter declaration.";
- "Here is a sample valid declaration:";
- " %parameter <X : sig type t end>";
- ])
- ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_run61 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 61: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at LID _ | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce51 *)
- (* Reducing production priority_keyword -> NONASSOC *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.token_associativity) = ( NonAssoc ) in
- _menhir_goto_priority_keyword _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_run62 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 62: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at LID _ | UID _ | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce49 *)
- (* Reducing production priority_keyword -> LEFT *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (Syntax.token_associativity) = ( LeftAssoc ) in
- _menhir_goto_priority_keyword _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_run63 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 63: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce61 *)
- (* Reducing production rule_specific_token -> INLINE *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (unit) = ( () ) in
- _menhir_goto_rule_specific_token _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_run64 : _menhir_env -> 'ttv_tail -> _menhir_state -> (Stretch.t) -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _v _startpos _endpos ->
- (* State 64: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let h = _v in
- let _startpos_h_ = _startpos in
- let _endpos_h_ = _endpos in
- (* _menhir_reduce2 *)
- (* Reducing production declaration -> HEADER *)
- let _startpos = _startpos_h_ in
- let _endpos = _endpos_h_ in
- let _v : (Syntax.declaration Positions.located list) = ( [ with_poss _startpos _endpos (DCode h) ] ) in
- _menhir_goto_declaration _menhir_env _menhir_stack _menhir_s _v
- and _menhir_run65 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 65: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce63 *)
- (* Reducing production rule_specific_token -> EOF *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (unit) = ( () ) in
- _menhir_goto_rule_specific_token _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_run66 : _menhir_env -> 'ttv_tail -> _menhir_state -> Lexing.position -> Lexing.position -> 'ttv_return =
- fun _menhir_env _menhir_stack _menhir_s _startpos _endpos ->
- (* State 66: *)
- (* Not allocating top stack cell *)
- let _menhir_env = _menhir_discard _menhir_env in
- (* Reducing without looking ahead at COLON | EOF | HEADER _ | INLINE | LEFT | NONASSOC | PARAMETER | PERCENTPERCENT _ | PUBLIC | RIGHT | START | TOKEN | TYPE | error *)
- let _menhir_stack = Obj.magic _menhir_stack in
- let _startpos__1_ = _startpos in
- let _endpos__1_ = _endpos in
- (* _menhir_reduce62 *)
- (* Reducing production rule_specific_token -> COLON *)
- let _startpos = _startpos__1_ in
- let _endpos = _endpos__1_ in
- let _v : (unit) = ( () ) in
- _menhir_goto_rule_specific_token _menhir_env _menhir_stack _menhir_s _v _startpos _endpos
- and _menhir_discard : _menhir_env -> _menhir_env =
- fun _menhir_env ->
- let lexer = _menhir_env._menhir_lexer in
- let lexbuf = _menhir_env._menhir_lexbuf in
- let _tok = lexer lexbuf in
- {
- _menhir_lexer = lexer;
- _menhir_lexbuf = lexbuf;
- _menhir_token = _tok;
- _menhir_error = false;
- }
- and grammar : (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (ConcreteSyntax.grammar) =
- fun lexer lexbuf ->
- let _menhir_env = (* _menhir_init *)
- let _tok = Obj.magic () in
- {
- _menhir_lexer = lexer;
- _menhir_lexbuf = lexbuf;
- _menhir_token = _tok;
- _menhir_error = false;
- } in
- Obj.magic (let _menhir_stack = () in
- (* _menhir_run0 *)
- (* State 0: *)
- let _menhir_env = _menhir_discard _menhir_env in
- let _tok = _menhir_env._menhir_token in
- match _tok with
- | COLON ->
- (* Shifting (COLON) to state 66 *)
- _menhir_run66 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | EOF ->
- (* Shifting (EOF) to state 65 *)
- _menhir_run65 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | HEADER _v ->
- (* Shifting (HEADER) to state 64 *)
- _menhir_run64 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _v _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | INLINE ->
- (* Shifting (INLINE) to state 63 *)
- _menhir_run63 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | LEFT ->
- (* Shifting (LEFT) to state 62 *)
- _menhir_run62 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | NONASSOC ->
- (* Shifting (NONASSOC) to state 61 *)
- _menhir_run61 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | PARAMETER ->
- (* Shifting (PARAMETER) to state 58 *)
- _menhir_run58 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p
- | PUBLIC ->
- (* Shifting (PUBLIC) to state 57 *)
- _menhir_run57 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | RIGHT ->
- (* Shifting (RIGHT) to state 56 *)
- _menhir_run56 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p _menhir_env._menhir_lexbuf.Lexing.lex_curr_p
- | START ->
- (* Shifting (START) to state 48 *)
- _menhir_run48 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p
- | TOKEN ->
- (* Shifting (TOKEN) to state 39 *)
- _menhir_run39 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p
- | TYPE ->
- (* Shifting (TYPE) to state 2 *)
- _menhir_run2 _menhir_env (Obj.magic _menhir_stack) MenhirState0 _menhir_env._menhir_lexbuf.Lexing.lex_start_p
- | PERCENTPERCENT _ ->
- _menhir_reduce26 _menhir_env (Obj.magic _menhir_stack) MenhirState0
- | _ ->
- assert (not _menhir_env._menhir_error);
- (* Initiating error handling *)
- _menhir_env._menhir_error <- true;
- _menhir_errorcase _menhir_env (Obj.magic _menhir_stack) MenhirState0)
Add Comment
Please, Sign In to add comment