Upstream sync
This commit is contained in:
181
lib/parser.rb
Normal file
181
lib/parser.rb
Normal file
@@ -0,0 +1,181 @@
|
||||
#
|
||||
# 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', 24)
|
||||
def parse(input)
|
||||
scan_str(input)
|
||||
end
|
||||
...end grammar.y/module_eval...
|
||||
##### State transition tables begin ###
|
||||
|
||||
racc_action_table = [
|
||||
8, 7, 3, 4, 11, 5, 16, 3, 4, 9,
|
||||
5, 3, 4, 6, 5, 3, 4, 8, 5, 8,
|
||||
7, 14, 15 ]
|
||||
|
||||
racc_action_check = [
|
||||
10, 10, 8, 8, 6, 8, 10, 0, 0, 3,
|
||||
0, 5, 5, 1, 5, 7, 7, 12, 7, 2,
|
||||
2, 9, 9 ]
|
||||
|
||||
racc_action_pointer = [
|
||||
2, 13, 16, 2, nil, 6, 4, 10, -3, 16,
|
||||
-3, nil, 14, nil, nil, nil, nil ]
|
||||
|
||||
racc_action_default = [
|
||||
-2, -10, -1, -3, -4, -10, -10, -10, -10, -10,
|
||||
-10, 17, -7, -8, -5, -6, -9 ]
|
||||
|
||||
racc_goto_table = [
|
||||
2, 1, nil, nil, nil, 10, nil, 12, 13 ]
|
||||
|
||||
racc_goto_check = [
|
||||
2, 1, nil, nil, nil, 2, nil, 2, 2 ]
|
||||
|
||||
racc_goto_pointer = [
|
||||
nil, 1, 0 ]
|
||||
|
||||
racc_goto_default = [
|
||||
nil, nil, nil ]
|
||||
|
||||
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,
|
||||
3, 12, :_reduce_9 ]
|
||||
|
||||
racc_reduce_n = 10
|
||||
|
||||
racc_shift_n = 17
|
||||
|
||||
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 = val[1]
|
||||
result
|
||||
end
|
||||
.,.,
|
||||
|
||||
def _reduce_none(val, _values, result)
|
||||
val[0]
|
||||
end
|
||||
|
||||
end # class Query
|
||||
Reference in New Issue
Block a user