# # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.4.9 # from Racc grammer file "". # require 'racc/parser.rb' module Hotcell class Parser < Racc::Parser module_eval(<<'...end parser.y/module_eval...', 'parser.y', 224) OPERATIONS = { '+' => :PLUS, '-' => :MINUS, '*' => :MULTIPLY, '**' => :POWER, '/' => :DIVIDE, '%' => :MODULO, '&&' => :AND, '||' => :OR, '!' => :NOT, '==' => :EQUAL, '!=' => :INEQUAL, '>' => :GT, '>=' => :GTE, '<' => :LT, '<=' => :LTE, '=' => :ASSIGN, ',' => :COMMA, '.' => :PERIOD, ':' => :COLON, '?' => :QUESTION, ';' => :SEMICOLON } BOPEN = { '[' => :AOPEN, '{' => :HOPEN, '(' => :POPEN } BCLOSE = { ']' => :ACLOSE, '}' => :HCLOSE, ')' => :PCLOSE } NEWLINE_PRED = Set.new(BOPEN.values + OPERATIONS.values) NEWLINE_NEXT = Set.new(BCLOSE.values + [:NEWLINE]) TAG_MODES = { '!' => :silence, '^' => :escape, 'e' => :escape, '~' => :normal, 'r' => :normal } def initialize source, options = {} @source = Source.wrap(source) @lexer = Lexer.new(source) @tokens = @lexer.tokens @position = -1 @commands = options[:commands] || {} @blocks = options[:blocks] || {} @endblocks = Set.new(@blocks.keys.map { |identifer| "end#{identifer}" }) @escape_tags = !!options[:escape_tags] @substack = [] @posstack = [] end def build klass, *args options = args.extract_options! options[:source] = @source klass.build *args.push(options) end def pospoppush pop, push = 0 # because fuck the brains, that's why! last = @posstack.pop reduced = @posstack.push(@posstack.pop(pop)[push])[-1] @posstack.push last reduced end def tag_modes tag, default = :normal mode = tag.gsub(/^{{/, '').first TAG_MODES[mode] || default end def parse children = @tokens.size.zero? ? [] : do_parse build Joiner, :JOINER, *children, position: 0 end def next_token @position = @position + 1 tcurr = @tokens[@position] if tcurr && (tcurr[0] == :COMMENT || tcurr[0] == :NEWLINE && ( ((tpred = @tokens[@position.pred]) && NEWLINE_PRED.include?(tpred[0])) || ((tnext = @tokens[@position.next]) && NEWLINE_NEXT.include?(tnext[0])) )) next_token else if tcurr @posstack << tcurr[1][1] tcurr = [tcurr[0], tcurr[1][0]] end if tcurr && tcurr[0] == :IDENTIFER if @commands.key?(tcurr[1]) [:COMMAND, tcurr[1]] elsif @blocks.key?(tcurr[1]) @substack.push(@blocks[tcurr[1]].subcommands) [:BLOCK, tcurr[1]] elsif @substack.last && @substack.last.key?(tcurr[1]) [:SUBCOMMAND, tcurr[1]] elsif @endblocks.include?(tcurr[1]) @substack.pop [:ENDBLOCK, tcurr[1]] elsif tcurr[1] == 'end' @substack.pop [:END, tcurr[1]] else tcurr end else tcurr || [false, false] end end end def on_error(token, value, vstack) raise Hotcell::UnexpectedLexem.new("#{token_to_str(token) || '?'} `#{value}`", *@source.info(@posstack.last).values_at(:line, :column)) end ...end parser.y/module_eval... ##### State transition tables begin ### racc_action_table = [ 46, 10, 26, 103, 117, 63, 114, 64, 25, 24, 55, 56, 114, 149, 115, 152, 46, 153, 26, 139, 64, 64, 117, 101, 25, 24, 148, 64, 115, 69, 7, 8, 150, 161, 162, 27, 116, 38, 39, 40, 41, 42, 43, 44, 45, 69, 7, 8, 47, 55, 56, 27, 154, 38, 39, 40, 41, 42, 43, 44, 45, 46, 142, 26, 47, 7, 48, 86, 87, 25, 24, 72, 67, 71, 73, 76, 74, 75, 46, 96, 26, 65, 95, 98, 21, 22, 25, 24, 12, 14, 16, 53, 18, 86, 87, 117, 27, 72, 38, 39, 40, 41, 42, 43, 44, 45, 103, 69, 159, 47, 86, 87, nil, 27, 72, 38, 39, 40, 41, 42, 43, 44, 45, 46, 144, 26, 47, 143, 98, 86, 87, 25, 24, 72, nil, 71, 73, 76, 74, 75, 86, 87, 86, 87, 72, 46, 72, 26, 71, 73, 76, nil, 59, 25, 24, 55, 56, nil, 27, 54, 38, 39, 40, 41, 42, 43, 44, 45, 21, 22, 46, 47, 26, nil, 69, 7, 48, nil, 25, 24, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 86, 87, 147, 47, 46, nil, 26, 86, 87, 59, nil, 72, 25, 24, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 86, 87, 46, 47, 26, 86, 87, nil, 59, 72, 25, 24, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, 69, 25, 24, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, 59, nil, 25, 24, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, 69, 25, 24, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, 69, nil, 25, 24, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, 69, 25, 24, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, 69, nil, 25, 24, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, 69, 25, 24, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, 69, nil, 25, 24, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, 69, 25, 24, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 21, 22, 46, 47, 26, nil, 69, nil, nil, nil, 25, 24, 27, 93, 38, 39, 40, 41, 42, 43, 44, 45, nil, nil, 46, 47, 26, nil, nil, nil, nil, 69, 25, 24, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, 69, nil, 25, 24, nil, 99, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, 69, 25, 24, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 21, 22, nil, 47, 12, 14, 16, 104, 18, 106, 107, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, nil, 25, 24, nil, nil, nil, 86, 87, nil, 46, 72, 26, 71, 73, 76, 74, 75, 25, 24, 86, 87, nil, 69, 72, nil, 71, 73, 76, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 69, nil, nil, 47, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, nil, 25, 24, nil, nil, nil, 86, 87, nil, 46, 72, 26, 71, 73, 76, 74, 75, 25, 24, nil, nil, nil, 69, nil, nil, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 69, nil, nil, 47, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, nil, 25, 24, nil, nil, nil, nil, nil, nil, 46, nil, 26, nil, nil, nil, nil, nil, 25, 24, nil, nil, nil, 69, nil, nil, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 69, nil, nil, 47, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, nil, 25, 24, nil, nil, nil, nil, nil, nil, nil, nil, 46, nil, 26, nil, nil, nil, nil, nil, 25, 24, nil, 69, nil, nil, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, nil, 14, 69, 47, 18, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, nil, 25, 24, nil, nil, nil, nil, nil, nil, 46, nil, 26, nil, nil, nil, nil, nil, 25, 24, nil, nil, nil, 59, nil, nil, nil, nil, nil, 27, 121, 38, 39, 40, 41, 42, 43, 44, 45, 69, nil, nil, 47, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, nil, 25, 24, nil, nil, nil, nil, nil, nil, 46, nil, 26, nil, nil, nil, nil, nil, 25, 24, nil, nil, nil, 69, nil, nil, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 69, nil, nil, 47, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, nil, 25, 24, nil, nil, nil, nil, nil, nil, 46, nil, 26, nil, nil, nil, nil, nil, 25, 24, nil, nil, nil, 69, nil, nil, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 69, nil, nil, 47, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, nil, nil, 25, 24, nil, nil, nil, nil, nil, nil, 46, nil, 26, nil, nil, nil, nil, nil, 25, 24, nil, nil, nil, 69, nil, nil, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 69, nil, nil, 47, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 46, nil, 26, 47, nil, nil, 86, 87, 25, 24, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 78, 88, 85, nil, nil, 59, nil, nil, nil, nil, nil, 27, nil, 38, 39, 40, 41, 42, 43, 44, 45, 86, 87, nil, 47, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 78, 88, 85, 86, 87, 160, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 78, 88, 85, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 78, 88, 85, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 78, 88, 85, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 78, 88, 85, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 78, 88, 85, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 78, -106, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84, 77, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, -106, -106, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, -106, -106, 86, 87, nil, nil, 72, nil, 71, 73, 76, 74, 75, 79, 80, 81, 82, 83, 84 ] racc_action_check = [ 115, 1, 115, 47, 102, 16, 69, 139, 115, 115, 146, 146, 59, 100, 59, 105, 114, 107, 114, 86, 16, 69, 61, 47, 114, 114, 100, 59, 103, 115, 1, 1, 102, 140, 146, 115, 60, 115, 115, 115, 115, 115, 115, 115, 115, 114, 0, 0, 115, 92, 92, 114, 108, 114, 114, 114, 114, 114, 114, 114, 114, 8, 92, 8, 114, 9, 9, 131, 131, 8, 8, 131, 20, 131, 131, 131, 131, 131, 160, 45, 160, 17, 45, 45, 8, 8, 160, 160, 8, 8, 8, 10, 8, 89, 89, 157, 8, 89, 8, 8, 8, 8, 8, 8, 8, 8, 117, 160, 122, 8, 128, 128, nil, 160, 128, 160, 160, 160, 160, 160, 160, 160, 160, 104, 94, 104, 160, 94, 94, 132, 132, 104, 104, 132, nil, 132, 132, 132, 132, 132, 123, 123, 127, 127, 123, 98, 127, 98, 127, 127, 127, nil, 104, 98, 98, 13, 13, nil, 104, 13, 104, 104, 104, 104, 104, 104, 104, 104, 98, 98, 14, 104, 14, nil, 98, 49, 49, nil, 14, 14, 98, nil, 98, 98, 98, 98, 98, 98, 98, 98, 90, 90, 98, 98, 116, nil, 116, 125, 125, 14, nil, 125, 116, 116, nil, 14, nil, 14, 14, 14, 14, 14, 14, 14, 14, 91, 91, 88, 14, 88, 124, 124, nil, 116, 124, 88, 88, nil, nil, 116, nil, 116, 116, 116, 116, 116, 116, 116, 116, 18, nil, 18, 116, nil, nil, nil, 88, 18, 18, nil, nil, nil, 88, nil, 88, 88, 88, 88, 88, 88, 88, 88, 149, nil, 149, 88, nil, nil, 18, nil, 149, 149, nil, nil, 18, nil, 18, 18, 18, 18, 18, 18, 18, 18, 21, nil, 21, 18, nil, nil, nil, 149, 21, 21, nil, nil, nil, 149, nil, 149, 149, 149, 149, 149, 149, 149, 149, 22, nil, 22, 149, nil, nil, 21, nil, 22, 22, nil, nil, 21, nil, 21, 21, 21, 21, 21, 21, 21, 21, 77, nil, 77, 21, nil, nil, nil, 22, 77, 77, nil, nil, nil, 22, nil, 22, 22, 22, 22, 22, 22, 22, 22, 24, nil, 24, 22, nil, nil, 77, nil, 24, 24, nil, nil, 77, nil, 77, 77, 77, 77, 77, 77, 77, 77, 25, nil, 25, 77, nil, nil, nil, 24, 25, 25, nil, nil, nil, 24, nil, 24, 24, 24, 24, 24, 24, 24, 24, 26, nil, 26, 24, nil, nil, 25, nil, 26, 26, nil, nil, 25, nil, 25, 25, 25, 25, 25, 25, 25, 25, 27, nil, 27, 25, nil, nil, nil, 26, 27, 27, nil, nil, nil, 26, nil, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 85, 26, 85, nil, 27, nil, nil, nil, 85, 85, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, nil, nil, 46, 27, 46, nil, nil, nil, nil, 85, 46, 46, nil, nil, nil, 85, nil, 85, 85, 85, 85, 85, 85, 85, 85, 84, nil, 84, 85, nil, nil, 46, nil, 84, 84, nil, 46, 46, nil, 46, 46, 46, 46, 46, 46, 46, 46, 48, nil, 48, 46, nil, nil, nil, 84, 48, 48, nil, nil, nil, 84, nil, 84, 84, 84, 84, 84, 84, 84, 84, 48, 48, nil, 84, 48, 48, 48, 48, 48, 48, 48, nil, 48, nil, 48, 48, 48, 48, 48, 48, 48, 48, 83, nil, 83, 48, nil, nil, nil, nil, 83, 83, nil, nil, nil, 134, 134, nil, 55, 134, 55, 134, 134, 134, 134, 134, 55, 55, 126, 126, nil, 83, 126, nil, 126, 126, 126, 83, nil, 83, 83, 83, 83, 83, 83, 83, 83, 55, nil, nil, 83, nil, nil, 55, nil, 55, 55, 55, 55, 55, 55, 55, 55, 56, nil, 56, 55, nil, nil, nil, nil, 56, 56, nil, nil, nil, 133, 133, nil, 82, 133, 82, 133, 133, 133, 133, 133, 82, 82, nil, nil, nil, 56, nil, nil, nil, nil, nil, 56, nil, 56, 56, 56, 56, 56, 56, 56, 56, 82, nil, nil, 56, nil, nil, 82, nil, 82, 82, 82, 82, 82, 82, 82, 82, 81, nil, 81, 82, nil, nil, nil, nil, 81, 81, nil, nil, nil, nil, nil, nil, 80, nil, 80, nil, nil, nil, nil, nil, 80, 80, nil, nil, nil, 81, nil, nil, nil, nil, nil, 81, nil, 81, 81, 81, 81, 81, 81, 81, 81, 80, nil, nil, 81, nil, nil, 80, nil, 80, 80, 80, 80, 80, 80, 80, 80, 79, nil, 79, 80, nil, nil, nil, nil, 79, 79, nil, nil, nil, nil, nil, nil, nil, nil, 63, nil, 63, nil, nil, nil, nil, nil, 63, 63, nil, 79, nil, nil, nil, nil, nil, 79, nil, 79, 79, 79, 79, 79, 79, 79, 79, nil, 63, 63, 79, 63, nil, nil, nil, 63, nil, 63, 63, 63, 63, 63, 63, 63, 63, 64, nil, 64, 63, nil, nil, nil, nil, 64, 64, nil, nil, nil, nil, nil, nil, 78, nil, 78, nil, nil, nil, nil, nil, 78, 78, nil, nil, nil, 64, nil, nil, nil, nil, nil, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 78, nil, nil, 64, nil, nil, 78, nil, 78, 78, 78, 78, 78, 78, 78, 78, 71, nil, 71, 78, nil, nil, nil, nil, 71, 71, nil, nil, nil, nil, nil, nil, 72, nil, 72, nil, nil, nil, nil, nil, 72, 72, nil, nil, nil, 71, nil, nil, nil, nil, nil, 71, nil, 71, 71, 71, 71, 71, 71, 71, 71, 72, nil, nil, 71, nil, nil, 72, nil, 72, 72, 72, 72, 72, 72, 72, 72, 73, nil, 73, 72, nil, nil, nil, nil, 73, 73, nil, nil, nil, nil, nil, nil, 74, nil, 74, nil, nil, nil, nil, nil, 74, 74, nil, nil, nil, 73, nil, nil, nil, nil, nil, 73, nil, 73, 73, 73, 73, 73, 73, 73, 73, 74, nil, nil, 73, nil, nil, 74, nil, 74, 74, 74, 74, 74, 74, 74, 74, 75, nil, 75, 74, nil, nil, nil, nil, 75, 75, nil, nil, nil, nil, nil, nil, 76, nil, 76, nil, nil, nil, nil, nil, 76, 76, nil, nil, nil, 75, nil, nil, nil, nil, nil, 75, nil, 75, 75, 75, 75, 75, 75, 75, 75, 76, nil, nil, 75, nil, nil, 76, nil, 76, 76, 76, 76, 76, 76, 76, 76, 87, nil, 87, 76, nil, nil, 23, 23, 87, 87, 23, nil, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, nil, nil, 87, nil, nil, nil, nil, nil, 87, nil, 87, 87, 87, 87, 87, 87, 87, 87, 137, 137, nil, 87, 137, nil, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 156, 156, 137, nil, 156, nil, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 120, 120, nil, nil, 120, nil, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 163, 163, nil, nil, 163, nil, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 58, 58, nil, nil, 58, nil, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 155, 155, nil, nil, 155, nil, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 141, 141, nil, nil, 141, nil, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 130, 130, nil, nil, 130, nil, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 135, 135, nil, nil, 135, nil, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 136, 136, nil, nil, 136, nil, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 129, 129, nil, nil, 129, nil, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129 ] racc_action_pointer = [ 17, 1, nil, nil, nil, nil, nil, nil, 57, 36, 91, nil, nil, 128, 166, nil, -19, 50, 235, nil, 41, 280, 303, 1049, 348, 370, 393, 415, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 33, 462, -30, 507, 146, nil, nil, nil, nil, nil, 568, 613, nil, 1172, -12, 11, -3, nil, 753, 798, nil, nil, nil, nil, -18, nil, 859, 875, 920, 936, 981, 997, 325, 814, 735, 690, 674, 629, 552, 485, 440, -14, 1042, 213, 90, 187, 212, 22, nil, 78, nil, nil, nil, 141, nil, -12, nil, -21, 2, 119, -16, nil, -18, 21, nil, nil, nil, nil, nil, 12, -4, 190, 73, nil, nil, 1130, nil, 68, 137, 217, 194, 579, 139, 107, 1286, 1234, 64, 126, 627, 566, 1252, 1269, 1088, nil, -32, -5, 1214, nil, nil, nil, nil, -17, nil, nil, 258, nil, nil, nil, nil, nil, 1193, 1109, 70, nil, nil, 74, nil, nil, 1151 ] racc_action_default = [ -106, -106, -2, -3, -4, -5, -6, -7, -106, -106, -106, -1, -8, -106, -10, -12, -103, -106, -18, -20, -106, -36, -40, -41, -106, -106, -106, -106, -65, -66, -67, -68, -69, -70, -71, -72, -73, -74, -75, -76, -77, -78, -79, -80, -81, -106, -106, -106, -106, -106, -29, -30, -31, 164, -9, -34, -38, -11, -94, -103, -101, -102, -98, -106, -106, -14, -19, -25, -35, -103, -39, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -106, -48, -49, -58, -106, -63, -106, -83, -84, -85, -106, -91, -106, -95, -106, -106, -15, -106, -22, -24, -106, -27, -28, -32, -33, -37, -106, -106, -106, -106, -13, -21, -60, -104, -106, -42, -43, -44, -45, -46, -47, -50, -51, -52, -53, -54, -55, -56, -57, -106, -61, -103, -106, -90, -64, -82, -86, -87, -106, -89, -92, -106, -96, -16, -17, -23, -26, -99, -93, -100, -97, -105, -106, -62, -88, -59 ] racc_goto_table = [ 58, 1, 57, 102, 58, 97, 66, 68, 70, 108, 89, 90, 91, 92, 49, 51, 52, 119, 138, 94, 105, 100, 118, 158, nil, nil, nil, 2, 11, nil, nil, nil, 58, nil, nil, nil, 50, nil, nil, nil, nil, 112, 113, nil, nil, nil, nil, nil, nil, 120, 58, nil, 122, nil, 145, 110, 111, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 157, 58, 141, 140, 109, nil, nil, nil, nil, nil, nil, nil, 146, nil, nil, nil, nil, nil, 58, nil, 151, nil, nil, nil, nil, nil, nil, nil, 120, 155, 156, 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, nil, nil, nil, nil, nil, 156, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 163 ] racc_goto_check = [ 19, 1, 9, 33, 19, 31, 9, 7, 7, 15, 19, 19, 19, 7, 18, 12, 17, 13, 20, 30, 11, 32, 8, 34, nil, nil, nil, 2, 2, nil, nil, nil, 19, nil, nil, nil, 2, nil, nil, nil, nil, 7, 7, nil, nil, nil, nil, nil, nil, 19, 19, nil, 9, nil, 31, 12, 17, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 33, 19, 19, 9, 2, nil, nil, nil, nil, nil, nil, nil, 7, nil, nil, nil, nil, nil, 19, nil, 9, nil, nil, nil, nil, nil, nil, nil, 19, 19, 19, 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, nil, nil, nil, nil, nil, 19, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 19 ] racc_goto_pointer = [ nil, 1, 27, nil, nil, nil, nil, -14, -41, -12, nil, -28, 6, -46, nil, -39, nil, 7, 5, -14, -68, nil, nil, nil, nil, nil, nil, nil, nil, nil, -26, -40, -25, -44, -94 ] racc_goto_default = [ nil, nil, nil, 3, 4, 5, 6, 13, 15, nil, 17, nil, nil, 19, 20, nil, 9, nil, nil, 23, 37, 28, 29, 30, 31, 32, 33, 34, 35, 36, nil, nil, 60, 61, 62 ] racc_reduce_table = [ 0, 0, :racc_error, 2, 55, :_reduce_1, 1, 55, :_reduce_2, 1, 56, :_reduce_none, 1, 56, :_reduce_none, 1, 56, :_reduce_none, 1, 56, :_reduce_none, 1, 57, :_reduce_7, 2, 58, :_reduce_8, 3, 58, :_reduce_9, 1, 62, :_reduce_10, 2, 62, :_reduce_11, 1, 64, :_reduce_none, 3, 64, :_reduce_13, 3, 60, :_reduce_14, 1, 65, :_reduce_15, 2, 65, :_reduce_16, 3, 66, :_reduce_17, 1, 67, :_reduce_18, 2, 67, :_reduce_19, 1, 68, :_reduce_none, 3, 68, :_reduce_21, 1, 69, :_reduce_none, 2, 69, :_reduce_23, 1, 69, :_reduce_none, 3, 70, :_reduce_25, 3, 71, :_reduce_26, 2, 72, :_reduce_27, 2, 72, :_reduce_28, 1, 72, :_reduce_29, 1, 72, :_reduce_30, 2, 59, :_reduce_31, 3, 59, :_reduce_32, 3, 61, :_reduce_33, 2, 61, :_reduce_34, 2, 61, :_reduce_35, 1, 61, :_reduce_36, 3, 61, :_reduce_37, 2, 61, :_reduce_38, 2, 61, :_reduce_39, 1, 61, :_reduce_40, 1, 61, :_reduce_41, 3, 73, :_reduce_42, 3, 73, :_reduce_43, 3, 73, :_reduce_44, 3, 73, :_reduce_45, 3, 73, :_reduce_46, 3, 73, :_reduce_47, 2, 73, :_reduce_48, 2, 73, :_reduce_49, 3, 73, :_reduce_50, 3, 73, :_reduce_51, 3, 73, :_reduce_52, 3, 73, :_reduce_53, 3, 73, :_reduce_54, 3, 73, :_reduce_55, 3, 73, :_reduce_56, 3, 73, :_reduce_57, 2, 73, :_reduce_58, 5, 73, :_reduce_59, 3, 73, :_reduce_60, 3, 73, :_reduce_61, 4, 73, :_reduce_62, 2, 73, :_reduce_63, 3, 73, :_reduce_64, 1, 73, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 76, :_reduce_none, 1, 76, :_reduce_none, 1, 76, :_reduce_none, 1, 77, :_reduce_none, 1, 77, :_reduce_none, 1, 78, :_reduce_none, 1, 80, :_reduce_none, 3, 79, :_reduce_82, 2, 79, :_reduce_83, 1, 84, :_reduce_84, 1, 84, :_reduce_85, 2, 84, :_reduce_86, 2, 84, :_reduce_87, 3, 85, :_reduce_88, 2, 85, :_reduce_89, 3, 81, :_reduce_90, 2, 82, :_reduce_91, 3, 82, :_reduce_92, 3, 86, :_reduce_93, 1, 86, :_reduce_94, 2, 83, :_reduce_95, 3, 83, :_reduce_96, 3, 87, :_reduce_97, 1, 87, :_reduce_98, 3, 88, :_reduce_99, 3, 63, :_reduce_100, 1, 63, :_reduce_none, 1, 63, :_reduce_102, 1, 74, :_reduce_103, 3, 74, :_reduce_104, 4, 74, :_reduce_105 ] racc_reduce_n = 106 racc_shift_n = 164 racc_token_table = { false => 0, :error => 1, :NEGATIVE => 2, :PERIOD => 3, :AOPEN => 4, :UPLUS => 5, :NOT => 6, :POWER => 7, :UMINUS => 8, :MULTIPLY => 9, :DIVIDE => 10, :MODULO => 11, :PLUS => 12, :MINUS => 13, :GT => 14, :GTE => 15, :LT => 16, :LTE => 17, :EQUAL => 18, :INEQUAL => 19, :AND => 20, :OR => 21, :RANGE => 22, :QUESTION => 23, :ASSIGN => 24, :COMMA => 25, :COLON => 26, :SEMICOLON => 27, :NEWLINE => 28, :TEMPLATE => 29, :TOPEN => 30, :TCLOSE => 31, :COMMAND => 32, :IDENTIFER => 33, :SUBCOMMAND => 34, :BLOCK => 35, :ENDBLOCK => 36, :END => 37, :ACLOSE => 38, :POPEN => 39, :PCLOSE => 40, :NIL => 41, :TRUE => 42, :FALSE => 43, :INTEGER => 44, :FLOAT => 45, :STRING => 46, :REGEXP => 47, :DOPEN => 48, :DCLOSE => 49, :IOPEN => 50, :ICLOSE => 51, :HOPEN => 52, :HCLOSE => 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 ] Racc_token_to_s_table = [ "$end", "error", "NEGATIVE", "PERIOD", "AOPEN", "UPLUS", "NOT", "POWER", "UMINUS", "MULTIPLY", "DIVIDE", "MODULO", "PLUS", "MINUS", "GT", "GTE", "LT", "LTE", "EQUAL", "INEQUAL", "AND", "OR", "RANGE", "QUESTION", "ASSIGN", "COMMA", "COLON", "SEMICOLON", "NEWLINE", "TEMPLATE", "TOPEN", "TCLOSE", "COMMAND", "IDENTIFER", "SUBCOMMAND", "BLOCK", "ENDBLOCK", "END", "ACLOSE", "POPEN", "PCLOSE", "NIL", "TRUE", "FALSE", "INTEGER", "FLOAT", "STRING", "REGEXP", "DOPEN", "DCLOSE", "IOPEN", "ICLOSE", "HOPEN", "HCLOSE", "$start", "document", "document_unit", "template", "tag", "block_tag", "command_tag", "sequence", "command_body", "arguments", "command", "subcommand", "subcommand_tag", "block_body", "block_open", "block_close", "block_open_tag", "block_close_tag", "block_subnodes", "expr", "method", "value", "const", "number", "string", "dstring", "regexp", "range", "array", "hash", "dstring_content", "dstring_interpolation", "params", "pairs", "pair" ] Racc_debug_parser = false ##### State transition tables end ##### # reduce 0 omitted module_eval(<<'.,.,', 'parser.y', 55) def _reduce_1(val, _values, result) pospoppush(2); val[0].push(val[1]) result end .,., module_eval(<<'.,.,', 'parser.y', 56) def _reduce_2(val, _values, result) result = [val[0]] result end .,., # reduce 3 omitted # reduce 4 omitted # reduce 5 omitted # reduce 6 omitted module_eval(<<'.,.,', 'parser.y', 59) def _reduce_7(val, _values, result) result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 61) def _reduce_8(val, _values, result) result = build Tag, :TAG, mode: tag_modes(val[0], @escape_tags ? :escape : :normal), position: pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 66) def _reduce_9(val, _values, result) result = build Tag, :TAG, *Array.wrap(val[1]).flatten, mode: tag_modes(val[0], @escape_tags ? :escape : :normal), position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 72) def _reduce_10(val, _values, result) result = build @commands[val[0]] || Command, val[0], position: pospoppush(1) result end .,., module_eval(<<'.,.,', 'parser.y', 74) def _reduce_11(val, _values, result) result = build @commands[val[0]] || Command, val[0], *val[1], position: pospoppush(2) result end .,., # reduce 12 omitted module_eval(<<'.,.,', 'parser.y', 78) def _reduce_13(val, _values, result) result = build Assigner, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 81) def _reduce_14(val, _values, result) command = val[1].is_a?(Command) ? val[1] : val[1].children[0] command.validate! result = build Tag, :TAG, val[1], mode: tag_modes(val[0]), position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 86) def _reduce_15(val, _values, result) result = build @substack.last[val[0]], val[0], position: pospoppush(1) result end .,., module_eval(<<'.,.,', 'parser.y', 88) def _reduce_16(val, _values, result) result = build @substack.last[val[0]], val[0], *val[1], position: pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 90) def _reduce_17(val, _values, result) pospoppush(3); result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 92) def _reduce_18(val, _values, result) result = build @blocks[val[0]] || Block, val[0], position: pospoppush(1) result end .,., module_eval(<<'.,.,', 'parser.y', 94) def _reduce_19(val, _values, result) result = build @blocks[val[0]] || Block, val[0], *val[1], position: pospoppush(2) result end .,., # reduce 20 omitted module_eval(<<'.,.,', 'parser.y', 98) def _reduce_21(val, _values, result) result = build Assigner, val[0], val[2], position: pospoppush(3) result end .,., # reduce 22 omitted module_eval(<<'.,.,', 'parser.y', 101) def _reduce_23(val, _values, result) pospoppush(2) result end .,., # reduce 24 omitted module_eval(<<'.,.,', 'parser.y', 104) def _reduce_25(val, _values, result) result = build Tag, :TAG, val[1], mode: tag_modes(val[0]), position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 106) def _reduce_26(val, _values, result) pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 108) def _reduce_27(val, _values, result) pospoppush(2) val[0][-1].is_a?(Joiner) ? val[0][-1].children.push(val[1]) : val[0].push(build(Joiner, :JOINER, val[1])) result end .,., module_eval(<<'.,.,', 'parser.y', 113) def _reduce_28(val, _values, result) pospoppush(2); val[0].push(val[1]) result end .,., module_eval(<<'.,.,', 'parser.y', 114) def _reduce_29(val, _values, result) result = [build(Joiner, :JOINER, val[0], position: pospoppush(1))] result end .,., module_eval(<<'.,.,', 'parser.y', 115) def _reduce_30(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 117) def _reduce_31(val, _values, result) pospoppush(2) block = val[0].children[0].is_a?(Block) ? val[0].children[0] : val[0].children[0].children[0] block.validate! result end .,., module_eval(<<'.,.,', 'parser.y', 123) def _reduce_32(val, _values, result) pospoppush(3) block = val[0].children[0].is_a?(Block) ? val[0].children[0] : val[0].children[0].children[0] block.options[:subnodes] = val[1] block.validate! result end .,., module_eval(<<'.,.,', 'parser.y', 130) def _reduce_33(val, _values, result) pospoppush(2); result = val[0].push(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 131) def _reduce_34(val, _values, result) pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 132) def _reduce_35(val, _values, result) pospoppush(2, 1); result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 133) def _reduce_36(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 134) def _reduce_37(val, _values, result) pospoppush(2); result = val[0].push(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 135) def _reduce_38(val, _values, result) pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 136) def _reduce_39(val, _values, result) pospoppush(2, 1); result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 137) def _reduce_40(val, _values, result) result = [] result end .,., module_eval(<<'.,.,', 'parser.y', 138) def _reduce_41(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 140) def _reduce_42(val, _values, result) result = build Expression, :MULTIPLY, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 141) def _reduce_43(val, _values, result) result = build Expression, :POWER, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 142) def _reduce_44(val, _values, result) result = build Expression, :DIVIDE, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 143) def _reduce_45(val, _values, result) result = build Expression, :PLUS, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 144) def _reduce_46(val, _values, result) result = build Expression, :MINUS, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 145) def _reduce_47(val, _values, result) result = build Expression, :MODULO, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 146) def _reduce_48(val, _values, result) result = build Expression, :UMINUS, val[1], position: pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 147) def _reduce_49(val, _values, result) result = build Expression, :UPLUS, val[1], position: pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 148) def _reduce_50(val, _values, result) result = build Expression, :AND, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 149) def _reduce_51(val, _values, result) result = build Expression, :OR, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 150) def _reduce_52(val, _values, result) result = build Expression, :GT, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 151) def _reduce_53(val, _values, result) result = build Expression, :GTE, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 152) def _reduce_54(val, _values, result) result = build Expression, :LT, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 153) def _reduce_55(val, _values, result) result = build Expression, :LTE, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 154) def _reduce_56(val, _values, result) result = build Expression, :EQUAL, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 155) def _reduce_57(val, _values, result) result = build Expression, :INEQUAL, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 156) def _reduce_58(val, _values, result) result = build Expression, :NOT, val[1], position: pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 157) def _reduce_59(val, _values, result) result = build Expression, :TERNARY, val[0], val[2], val[4], position: pospoppush(5) result end .,., module_eval(<<'.,.,', 'parser.y', 158) def _reduce_60(val, _values, result) result = build Assigner, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 159) def _reduce_61(val, _values, result) pospoppush(3); val[2].children[0] = val[0]; result = val[2] result end .,., module_eval(<<'.,.,', 'parser.y', 161) def _reduce_62(val, _values, result) result = build Summoner, '[]', val[0], *val[2], position: pospoppush(4) result end .,., module_eval(<<'.,.,', 'parser.y', 163) def _reduce_63(val, _values, result) pospoppush(2); result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 165) def _reduce_64(val, _values, result) result = case val[1].size when 1 val[1][0] else build Sequencer, :SEQUENCE, *val[1].flatten, position: pospoppush(3) end result end .,., # reduce 65 omitted # reduce 66 omitted # reduce 67 omitted # reduce 68 omitted # reduce 69 omitted # reduce 70 omitted # reduce 71 omitted # reduce 72 omitted # reduce 73 omitted # reduce 74 omitted # reduce 75 omitted # reduce 76 omitted # reduce 77 omitted # reduce 78 omitted # reduce 79 omitted # reduce 80 omitted # reduce 81 omitted module_eval(<<'.,.,', 'parser.y', 181) def _reduce_82(val, _values, result) result = build Expression, :DSTRING, *val[1], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 182) def _reduce_83(val, _values, result) pospoppush(2); result = '' result end .,., module_eval(<<'.,.,', 'parser.y', 183) def _reduce_84(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 184) def _reduce_85(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 185) def _reduce_86(val, _values, result) pospoppush(2); val[0].push(val[1]); result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 186) def _reduce_87(val, _values, result) pospoppush(2); val[0].push(val[1]); result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 188) def _reduce_88(val, _values, result) result = case val[1].size when 1 val[1][0] else build Sequencer, :SEQUENCE, *val[1].flatten, position: pospoppush(3) end result end .,., module_eval(<<'.,.,', 'parser.y', 195) def _reduce_89(val, _values, result) pospoppush(2); result = nil result end .,., module_eval(<<'.,.,', 'parser.y', 198) def _reduce_90(val, _values, result) result = build Expression, val[1] == '..' ? :RANGE : :ERANGE, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 202) def _reduce_91(val, _values, result) result = build Arrayer, :ARRAY, position: pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 203) def _reduce_92(val, _values, result) result = build Arrayer, :ARRAY, *val[1], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 204) def _reduce_93(val, _values, result) pospoppush(3); val[0].push(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 205) def _reduce_94(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 207) def _reduce_95(val, _values, result) result = build Hasher, :HASH, position: pospoppush(2) result end .,., module_eval(<<'.,.,', 'parser.y', 208) def _reduce_96(val, _values, result) result = build Hasher, :HASH, *val[1], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 209) def _reduce_97(val, _values, result) pospoppush(3); val[0].push(val[2]) result end .,., module_eval(<<'.,.,', 'parser.y', 210) def _reduce_98(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 211) def _reduce_99(val, _values, result) result = build Arrayer, :PAIR, val[0], val[2], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 213) def _reduce_100(val, _values, result) result = [*val[0], build(Hasher, :HASH, *val[2], position: pospoppush(3))] result end .,., # reduce 101 omitted module_eval(<<'.,.,', 'parser.y', 215) def _reduce_102(val, _values, result) result = build Hasher, :HASH, *val[0], position: pospoppush(1) result end .,., module_eval(<<'.,.,', 'parser.y', 216) def _reduce_103(val, _values, result) result = build Summoner, val[0], position: pospoppush(1) result end .,., module_eval(<<'.,.,', 'parser.y', 217) def _reduce_104(val, _values, result) result = build Summoner, val[0], position: pospoppush(3) result end .,., module_eval(<<'.,.,', 'parser.y', 219) def _reduce_105(val, _values, result) result = build Summoner, val[0], nil, *val[2], position: pospoppush(4) result end .,., def _reduce_none(val, _values, result) val[0] end end # class Parser end # module Hotcell