#
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.7.3
# from Racc grammar file "parser.y".
#

###### racc/parser.rb begin
unless $".find {|p| p.end_with?('/racc/parser.rb')}
$".push "#{__dir__}/racc/parser.rb"
self.class.module_eval(<<'...end racc/parser.rb/module_eval...', 'racc/parser.rb', 1)
#--
# Copyright (c) 1999-2006 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the same terms of ruby.
#
# As a special exception, when this code is copied by Racc
# into a Racc output file, you may use that output file
# without restriction.
#++

unless $".find {|p| p.end_with?('/racc/info.rb')}
$".push "#{__dir__}/racc/info.rb"

module Racc
  VERSION   = '1.7.3'
  Version = VERSION
  Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
end

end


unless defined?(NotImplementedError)
  NotImplementedError = NotImplementError # :nodoc:
end

module Racc
  class ParseError < StandardError; end
end
unless defined?(::ParseError)
  ParseError = Racc::ParseError # :nodoc:
end

# Racc is a LALR(1) parser generator.
# It is written in Ruby itself, and generates Ruby programs.
#
# == Command-line Reference
#
#     racc [-o<var>filename</var>] [--output-file=<var>filename</var>]
#          [-e<var>rubypath</var>] [--executable=<var>rubypath</var>]
#          [-v] [--verbose]
#          [-O<var>filename</var>] [--log-file=<var>filename</var>]
#          [-g] [--debug]
#          [-E] [--embedded]
#          [-l] [--no-line-convert]
#          [-c] [--line-convert-all]
#          [-a] [--no-omit-actions]
#          [-C] [--check-only]
#          [-S] [--output-status]
#          [--version] [--copyright] [--help] <var>grammarfile</var>
#
# [+grammarfile+]
#   Racc grammar file. Any extension is permitted.
# [-o+outfile+, --output-file=+outfile+]
#   A filename for output. default is <+filename+>.tab.rb
# [-O+filename+, --log-file=+filename+]
#   Place logging output in file +filename+.
#   Default log file name is <+filename+>.output.
# [-e+rubypath+, --executable=+rubypath+]
#   output executable file(mode 755). where +path+ is the Ruby interpreter.
# [-v, --verbose]
#   verbose mode. create +filename+.output file, like yacc's y.output file.
# [-g, --debug]
#   add debug code to parser class. To display debugging information,
#   use this '-g' option and set @yydebug true in parser class.
# [-E, --embedded]
#   Output parser which doesn't need runtime files (racc/parser.rb).
# [-F, --frozen]
#   Output parser which declares frozen_string_literals: true
# [-C, --check-only]
#   Check syntax of racc grammar file and quit.
# [-S, --output-status]
#   Print messages time to time while compiling.
# [-l, --no-line-convert]
#   turns off line number converting.
# [-c, --line-convert-all]
#   Convert line number of actions, inner, header and footer.
# [-a, --no-omit-actions]
#   Call all actions, even if an action is empty.
# [--version]
#   print Racc version and quit.
# [--copyright]
#   Print copyright and quit.
# [--help]
#   Print usage and quit.
#
# == Generating Parser Using Racc
#
# To compile Racc grammar file, simply type:
#
#   $ racc parse.y
#
# This creates Ruby script file "parse.tab.y". The -o option can change the output filename.
#
# == Writing A Racc Grammar File
#
# If you want your own parser, you have to write a grammar file.
# A grammar file contains the name of your parser class, grammar for the parser,
# user code, and anything else.
# When writing a grammar file, yacc's knowledge is helpful.
# If you have not used yacc before, Racc is not too difficult.
#
# Here's an example Racc grammar file.
#
#   class Calcparser
#   rule
#     target: exp { print val[0] }
#
#     exp: exp '+' exp
#        | exp '*' exp
#        | '(' exp ')'
#        | NUMBER
#   end
#
# Racc grammar files resemble yacc files.
# But (of course), this is Ruby code.
# yacc's $$ is the 'result', $0, $1... is
# an array called 'val', and $-1, $-2... is an array called '_values'.
#
# See the {Grammar File Reference}[rdoc-ref:lib/racc/rdoc/grammar.en.rdoc] for
# more information on grammar files.
#
# == Parser
#
# Then you must prepare the parse entry method. There are two types of
# parse methods in Racc, Racc::Parser#do_parse and Racc::Parser#yyparse
#
# Racc::Parser#do_parse is simple.
#
# It's yyparse() of yacc, and Racc::Parser#next_token is yylex().
# This method must returns an array like [TOKENSYMBOL, ITS_VALUE].
# EOF is [false, false].
# (TOKENSYMBOL is a Ruby symbol (taken from String#intern) by default.
# If you want to change this, see the grammar reference.
#
# Racc::Parser#yyparse is little complicated, but useful.
# It does not use Racc::Parser#next_token, instead it gets tokens from any iterator.
#
# For example, <code>yyparse(obj, :scan)</code> causes
# calling +obj#scan+, and you can return tokens by yielding them from +obj#scan+.
#
# == Debugging
#
# When debugging, "-v" or/and the "-g" option is helpful.
#
# "-v" creates verbose log file (.output).
# "-g" creates a "Verbose Parser".
# Verbose Parser prints the internal status when parsing.
# But it's _not_ automatic.
# You must use -g option and set +@yydebug+ to +true+ in order to get output.
# -g option only creates the verbose parser.
#
# === Racc reported syntax error.
#
# Isn't there too many "end"?
# grammar of racc file is changed in v0.10.
#
# Racc does not use '%' mark, while yacc uses huge number of '%' marks..
#
# === Racc reported "XXXX conflicts".
#
# Try "racc -v xxxx.y".
# It causes producing racc's internal log file, xxxx.output.
#
# === Generated parsers does not work correctly
#
# Try "racc -g xxxx.y".
# This command let racc generate "debugging parser".
# Then set @yydebug=true in your parser.
# It produces a working log of your parser.
#
# == Re-distributing Racc runtime
#
# A parser, which is created by Racc, requires the Racc runtime module;
# racc/parser.rb.
#
# Ruby 1.8.x comes with Racc runtime module,
# you need NOT distribute Racc runtime files.
#
# If you want to include the Racc runtime module with your parser.
# This can be done by using '-E' option:
#
#   $ racc -E -omyparser.rb myparser.y
#
# This command creates myparser.rb which `includes' Racc runtime.
# Only you must do is to distribute your parser file (myparser.rb).
#
# Note: parser.rb is ruby license, but your parser is not.
# Your own parser is completely yours.
module Racc

  unless defined?(Racc_No_Extensions)
    Racc_No_Extensions = false # :nodoc:
  end

  class Parser

    Racc_Runtime_Version = ::Racc::VERSION
    Racc_Runtime_Core_Version_R = ::Racc::VERSION

    begin
      if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
        require 'jruby'
        require 'racc/cparse-jruby.jar'
        com.headius.racc.Cparse.new.load(JRuby.runtime, false)
      else
        require 'racc/cparse'
      end

      unless new.respond_to?(:_racc_do_parse_c, true)
        raise LoadError, 'old cparse.so'
      end
      if Racc_No_Extensions
        raise LoadError, 'selecting ruby version of racc runtime core'
      end

      Racc_Main_Parsing_Routine    = :_racc_do_parse_c # :nodoc:
      Racc_YY_Parse_Method         = :_racc_yyparse_c # :nodoc:
      Racc_Runtime_Core_Version    = Racc_Runtime_Core_Version_C # :nodoc:
      Racc_Runtime_Type            = 'c' # :nodoc:
    rescue LoadError
      Racc_Main_Parsing_Routine    = :_racc_do_parse_rb
      Racc_YY_Parse_Method         = :_racc_yyparse_rb
      Racc_Runtime_Core_Version    = Racc_Runtime_Core_Version_R
      Racc_Runtime_Type            = 'ruby'
    end

    def Parser.racc_runtime_type # :nodoc:
      Racc_Runtime_Type
    end

    def _racc_setup
      @yydebug = false unless self.class::Racc_debug_parser
      @yydebug = false unless defined?(@yydebug)
      if @yydebug
        @racc_debug_out = $stderr unless defined?(@racc_debug_out)
        @racc_debug_out ||= $stderr
      end
      arg = self.class::Racc_arg
      arg[13] = true if arg.size < 14
      arg
    end

    def _racc_init_sysvars
      @racc_state  = [0]
      @racc_tstack = []
      @racc_vstack = []

      @racc_t = nil
      @racc_val = nil

      @racc_read_next = true

      @racc_user_yyerror = false
      @racc_error_status = 0
    end

    # The entry point of the parser. This method is used with #next_token.
    # If Racc wants to get token (and its value), calls next_token.
    #
    # Example:
    #     def parse
    #       @q = [[1,1],
    #             [2,2],
    #             [3,3],
    #             [false, '$']]
    #       do_parse
    #     end
    #
    #     def next_token
    #       @q.shift
    #     end
    class_eval <<~RUBY, __FILE__, __LINE__ + 1
    def do_parse
      #{Racc_Main_Parsing_Routine}(_racc_setup(), false)
    end
    RUBY

    # The method to fetch next token.
    # If you use #do_parse method, you must implement #next_token.
    #
    # The format of return value is [TOKEN_SYMBOL, VALUE].
    # +token-symbol+ is represented by Ruby's symbol by default, e.g. :IDENT
    # for 'IDENT'.  ";" (String) for ';'.
    #
    # The final symbol (End of file) must be false.
    def next_token
      raise NotImplementedError, "#{self.class}\#next_token is not defined"
    end

    def _racc_do_parse_rb(arg, in_debug)
      action_table, action_check, action_default, action_pointer,
      _,            _,            _,              _,
      _,            _,            token_table,    * = arg

      _racc_init_sysvars
      tok = act = i = nil

      catch(:racc_end_parse) {
        while true
          if i = action_pointer[@racc_state[-1]]
            if @racc_read_next
              if @racc_t != 0   # not EOF
                tok, @racc_val = next_token()
                unless tok      # EOF
                  @racc_t = 0
                else
                  @racc_t = (token_table[tok] or 1)   # error token
                end
                racc_read_token(@racc_t, tok, @racc_val) if @yydebug
                @racc_read_next = false
              end
            end
            i += @racc_t
            unless i >= 0 and
                   act = action_table[i] and
                   action_check[i] == @racc_state[-1]
              act = action_default[@racc_state[-1]]
            end
          else
            act = action_default[@racc_state[-1]]
          end
          while act = _racc_evalact(act, arg)
            ;
          end
        end
      }
    end

    # Another entry point for the parser.
    # If you use this method, you must implement RECEIVER#METHOD_ID method.
    #
    # RECEIVER#METHOD_ID is a method to get next token.
    # It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
    class_eval <<~RUBY, __FILE__, __LINE__ + 1
    def yyparse(recv, mid)
      #{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), false)
    end
    RUBY

    def _racc_yyparse_rb(recv, mid, arg, c_debug)
      action_table, action_check, action_default, action_pointer,
      _,            _,            _,              _,
      _,            _,            token_table,    * = arg

      _racc_init_sysvars

      catch(:racc_end_parse) {
        until i = action_pointer[@racc_state[-1]]
          while act = _racc_evalact(action_default[@racc_state[-1]], arg)
            ;
          end
        end
        recv.__send__(mid) do |tok, val|
          unless tok
            @racc_t = 0
          else
            @racc_t = (token_table[tok] or 1)   # error token
          end
          @racc_val = val
          @racc_read_next = false

          i += @racc_t
          unless i >= 0 and
                 act = action_table[i] and
                 action_check[i] == @racc_state[-1]
            act = action_default[@racc_state[-1]]
          end
          while act = _racc_evalact(act, arg)
            ;
          end

          while !(i = action_pointer[@racc_state[-1]]) ||
                ! @racc_read_next ||
                @racc_t == 0  # $
            unless i and i += @racc_t and
                   i >= 0 and
                   act = action_table[i] and
                   action_check[i] == @racc_state[-1]
              act = action_default[@racc_state[-1]]
            end
            while act = _racc_evalact(act, arg)
              ;
            end
          end
        end
      }
    end

    ###
    ### common
    ###

    def _racc_evalact(act, arg)
      action_table, action_check, _, action_pointer,
      _,            _,            _, _,
      _,            _,            _, shift_n,
      reduce_n,     * = arg
      nerr = 0   # tmp

      if act > 0 and act < shift_n
        #
        # shift
        #
        if @racc_error_status > 0
          @racc_error_status -= 1 unless @racc_t <= 1 # error token or EOF
        end
        @racc_vstack.push @racc_val
        @racc_state.push act
        @racc_read_next = true
        if @yydebug
          @racc_tstack.push @racc_t
          racc_shift @racc_t, @racc_tstack, @racc_vstack
        end

      elsif act < 0 and act > -reduce_n
        #
        # reduce
        #
        code = catch(:racc_jump) {
          @racc_state.push _racc_do_reduce(arg, act)
          false
        }
        if code
          case code
          when 1 # yyerror
            @racc_user_yyerror = true   # user_yyerror
            return -reduce_n
          when 2 # yyaccept
            return shift_n
          else
            raise '[Racc Bug] unknown jump code'
          end
        end

      elsif act == shift_n
        #
        # accept
        #
        racc_accept if @yydebug
        throw :racc_end_parse, @racc_vstack[0]

      elsif act == -reduce_n
        #
        # error
        #
        case @racc_error_status
        when 0
          unless arg[21]    # user_yyerror
            nerr += 1
            on_error @racc_t, @racc_val, @racc_vstack
          end
        when 3
          if @racc_t == 0   # is $
            # We're at EOF, and another error occurred immediately after
            # attempting auto-recovery
            throw :racc_end_parse, nil
          end
          @racc_read_next = true
        end
        @racc_user_yyerror = false
        @racc_error_status = 3
        while true
          if i = action_pointer[@racc_state[-1]]
            i += 1   # error token
            if  i >= 0 and
                (act = action_table[i]) and
                action_check[i] == @racc_state[-1]
              break
            end
          end
          throw :racc_end_parse, nil if @racc_state.size <= 1
          @racc_state.pop
          @racc_vstack.pop
          if @yydebug
            @racc_tstack.pop
            racc_e_pop @racc_state, @racc_tstack, @racc_vstack
          end
        end
        return act

      else
        raise "[Racc Bug] unknown action #{act.inspect}"
      end

      racc_next_state(@racc_state[-1], @racc_state) if @yydebug

      nil
    end

    def _racc_do_reduce(arg, act)
      _,          _,            _,            _,
      goto_table, goto_check,   goto_default, goto_pointer,
      nt_base,    reduce_table, _,            _,
      _,          use_result,   * = arg

      state = @racc_state
      vstack = @racc_vstack
      tstack = @racc_tstack

      i = act * -3
      len       = reduce_table[i]
      reduce_to = reduce_table[i+1]
      method_id = reduce_table[i+2]
      void_array = []

      tmp_t = tstack[-len, len] if @yydebug
      tmp_v = vstack[-len, len]
      tstack[-len, len] = void_array if @yydebug
      vstack[-len, len] = void_array
      state[-len, len]  = void_array

      # tstack must be updated AFTER method call
      if use_result
        vstack.push __send__(method_id, tmp_v, vstack, tmp_v[0])
      else
        vstack.push __send__(method_id, tmp_v, vstack)
      end
      tstack.push reduce_to

      racc_reduce(tmp_t, reduce_to, tstack, vstack) if @yydebug

      k1 = reduce_to - nt_base
      if i = goto_pointer[k1]
        i += state[-1]
        if i >= 0 and (curstate = goto_table[i]) and goto_check[i] == k1
          return curstate
        end
      end
      goto_default[k1]
    end

    # This method is called when a parse error is found.
    #
    # ERROR_TOKEN_ID is an internal ID of token which caused error.
    # You can get string representation of this ID by calling
    # #token_to_str.
    #
    # ERROR_VALUE is a value of error token.
    #
    # value_stack is a stack of symbol values.
    # DO NOT MODIFY this object.
    #
    # This method raises ParseError by default.
    #
    # If this method returns, parsers enter "error recovering mode".
    def on_error(t, val, vstack)
      raise ParseError, sprintf("parse error on value %s (%s)",
                                val.inspect, token_to_str(t) || '?')
    end

    # Enter error recovering mode.
    # This method does not call #on_error.
    def yyerror
      throw :racc_jump, 1
    end

    # Exit parser.
    # Return value is +Symbol_Value_Stack[0]+.
    def yyaccept
      throw :racc_jump, 2
    end

    # Leave error recovering mode.
    def yyerrok
      @racc_error_status = 0
    end

    # For debugging output
    def racc_read_token(t, tok, val)
      @racc_debug_out.print 'read    '
      @racc_debug_out.print tok.inspect, '(', racc_token2str(t), ') '
      @racc_debug_out.puts val.inspect
      @racc_debug_out.puts
    end

    def racc_shift(tok, tstack, vstack)
      @racc_debug_out.puts "shift   #{racc_token2str tok}"
      racc_print_stacks tstack, vstack
      @racc_debug_out.puts
    end

    def racc_reduce(toks, sim, tstack, vstack)
      out = @racc_debug_out
      out.print 'reduce '
      if toks.empty?
        out.print ' <none>'
      else
        toks.each {|t| out.print ' ', racc_token2str(t) }
      end
      out.puts " --> #{racc_token2str(sim)}"
      racc_print_stacks tstack, vstack
      @racc_debug_out.puts
    end

    def racc_accept
      @racc_debug_out.puts 'accept'
      @racc_debug_out.puts
    end

    def racc_e_pop(state, tstack, vstack)
      @racc_debug_out.puts 'error recovering mode: pop token'
      racc_print_states state
      racc_print_stacks tstack, vstack
      @racc_debug_out.puts
    end

    def racc_next_state(curstate, state)
      @racc_debug_out.puts  "goto    #{curstate}"
      racc_print_states state
      @racc_debug_out.puts
    end

    def racc_print_stacks(t, v)
      out = @racc_debug_out
      out.print '        ['
      t.each_index do |i|
        out.print ' (', racc_token2str(t[i]), ' ', v[i].inspect, ')'
      end
      out.puts ' ]'
    end

    def racc_print_states(s)
      out = @racc_debug_out
      out.print '        ['
      s.each {|st| out.print ' ', st }
      out.puts ' ]'
    end

    def racc_token2str(tok)
      self.class::Racc_token_to_s_table[tok] or
          raise "[Racc Bug] can't convert token #{tok} to string"
    end

    # Convert internal ID of token symbol to the string.
    def token_to_str(t)
      self.class::Racc_token_to_s_table[t]
    end

  end

end

...end racc/parser.rb/module_eval...
end
###### racc/parser.rb end
module Lrama
  class Parser < Racc::Parser

module_eval(<<'...end parser.y/module_eval...', 'parser.y', 536)

include Lrama::Report::Duration

def initialize(text, path, debug = false)
  @grammar_file = Lrama::Lexer::GrammarFile.new(path, text)
  @yydebug = debug
  @rule_counter = Lrama::Grammar::Counter.new(0)
  @midrule_action_counter = Lrama::Grammar::Counter.new(1)
end

def parse
  report_duration(:parse) do
    @lexer = Lrama::Lexer.new(@grammar_file)
    @grammar = Lrama::Grammar.new(@rule_counter)
    @precedence_number = 0
    reset_precs
    do_parse
    @grammar
  end
end

def next_token
  @lexer.next_token
end

def on_error(error_token_id, error_value, value_stack)
  if error_value.is_a?(Lrama::Lexer::Token)
    location = error_value.location
    value = "'#{error_value.s_value}'"
  else
    location = @lexer.location
    value = error_value.inspect
  end

  error_message = "parse error on value #{value} (#{token_to_str(error_token_id) || '?'})"

  raise_parse_error(error_message, location)
end

def on_action_error(error_message, error_value)
  if error_value.is_a?(Lrama::Lexer::Token)
    location = error_value.location
  else
    location = @lexer.location
  end

  raise_parse_error(error_message, location)
end

private

def reset_precs
  @prec_seen = false
  @code_after_prec = false
end

def begin_c_declaration(end_symbol)
  @lexer.status = :c_declaration
  @lexer.end_symbol = end_symbol
end

def end_c_declaration
  @lexer.status = :initial
  @lexer.end_symbol = nil
end

def raise_parse_error(error_message, location)
  raise ParseError, location.generate_error_message(error_message)
end
...end parser.y/module_eval...
##### State transition tables begin ###

racc_action_table = [
    98,    51,    99,   163,    88,    79,    51,    51,   180,   163,
    79,    79,    51,   162,   180,   156,    79,   165,   157,    51,
     3,    50,   181,   165,    70,    51,     8,    50,   181,    79,
    75,    51,     6,    50,     7,   161,    82,    47,    51,    51,
    50,    50,    89,    82,    82,   166,    41,    51,   100,    50,
   182,   166,    82,    51,    48,    50,   182,    23,    25,    26,
    27,    28,    29,    30,    31,    32,    33,    34,    35,    36,
    37,    38,    47,    51,    51,    50,    50,    93,    79,   197,
    51,    51,    50,    50,    79,   197,    51,    51,    50,    50,
    79,   197,    23,    25,    26,    27,    28,    29,    30,    31,
    32,    33,    34,    35,    36,    37,    38,     9,    51,    54,
    50,    14,    15,    16,    17,    18,    19,    54,    54,    20,
    21,    22,    23,    25,    26,    27,    28,    29,    30,    31,
    32,    33,    34,    35,    36,    37,    38,    39,    51,    51,
    50,    50,    79,   197,    51,    51,    50,    50,    79,   197,
    51,    51,    50,    50,    79,   197,    51,    51,    50,    50,
    79,    79,    51,    51,    50,    50,    79,    79,    51,    51,
    50,    50,    79,    79,    51,    51,    50,   207,    79,    79,
    51,    51,   207,   207,    79,    79,    51,    51,    50,    50,
    79,   187,   188,   189,    96,   187,   188,   189,    96,   217,
   221,   229,   218,   218,   218,    51,    51,    50,    50,   187,
   188,   189,    57,    58,    59,    60,    61,    62,    63,    64,
    65,    66,    67,    90,    94,    96,   101,   101,   101,   103,
   109,   113,   114,   117,   117,   117,   117,   120,    47,   124,
   125,   127,   129,   130,   131,   132,   133,   136,   140,   141,
   142,   143,   146,   147,   148,   150,   160,   168,   170,   171,
   172,   173,   174,   176,   177,   178,   146,   184,   192,   193,
   200,   160,   204,   176,   211,   160,   215,   216,   178,   176,
   226,   176,   228,    96,    96,   176 ]

racc_action_check = [
    49,   145,    49,   145,    39,   145,   159,   183,   159,   183,
   159,   183,   201,   144,   201,   139,   201,   145,   139,    33,
     1,    33,   159,   183,    33,    34,     3,    34,   201,    34,
    34,    35,     2,    35,     2,   144,    35,     9,    36,    37,
    36,    37,    39,    36,    37,   145,     7,    38,    49,    38,
   159,   183,    38,    15,    14,    15,   201,     9,     9,     9,
     9,     9,     9,     9,     9,     9,     9,     9,     9,     9,
     9,     9,    42,    69,   172,    69,   172,    42,   172,   172,
   173,    70,   173,    70,   173,   173,   174,    81,   174,    81,
   174,   174,    42,    42,    42,    42,    42,    42,    42,    42,
    42,    42,    42,    42,    42,    42,    42,     4,    82,    16,
    82,     4,     4,     4,     4,     4,     4,    17,    18,     4,
     4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
     4,     4,     4,     4,     4,     4,     4,     4,   194,   109,
   194,   109,   194,   194,   198,   111,   198,   111,   198,   198,
   199,   117,   199,   117,   199,   199,    74,    75,    74,    75,
    74,    75,   114,   116,   114,   116,   114,   116,   137,   166,
   137,   166,   137,   166,   182,   184,   182,   184,   182,   184,
   204,   216,   204,   216,   204,   216,   218,   119,   218,   119,
   218,   164,   164,   164,   164,   179,   179,   179,   179,   208,
   214,   223,   208,   214,   223,   134,   138,   134,   138,   209,
   209,   209,    19,    20,    23,    25,    26,    27,    28,    29,
    30,    31,    32,    40,    45,    46,    53,    55,    56,    57,
    68,    72,    73,    80,    85,    86,    87,    88,    89,    95,
    96,   102,   104,   105,   106,   107,   108,   112,   120,   121,
   122,   123,   124,   125,   126,   128,   141,   149,   151,   152,
   153,   154,   155,   156,   157,   158,   161,   163,   167,   169,
   175,   178,   180,   186,   190,   200,   205,   207,   213,   217,
   220,   221,   222,   226,   228,   230 ]

racc_action_pointer = [
   nil,    20,    22,    26,    98,   nil,   nil,    39,   nil,    33,
   nil,   nil,   nil,   nil,    48,    50,    90,    98,    99,   207,
   194,   nil,   nil,   195,   nil,   196,   197,   198,   213,   214,
   215,   216,   217,    16,    22,    28,    35,    36,    44,    -1,
   221,   nil,    68,   nil,   nil,   201,   174,   nil,   nil,    -5,
   nil,   nil,   nil,   207,   nil,   208,   209,   210,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   222,    70,
    78,   nil,   225,   224,   153,   154,   nil,   nil,   nil,   nil,
   225,    84,   105,   nil,   nil,   226,   227,   228,   197,   234,
   nil,   nil,   nil,   nil,   nil,   197,   235,   nil,   nil,   nil,
   nil,   nil,   239,   nil,   240,   241,   242,   243,   244,   136,
   nil,   142,   240,   nil,   159,   nil,   160,   148,   nil,   184,
   243,   207,   239,   249,   206,   201,   252,   nil,   253,   nil,
   nil,   nil,   nil,   nil,   202,   nil,   nil,   165,   203,   -26,
   nil,   210,   nil,   nil,   -10,    -2,   nil,   nil,   nil,   237,
   nil,   238,   239,   240,   241,   242,   255,   259,   220,     3,
   nil,   220,   nil,   227,   143,   nil,   166,   248,   nil,   249,
   nil,   nil,    71,    77,    83,   228,   nil,   nil,   225,   147,
   232,   nil,   171,     4,   172,   nil,   265,   nil,   nil,   nil,
   272,   nil,   nil,   nil,   135,   nil,   nil,   nil,   141,   147,
   229,     9,   nil,   nil,   177,   274,   nil,   237,   158,   161,
   nil,   nil,   nil,   233,   159,   nil,   178,   271,   183,   nil,
   260,   273,   262,   160,   nil,   nil,   232,   nil,   233,   nil,
   277,   nil,   nil ]

racc_action_default = [
    -2,  -138,    -8,  -138,  -138,    -3,    -4,  -138,   233,  -138,
    -9,   -10,   -11,   -12,  -138,  -138,  -138,  -138,  -138,  -138,
  -138,   -24,   -25,  -138,   -29,  -138,  -138,  -138,  -138,  -138,
  -138,  -138,  -138,  -138,  -138,  -138,  -138,  -138,  -138,  -138,
  -138,    -7,  -123,   -96,   -98,  -138,  -120,  -122,   -13,  -127,
   -94,   -95,  -126,   -15,   -85,   -16,   -17,  -138,   -21,   -26,
   -30,   -33,   -36,   -39,   -40,   -41,   -42,   -43,   -44,   -50,
  -138,   -53,   -71,   -45,   -75,  -138,   -78,   -80,   -81,  -135,
   -46,   -88,  -138,   -91,   -93,   -47,   -48,   -49,  -138,  -138,
    -5,    -1,   -97,  -124,   -99,  -138,  -138,   -14,  -128,  -129,
  -130,   -82,  -138,   -18,  -138,  -138,  -138,  -138,  -138,  -138,
   -54,   -51,   -73,   -72,  -138,   -79,   -76,  -138,   -92,   -89,
  -138,  -138,  -138,  -138,  -104,  -138,  -138,   -86,  -138,   -22,
   -27,   -31,   -34,   -37,   -52,   -55,   -74,   -77,   -90,  -138,
   -58,   -62,    -6,  -125,  -100,  -101,  -105,  -121,   -83,  -138,
   -19,  -138,  -138,  -138,  -138,  -138,  -136,  -138,   -57,   -60,
   -63,  -104,  -103,   -94,  -120,  -109,  -138,  -138,   -87,  -138,
   -23,   -28,  -138,  -138,  -138,  -138,  -137,   -59,   -62,  -120,
   -94,   -67,  -138,  -102,  -138,  -106,  -136,  -113,  -114,  -115,
  -138,  -112,   -84,   -20,   -32,  -131,  -133,  -134,   -35,   -38,
   -62,   -61,   -64,   -65,  -138,  -138,   -70,   -94,  -138,  -116,
  -107,  -110,  -132,   -56,  -138,   -68,  -138,  -136,  -138,  -118,
  -138,  -136,  -138,  -138,  -108,  -117,  -120,   -66,  -120,  -119,
  -136,   -69,  -111 ]

racc_goto_table = [
    76,    95,    69,    52,    74,   158,   110,   175,   118,   119,
   145,   208,     1,   212,   186,     2,    43,   212,   212,     4,
    42,    72,    91,    84,    84,    84,    84,     5,    40,   203,
   122,   214,    80,    85,    86,    87,    10,   210,    11,   111,
   115,    76,    12,   223,   138,   116,   118,   183,   110,    92,
    53,    55,    56,   194,   198,   199,    13,    72,    72,   219,
    49,    97,   128,   169,   213,   118,   104,   151,   224,    84,
    84,   110,   227,   105,   152,   106,   153,   107,   134,   154,
    76,   232,   115,   108,   137,   155,    68,    73,   112,   135,
   139,   121,   201,   205,   222,   126,   167,    72,   102,    72,
   149,   144,   190,   115,   220,    84,   123,    84,   nil,   nil,
   nil,   164,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   185,
   nil,   nil,    72,   nil,   nil,   179,    84,   nil,   nil,   nil,
   nil,   nil,   191,   nil,   202,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   206,   164,
   209,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   179,   nil,   nil,
   209,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   230,   209,   231,   225 ]

racc_goto_check = [
    43,    44,    33,    35,    49,    40,    34,    39,    56,    55,
    60,    46,     1,    64,    45,     2,    57,    64,    64,     3,
     4,    35,     5,    35,    35,    35,    35,     6,     7,    45,
     8,    46,    32,    32,    32,    32,     9,    39,    10,    33,
    43,    43,    11,    46,    55,    49,    56,    60,    34,    57,
    15,    15,    15,    21,    21,    21,    12,    35,    35,    45,
    13,    14,    16,    17,    40,    56,    18,    19,    39,    35,
    35,    34,    39,    22,    23,    24,    25,    26,    33,    27,
    43,    39,    43,    28,    49,    29,    30,    31,    36,    37,
    38,    41,    42,    47,    48,    51,    52,    35,    53,    35,
    54,    59,    61,    43,    62,    35,    63,    35,   nil,   nil,
   nil,    43,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    44,
   nil,   nil,    35,   nil,   nil,    43,    35,   nil,   nil,   nil,
   nil,   nil,    43,   nil,    44,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,    43,    43,
    43,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,    43,   nil,   nil,
    43,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,    44,    43,    44,    43 ]

racc_goto_pointer = [
   nil,    12,    15,    17,    11,   -20,    25,    22,   -60,    32,
    34,    38,    52,    45,    12,    34,   -41,   -87,     8,   -62,
   nil,  -119,    14,   -56,    15,   -55,    16,   -53,    21,   -48,
    53,    53,    -3,   -31,   -63,   -12,    16,   -23,   -30,  -149,
  -136,     2,   -86,   -34,   -45,  -150,  -173,   -88,  -121,   -30,
   nil,    -6,   -52,    44,   -27,   -73,   -73,     7,   nil,   -23,
  -114,   -63,  -107,    13,  -181 ]

racc_goto_default = [
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    45,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    24,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,    71,    77,   nil,   nil,   nil,   nil,
   nil,    46,   159,   196,   nil,   nil,   nil,   nil,   nil,   nil,
    78,   nil,   nil,   nil,   nil,    81,    83,   nil,    44,   nil,
   nil,   nil,   nil,   nil,   195 ]

racc_reduce_table = [
  0, 0, :racc_error,
  5, 55, :_reduce_none,
  0, 56, :_reduce_none,
  2, 56, :_reduce_none,
  0, 61, :_reduce_4,
  0, 62, :_reduce_5,
  5, 60, :_reduce_6,
  2, 60, :_reduce_none,
  0, 57, :_reduce_8,
  2, 57, :_reduce_none,
  1, 63, :_reduce_none,
  1, 63, :_reduce_none,
  1, 63, :_reduce_none,
  2, 63, :_reduce_13,
  3, 63, :_reduce_none,
  2, 63, :_reduce_none,
  2, 63, :_reduce_16,
  2, 63, :_reduce_17,
  0, 70, :_reduce_18,
  0, 71, :_reduce_19,
  7, 63, :_reduce_20,
  0, 72, :_reduce_21,
  0, 73, :_reduce_22,
  6, 63, :_reduce_23,
  1, 63, :_reduce_24,
  1, 63, :_reduce_none,
  0, 76, :_reduce_26,
  0, 77, :_reduce_27,
  6, 64, :_reduce_28,
  1, 64, :_reduce_none,
  0, 78, :_reduce_30,
  0, 79, :_reduce_31,
  7, 64, :_reduce_32,
  0, 80, :_reduce_33,
  0, 81, :_reduce_34,
  7, 64, :_reduce_35,
  0, 82, :_reduce_36,
  0, 83, :_reduce_37,
  7, 64, :_reduce_38,
  2, 64, :_reduce_39,
  2, 64, :_reduce_40,
  2, 64, :_reduce_41,
  2, 64, :_reduce_42,
  2, 64, :_reduce_43,
  2, 74, :_reduce_none,
  2, 74, :_reduce_45,
  2, 74, :_reduce_46,
  2, 74, :_reduce_47,
  2, 74, :_reduce_48,
  2, 74, :_reduce_49,
  1, 84, :_reduce_50,
  2, 84, :_reduce_51,
  3, 84, :_reduce_52,
  1, 87, :_reduce_53,
  2, 87, :_reduce_54,
  3, 88, :_reduce_55,
  8, 65, :_reduce_56,
  5, 66, :_reduce_57,
  1, 92, :_reduce_58,
  3, 92, :_reduce_59,
  1, 94, :_reduce_60,
  3, 94, :_reduce_61,
  0, 96, :_reduce_62,
  1, 96, :_reduce_63,
  3, 96, :_reduce_64,
  3, 96, :_reduce_65,
  6, 96, :_reduce_66,
  0, 101, :_reduce_67,
  0, 102, :_reduce_68,
  7, 96, :_reduce_69,
  3, 96, :_reduce_70,
  0, 90, :_reduce_none,
  1, 90, :_reduce_none,
  0, 91, :_reduce_none,
  1, 91, :_reduce_none,
  1, 85, :_reduce_75,
  2, 85, :_reduce_76,
  3, 85, :_reduce_77,
  1, 103, :_reduce_78,
  2, 103, :_reduce_79,
  1, 97, :_reduce_none,
  1, 97, :_reduce_none,
  0, 105, :_reduce_82,
  0, 106, :_reduce_83,
  6, 69, :_reduce_84,
  0, 107, :_reduce_85,
  0, 108, :_reduce_86,
  5, 69, :_reduce_87,
  1, 86, :_reduce_88,
  2, 86, :_reduce_89,
  3, 86, :_reduce_90,
  1, 109, :_reduce_91,
  2, 109, :_reduce_92,
  1, 110, :_reduce_none,
  1, 89, :_reduce_94,
  1, 89, :_reduce_95,
  1, 58, :_reduce_none,
  2, 58, :_reduce_none,
  1, 111, :_reduce_none,
  2, 111, :_reduce_none,
  4, 112, :_reduce_100,
  1, 113, :_reduce_101,
  3, 113, :_reduce_102,
  2, 113, :_reduce_none,
  0, 114, :_reduce_104,
  1, 114, :_reduce_105,
  3, 114, :_reduce_106,
  4, 114, :_reduce_107,
  6, 114, :_reduce_108,
  0, 115, :_reduce_109,
  0, 116, :_reduce_110,
  8, 114, :_reduce_111,
  3, 114, :_reduce_112,
  1, 99, :_reduce_113,
  1, 99, :_reduce_114,
  1, 99, :_reduce_115,
  1, 100, :_reduce_116,
  3, 100, :_reduce_117,
  2, 100, :_reduce_118,
  4, 100, :_reduce_119,
  0, 98, :_reduce_none,
  3, 98, :_reduce_121,
  1, 95, :_reduce_none,
  0, 59, :_reduce_none,
  0, 117, :_reduce_124,
  3, 59, :_reduce_125,
  1, 67, :_reduce_none,
  0, 68, :_reduce_none,
  1, 68, :_reduce_none,
  1, 68, :_reduce_none,
  1, 68, :_reduce_none,
  1, 75, :_reduce_131,
  2, 75, :_reduce_132,
  1, 118, :_reduce_none,
  1, 118, :_reduce_none,
  1, 104, :_reduce_135,
  0, 93, :_reduce_none,
  1, 93, :_reduce_none ]

racc_reduce_n = 138

racc_shift_n = 233

racc_token_table = {
  false => 0,
  :error => 1,
  :C_DECLARATION => 2,
  :CHARACTER => 3,
  :IDENT_COLON => 4,
  :IDENTIFIER => 5,
  :INTEGER => 6,
  :STRING => 7,
  :TAG => 8,
  "%%" => 9,
  "%{" => 10,
  "%}" => 11,
  "%require" => 12,
  "%expect" => 13,
  "%define" => 14,
  "%param" => 15,
  "%lex-param" => 16,
  "%parse-param" => 17,
  "%code" => 18,
  "{" => 19,
  "}" => 20,
  "%initial-action" => 21,
  "%no-stdlib" => 22,
  ";" => 23,
  "%union" => 24,
  "%destructor" => 25,
  "%printer" => 26,
  "%error-token" => 27,
  "%after-shift" => 28,
  "%before-reduce" => 29,
  "%after-reduce" => 30,
  "%after-shift-error-token" => 31,
  "%after-pop-stack" => 32,
  "%token" => 33,
  "%type" => 34,
  "%left" => 35,
  "%right" => 36,
  "%precedence" => 37,
  "%nonassoc" => 38,
  "%rule" => 39,
  "(" => 40,
  ")" => 41,
  ":" => 42,
  "%inline" => 43,
  "," => 44,
  "|" => 45,
  "%empty" => 46,
  "%prec" => 47,
  "?" => 48,
  "+" => 49,
  "*" => 50,
  "[" => 51,
  "]" => 52,
  "{...}" => 53 }

racc_nt_base = 54

racc_use_result_var = true

Racc_arg = [
  racc_action_table,
  racc_action_check,
  racc_action_default,
  racc_action_pointer,
  racc_goto_table,
  racc_goto_check,
  racc_goto_default,
  racc_goto_pointer,
  racc_nt_base,
  racc_reduce_table,
  racc_token_table,
  racc_shift_n,
  racc_reduce_n,
  racc_use_result_var ]
Ractor.make_shareable(Racc_arg) if defined?(Ractor)

Racc_token_to_s_table = [
  "$end",
  "error",
  "C_DECLARATION",
  "CHARACTER",
  "IDENT_COLON",
  "IDENTIFIER",
  "INTEGER",
  "STRING",
  "TAG",
  "\"%%\"",
  "\"%{\"",
  "\"%}\"",
  "\"%require\"",
  "\"%expect\"",
  "\"%define\"",
  "\"%param\"",
  "\"%lex-param\"",
  "\"%parse-param\"",
  "\"%code\"",
  "\"{\"",
  "\"}\"",
  "\"%initial-action\"",
  "\"%no-stdlib\"",
  "\";\"",
  "\"%union\"",
  "\"%destructor\"",
  "\"%printer\"",
  "\"%error-token\"",
  "\"%after-shift\"",
  "\"%before-reduce\"",
  "\"%after-reduce\"",
  "\"%after-shift-error-token\"",
  "\"%after-pop-stack\"",
  "\"%token\"",
  "\"%type\"",
  "\"%left\"",
  "\"%right\"",
  "\"%precedence\"",
  "\"%nonassoc\"",
  "\"%rule\"",
  "\"(\"",
  "\")\"",
  "\":\"",
  "\"%inline\"",
  "\",\"",
  "\"|\"",
  "\"%empty\"",
  "\"%prec\"",
  "\"?\"",
  "\"+\"",
  "\"*\"",
  "\"[\"",
  "\"]\"",
  "\"{...}\"",
  "$start",
  "input",
  "prologue_declarations",
  "bison_declarations",
  "grammar",
  "epilogue_opt",
  "prologue_declaration",
  "@1",
  "@2",
  "bison_declaration",
  "grammar_declaration",
  "rule_declaration",
  "inline_declaration",
  "variable",
  "value",
  "params",
  "@3",
  "@4",
  "@5",
  "@6",
  "symbol_declaration",
  "generic_symlist",
  "@7",
  "@8",
  "@9",
  "@10",
  "@11",
  "@12",
  "@13",
  "@14",
  "token_declarations",
  "symbol_declarations",
  "token_declarations_for_precedence",
  "token_declaration_list",
  "token_declaration",
  "id",
  "int_opt",
  "alias",
  "rule_args",
  "tag_opt",
  "rule_rhs_list",
  "id_colon",
  "rule_rhs",
  "symbol",
  "named_ref_opt",
  "parameterizing_suffix",
  "parameterizing_args",
  "@15",
  "@16",
  "symbol_declaration_list",
  "string_as_id",
  "@17",
  "@18",
  "@19",
  "@20",
  "token_declaration_list_for_precedence",
  "token_declaration_for_precedence",
  "rules_or_grammar_declaration",
  "rules",
  "rhs_list",
  "rhs",
  "@21",
  "@22",
  "@23",
  "generic_symlist_item" ]
Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)

Racc_debug_parser = true

##### State transition tables end #####

# reduce 0 omitted

# reduce 1 omitted

# reduce 2 omitted

# reduce 3 omitted

module_eval(<<'.,.,', 'parser.y', 14)
  def _reduce_4(val, _values, result)
                                begin_c_declaration("%}")
                            @grammar.prologue_first_lineno = @lexer.line

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 19)
  def _reduce_5(val, _values, result)
                                end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 23)
  def _reduce_6(val, _values, result)
                                @grammar.prologue = val[2].s_value

    result
  end
.,.,

# reduce 7 omitted

module_eval(<<'.,.,', 'parser.y', 27)
  def _reduce_8(val, _values, result)
     result = ""
    result
  end
.,.,

# reduce 9 omitted

# reduce 10 omitted

# reduce 11 omitted

# reduce 12 omitted

module_eval(<<'.,.,', 'parser.y', 33)
  def _reduce_13(val, _values, result)
     @grammar.expect = val[1]
    result
  end
.,.,

# reduce 14 omitted

# reduce 15 omitted

module_eval(<<'.,.,', 'parser.y', 38)
  def _reduce_16(val, _values, result)
                             val[1].each {|token|
                           @grammar.lex_param = Grammar::Code::NoReferenceCode.new(type: :lex_param, token_code: token).token_code.s_value
                         }

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 44)
  def _reduce_17(val, _values, result)
                             val[1].each {|token|
                           @grammar.parse_param = Grammar::Code::NoReferenceCode.new(type: :parse_param, token_code: token).token_code.s_value
                         }

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 50)
  def _reduce_18(val, _values, result)
                             begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 54)
  def _reduce_19(val, _values, result)
                             end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 58)
  def _reduce_20(val, _values, result)
                             @grammar.add_percent_code(id: val[1], code: val[4])

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 62)
  def _reduce_21(val, _values, result)
                             begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 66)
  def _reduce_22(val, _values, result)
                             end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 70)
  def _reduce_23(val, _values, result)
                             @grammar.initial_action = Grammar::Code::InitialActionCode.new(type: :initial_action, token_code: val[3])

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 72)
  def _reduce_24(val, _values, result)
     @grammar.no_stdlib = true
    result
  end
.,.,

# reduce 25 omitted

module_eval(<<'.,.,', 'parser.y', 77)
  def _reduce_26(val, _values, result)
                               begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 81)
  def _reduce_27(val, _values, result)
                               end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 85)
  def _reduce_28(val, _values, result)
                               @grammar.set_union(
                             Grammar::Code::NoReferenceCode.new(type: :union, token_code: val[3]),
                             val[3].line
                           )

    result
  end
.,.,

# reduce 29 omitted

module_eval(<<'.,.,', 'parser.y', 93)
  def _reduce_30(val, _values, result)
                               begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 97)
  def _reduce_31(val, _values, result)
                               end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 101)
  def _reduce_32(val, _values, result)
                               @grammar.add_destructor(
                             ident_or_tags: val[6],
                             token_code: val[3],
                             lineno: val[3].line
                           )

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 109)
  def _reduce_33(val, _values, result)
                               begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 113)
  def _reduce_34(val, _values, result)
                               end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 117)
  def _reduce_35(val, _values, result)
                               @grammar.add_printer(
                             ident_or_tags: val[6],
                             token_code: val[3],
                             lineno: val[3].line
                           )

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 125)
  def _reduce_36(val, _values, result)
                               begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 129)
  def _reduce_37(val, _values, result)
                               end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 133)
  def _reduce_38(val, _values, result)
                               @grammar.add_error_token(
                             ident_or_tags: val[6],
                             token_code: val[3],
                             lineno: val[3].line
                           )

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 141)
  def _reduce_39(val, _values, result)
                               @grammar.after_shift = val[1]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 145)
  def _reduce_40(val, _values, result)
                               @grammar.before_reduce = val[1]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 149)
  def _reduce_41(val, _values, result)
                               @grammar.after_reduce = val[1]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 153)
  def _reduce_42(val, _values, result)
                               @grammar.after_shift_error_token = val[1]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 157)
  def _reduce_43(val, _values, result)
                               @grammar.after_pop_stack = val[1]

    result
  end
.,.,

# reduce 44 omitted

module_eval(<<'.,.,', 'parser.y', 163)
  def _reduce_45(val, _values, result)
                              val[1].each {|hash|
                            hash[:tokens].each {|id|
                              @grammar.add_type(id: id, tag: hash[:tag])
                            }
                          }

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 171)
  def _reduce_46(val, _values, result)
                              val[1].each {|hash|
                            hash[:tokens].each {|id|
                              sym = @grammar.add_term(id: id)
                              @grammar.add_left(sym, @precedence_number)
                            }
                          }
                          @precedence_number += 1

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 181)
  def _reduce_47(val, _values, result)
                              val[1].each {|hash|
                            hash[:tokens].each {|id|
                              sym = @grammar.add_term(id: id)
                              @grammar.add_right(sym, @precedence_number)
                            }
                          }
                          @precedence_number += 1

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 191)
  def _reduce_48(val, _values, result)
                              val[1].each {|hash|
                            hash[:tokens].each {|id|
                              sym = @grammar.add_term(id: id)
                              @grammar.add_precedence(sym, @precedence_number)
                            }
                          }
                          @precedence_number += 1

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 201)
  def _reduce_49(val, _values, result)
                              val[1].each {|hash|
                            hash[:tokens].each {|id|
                              sym = @grammar.add_term(id: id)
                              @grammar.add_nonassoc(sym, @precedence_number)
                            }
                          }
                          @precedence_number += 1

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 212)
  def _reduce_50(val, _values, result)
                              val[0].each {|token_declaration|
                            @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: nil, replace: true)
                          }

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 218)
  def _reduce_51(val, _values, result)
                              val[1].each {|token_declaration|
                            @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: val[0], replace: true)
                          }

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 224)
  def _reduce_52(val, _values, result)
                              val[2].each {|token_declaration|
                            @grammar.add_term(id: token_declaration[0], alias_name: token_declaration[2], token_id: token_declaration[1], tag: val[1], replace: true)
                          }

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 229)
  def _reduce_53(val, _values, result)
     result = [val[0]]
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 230)
  def _reduce_54(val, _values, result)
     result = val[0].append(val[1])
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 232)
  def _reduce_55(val, _values, result)
     result = val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 236)
  def _reduce_56(val, _values, result)
                            rule = Grammar::ParameterizingRule::Rule.new(val[1].s_value, val[3], val[7], tag: val[5])
                        @grammar.add_parameterizing_rule(rule)

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 242)
  def _reduce_57(val, _values, result)
                            rule = Grammar::ParameterizingRule::Rule.new(val[2].s_value, [], val[4], is_inline: true)
                        @grammar.add_parameterizing_rule(rule)

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 246)
  def _reduce_58(val, _values, result)
     result = [val[0]]
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 247)
  def _reduce_59(val, _values, result)
     result = val[0].append(val[2])
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 251)
  def _reduce_60(val, _values, result)
                      builder = val[0]
                  result = [builder]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 256)
  def _reduce_61(val, _values, result)
                      builder = val[2]
                  result = val[0].append(builder)

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 262)
  def _reduce_62(val, _values, result)
                  reset_precs
              result = Grammar::ParameterizingRule::Rhs.new

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 267)
  def _reduce_63(val, _values, result)
                  reset_precs
              result = Grammar::ParameterizingRule::Rhs.new

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 272)
  def _reduce_64(val, _values, result)
                  token = val[1]
              token.alias_name = val[2]
              builder = val[0]
              builder.symbols << token
              result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 280)
  def _reduce_65(val, _values, result)
                    builder = val[0]
                builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], location: @lexer.location, args: [val[1]])
                result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 286)
  def _reduce_66(val, _values, result)
                    builder = val[0]
                builder.symbols << Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[3], lhs_tag: val[5])
                result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 292)
  def _reduce_67(val, _values, result)
                  if @prec_seen
                on_action_error("multiple User_code after %prec", val[0])  if @code_after_prec
                @code_after_prec = true
              end
              begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 300)
  def _reduce_68(val, _values, result)
                  end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 304)
  def _reduce_69(val, _values, result)
                  user_code = val[3]
              user_code.alias_name = val[6]
              builder = val[0]
              builder.user_code = user_code
              result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 312)
  def _reduce_70(val, _values, result)
                  sym = @grammar.find_symbol_by_id!(val[2])
              @prec_seen = true
              builder = val[0]
              builder.precedence_sym = sym
              result = builder

    result
  end
.,.,

# reduce 71 omitted

# reduce 72 omitted

# reduce 73 omitted

# reduce 74 omitted

module_eval(<<'.,.,', 'parser.y', 327)
  def _reduce_75(val, _values, result)
                               result = [{tag: nil, tokens: val[0]}]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 331)
  def _reduce_76(val, _values, result)
                               result = [{tag: val[0], tokens: val[1]}]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 335)
  def _reduce_77(val, _values, result)
                             result = val[0].append({tag: val[1], tokens: val[2]})

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 338)
  def _reduce_78(val, _values, result)
     result = [val[0]]
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 339)
  def _reduce_79(val, _values, result)
     result = val[0].append(val[1])
    result
  end
.,.,

# reduce 80 omitted

# reduce 81 omitted

module_eval(<<'.,.,', 'parser.y', 346)
  def _reduce_82(val, _values, result)
                  begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 350)
  def _reduce_83(val, _values, result)
                  end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 354)
  def _reduce_84(val, _values, result)
                  result = val[0].append(val[3])

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 358)
  def _reduce_85(val, _values, result)
                  begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 362)
  def _reduce_86(val, _values, result)
                  end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 366)
  def _reduce_87(val, _values, result)
                  result = [val[2]]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 371)
  def _reduce_88(val, _values, result)
                                             result = [{tag: nil, tokens: val[0]}]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 375)
  def _reduce_89(val, _values, result)
                                             result = [{tag: val[0], tokens: val[1]}]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 379)
  def _reduce_90(val, _values, result)
                                             result = val[0].append({tag: val[1], tokens: val[2]})

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 382)
  def _reduce_91(val, _values, result)
     result = [val[0]]
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 383)
  def _reduce_92(val, _values, result)
     result = val[0].append(val[1])
    result
  end
.,.,

# reduce 93 omitted

module_eval(<<'.,.,', 'parser.y', 387)
  def _reduce_94(val, _values, result)
     on_action_error("ident after %prec", val[0]) if @prec_seen
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 388)
  def _reduce_95(val, _values, result)
     on_action_error("char after %prec", val[0]) if @prec_seen
    result
  end
.,.,

# reduce 96 omitted

# reduce 97 omitted

# reduce 98 omitted

# reduce 99 omitted

module_eval(<<'.,.,', 'parser.y', 398)
  def _reduce_100(val, _values, result)
                 lhs = val[0]
             lhs.alias_name = val[1]
             val[3].each do |builder|
               builder.lhs = lhs
               builder.complete_input
               @grammar.add_rule_builder(builder)
             end

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 409)
  def _reduce_101(val, _values, result)
                    builder = val[0]
                if !builder.line
                  builder.line = @lexer.line - 1
                end
                result = [builder]

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 417)
  def _reduce_102(val, _values, result)
                    builder = val[2]
                if !builder.line
                  builder.line = @lexer.line - 1
                end
                result = val[0].append(builder)

    result
  end
.,.,

# reduce 103 omitted

module_eval(<<'.,.,', 'parser.y', 427)
  def _reduce_104(val, _values, result)
               reset_precs
           result = Grammar::RuleBuilder.new(@rule_counter, @midrule_action_counter)

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 432)
  def _reduce_105(val, _values, result)
               reset_precs
           result = Grammar::RuleBuilder.new(@rule_counter, @midrule_action_counter)

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 437)
  def _reduce_106(val, _values, result)
               token = val[1]
           token.alias_name = val[2]
           builder = val[0]
           builder.add_rhs(token)
           result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 445)
  def _reduce_107(val, _values, result)
               token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], location: @lexer.location, args: [val[1]], lhs_tag: val[3])
           builder = val[0]
           builder.add_rhs(token)
           builder.line = val[1].first_line
           result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 453)
  def _reduce_108(val, _values, result)
               token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[3], lhs_tag: val[5])
           builder = val[0]
           builder.add_rhs(token)
           builder.line = val[1].first_line
           result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 461)
  def _reduce_109(val, _values, result)
               if @prec_seen
             on_action_error("multiple User_code after %prec", val[0])  if @code_after_prec
             @code_after_prec = true
           end
           begin_c_declaration("}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 469)
  def _reduce_110(val, _values, result)
               end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 473)
  def _reduce_111(val, _values, result)
               user_code = val[3]
           user_code.alias_name = val[6]
           user_code.tag = val[7]
           builder = val[0]
           builder.user_code = user_code
           result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 482)
  def _reduce_112(val, _values, result)
               sym = @grammar.find_symbol_by_id!(val[2])
           @prec_seen = true
           builder = val[0]
           builder.precedence_sym = sym
           result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 489)
  def _reduce_113(val, _values, result)
     result = "option"
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 490)
  def _reduce_114(val, _values, result)
     result = "nonempty_list"
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 491)
  def _reduce_115(val, _values, result)
     result = "list"
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 493)
  def _reduce_116(val, _values, result)
     result = [val[0]]
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 494)
  def _reduce_117(val, _values, result)
     result = val[0].append(val[2])
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 495)
  def _reduce_118(val, _values, result)
     result = [Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, location: @lexer.location, args: val[0])]
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 496)
  def _reduce_119(val, _values, result)
     result = [Lrama::Lexer::Token::InstantiateRule.new(s_value: val[0].s_value, location: @lexer.location, args: val[2])]
    result
  end
.,.,

# reduce 120 omitted

module_eval(<<'.,.,', 'parser.y', 499)
  def _reduce_121(val, _values, result)
     result = val[1].s_value
    result
  end
.,.,

# reduce 122 omitted

# reduce 123 omitted

module_eval(<<'.,.,', 'parser.y', 506)
  def _reduce_124(val, _values, result)
                        begin_c_declaration('\Z')
                    @grammar.epilogue_first_lineno = @lexer.line + 1

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 511)
  def _reduce_125(val, _values, result)
                        end_c_declaration
                    @grammar.epilogue = val[2].s_value

    result
  end
.,.,

# reduce 126 omitted

# reduce 127 omitted

# reduce 128 omitted

# reduce 129 omitted

# reduce 130 omitted

module_eval(<<'.,.,', 'parser.y', 522)
  def _reduce_131(val, _values, result)
     result = [val[0]]
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 523)
  def _reduce_132(val, _values, result)
     result = val[0].append(val[1])
    result
  end
.,.,

# reduce 133 omitted

# reduce 134 omitted

module_eval(<<'.,.,', 'parser.y', 528)
  def _reduce_135(val, _values, result)
     result = Lrama::Lexer::Token::Ident.new(s_value: val[0])
    result
  end
.,.,

# reduce 136 omitted

# reduce 137 omitted

def _reduce_none(val, _values, result)
  val[0]
end

  end   # class Parser
end   # module Lrama
