Module: OracleSqlParser::Grammar::Condition::Exists
- Includes:
- Treetop::Runtime
- Included in:
- OracleSqlParser::Grammar::Condition, ExistsParser
- Defined in:
- lib/oracle-sql-parser/grammar/condition/exists.rb
Defined Under Namespace
Modules: ExistsCondition0, ExistsCondition1
Instance Method Summary collapse
Instance Method Details
#_nt_exists_condition ⇒ Object
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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/oracle-sql-parser/grammar/condition/exists.rb', line 31 def _nt_exists_condition start_index = index if node_cache[:exists_condition].has_key?(index) cached = node_cache[:exists_condition][index] if cached node_cache[:exists_condition][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_exists_keyword s0 << r1 if r1 r3 = _nt_space if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 if r2 if (match_len = has_terminal?('(', false, index)) r4 = true @index += match_len else terminal_parse_failure('\'(\'') r4 = nil end s0 << r4 if r4 r6 = _nt_space if r6 r5 = r6 else r5 = instantiate_node(SyntaxNode,input, index...index) end s0 << r5 if r5 r7 = _nt_subquery s0 << r7 if r7 r9 = _nt_space if r9 r8 = r9 else r8 = instantiate_node(SyntaxNode,input, index...index) end s0 << r8 if r8 if (match_len = has_terminal?(')', false, index)) r10 = true @index += match_len else terminal_parse_failure('\')\'') r10 = nil end s0 << r10 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ExistsCondition0) r0.extend(ExistsCondition1) else @index = i0 r0 = nil end node_cache[:exists_condition][start_index] = r0 r0 end |