# # 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 = [ 6, 18, 19, 9, 59, 20, 21, 8, 6, 28, 29, 8, 59, 51, 6, 49, 6, 23, 24, 8, 59, 51, 3, 4, 5, 8, 30, 8, 31, 51, 32, 44, 52, 53, 54, 55, 56, 57, 58, 8, 52, 53, 54, 55, 56, 57, 58, 69, 52, 53, 54, 55, 56, 57, 58, 6, 70, 72, 73, 59, 77, 84, 85, 6, 86, 87, 8, 59, 51, 6, 88, 6, 89, 90, 8, 59, 51, 10, 11, 12, 8, nil, 8, nil, 51, nil, nil, 52, 53, 54, 55, 56, 57, 58, nil, 52, 53, 54, 55, 56, 57, 58, nil, 52, 53, 54, 55, 56, 57, 58, 6, nil, nil, nil, 59, nil, nil, nil, 6, nil, nil, 8, 59, 51, nil, nil, 6, nil, nil, 8, 59, 51, nil, 67, nil, nil, nil, 8, nil, 51, nil, nil, 52, 53, 54, 55, 56, 57, 58, nil, 52, 53, 54, 55, 56, 57, 58, nil, 52, 53, 54, 55, 56, 57, 58, 6, nil, nil, nil, 59, nil, nil, nil, 6, nil, nil, 8, 59, 51, nil, nil, 74, 6, nil, 8, nil, 51, nil, nil, 78, 3, 4, 5, 8, nil, nil, nil, 52, 53, 54, 55, 56, 57, 58, nil, 52, 53, 54, 55, 56, 57, 58, 6, nil, nil, nil, 59, nil, nil, nil, 6, nil, nil, 8, 59, 51, nil, nil, 80, 6, 6, 8, nil, 51, 59, nil, 82, 3, 4, 5, 8, 8, nil, 51, 52, 53, 54, 55, 56, 57, 58, nil, 52, 53, 54, 55, 56, 57, 58, nil, nil, 6, 52, 53, 54, 55, 56, 57, 58, 3, 4, 5, 8, 6, nil, nil, nil, 6, nil, nil, nil, 3, 4, 5, 8, 3, 4, 5, 8, 6, nil, nil, nil, 6, nil, nil, nil, 3, 4, 5, 8, 3, 4, 5, 8, 6, nil, nil, nil, 6, nil, nil, nil, 3, 4, 5, 8, 3, 4, 5, 8, 40, 33, 35, 34, 37, 36, 39, 38, 43, 42, 41 ] racc_action_check = [ 33, 6, 6, 1, 33, 7, 7, 6, 34, 17, 17, 33, 34, 33, 0, 33, 35, 8, 9, 34, 35, 34, 0, 0, 0, 0, 19, 35, 21, 35, 22, 29, 33, 33, 33, 33, 33, 33, 33, 32, 34, 34, 34, 34, 34, 34, 34, 42, 35, 35, 35, 35, 35, 35, 35, 36, 43, 45, 46, 36, 51, 71, 75, 37, 76, 77, 36, 37, 36, 2, 79, 38, 81, 83, 37, 38, 37, 2, 2, 2, 2, nil, 38, nil, 38, nil, nil, 36, 36, 36, 36, 36, 36, 36, nil, 37, 37, 37, 37, 37, 37, 37, nil, 38, 38, 38, 38, 38, 38, 38, 39, nil, nil, nil, 39, nil, nil, nil, 40, nil, nil, 39, 40, 39, nil, nil, 41, nil, nil, 40, 41, 40, nil, 40, nil, nil, nil, 41, nil, 41, nil, nil, 39, 39, 39, 39, 39, 39, 39, nil, 40, 40, 40, 40, 40, 40, 40, nil, 41, 41, 41, 41, 41, 41, 41, 49, nil, nil, nil, 49, nil, nil, nil, 67, nil, nil, 49, 67, 49, nil, nil, 49, 3, nil, 67, nil, 67, nil, nil, 67, 3, 3, 3, 3, nil, nil, nil, 49, 49, 49, 49, 49, 49, 49, nil, 67, 67, 67, 67, 67, 67, 67, 69, nil, nil, nil, 69, nil, nil, nil, 70, nil, nil, 69, 70, 69, nil, nil, 69, 4, 86, 70, nil, 70, 86, nil, 70, 4, 4, 4, 4, 86, nil, 86, 69, 69, 69, 69, 69, 69, 69, nil, 70, 70, 70, 70, 70, 70, 70, nil, nil, 5, 86, 86, 86, 86, 86, 86, 86, 5, 5, 5, 5, 10, nil, nil, nil, 11, nil, nil, nil, 10, 10, 10, 10, 11, 11, 11, 11, 12, nil, nil, nil, 30, nil, nil, nil, 12, 12, 12, 12, 30, 30, 30, 30, 31, nil, nil, nil, 44, nil, nil, nil, 31, 31, 31, 31, 44, 44, 44, 44, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23 ] racc_action_pointer = [ 12, 3, 67, 180, 227, 259, -6, -2, 13, 18, 271, 275, 287, nil, nil, nil, nil, 2, nil, 7, nil, 9, 16, 300, nil, nil, nil, nil, nil, 12, 291, 303, 26, -2, 6, 14, 53, 61, 69, 108, 116, 124, 30, 39, 307, 37, 38, nil, nil, 163, nil, 27, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 171, nil, 210, 218, 41, nil, nil, nil, 44, 55, 49, nil, 52, nil, 54, nil, 55, nil, nil, 228, nil, nil, nil, nil, nil ] racc_action_default = [ -49, -49, -5, -49, -49, -49, -16, -17, -49, -49, -49, -49, -49, -4, -6, -7, -8, -15, -10, -49, -11, -49, -49, -49, 92, -1, -2, -3, -9, -49, -49, -49, -19, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -49, -18, -20, -49, -39, -49, -41, -42, -43, -44, -45, -46, -47, -48, -21, -22, -23, -24, -25, -26, -27, -49, -28, -49, -49, -49, -13, -14, -29, -49, -38, -49, -30, -49, -31, -49, -32, -49, -12, -33, -49, -40, -34, -35, -36, -37 ] racc_goto_table = [ 1, 22, 13, 14, 15, 16, nil, 17, nil, nil, 25, 26, 27, nil, 75, 2, nil, 2, 2, 2, 2, nil, nil, nil, nil, 2, 2, 2, nil, nil, 45, 46, 79, 47, 81, 83, nil, nil, nil, nil, nil, nil, nil, nil, 71, 2, 2, nil, nil, nil, nil, 91, nil, nil, nil, nil, nil, nil, nil, 2, 48, 60, 61, 62, 63, 64, 65, 66, 68 ] racc_goto_check = [ 1, 4, 1, 1, 1, 1, nil, 3, nil, nil, 1, 1, 1, nil, 6, 2, nil, 2, 2, 2, 2, nil, nil, nil, nil, 2, 2, 2, nil, nil, 1, 1, 6, 3, 6, 6, nil, nil, nil, nil, nil, nil, nil, nil, 1, 2, 2, nil, nil, nil, nil, 6, nil, nil, nil, nil, nil, nil, nil, 2, 5, 5, 5, 5, 5, 5, 5, 5, 5 ] racc_goto_pointer = [ nil, 0, 15, 1, -7, 27, -35 ] racc_goto_default = [ nil, nil, 50, 7, nil, 76, nil ] racc_reduce_table = [ 0, 0, :racc_error, 3, 42, :_reduce_1, 3, 42, :_reduce_2, 3, 42, :_reduce_3, 2, 42, :_reduce_4, 1, 42, :_reduce_5, 2, 42, :_reduce_6, 2, 42, :_reduce_7, 2, 42, :_reduce_8, 3, 43, :_reduce_9, 2, 43, :_reduce_10, 2, 43, :_reduce_11, 6, 43, :_reduce_12, 5, 43, :_reduce_13, 5, 43, :_reduce_14, 2, 43, :_reduce_15, 1, 43, :_reduce_16, 1, 43, :_reduce_17, 4, 44, :_reduce_18, 3, 44, :_reduce_19, 3, 45, :_reduce_20, 3, 45, :_reduce_21, 3, 45, :_reduce_22, 3, 45, :_reduce_23, 3, 45, :_reduce_24, 3, 45, :_reduce_25, 3, 45, :_reduce_26, 3, 45, :_reduce_27, 3, 45, :_reduce_28, 4, 45, :_reduce_29, 4, 45, :_reduce_30, 4, 45, :_reduce_31, 4, 45, :_reduce_32, 5, 45, :_reduce_33, 5, 45, :_reduce_34, 5, 45, :_reduce_35, 5, 45, :_reduce_36, 3, 47, :_reduce_37, 1, 47, :_reduce_38, 1, 46, :_reduce_none, 3, 46, :_reduce_40, 1, 46, :_reduce_41, 1, 46, :_reduce_42, 1, 46, :_reduce_43, 1, 46, :_reduce_44, 1, 46, :_reduce_45, 1, 46, :_reduce_46, 1, 46, :_reduce_47, 1, 46, :_reduce_48 ] racc_reduce_n = 49 racc_shift_n = 92 racc_token_table = { false => 0, :error => 1, :tNODE_TYPE => 2, :tATTRIBUTE => 3, :tKEY => 4, :tIDENTIFIER => 5, :tIDENTIFIER_VALUE => 6, :tINDEX => 7, :tHAS => 8, :tCOMMA => 9, :tCHILD => 10, :tSUBSEQUENT_SIBLING => 11, :tNEXT_SIBLING => 12, :tOPEN_ATTRIBUTE => 13, :tCLOSE_ATTRIBUTE => 14, :tOPEN_DYNAMIC_ATTRIBUTE => 15, :tCLOSE_DYNAMIC_ATTRIBUTE => 16, :tOPEN_ARRAY => 17, :tCLOSE_ARRAY => 18, :tOPEN_SELECTOR => 19, :tCLOSE_SELECTOR => 20, :tEQUAL => 21, :tNOT_EQUAL => 22, :tMATCH => 23, :tNOT_MATCH => 24, :tGREATER_THAN => 25, :tGREATER_THAN_OR_EQUAL => 26, :tLESS_THAN => 27, :tLESS_THAN_OR_EQUAL => 28, :tIN => 29, :tNOT_IN => 30, :tINCLUDES => 31, :tARRAY_VALUE => 32, :tDYNAMIC_ATTRIBUTE => 33, :tBOOLEAN => 34, :tFLOAT => 35, :tINTEGER => 36, :tNIL => 37, :tREGEXP => 38, :tSTRING => 39, :tSYMBOL => 40 } racc_nt_base = 41 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", "tHAS", "tCOMMA", "tCHILD", "tSUBSEQUENT_SIBLING", "tNEXT_SIBLING", "tOPEN_ATTRIBUTE", "tCLOSE_ATTRIBUTE", "tOPEN_DYNAMIC_ATTRIBUTE", "tCLOSE_DYNAMIC_ATTRIBUTE", "tOPEN_ARRAY", "tCLOSE_ARRAY", "tOPEN_SELECTOR", "tCLOSE_SELECTOR", "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(selector: val[0], rest: val[2], relationship: :child) end def _reduce_2(val, _values) Compiler::Expression.new(selector: val[0], rest: val[2], relationship: :subsequent_sibling) end def _reduce_3(val, _values) Compiler::Expression.new(selector: val[0], rest: val[2], relationship: :next_sibling) end def _reduce_4(val, _values) Compiler::Expression.new(selector: val[0], rest: val[1], relationship: :descendant) end def _reduce_5(val, _values) Compiler::Expression.new(selector: val[0]) end def _reduce_6(val, _values) Compiler::Expression.new(rest: val[1], relationship: :child) end def _reduce_7(val, _values) Compiler::Expression.new(rest: val[1], relationship: :subsequent_sibling) end def _reduce_8(val, _values) Compiler::Expression.new(rest: val[1], relationship: :next_sibling) end def _reduce_9(val, _values) Compiler::Selector.new(node_type: val[0], attribute_list: val[1], index: val[2]) end def _reduce_10(val, _values) Compiler::Selector.new(node_type: val[0], index: val[1]) end def _reduce_11(val, _values) Compiler::Selector.new(attribute_list: val[0], index: val[1]) end def _reduce_12(val, _values) Compiler::Selector.new(node_type: val[0], attribute_list: val[1], has_expression: val[4]) end def _reduce_13(val, _values) Compiler::Selector.new(node_type: val[0], has_expression: val[3]) end def _reduce_14(val, _values) Compiler::Selector.new(attribute_list: val[0], has_expression: val[3]) end def _reduce_15(val, _values) Compiler::Selector.new(node_type: val[0], attribute_list: val[1]) end def _reduce_16(val, _values) Compiler::Selector.new(node_type: val[0]) end def _reduce_17(val, _values) Compiler::Selector.new(attribute_list: val[0]) end def _reduce_18(val, _values) Compiler::AttributeList.new(attribute: val[1], rest: val[3]) end def _reduce_19(val, _values) Compiler::AttributeList.new(attribute: val[1]) 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: :>) end def _reduce_25(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :<=) end def _reduce_26(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :<) end def _reduce_27(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :==) end def _reduce_28(val, _values) Compiler::Attribute.new(key: val[0], value: val[2], operator: :includes) end def _reduce_29(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :!=) end def _reduce_30(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :==) end def _reduce_31(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :not_in) end def _reduce_32(val, _values) Compiler::Attribute.new(key: val[0], value: Compiler::Array.new, operator: :in) end def _reduce_33(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :!=) end def _reduce_34(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :==) end def _reduce_35(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :not_in) end def _reduce_36(val, _values) Compiler::Attribute.new(key: val[0], value: val[3], operator: :in) end def _reduce_37(val, _values) Compiler::Array.new(value: val[0], rest: val[2]) end def _reduce_38(val, _values) Compiler::Array.new(value: val[0]) end # reduce 39 omitted def _reduce_40(val, _values) Compiler::DynamicAttribute.new(value: val[1]) end def _reduce_41(val, _values) Compiler::Boolean.new(value: val[0]) end def _reduce_42(val, _values) Compiler::Float.new(value: val[0]) end def _reduce_43(val, _values) Compiler::Integer.new(value: val[0]) end def _reduce_44(val, _values) Compiler::Nil.new(value: val[0]) end def _reduce_45(val, _values) Compiler::Regexp.new(value: val[0]) end def _reduce_46(val, _values) Compiler::String.new(value: val[0]) end def _reduce_47(val, _values) Compiler::Symbol.new(value: val[0]) end def _reduce_48(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