208 lines
4.5 KiB
Ruby
208 lines
4.5 KiB
Ruby
#
|
|
# DO NOT MODIFY!!!!
|
|
# This file is automatically generated by Racc 1.4.16
|
|
# from Racc grammar file "".
|
|
#
|
|
|
|
require 'racc/parser.rb'
|
|
|
|
require_relative 'lexer'
|
|
|
|
class Query < Racc::Parser
|
|
|
|
module_eval(<<'...end grammar.y/module_eval...', 'grammar.y', 26)
|
|
def parse(input)
|
|
scan_str(input)
|
|
end
|
|
...end grammar.y/module_eval...
|
|
##### State transition tables begin ###
|
|
|
|
racc_action_table = [
|
|
5, 10, 9, 3, 4, 5, 6, 19, 3, 4,
|
|
7, 6, 5, 10, 9, 3, 4, 5, 6, 11,
|
|
3, 4, 5, 6, 14, 3, 4, nil, 6, 5,
|
|
10, 9, 3, 4, 5, 6, nil, 3, 4, 5,
|
|
6, nil, 3, 4, nil, 6, 5, 10, nil, 3,
|
|
4, 5, 6, nil, 3, 4, nil, 6, 3, 4,
|
|
nil, 6, 17, 18 ]
|
|
|
|
racc_action_check = [
|
|
13, 13, 13, 13, 13, 0, 13, 13, 0, 0,
|
|
1, 0, 2, 2, 2, 2, 2, 5, 2, 3,
|
|
5, 5, 6, 5, 7, 6, 6, nil, 6, 8,
|
|
8, 8, 8, 8, 9, 8, nil, 9, 9, 10,
|
|
9, nil, 10, 10, nil, 10, 15, 15, nil, 15,
|
|
15, 16, 15, nil, 16, 16, nil, 16, 12, 12,
|
|
nil, 12, 11, 11 ]
|
|
|
|
racc_action_pointer = [
|
|
3, 10, 10, 12, nil, 15, 20, 24, 27, 32,
|
|
37, 57, 53, -2, nil, 44, 49, nil, nil, nil ]
|
|
|
|
racc_action_default = [
|
|
-2, -12, -1, -3, -4, -12, -12, -12, -11, -12,
|
|
-12, -12, -9, -12, 20, -7, -8, -5, -6, -10 ]
|
|
|
|
racc_goto_table = [
|
|
2, 1, nil, nil, nil, 12, 13, nil, nil, 15,
|
|
16 ]
|
|
|
|
racc_goto_check = [
|
|
2, 1, nil, nil, nil, 2, 2, nil, nil, 2,
|
|
2 ]
|
|
|
|
racc_goto_pointer = [
|
|
nil, 1, 0 ]
|
|
|
|
racc_goto_default = [
|
|
nil, nil, 8 ]
|
|
|
|
racc_reduce_table = [
|
|
0, 0, :racc_error,
|
|
1, 11, :_reduce_none,
|
|
0, 11, :_reduce_2,
|
|
1, 12, :_reduce_3,
|
|
1, 12, :_reduce_4,
|
|
3, 12, :_reduce_5,
|
|
3, 12, :_reduce_6,
|
|
3, 12, :_reduce_7,
|
|
3, 12, :_reduce_8,
|
|
2, 12, :_reduce_9,
|
|
3, 12, :_reduce_10,
|
|
2, 12, :_reduce_11 ]
|
|
|
|
racc_reduce_n = 12
|
|
|
|
racc_shift_n = 20
|
|
|
|
racc_token_table = {
|
|
false => 0,
|
|
:error => 1,
|
|
:OPERATOR_NOT => 2,
|
|
:OPERATOR_AND => 3,
|
|
:OPERATOR_OR => 4,
|
|
:TERM_WITHOUT_QUOTES => 5,
|
|
:TERM_WITH_QUOTES => 6,
|
|
:COLON => 7,
|
|
:L_BRACKET => 8,
|
|
:R_BRACKET => 9 }
|
|
|
|
racc_nt_base = 10
|
|
|
|
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",
|
|
"OPERATOR_NOT",
|
|
"OPERATOR_AND",
|
|
"OPERATOR_OR",
|
|
"TERM_WITHOUT_QUOTES",
|
|
"TERM_WITH_QUOTES",
|
|
"COLON",
|
|
"L_BRACKET",
|
|
"R_BRACKET",
|
|
"$start",
|
|
"target",
|
|
"expression" ]
|
|
|
|
Racc_debug_parser = false
|
|
|
|
##### State transition tables end #####
|
|
|
|
# reduce 0 omitted
|
|
|
|
# reduce 1 omitted
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 8)
|
|
def _reduce_2(val, _values, result)
|
|
result = 0
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 10)
|
|
def _reduce_3(val, _values, result)
|
|
result = {:DEFAULT_COLUMN => val[0]}
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 11)
|
|
def _reduce_4(val, _values, result)
|
|
result = {:DEFAULT_COLUMN => val[0]}
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 12)
|
|
def _reduce_5(val, _values, result)
|
|
result = {val[0] => val[2]}
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 13)
|
|
def _reduce_6(val, _values, result)
|
|
result = {val[0] => val[2]}
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 14)
|
|
def _reduce_7(val, _values, result)
|
|
result = {:OPERATOR_OR => [val[0], val[2]]}
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 15)
|
|
def _reduce_8(val, _values, result)
|
|
result = {:OPERATOR_AND => [val[0], val[2]]}
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 16)
|
|
def _reduce_9(val, _values, result)
|
|
result = {:OPERATOR_NOT => val[1]}
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 17)
|
|
def _reduce_10(val, _values, result)
|
|
result = val[1]
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
module_eval(<<'.,.,', 'grammar.y', 18)
|
|
def _reduce_11(val, _values, result)
|
|
result = {:OPERATOR_OR => [val[0], val[1]]}
|
|
result
|
|
end
|
|
.,.,
|
|
|
|
def _reduce_none(val, _values, result)
|
|
val[0]
|
|
end
|
|
|
|
end # class Query
|