# frozen_string_literal: true
#
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.8.1
# 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.8.1'
  Version = VERSION
  Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
end

end


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

# Racc is an 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', 504)

include Lrama::Tracer::Duration

def initialize(text, path, debug = false, locations = false, define = {})
  @path = path
  @grammar_file = Lrama::Lexer::GrammarFile.new(path, text)
  @yydebug = debug || define.key?('parse.trace')
  @rule_counter = Lrama::Grammar::Counter.new(0)
  @midrule_action_counter = Lrama::Grammar::Counter.new(1)
  @locations = locations
  @define = define
end

def parse
  message = "parse '#{File.basename(@path)}'"
  report_duration(message) do
    @lexer = Lrama::Lexer.new(@grammar_file)
    @grammar = Lrama::Grammar.new(@rule_counter, @locations, @define)
    @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)
  case error_value
  when Lrama::Lexer::Token::Int
    location = error_value.location
    value = "#{error_value.s_value}"
  when Lrama::Lexer::Token::Token
    location = error_value.location
    value = "\"#{error_value.s_value}\""
  when Lrama::Lexer::Token::Base
    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::Base)
    location = error_value.location
  else
    location = @lexer.location
  end

  raise_parse_error(error_message, location)
end

private

def reset_precs
  @opening_prec_seen = false
  @trailing_prec_seen = false
  @code_after_prec = false
end

def prec_seen?
  @opening_prec_seen || @trailing_prec_seen
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,    98,    99,    99,    87,    53,    53,    52,   178,   110,
   110,    97,    53,    53,   184,   178,   110,   110,    53,   181,
   184,   162,   110,     6,   163,   181,   181,    53,    53,    52,
    52,   181,    79,    79,    53,    53,    52,    52,    43,    79,
    79,    53,     4,    52,     5,   110,    88,    94,   182,   125,
   126,   163,   100,   100,   180,   193,   194,   195,   137,   185,
   188,   180,     4,    44,     5,   185,   188,    94,    24,    25,
    26,    27,    28,    29,    30,    31,    32,    46,    33,    34,
    35,    36,    37,    38,    39,    40,    41,    47,    24,    25,
    26,    27,    28,    29,    30,    31,    32,    47,    33,    34,
    35,    36,    37,    38,    39,    40,    41,    12,    13,    50,
    57,    14,    15,    16,    17,    18,    19,    20,    24,    25,
    26,    27,    28,    29,    30,    31,    32,    57,    33,    34,
    35,    36,    37,    38,    39,    40,    41,    12,    13,    57,
    60,    14,    15,    16,    17,    18,    19,    20,    24,    25,
    26,    27,    28,    29,    30,    31,    32,    57,    33,    34,
    35,    36,    37,    38,    39,    40,    41,    53,    53,    52,
    52,   110,   105,    53,    53,    52,    52,   110,   105,    53,
    53,    52,    52,   110,   105,    53,    53,    52,    52,   110,
   105,    53,    53,    52,    52,   110,   110,    53,    53,    52,
   209,   110,   110,    53,    53,   209,    52,   110,   110,    53,
    53,   209,    52,   110,   193,   194,   195,   137,   216,   222,
   229,   217,   217,   217,    53,    53,    52,    52,   193,   194,
   195,    57,    57,    57,    57,    66,    67,    68,    69,    70,
    72,    72,    72,    86,    89,    47,    57,    57,   113,   117,
   117,    79,   123,   124,   131,    47,   133,   137,   139,   143,
   149,   150,   151,   152,   133,   155,   156,   157,   110,   166,
   149,   169,   172,   173,    72,   175,   176,   183,   189,   166,
   196,   137,   200,   202,   137,   166,   211,   166,   137,    72,
   176,   218,   176,    72,    72,   227,   137,    72 ]

racc_action_check = [
    51,    97,    51,    97,    41,    75,   165,    75,   165,    75,
   165,    51,   171,   190,   171,   190,   171,   190,   201,   165,
   201,   148,   201,     1,   148,   171,   190,    36,    37,    36,
    37,   201,    36,    37,    38,    39,    38,    39,     5,    38,
    39,   117,     0,   117,     0,   117,    41,    46,   168,    88,
    88,   168,    51,    97,   165,   177,   177,   177,   177,   171,
   171,   190,     2,     6,     2,   201,   201,    90,    46,    46,
    46,    46,    46,    46,    46,    46,    46,     9,    46,    46,
    46,    46,    46,    46,    46,    46,    46,    10,    90,    90,
    90,    90,    90,    90,    90,    90,    90,    11,    90,    90,
    90,    90,    90,    90,    90,    90,    90,     3,     3,    12,
    14,     3,     3,     3,     3,     3,     3,     3,     3,     3,
     3,     3,     3,     3,     3,     3,     3,    15,     3,     3,
     3,     3,     3,     3,     3,     3,     3,     8,     8,    16,
    17,     8,     8,     8,     8,     8,     8,     8,     8,     8,
     8,     8,     8,     8,     8,     8,     8,    18,     8,     8,
     8,     8,     8,     8,     8,     8,     8,    63,    13,    63,
    13,    63,    63,    64,    73,    64,    73,    64,    64,    65,
    78,    65,    78,    65,    65,   106,    79,   106,    79,   106,
   106,   118,   180,   118,   180,   118,   180,   188,   196,   188,
   196,   188,   196,   202,   217,   202,   217,   202,   217,   218,
   113,   218,   113,   218,   186,   186,   186,   186,   208,   213,
   226,   208,   213,   226,   114,   123,   114,   123,   210,   210,
   210,    24,    25,    26,    27,    28,    29,    30,    31,    32,
    33,    34,    35,    40,    42,    47,    55,    60,    71,    74,
    76,    80,    81,    87,    91,    92,    93,    94,   102,   116,
   124,   125,   126,   127,   133,   136,   137,   138,   144,   150,
   151,   153,   156,   158,   162,   163,   164,   170,   174,   176,
   178,   179,   182,   184,   187,   189,   199,   200,   204,   205,
   207,   209,   212,   214,   216,   221,   222,   228 ]

racc_action_pointer = [
    32,    23,    52,    93,   nil,    31,    63,   nil,   123,    68,
    74,    84,   103,   165,    94,   111,   123,   135,   141,   nil,
   nil,   nil,   nil,   nil,   215,   216,   217,   218,   230,   231,
   232,   233,   234,   232,   233,   234,    24,    25,    31,    32,
   238,    -1,   242,   nil,   nil,   nil,    43,   232,   nil,   nil,
   nil,    -5,   nil,   nil,   nil,   230,   nil,   nil,   nil,   nil,
   231,   nil,   nil,   164,   170,   176,   nil,   nil,   nil,   nil,
   nil,   240,   nil,   171,   241,     2,   242,   nil,   177,   183,
   243,   244,   nil,   nil,   nil,   nil,   nil,   209,    45,   nil,
    63,   245,   242,   243,   202,   nil,   nil,    -4,   nil,   nil,
   nil,   nil,   256,   nil,   nil,   nil,   182,   nil,   nil,   nil,
   nil,   nil,   nil,   207,   221,   nil,   253,    38,   188,   nil,
   nil,   nil,   nil,   222,   255,   215,   218,   252,   nil,   nil,
   nil,   nil,   nil,   251,   nil,   nil,   219,   261,   250,   nil,
   nil,   nil,   nil,   nil,   261,   nil,   nil,   nil,   -24,   nil,
   219,   265,   nil,   269,   nil,   nil,   216,   nil,   256,   nil,
   nil,   nil,   266,   270,   227,     3,   nil,   nil,     3,   nil,
   228,     9,   nil,   nil,   232,   nil,   229,     3,   236,   226,
   189,   nil,   236,   nil,   239,   nil,   162,   229,   194,   235,
    10,   nil,   nil,   nil,   nil,   nil,   195,   nil,   nil,   284,
   237,    15,   200,   nil,   233,   281,   nil,   241,   173,   247,
   176,   nil,   243,   174,   285,   nil,   286,   201,   206,   nil,
   nil,   278,   241,   nil,   nil,   nil,   175,   nil,   289,   nil,
   nil ]

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

racc_goto_table = [
    73,   118,   136,    54,    48,    49,   164,    96,    91,   120,
   121,    93,   187,   148,   107,   111,   112,   119,   134,   171,
    56,    58,    59,     3,    61,     7,    78,    78,    78,    78,
    62,    63,    64,    65,   115,    74,    76,   192,     1,   129,
   168,    95,   187,   118,   118,   207,   204,   201,    77,    83,
    84,    85,   128,   138,   147,    93,   212,   140,   154,   145,
   146,   101,   130,   116,    42,   127,   103,   208,    78,    78,
   219,     9,    51,   213,   141,   142,    45,    71,   159,   144,
   190,   160,   161,   102,   158,   191,   132,   197,   122,   226,
   170,   177,   220,   199,   203,   205,   221,   186,   153,   nil,
   nil,   nil,   nil,   116,   116,   nil,   198,   nil,   nil,   nil,
   nil,   nil,   214,    78,   206,   nil,   177,   nil,   nil,   nil,
   nil,   nil,   210,   nil,   nil,   nil,   nil,   186,   210,   174,
   228,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   225,   210,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   215,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   223,   nil,   224,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   230 ]

racc_goto_check = [
    29,    22,    42,    31,    14,    14,    35,    16,     8,    48,
    48,    13,    40,    34,    24,    24,    24,    45,    52,    54,
    18,    18,    18,     6,    17,     6,    31,    31,    31,    31,
    17,    17,    17,    17,    30,    26,    26,    38,     1,     5,
    34,    14,    40,    22,    22,    35,    38,    54,    27,    27,
    27,    27,     8,    16,    48,    13,    35,    24,    52,    45,
    45,    18,     9,    31,    10,    11,    17,    39,    31,    31,
    38,     7,    15,    39,    30,    30,     7,    25,    32,    33,
    36,    43,    44,    46,    47,    42,    14,    42,    50,    39,
    53,    22,    55,    56,    42,    42,    57,    22,    58,   nil,
   nil,   nil,   nil,    31,    31,   nil,    22,   nil,   nil,   nil,
   nil,   nil,    42,    31,    22,   nil,    22,   nil,   nil,   nil,
   nil,   nil,    22,   nil,   nil,   nil,   nil,    22,    22,    29,
    42,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,    22,    22,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,    29,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,    29,   nil,    29,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,    29 ]

racc_goto_pointer = [
   nil,    38,   nil,   nil,   nil,   -52,    23,    68,   -38,   -29,
    60,   -24,   nil,   -35,    -6,    59,   -44,     6,     6,   nil,
   nil,   nil,   -74,   nil,   -49,    44,     1,    12,   nil,   -33,
   -39,   -10,   -66,   -37,  -111,  -144,   -96,   nil,  -140,  -129,
  -159,   nil,   -92,   -63,   -62,   -58,    26,   -55,   -69,   nil,
     8,   nil,   -75,   -65,  -136,  -118,   -88,  -115,   -33 ]

racc_goto_default = [
   nil,   nil,     2,     8,    90,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,    10,    11,   nil,   nil,   nil,    55,   nil,    21,
    22,    23,   104,   106,   nil,   nil,   nil,   nil,   114,    75,
   nil,   108,   nil,   nil,   nil,   nil,   165,   135,   nil,   nil,
   179,   167,   nil,   109,   nil,   nil,   nil,   nil,    81,    80,
    82,    92,   nil,   nil,   nil,   nil,   nil,   nil,   nil ]

racc_reduce_table = [
  0, 0, :racc_error,
  0, 64, :_reduce_1,
  2, 64, :_reduce_2,
  0, 65, :_reduce_3,
  2, 65, :_reduce_4,
  1, 66, :_reduce_5,
  2, 66, :_reduce_6,
  0, 67, :_reduce_none,
  1, 67, :_reduce_none,
  5, 59, :_reduce_none,
  0, 68, :_reduce_10,
  0, 69, :_reduce_11,
  5, 60, :_reduce_12,
  2, 60, :_reduce_13,
  0, 72, :_reduce_14,
  2, 72, :_reduce_15,
  2, 61, :_reduce_none,
  2, 61, :_reduce_none,
  1, 76, :_reduce_18,
  2, 76, :_reduce_19,
  2, 70, :_reduce_20,
  3, 70, :_reduce_21,
  5, 70, :_reduce_22,
  2, 70, :_reduce_none,
  2, 70, :_reduce_24,
  2, 70, :_reduce_25,
  3, 70, :_reduce_26,
  2, 70, :_reduce_27,
  1, 70, :_reduce_28,
  1, 70, :_reduce_29,
  1, 81, :_reduce_30,
  1, 81, :_reduce_31,
  1, 82, :_reduce_32,
  2, 82, :_reduce_33,
  1, 71, :_reduce_none,
  1, 71, :_reduce_none,
  1, 71, :_reduce_none,
  2, 71, :_reduce_37,
  3, 71, :_reduce_38,
  3, 71, :_reduce_39,
  3, 71, :_reduce_40,
  2, 71, :_reduce_41,
  2, 71, :_reduce_42,
  2, 71, :_reduce_43,
  2, 71, :_reduce_44,
  2, 71, :_reduce_45,
  2, 77, :_reduce_none,
  2, 77, :_reduce_47,
  2, 77, :_reduce_48,
  2, 77, :_reduce_49,
  2, 77, :_reduce_50,
  2, 77, :_reduce_51,
  2, 77, :_reduce_52,
  2, 77, :_reduce_53,
  0, 87, :_reduce_none,
  1, 87, :_reduce_none,
  1, 88, :_reduce_56,
  2, 88, :_reduce_57,
  2, 83, :_reduce_58,
  3, 83, :_reduce_59,
  0, 91, :_reduce_none,
  1, 91, :_reduce_none,
  3, 86, :_reduce_62,
  8, 78, :_reduce_63,
  5, 79, :_reduce_64,
  8, 79, :_reduce_65,
  1, 92, :_reduce_66,
  3, 92, :_reduce_67,
  1, 93, :_reduce_68,
  3, 93, :_reduce_69,
  0, 99, :_reduce_none,
  1, 99, :_reduce_none,
  0, 100, :_reduce_none,
  1, 100, :_reduce_none,
  1, 94, :_reduce_74,
  3, 94, :_reduce_75,
  3, 94, :_reduce_76,
  6, 94, :_reduce_77,
  3, 94, :_reduce_78,
  3, 94, :_reduce_79,
  0, 102, :_reduce_none,
  1, 102, :_reduce_none,
  1, 90, :_reduce_82,
  1, 103, :_reduce_83,
  2, 103, :_reduce_84,
  2, 84, :_reduce_85,
  3, 84, :_reduce_86,
  1, 80, :_reduce_none,
  1, 80, :_reduce_none,
  0, 104, :_reduce_89,
  0, 105, :_reduce_90,
  5, 75, :_reduce_91,
  1, 106, :_reduce_92,
  2, 106, :_reduce_93,
  2, 107, :_reduce_94,
  1, 108, :_reduce_95,
  2, 108, :_reduce_96,
  1, 85, :_reduce_97,
  1, 85, :_reduce_98,
  3, 85, :_reduce_99,
  1, 89, :_reduce_none,
  1, 89, :_reduce_none,
  1, 110, :_reduce_102,
  2, 110, :_reduce_103,
  2, 62, :_reduce_none,
  2, 62, :_reduce_none,
  4, 109, :_reduce_106,
  1, 111, :_reduce_107,
  3, 111, :_reduce_108,
  0, 112, :_reduce_109,
  2, 112, :_reduce_110,
  3, 112, :_reduce_111,
  5, 112, :_reduce_112,
  7, 112, :_reduce_113,
  4, 112, :_reduce_114,
  3, 112, :_reduce_115,
  1, 96, :_reduce_116,
  1, 96, :_reduce_117,
  1, 96, :_reduce_118,
  0, 113, :_reduce_none,
  1, 113, :_reduce_none,
  2, 97, :_reduce_121,
  3, 97, :_reduce_122,
  4, 97, :_reduce_123,
  0, 114, :_reduce_124,
  0, 115, :_reduce_125,
  5, 98, :_reduce_126,
  3, 95, :_reduce_127,
  0, 116, :_reduce_128,
  3, 63, :_reduce_129,
  1, 73, :_reduce_none,
  0, 74, :_reduce_none,
  1, 74, :_reduce_none,
  1, 74, :_reduce_none,
  1, 74, :_reduce_none,
  1, 101, :_reduce_135 ]

racc_reduce_n = 136

racc_shift_n = 231

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,
  ";" => 13,
  "%expect" => 14,
  "%define" => 15,
  "{" => 16,
  "}" => 17,
  "%param" => 18,
  "%lex-param" => 19,
  "%parse-param" => 20,
  "%code" => 21,
  "%initial-action" => 22,
  "%no-stdlib" => 23,
  "%locations" => 24,
  "%union" => 25,
  "%destructor" => 26,
  "%printer" => 27,
  "%error-token" => 28,
  "%after-shift" => 29,
  "%before-reduce" => 30,
  "%after-reduce" => 31,
  "%after-shift-error-token" => 32,
  "%after-pop-stack" => 33,
  "-temp-group" => 34,
  "%token" => 35,
  "%type" => 36,
  "%nterm" => 37,
  "%left" => 38,
  "%right" => 39,
  "%precedence" => 40,
  "%nonassoc" => 41,
  "%start" => 42,
  "%rule" => 43,
  "(" => 44,
  ")" => 45,
  ":" => 46,
  "%inline" => 47,
  "," => 48,
  "|" => 49,
  "%empty" => 50,
  "%prec" => 51,
  "?" => 52,
  "+" => 53,
  "*" => 54,
  "[" => 55,
  "]" => 56,
  "{...}" => 57 }

racc_nt_base = 58

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\"",
  "\"%locations\"",
  "\"%union\"",
  "\"%destructor\"",
  "\"%printer\"",
  "\"%error-token\"",
  "\"%after-shift\"",
  "\"%before-reduce\"",
  "\"%after-reduce\"",
  "\"%after-shift-error-token\"",
  "\"%after-pop-stack\"",
  "\"-temp-group\"",
  "\"%token\"",
  "\"%type\"",
  "\"%nterm\"",
  "\"%left\"",
  "\"%right\"",
  "\"%precedence\"",
  "\"%nonassoc\"",
  "\"%start\"",
  "\"%rule\"",
  "\"(\"",
  "\")\"",
  "\":\"",
  "\"%inline\"",
  "\",\"",
  "\"|\"",
  "\"%empty\"",
  "\"%prec\"",
  "\"?\"",
  "\"+\"",
  "\"*\"",
  "\"[\"",
  "\"]\"",
  "\"{...}\"",
  "$start",
  "input",
  "prologue_declaration",
  "bison_declaration",
  "rules_or_grammar_declaration",
  "epilogue_declaration",
  "\"-many@prologue_declaration\"",
  "\"-many@bison_declaration\"",
  "\"-many1@rules_or_grammar_declaration\"",
  "\"-option@epilogue_declaration\"",
  "@1",
  "@2",
  "parser_option",
  "grammar_declaration",
  "\"-many@;\"",
  "variable",
  "value",
  "param",
  "\"-many1@param\"",
  "symbol_declaration",
  "rule_declaration",
  "inline_declaration",
  "symbol",
  "\"-group@symbol|TAG\"",
  "\"-many1@-group@symbol|TAG\"",
  "token_declarations",
  "symbol_declarations",
  "token_declarations_for_precedence",
  "token_declaration",
  "\"-option@TAG\"",
  "\"-many1@token_declaration\"",
  "id",
  "alias",
  "\"-option@INTEGER\"",
  "rule_args",
  "rule_rhs_list",
  "rule_rhs",
  "named_ref",
  "parameterized_suffix",
  "parameterized_args",
  "action",
  "\"-option@%empty\"",
  "\"-option@named_ref\"",
  "string_as_id",
  "\"-option@string_as_id\"",
  "\"-many1@symbol\"",
  "@3",
  "@4",
  "\"-many1@id\"",
  "\"-group@TAG-\\\"-many1@id\\\"\"",
  "\"-many1@-group@TAG-\\\"-many1@id\\\"\"",
  "rules",
  "\"-many1@;\"",
  "rhs_list",
  "rhs",
  "\"-option@parameterized_suffix\"",
  "@5",
  "@6",
  "@7" ]
Ractor.make_shareable(Racc_token_to_s_table) if defined?(Ractor)

Racc_debug_parser = true

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

# reduce 0 omitted

module_eval(<<'.,.,', 'parser.y', 11)
  def _reduce_1(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 11)
  def _reduce_2(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 11)
  def _reduce_3(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 11)
  def _reduce_4(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 11)
  def _reduce_5(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 11)
  def _reduce_6(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

# reduce 7 omitted

# reduce 8 omitted

# reduce 9 omitted

module_eval(<<'.,.,', 'parser.y', 13)
  def _reduce_10(val, _values, result)
              begin_c_declaration("%}")

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 17)
  def _reduce_11(val, _values, result)
              end_c_declaration

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 21)
  def _reduce_12(val, _values, result)
              @grammar.prologue_first_lineno = val[0].first_line
          @grammar.prologue = val[2].s_value

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 26)
  def _reduce_13(val, _values, result)
              @grammar.required = true

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 34)
  def _reduce_14(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 34)
  def _reduce_15(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

# reduce 16 omitted

# reduce 17 omitted

module_eval(<<'.,.,', 'parser.y', 77)
  def _reduce_18(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 77)
  def _reduce_19(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 36)
  def _reduce_20(val, _values, result)
              @grammar.expect = val[1].s_value

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 40)
  def _reduce_21(val, _values, result)
              @grammar.define[val[1].s_value] = val[2]&.s_value

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 44)
  def _reduce_22(val, _values, result)
              @grammar.define[val[1].s_value] = val[3]&.s_value

    result
  end
.,.,

# reduce 23 omitted

module_eval(<<'.,.,', 'parser.y', 49)
  def _reduce_24(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', 55)
  def _reduce_25(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', 61)
  def _reduce_26(val, _values, result)
              @grammar.add_percent_code(id: val[1], code: val[2])

    result
  end
.,.,

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

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 69)
  def _reduce_28(val, _values, result)
              @grammar.no_stdlib = true

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 73)
  def _reduce_29(val, _values, result)
              @grammar.locations = true

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 133)
  def _reduce_30(val, _values, result)
    result = val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 133)
  def _reduce_31(val, _values, result)
    result = val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 133)
  def _reduce_32(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 133)
  def _reduce_33(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

# reduce 34 omitted

# reduce 35 omitted

# reduce 36 omitted

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

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 89)
  def _reduce_38(val, _values, result)
              @grammar.add_destructor(
            ident_or_tags: val[2].flatten,
            token_code: val[1],
            lineno: val[1].line
          )

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 97)
  def _reduce_39(val, _values, result)
              @grammar.add_printer(
            ident_or_tags: val[2].flatten,
            token_code: val[1],
            lineno: val[1].line
          )

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 105)
  def _reduce_40(val, _values, result)
              @grammar.add_error_token(
            ident_or_tags: val[2].flatten,
            token_code: val[1],
            lineno: val[1].line
          )

    result
  end
.,.,

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

    result
  end
.,.,

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

    result
  end
.,.,

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

    result
  end
.,.,

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

    result
  end
.,.,

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

    result
  end
.,.,

# reduce 46 omitted

module_eval(<<'.,.,', 'parser.y', 136)
  def _reduce_47(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', 144)
  def _reduce_48(val, _values, result)
              val[1].each {|hash|
            hash[:tokens].each {|id|
              if @grammar.find_term_by_s_value(id.s_value)
                on_action_error("symbol #{id.s_value} redeclared as a nonterminal", id)
              else
                @grammar.add_type(id: id, tag: hash[:tag])
              end
            }
          }

    result
  end
.,.,

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

    result
  end
.,.,

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

    result
  end
.,.,

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

    result
  end
.,.,

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

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 196)
  def _reduce_53(val, _values, result)
              @grammar.set_start_nterm(val[1])

    result
  end
.,.,

# reduce 54 omitted

# reduce 55 omitted

module_eval(<<'.,.,', 'parser.y', 214)
  def _reduce_56(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 214)
  def _reduce_57(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 202)
  def _reduce_58(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]&.s_value, tag: val[0], replace: true)
          }

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 208)
  def _reduce_59(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]&.s_value, tag: val[1], replace: true)
          }

    result
  end
.,.,

# reduce 60 omitted

# reduce 61 omitted

module_eval(<<'.,.,', 'parser.y', 213)
  def _reduce_62(val, _values, result)
     result = val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 218)
  def _reduce_63(val, _values, result)
              rule = Grammar::Parameterized::Rule.new(val[1].s_value, val[3], val[7], tag: val[5])
          @grammar.add_parameterized_rule(rule)

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 225)
  def _reduce_64(val, _values, result)
              rule = Grammar::Parameterized::Rule.new(val[2].s_value, [], val[4], is_inline: true)
          @grammar.add_parameterized_rule(rule)

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 230)
  def _reduce_65(val, _values, result)
              rule = Grammar::Parameterized::Rule.new(val[2].s_value, val[4], val[7], is_inline: true)
          @grammar.add_parameterized_rule(rule)

    result
  end
.,.,

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

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

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

    result
  end
.,.,

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

    result
  end
.,.,

# reduce 70 omitted

# reduce 71 omitted

# reduce 72 omitted

# reduce 73 omitted

module_eval(<<'.,.,', 'parser.y', 253)
  def _reduce_74(val, _values, result)
              reset_precs
          result = Grammar::Parameterized::Rhs.new

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 258)
  def _reduce_75(val, _values, result)
              on_action_error("intermediate %prec in a rule", val[1]) if @trailing_prec_seen
          token = val[1]
          token.alias_name = val[2]
          builder = val[0]
          builder.symbols << token
          result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 267)
  def _reduce_76(val, _values, result)
              on_action_error("intermediate %prec in a rule", val[1]) if @trailing_prec_seen
          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', 274)
  def _reduce_77(val, _values, result)
              on_action_error("intermediate %prec in a rule", val[1]) if @trailing_prec_seen
          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', 281)
  def _reduce_78(val, _values, result)
              user_code = val[1]
          user_code.alias_name = val[2]
          builder = val[0]
          builder.user_code = user_code
          result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 289)
  def _reduce_79(val, _values, result)
              on_action_error("multiple %prec in a rule", val[0]) if prec_seen?
          sym = @grammar.find_symbol_by_id!(val[2])
          if val[0].rhs.empty?
            @opening_prec_seen = true
          else
            @trailing_prec_seen = true
          end
          builder = val[0]
          builder.precedence_sym = sym
          result = builder

    result
  end
.,.,

# reduce 80 omitted

# reduce 81 omitted

module_eval(<<'.,.,', 'parser.y', 301)
  def _reduce_82(val, _values, result)
     result = val[0].s_value if val[0]
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 315)
  def _reduce_83(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 315)
  def _reduce_84(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 306)
  def _reduce_85(val, _values, result)
              result = if val[0]
            [{tag: val[0], tokens: val[1]}]
          else
            [{tag: nil, tokens: val[1]}]
          end

    result
  end
.,.,

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

# reduce 87 omitted

# reduce 88 omitted

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

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 325)
  def _reduce_90(val, _values, result)
              end_c_declaration

    result
  end
.,.,

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

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 338)
  def _reduce_92(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 338)
  def _reduce_93(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 338)
  def _reduce_94(val, _values, result)
    result = val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 338)
  def _reduce_95(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 338)
  def _reduce_96(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

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

module_eval(<<'.,.,', 'parser.y', 334)
  def _reduce_98(val, _values, result)
     result = val[0].map {|tag, ids| {tag: tag, tokens: ids} }
    result
  end
.,.,

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

# reduce 100 omitted

# reduce 101 omitted

module_eval(<<'.,.,', 'parser.y', 346)
  def _reduce_102(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 346)
  def _reduce_103(val, _values, result)
    result = val[1] ? val[1].unshift(val[0]) : val
    result
  end
.,.,

# reduce 104 omitted

# reduce 105 omitted

module_eval(<<'.,.,', 'parser.y', 348)
  def _reduce_106(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', 360)
  def _reduce_107(val, _values, result)
              if val[0].rhs.count > 1
            empties = val[0].rhs.select { |sym| sym.is_a?(Lrama::Lexer::Token::Empty) }
            empties.each do |empty|
              on_action_error("%empty on non-empty rule", empty)
            end
          end
          builder = val[0]
          if !builder.line
            builder.line = @lexer.line - 1
          end
          result = [builder]

    result
  end
.,.,

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

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 384)
  def _reduce_109(val, _values, result)
              reset_precs
          result = @grammar.create_rule_builder(@rule_counter, @midrule_action_counter)

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 389)
  def _reduce_110(val, _values, result)
              builder = val[0]
          builder.add_rhs(Lrama::Lexer::Token::Empty.new(location: @lexer.location))
          result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 395)
  def _reduce_111(val, _values, result)
              on_action_error("intermediate %prec in a rule", val[1]) if @trailing_prec_seen
          token = val[1]
          token.alias_name = val[2]
          builder = val[0]
          builder.add_rhs(token)
          result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 404)
  def _reduce_112(val, _values, result)
              on_action_error("intermediate %prec in a rule", val[1]) if @trailing_prec_seen
          token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[2], alias_name: val[3], location: @lexer.location, args: [val[1]], lhs_tag: val[4])
          builder = val[0]
          builder.add_rhs(token)
          builder.line = val[1].first_line
          result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 413)
  def _reduce_113(val, _values, result)
              on_action_error("intermediate %prec in a rule", val[1]) if @trailing_prec_seen
          token = Lrama::Lexer::Token::InstantiateRule.new(s_value: val[1].s_value, alias_name: val[5], location: @lexer.location, args: val[3], lhs_tag: val[6])
          builder = val[0]
          builder.add_rhs(token)
          builder.line = val[1].first_line
          result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 422)
  def _reduce_114(val, _values, result)
              user_code = val[1]
          user_code.alias_name = val[2]
          user_code.tag = val[3]
          builder = val[0]
          builder.user_code = user_code
          result = builder

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 431)
  def _reduce_115(val, _values, result)
              on_action_error("multiple %prec in a rule", val[0]) if prec_seen?
          sym = @grammar.find_symbol_by_id!(val[2])
          if val[0].rhs.empty?
            @opening_prec_seen = true
          else
            @trailing_prec_seen = true
          end
          builder = val[0]
          builder.precedence_sym = sym
          result = builder

    result
  end
.,.,

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

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

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

# reduce 119 omitted

# reduce 120 omitted

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

    result
  end
.,.,

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

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

module_eval(<<'.,.,', 'parser.y', 463)
  def _reduce_124(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', 471)
  def _reduce_125(val, _values, result)
              end_c_declaration

    result
  end
.,.,

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

    result
  end
.,.,

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

module_eval(<<'.,.,', 'parser.y', 483)
  def _reduce_128(val, _values, result)
              begin_c_declaration('\Z')

    result
  end
.,.,

module_eval(<<'.,.,', 'parser.y', 487)
  def _reduce_129(val, _values, result)
              end_c_declaration
          @grammar.epilogue_first_lineno = val[0].first_line + 1
          @grammar.epilogue = val[2].s_value

    result
  end
.,.,

# reduce 130 omitted

# reduce 131 omitted

# reduce 132 omitted

# reduce 133 omitted

# reduce 134 omitted

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

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

  end   # class Parser
end   # module Lrama
