# # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.6.0 # from Racc grammar file "". # require 'racc/parser.rb' module Synvert module Core module NodeQuery class Parser < Racc::Parser def initialize @lexer = Lexer.new end def parse string @lexer.parse string do_parse end def next_token @lexer.next_token end ##### State transition tables begin ### racc_action_table = [ 8, 19, 11, 15, 53, 16, 10, 8, 20, 22, 10, 53, 45, 23, 43, 24, 8, 10, 26, 45, 53, 27, 40, 10, 63, 64, 10, 68, 45, 75, 77, 78, 79, 46, 47, 48, 49, 50, 51, 52, 46, 47, 48, 49, 50, 51, 52, 80, nil, 46, 47, 48, 49, 50, 51, 52, 8, nil, nil, nil, 53, nil, nil, 8, nil, nil, 10, 53, 45, nil, 8, nil, nil, 10, 53, 45, nil, nil, nil, nil, 10, nil, 45, nil, nil, nil, nil, nil, nil, 46, 47, 48, 49, 50, 51, 52, 46, 47, 48, 49, 50, 51, 52, 46, 47, 48, 49, 50, 51, 52, 8, nil, nil, nil, 53, nil, nil, 8, nil, nil, 10, 53, 45, nil, 8, nil, nil, 10, 53, 45, nil, 61, nil, nil, 10, nil, 45, nil, nil, nil, nil, nil, nil, 46, 47, 48, 49, 50, 51, 52, 46, 47, 48, 49, 50, 51, 52, 46, 47, 48, 49, 50, 51, 52, 8, nil, nil, nil, 53, nil, nil, 8, nil, nil, 10, 53, 45, nil, 8, 65, nil, 10, 53, 45, nil, nil, 69, nil, 10, nil, 45, nil, nil, 71, nil, nil, nil, 46, 47, 48, 49, 50, 51, 52, 46, 47, 48, 49, 50, 51, 52, 46, 47, 48, 49, 50, 51, 52, 8, nil, nil, nil, 53, nil, nil, 8, nil, nil, 10, 53, 45, nil, 8, 73, nil, 10, nil, 45, 6, 2, 3, 4, 10, nil, nil, nil, nil, nil, nil, nil, 5, 46, 47, 48, 49, 50, 51, 52, 46, 47, 48, 49, 50, 51, 52, 8, nil, nil, nil, nil, 8, 6, 2, 3, 4, 10, 6, 2, 3, 4, 10, nil, nil, 5, 8, nil, nil, nil, 5, 8, 6, 2, 3, 4, 10, 6, 2, 3, 4, 10, nil, nil, 5, 8, nil, nil, nil, 5, 8, 6, 2, 3, 4, 10, 6, 2, 3, 4, 10, nil, nil, 5, nil, nil, nil, nil, 5, 35, 28, 30, 29, 32, 31, 34, 33, 38, 37, 36 ] racc_action_check = [ 28, 8, 1, 5, 28, 6, 8, 29, 9, 10, 28, 29, 28, 11, 28, 15, 30, 29, 18, 29, 30, 21, 25, 27, 37, 38, 30, 45, 30, 66, 68, 70, 72, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 74, nil, 30, 30, 30, 30, 30, 30, 30, 31, nil, nil, nil, 31, nil, nil, 32, nil, nil, 31, 32, 31, nil, 33, nil, nil, 32, 33, 32, nil, nil, nil, nil, 33, nil, 33, nil, nil, nil, nil, nil, nil, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 33, 34, nil, nil, nil, 34, nil, nil, 35, nil, nil, 34, 35, 34, nil, 36, nil, nil, 35, 36, 35, nil, 35, nil, nil, 36, nil, 36, nil, nil, nil, nil, nil, nil, 34, 34, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 36, 43, nil, nil, nil, 43, nil, nil, 61, nil, nil, 43, 61, 43, nil, 63, 43, nil, 61, 63, 61, nil, nil, 61, nil, 63, nil, 63, nil, nil, 63, nil, nil, nil, 43, 43, 43, 43, 43, 43, 43, 61, 61, 61, 61, 61, 61, 61, 63, 63, 63, 63, 63, 63, 63, 64, nil, nil, nil, 64, nil, nil, 67, nil, nil, 64, 67, 64, nil, 0, 64, nil, 67, nil, 67, 0, 0, 0, 0, 0, nil, nil, nil, nil, nil, nil, nil, 0, 64, 64, 64, 64, 64, 64, 64, 67, 67, 67, 67, 67, 67, 67, 2, nil, nil, nil, nil, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, nil, nil, 2, 4, nil, nil, nil, 3, 7, 4, 4, 4, 4, 4, 7, 7, 7, 7, 7, nil, nil, 4, 16, nil, nil, nil, 7, 24, 16, 16, 16, 16, 16, 24, 24, 24, 24, 24, nil, nil, 16, nil, nil, nil, nil, 24, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 ] racc_action_pointer = [ 230, 2, 263, 268, 282, -2, -13, 287, -6, 1, 5, 13, nil, nil, nil, -6, 301, nil, 11, nil, nil, 8, 305, nil, 306, 3, nil, 11, -2, 5, 14, 54, 61, 68, 108, 115, 122, 8, 9, nil, nil, nil, nil, 162, nil, -7, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 169, nil, 176, 216, nil, 12, 223, 15, nil, 14, nil, 15, nil, 30, nil, nil, nil, nil, nil, nil ] racc_action_default = [ -45, -45, -45, -45, -45, -45, -45, -7, -12, -13, -45, -45, -1, -2, -3, -45, -45, -6, -11, -9, -10, -45, -45, 81, -45, -45, -8, -15, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, -4, -5, -14, -16, -45, -35, -45, -37, -38, -39, -40, -41, -42, -43, -44, -17, -18, -19, -20, -21, -22, -23, -45, -24, -45, -45, -25, -45, -34, -45, -26, -45, -27, -45, -28, -45, -29, -33, -36, -30, -31, -32 ] racc_goto_table = [ 1, 18, 12, 13, 14, 66, 7, 17, 7, 7, 7, 21, nil, 7, nil, nil, 25, nil, nil, nil, 41, nil, 7, 70, 39, 72, 74, nil, nil, 76, 7, 42, 54, 55, 56, 57, 58, 59, 60, 62 ] racc_goto_check = [ 1, 3, 1, 1, 1, 6, 2, 1, 2, 2, 2, 4, nil, 2, nil, nil, 1, nil, nil, nil, 3, nil, 2, 6, 1, 6, 6, nil, nil, 6, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5 ] racc_goto_pointer = [ nil, 0, 6, -7, 1, 3, -38 ] racc_goto_default = [ nil, nil, 44, 9, nil, 67, nil ] racc_reduce_table = [ 0, 0, :racc_error, 2, 43, :_reduce_1, 2, 43, :_reduce_2, 2, 43, :_reduce_3, 4, 43, :_reduce_4, 4, 43, :_reduce_5, 2, 43, :_reduce_6, 1, 43, :_reduce_7, 3, 44, :_reduce_8, 2, 44, :_reduce_9, 2, 44, :_reduce_10, 2, 44, :_reduce_11, 1, 44, :_reduce_12, 1, 44, :_reduce_13, 4, 45, :_reduce_14, 3, 45, :_reduce_15, 3, 46, :_reduce_16, 3, 46, :_reduce_17, 3, 46, :_reduce_18, 3, 46, :_reduce_19, 3, 46, :_reduce_20, 3, 46, :_reduce_21, 3, 46, :_reduce_22, 3, 46, :_reduce_23, 3, 46, :_reduce_24, 4, 46, :_reduce_25, 4, 46, :_reduce_26, 4, 46, :_reduce_27, 4, 46, :_reduce_28, 5, 46, :_reduce_29, 5, 46, :_reduce_30, 5, 46, :_reduce_31, 5, 46, :_reduce_32, 2, 48, :_reduce_33, 1, 48, :_reduce_34, 1, 47, :_reduce_none, 3, 47, :_reduce_36, 1, 47, :_reduce_37, 1, 47, :_reduce_38, 1, 47, :_reduce_39, 1, 47, :_reduce_40, 1, 47, :_reduce_41, 1, 47, :_reduce_42, 1, 47, :_reduce_43, 1, 47, :_reduce_44 ] racc_reduce_n = 45 racc_shift_n = 81 racc_token_table = { false => 0, :error => 1, :tNODE_TYPE => 2, :tATTRIBUTE => 3, :tKEY => 4, :tIDENTIFIER => 5, :tIDENTIFIER_VALUE => 6, :tINDEX => 7, :tPSEUDO_CLASS => 8, :tCHILD => 9, :tSUBSEQUENT_SIBLING => 10, :tNEXT_SIBLING => 11, :tOPEN_ATTRIBUTE => 12, :tCLOSE_ATTRIBUTE => 13, :tOPEN_DYNAMIC_ATTRIBUTE => 14, :tCLOSE_DYNAMIC_ATTRIBUTE => 15, :tOPEN_ARRAY => 16, :tCLOSE_ARRAY => 17, :tOPEN_SELECTOR => 18, :tCLOSE_SELECTOR => 19, :tOPEN_GOTO_SCOPE => 20, :tCLOSE_GOTO_SCOPE => 21, :tEQUAL => 22, :tNOT_EQUAL => 23, :tMATCH => 24, :tNOT_MATCH => 25, :tGREATER_THAN => 26, :tGREATER_THAN_OR_EQUAL => 27, :tLESS_THAN => 28, :tLESS_THAN_OR_EQUAL => 29, :tIN => 30, :tNOT_IN => 31, :tINCLUDES => 32, :tARRAY_VALUE => 33, :tDYNAMIC_ATTRIBUTE => 34, :tBOOLEAN => 35, :tFLOAT => 36, :tINTEGER => 37, :tNIL => 38, :tREGEXP => 39, :tSTRING => 40, :tSYMBOL => 41 } racc_nt_base = 42 racc_use_result_var = false 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", "tNODE_TYPE", "tATTRIBUTE", "tKEY", "tIDENTIFIER", "tIDENTIFIER_VALUE", "tINDEX", "tPSEUDO_CLASS", "tCHILD", "tSUBSEQUENT_SIBLING", "tNEXT_SIBLING", "tOPEN_ATTRIBUTE", "tCLOSE_ATTRIBUTE", "tOPEN_DYNAMIC_ATTRIBUTE", "tCLOSE_DYNAMIC_ATTRIBUTE", "tOPEN_ARRAY", "tCLOSE_ARRAY", "tOPEN_SELECTOR", "tCLOSE_SELECTOR", "tOPEN_GOTO_SCOPE", "tCLOSE_GOTO_SCOPE", "tEQUAL", "tNOT_EQUAL", "tMATCH", "tNOT_MATCH", "tGREATER_THAN", "tGREATER_THAN_OR_EQUAL", "tLESS_THAN", "tLESS_THAN_OR_EQUAL", "tIN", "tNOT_IN", "tINCLUDES", "tARRAY_VALUE", "tDYNAMIC_ATTRIBUTE", "tBOOLEAN", "tFLOAT", "tINTEGER", "tNIL", "tREGEXP", "tSTRING", "tSYMBOL", "$start", "expression", "selector", "attribute_list", "attribute", "value", "array_value" ] Racc_debug_parser = false ##### State transition tables end ##### # reduce 0 omitted def _reduce_1(val, _values) Compiler::Expression.new(rest: val[1], relationship: :child) end def _reduce_2(val, _values) Compiler::Expression.new(rest: val[1], relationship: :subsequent_sibling) end def _reduce_3(val, _values) Compiler::Expression.new(rest: val[1], relationship: :next_sibling) end def _reduce_4(val, _values) Compiler::Expression.new(goto_scope: val[1], rest: val[3]) end def _reduce_5(val, _values) Compiler::Expression.new(relationship: val[0].to_sym, rest: val[2]) end def _reduce_6(val, _values) Compiler::Expression.new(selector: val[0], rest: val[1]) end def _reduce_7(val, _values) Compiler::Expression.new(selector: val[0]) end def _reduce_8(val, _values) Compiler::Selector.new(node_type: val[0], attribute_list: val[1], index: val[2]) end def _reduce_9(val, _values) Compiler::Selector.new(node_type: val[0], index: val[1]) end def _reduce_10(val, _values) Compiler::Selector.new(attribute_list: val[0], index: val[1]) end def _reduce_11(val, _values) Compiler::Selector.new(node_type: val[0], attribute_list: val[1]) end def _reduce_12(val, _values) Compiler::Selector.new(node_type: val[0]) end def _reduce_13(val, _values) Compiler::Selector.new(attribute_list: val[0]) end def _reduce_14(val, _values) Compiler::AttributeList.new(attribute: val[1], rest: val[3]) end def _reduce_15(val, _values) Compiler::AttributeList.new(attribute: val[1]) end def _reduce_16(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :!=) end def _reduce_17(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :!~) end def _reduce_18(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :=~) end def _reduce_19(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :>=) end def _reduce_20(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :>) end def _reduce_21(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :<=) end def _reduce_22(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :<) end def _reduce_23(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :==) end def _reduce_24(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :includes) end def _reduce_25(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :!=) end def _reduce_26(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :==) end def _reduce_27(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :not_in) end def _reduce_28(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :in) end def _reduce_29(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :!=) end def _reduce_30(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :==) end def _reduce_31(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :not_in) end def _reduce_32(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :in) end def _reduce_33(val, _values) Compiler::Array.new(value: val[0], rest: val[1]) end def _reduce_34(val, _values) Compiler::Array.new(value: val[0]) end # reduce 35 omitted def _reduce_36(val, _values) Compiler::DynamicAttribute.new(value: val[1]) end def _reduce_37(val, _values) Compiler::Boolean.new(value: val[0]) end def _reduce_38(val, _values) Compiler::Float.new(value: val[0]) end def _reduce_39(val, _values) Compiler::Integer.new(value: val[0]) end def _reduce_40(val, _values) Compiler::Nil.new(value: val[0]) end def _reduce_41(val, _values) Compiler::Regexp.new(value: val[0]) end def _reduce_42(val, _values) Compiler::String.new(value: val[0]) end def _reduce_43(val, _values) Compiler::Symbol.new(value: val[0]) end def _reduce_44(val, _values) Compiler::Identifier.new(value: val[0]) end def _reduce_none(val, _values) val[0] end end # class Parser end # module NodeQuery end # module Core end # module Synvert