Module: OracleSqlParser::Grammar::Condition::PatternMatching
- Includes:
- Treetop::Runtime
- Included in:
- OracleSqlParser::Grammar::Condition, PatternMatchingParser
- Defined in:
- lib/oracle-sql-parser/grammar/condition/pattern_matching.rb
Defined Under Namespace
Modules: LikeCondition0, LikeCondition1, LikeCondition2, LikeCondition3, PatternMachingCondition0, RegexpLikeCondition0, RegexpLikeCondition1
Instance Method Summary collapse
- #_nt_like_condition ⇒ Object
- #_nt_pattern_maching_condition ⇒ Object
- #_nt_regexp_like_condition ⇒ Object
- #root ⇒ Object
Instance Method Details
#_nt_like_condition ⇒ Object
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 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/oracle-sql-parser/grammar/condition/pattern_matching.rb', line 128 def _nt_like_condition start_index = index if node_cache[:like_condition].has_key?(index) cached = node_cache[:like_condition][index] if cached node_cache[:like_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_ident 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(LikeCondition0) else @index = i4 r4 = nil end if r4 r3 = r4 else r3 = instantiate_node(SyntaxNode,input, index...index) end s0 << r3 if r3 i7 = index r8 = _nt_like_keyword if r8 r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true r7 = r8 else r9 = _nt_like2_keyword if r9 r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true r7 = r9 else r10 = _nt_like4_keyword if r10 r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true r7 = r10 else r11 = _nt_likec_keyword if r11 r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true r7 = r11 else @index = i7 r7 = nil end end end end s0 << r7 if r7 r12 = _nt_space s0 << r12 if r12 r13 = _nt_text_literal s0 << r13 if r13 i15, s15 = index, [] r16 = _nt_space s15 << r16 if r16 r17 = _nt_escape_keyword s15 << r17 if r17 r18 = _nt_space s15 << r18 if r18 r19 = _nt_text_literal s15 << r19 end end end if s15.last r15 = instantiate_node(SyntaxNode,input, i15...index, s15) r15.extend(LikeCondition1) else @index = i15 r15 = nil end if r15 r14 = r15 else r14 = instantiate_node(SyntaxNode,input, index...index) end s0 << r14 end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(LikeCondition2) r0.extend(LikeCondition3) else @index = i0 r0 = nil end node_cache[:like_condition][start_index] = r0 r0 end |
#_nt_pattern_maching_condition ⇒ Object
18 19 20 21 22 23 24 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 |
# File 'lib/oracle-sql-parser/grammar/condition/pattern_matching.rb', line 18 def _nt_pattern_maching_condition start_index = index if node_cache[:pattern_maching_condition].has_key?(index) cached = node_cache[:pattern_maching_condition][index] if cached node_cache[:pattern_maching_condition][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_like_condition if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 r0.extend(PatternMachingCondition0) r0.extend(PatternMachingCondition0) else r2 = _nt_regexp_like_condition if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 r0.extend(PatternMachingCondition0) r0.extend(PatternMachingCondition0) else @index = i0 r0 = nil end end node_cache[:pattern_maching_condition][start_index] = r0 r0 end |
#_nt_regexp_like_condition ⇒ Object
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 |
# File 'lib/oracle-sql-parser/grammar/condition/pattern_matching.rb', line 274 def _nt_regexp_like_condition start_index = index if node_cache[:regexp_like_condition].has_key?(index) cached = node_cache[:regexp_like_condition][index] if cached node_cache[:regexp_like_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_regexp_like_keyword s0 << r1 if r1 if (match_len = has_terminal?('(', false, index)) r2 = true @index += match_len else terminal_parse_failure('\'(\'') r2 = nil end s0 << r2 if r2 r4 = _nt_space if r4 r3 = r4 else r3 = instantiate_node(SyntaxNode,input, index...index) end s0 << r3 if r3 r5 = _nt_ident s0 << r5 if r5 r7 = _nt_space if r7 r6 = r7 else r6 = instantiate_node(SyntaxNode,input, index...index) end s0 << r6 if r6 if (match_len = has_terminal?(',', false, index)) r8 = true @index += match_len else terminal_parse_failure('\',\'') r8 = nil end s0 << r8 if r8 r10 = _nt_space if r10 r9 = r10 else r9 = instantiate_node(SyntaxNode,input, index...index) end s0 << r9 if r9 r11 = _nt_text_literal s0 << r11 if r11 r13 = _nt_space if r13 r12 = r13 else r12 = instantiate_node(SyntaxNode,input, index...index) end s0 << r12 if r12 if (match_len = has_terminal?(')', false, index)) r14 = true @index += match_len else terminal_parse_failure('\')\'') r14 = nil end s0 << r14 end end end end end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(RegexpLikeCondition0) r0.extend(RegexpLikeCondition1) else @index = i0 r0 = nil end node_cache[:regexp_like_condition][start_index] = r0 r0 end |