Commit 9ed369a
feat(plsql): sync grammar with upstream antlr/grammars-v4 (#47)
* feat(plsql): sync grammar with upstream antlr/grammars-v4
Add 51 lexer tokens and 20 parser rules from upstream for enhanced
Oracle support while preserving all existing Bytebase customizations.
New capabilities:
- Oracle 21c+ annotations (ANNOTATIONS clause)
- CREATE SCHEMA statement
- DROP MATERIALIZED VIEW LOG statement
- Compound triggers (COMPOUND TRIGGER)
- MOVE PARTITION / RENAME PARTITION operations
- SQL%BULK_ROWCOUNT / SQL%BULK_EXCEPTIONS expressions
- Preprocessor directives ($IF, $ERROR, $ELSIF, etc.)
- ACCESSIBLE BY clause for package visibility
- PIPELINED USING clause
- DEFAULT COLLATION clause
Also fixes:
- Sequence keywords for Oracle 19C+ (NOKEEP, NOSCALE, GLOBAL, etc.)
- Extra semicolon in create_type.sql test file
All 371 tests pass with no regressions.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(plsql): add extended upstream rules for more complete Oracle support
Adds 28 additional parser rules from upstream:
C External Call Support:
- c_external_parameter, c_property
Analytic Views:
- hierarchies_clause, filter_clause, filter_clauses
- subav_clause, subav_factoring_clause
- add_calc_meas_clause, add_calcs_clause
- aggregate_clause
Utility Rules:
- parallel_instances_clause, overriding_procedure_spec
- assignable_element, connection_qualifier, local_link_name
- by_user_for_statistics_clause, unary_logical_operation
- variable_or_collection, collection_expression
- virtual_column_expression
Partition Values:
- index_partitioning_values_list, range_values_list
SQL*Plus:
- clear_command, start_command, sql_plus_command_no_semicolon
Other:
- expressions_, string_delimiter, system_actions
All 371 tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat(plsql): integrate upstream rules into grammar entry points
Integrates the upstream rules into the main grammar so they are actually
usable:
- Add create_schema to unit_statement
- Add drop_materialized_view_log to unit_statement
- Add accessible_by_clause to create_package, create_function_body,
create_procedure_body
- Add annotations_clause to create_package, create_function_body,
create_procedure_body
- Add default_collation_clause to create_package, create_function_body,
create_procedure_body
- Add compound_trigger_block to trigger_body
- Integrate pipelined_using_clause into create_function_body for
polymorphic table functions (ROW/TABLE POLYMORPHIC)
Test files added from upstream:
- examples/create_function03.sql (polymorphic pipelined function)
- examples/drop_materialized_view_log.sql
All 373 tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* style(plsql): group bracket/paren tokens together in lexer
Move LEFT_CURLY_PAREN and RIGHT_CURLY_PAREN to be adjacent to
LEFT_BRACKET/RIGHT_BRACKET and LEFT_PAREN/RIGHT_PAREN for easier
navigation and consistency.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 5e19d5c commit 9ed369a
12 files changed
Lines changed: 56968 additions & 43205 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| 541 | + | |
541 | 542 | | |
542 | 543 | | |
543 | 544 | | |
| |||
1055 | 1056 | | |
1056 | 1057 | | |
1057 | 1058 | | |
| 1059 | + | |
1058 | 1060 | | |
1059 | 1061 | | |
1060 | 1062 | | |
| |||
1137 | 1139 | | |
1138 | 1140 | | |
1139 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
1140 | 1144 | | |
1141 | 1145 | | |
1142 | 1146 | | |
| |||
1611 | 1615 | | |
1612 | 1616 | | |
1613 | 1617 | | |
| 1618 | + | |
1614 | 1619 | | |
1615 | 1620 | | |
1616 | 1621 | | |
| |||
2422 | 2427 | | |
2423 | 2428 | | |
2424 | 2429 | | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
| 2459 | + | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
| 2464 | + | |
| 2465 | + | |
| 2466 | + | |
| 2467 | + | |
| 2468 | + | |
| 2469 | + | |
| 2470 | + | |
| 2471 | + | |
| 2472 | + | |
| 2473 | + | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
| 2477 | + | |
| 2478 | + | |
| 2479 | + | |
| 2480 | + | |
| 2481 | + | |
| 2482 | + | |
2425 | 2483 | | |
2426 | 2484 | | |
2427 | 2485 | | |
| |||
2551 | 2609 | | |
2552 | 2610 | | |
2553 | 2611 | | |
2554 | | - | |
2555 | | - | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
2556 | 2616 | | |
2557 | 2617 | | |
2558 | 2618 | | |
| |||
0 commit comments