Module: OracleSqlParser::Grammar::Condition::Compound
Defined Under Namespace
Modules: CompoundCondition0, CompoundCondition1
Instance Method Summary
collapse
Instance Method Details
#_nt_compound_condition ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/oracle-sql-parser/grammar/condition/compound.rb', line 25
def _nt_compound_condition
start_index = index
if node_cache[:compound_condition].has_key?(index)
cached = node_cache[:compound_condition][index]
if cached
node_cache[:compound_condition][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
i0, s0 = index, []
if (match_len = has_terminal?('(', false, index))
r1 = true
@index += match_len
else
terminal_parse_failure('\'(\'')
r1 = nil
end
s0 << r1
if r1
r2 = _nt_logical_condition
s0 << r2
if r2
if (match_len = has_terminal?(')', false, index))
r3 = true
@index += match_len
else
terminal_parse_failure('\')\'')
r3 = nil
end
s0 << r3
end
end
if s0.last
r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
r0.extend(CompoundCondition0)
r0.extend(CompoundCondition1)
else
@index = i0
r0 = nil
end
node_cache[:compound_condition][start_index] = r0
r0
end
|
8
9
10
|
# File 'lib/oracle-sql-parser/grammar/condition/compound.rb', line 8
def root
@root ||= :compound_condition
end
|