Module: OracleSqlParser::Grammar::Select::ForUpdate
- Includes:
- Treetop::Runtime
- Included in:
- OracleSqlParser::Grammar::Select, ForUpdateParser
- Defined in:
- lib/oracle-sql-parser/grammar/select/for_update.rb
Defined Under Namespace
Modules: ForUpdateClause0, ForUpdateClause1, ForUpdateClause2, ForUpdateClause3, ForUpdateClause4, ForUpdateClauseColumn0, ForUpdateClauseColumn1, ForUpdateClauseColumn2, ForUpdateClauseColumn3, ForUpdateClauseColumns0, ForUpdateClauseColumns1, ForUpdateClauseColumns2
Instance Method Summary collapse
- #_nt_for_update_clause ⇒ Object
- #_nt_for_update_clause_column ⇒ Object
- #_nt_for_update_clause_columns ⇒ Object
- #root ⇒ Object
Instance Method Details
#_nt_for_update_clause ⇒ Object
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 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 |
# File 'lib/oracle-sql-parser/grammar/select/for_update.rb', line 90 def _nt_for_update_clause start_index = index if node_cache[:for_update_clause].has_key?(index) cached = node_cache[:for_update_clause][index] if cached node_cache[:for_update_clause][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_for_keyword s0 << r1 if r1 r2 = _nt_space s0 << r2 if r2 r3 = _nt_update_keyword s0 << r3 if r3 i5, s5 = index, [] r6 = _nt_space s5 << r6 if r6 r7 = _nt_of_keyword s5 << r7 if r7 r8 = _nt_space s5 << r8 if r8 r9 = _nt_for_update_clause_columns s5 << r9 end end end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(ForUpdateClause0) else @index = i5 r5 = nil end if r5 r4 = r5 else r4 = instantiate_node(SyntaxNode,input, index...index) end s0 << r4 if r4 i11 = index i12, s12 = index, [] r13 = _nt_space s12 << r13 if r13 r14 = _nt_wait_keyword s12 << r14 if r14 r15 = _nt_space s12 << r15 if r15 r16 = _nt_integer s12 << r16 end end end if s12.last r12 = instantiate_node(SyntaxNode,input, i12...index, s12) r12.extend(ForUpdateClause1) else @index = i12 r12 = nil end if r12 r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true r11 = r12 else i17, s17 = index, [] r18 = _nt_space s17 << r18 if r18 r19 = _nt_nowait_keyword s17 << r19 end if s17.last r17 = instantiate_node(SyntaxNode,input, i17...index, s17) r17.extend(ForUpdateClause2) else @index = i17 r17 = nil end if r17 r17 = SyntaxNode.new(input, (index-1)...index) if r17 == true r11 = r17 else @index = i11 r11 = nil end end if r11 r10 = r11 else r10 = instantiate_node(SyntaxNode,input, index...index) end s0 << r10 end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ForUpdateClause3) r0.extend(ForUpdateClause4) else @index = i0 r0 = nil end node_cache[:for_update_clause][start_index] = r0 r0 end |
#_nt_for_update_clause_column ⇒ Object
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/oracle-sql-parser/grammar/select/for_update.rb', line 355 def _nt_for_update_clause_column start_index = index if node_cache[:for_update_clause_column].has_key?(index) cached = node_cache[:for_update_clause_column][index] if cached node_cache[:for_update_clause_column][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] r2 = _nt_schema_name s1 << r2 if r2 r4 = _nt_space if r4 r3 = r4 else r3 = instantiate_node(SyntaxNode,input, index...index) end s1 << r3 if r3 if (match_len = has_terminal?('.', false, index)) r5 = true @index += match_len else terminal_parse_failure('\'.\'') r5 = nil end s1 << r5 if r5 r7 = _nt_space if r7 r6 = r7 else r6 = instantiate_node(SyntaxNode,input, index...index) end s1 << r6 if r6 r8 = _nt_table_name s1 << r8 if r8 r10 = _nt_space if r10 r9 = r10 else r9 = instantiate_node(SyntaxNode,input, index...index) end s1 << r9 if r9 if (match_len = has_terminal?('.', false, index)) r11 = true @index += match_len else terminal_parse_failure('\'.\'') r11 = nil end s1 << r11 if r11 r13 = _nt_space if r13 r12 = r13 else r12 = instantiate_node(SyntaxNode,input, index...index) end s1 << r12 if r12 r14 = _nt_column_name s1 << r14 end end end end end end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(ForUpdateClauseColumn0) else @index = i1 r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 r0.extend(ForUpdateClauseColumn3) r0.extend(ForUpdateClauseColumn3) else i15, s15 = index, [] r16 = _nt_table_name s15 << r16 if r16 r18 = _nt_space if r18 r17 = r18 else r17 = instantiate_node(SyntaxNode,input, index...index) end s15 << r17 if r17 if (match_len = has_terminal?('.', false, index)) r19 = true @index += match_len else terminal_parse_failure('\'.\'') r19 = nil end s15 << r19 if r19 r21 = _nt_space if r21 r20 = r21 else r20 = instantiate_node(SyntaxNode,input, index...index) end s15 << r20 if r20 r22 = _nt_column_name s15 << r22 end end end end if s15.last r15 = instantiate_node(SyntaxNode,input, i15...index, s15) r15.extend(ForUpdateClauseColumn1) else @index = i15 r15 = nil end if r15 r15 = SyntaxNode.new(input, (index-1)...index) if r15 == true r0 = r15 r0.extend(ForUpdateClauseColumn3) r0.extend(ForUpdateClauseColumn3) else i23, s23 = index, [] r25 = _nt_space if r25 r24 = r25 else r24 = instantiate_node(SyntaxNode,input, index...index) end s23 << r24 if r24 r26 = _nt_column_name s23 << r26 end if s23.last r23 = instantiate_node(SyntaxNode,input, i23...index, s23) r23.extend(ForUpdateClauseColumn2) else @index = i23 r23 = nil end if r23 r23 = SyntaxNode.new(input, (index-1)...index) if r23 == true r0 = r23 r0.extend(ForUpdateClauseColumn3) r0.extend(ForUpdateClauseColumn3) else @index = i0 r0 = nil end end end node_cache[:for_update_clause_column][start_index] = r0 r0 end |
#_nt_for_update_clause_columns ⇒ Object
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 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 |
# File 'lib/oracle-sql-parser/grammar/select/for_update.rb', line 241 def _nt_for_update_clause_columns start_index = index if node_cache[:for_update_clause_columns].has_key?(index) cached = node_cache[:for_update_clause_columns][index] if cached node_cache[:for_update_clause_columns][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_for_update_clause_column s0 << r1 if r1 s2, i2 = [], index loop do i3, s3 = index, [] r5 = _nt_space if r5 r4 = r5 else r4 = instantiate_node(SyntaxNode,input, index...index) end s3 << r4 if r4 if (match_len = has_terminal?(',', false, index)) r6 = true @index += match_len else terminal_parse_failure('\',\'') r6 = nil end s3 << r6 if r6 r8 = _nt_space if r8 r7 = r8 else r7 = instantiate_node(SyntaxNode,input, index...index) end s3 << r7 if r7 r9 = _nt_for_update_clause_column s3 << r9 end end end if s3.last r3 = instantiate_node(SyntaxNode,input, i3...index, s3) r3.extend(ForUpdateClauseColumns0) else @index = i3 r3 = nil end if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ForUpdateClauseColumns1) r0.extend(ForUpdateClauseColumns2) else @index = i0 r0 = nil end node_cache[:for_update_clause_columns][start_index] = r0 r0 end |