Module: OracleSqlParser::Grammar::Condition::In

Includes:
Treetop::Runtime
Included in:
OracleSqlParser::Grammar::Condition, InParser
Defined in:
lib/oracle-sql-parser/grammar/condition/in.rb

Defined Under Namespace

Modules: InCondition0, InCondition1, InCondition2

Instance Method Summary collapse

Instance Method Details

#_nt_in_conditionObject



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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/oracle-sql-parser/grammar/condition/in.rb', line 59

def _nt_in_condition
  start_index = index
  if node_cache[:in_condition].has_key?(index)
    cached = node_cache[:in_condition][index]
    if cached
      node_cache[:in_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_expr
  s0 << r1
  if r1
    r2 = _nt_space
    s0 << r2
    if r2
      i4, s4 = index, []
      r5 = _nt_not_keyword
      s4 << r5
      if r5
        r6 = _nt_space
        s4 << r6
      end
      if s4.last
        r4 = instantiate_node(SyntaxNode,input, i4...index, s4)
        r4.extend(InCondition0)
      else
        @index = i4
        r4 = nil
      end
      if r4
        r3 = r4
      else
        r3 = instantiate_node(SyntaxNode,input, index...index)
      end
      s0 << r3
      if r3
        r7 = _nt_in_keyword
        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
            if r10
              r12 = _nt_space
              if r12
                r11 = r12
              else
                r11 = instantiate_node(SyntaxNode,input, index...index)
              end
              s0 << r11
              if r11
                i13 = index
                r14 = _nt_exprs
                if r14
                  r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true
                  r13 = r14
                else
                  r15 = _nt_subquery
                  if r15
                    r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true
                    r13 = r15
                  else
                    @index = i13
                    r13 = nil
                  end
                end
                s0 << r13
                if r13
                  r17 = _nt_space
                  if r17
                    r16 = r17
                  else
                    r16 = instantiate_node(SyntaxNode,input, index...index)
                  end
                  s0 << r16
                  if r16
                    if (match_len = has_terminal?(')', false, index))
                      r18 = true
                      @index += match_len
                    else
                      terminal_parse_failure('\')\'')
                      r18 = nil
                    end
                    s0 << r18
                  end
                end
              end
            end
          end
        end
      end
    end
  end
  if s0.last
    r0 = instantiate_node(SyntaxNode,input, i0...index, s0)
    r0.extend(InCondition1)
    r0.extend(InCondition2)
  else
    @index = i0
    r0 = nil
  end

  node_cache[:in_condition][start_index] = r0

  r0
end

#rootObject



8
9
10
# File 'lib/oracle-sql-parser/grammar/condition/in.rb', line 8

def root
  @root ||= :in_condition
end