[MDEV-21043] Collect different bison %type declarations into a single chunk Created: 2019-11-13  Updated: 2020-01-23  Resolved: 2019-11-13

Status: Closed
Project: MariaDB Server
Component/s: Parser
Fix Version/s: 10.5.0

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-12518 Unify sql_yacc.yy and sql_yacc_ora.yy Closed

 Description   

Bison grammar files sql_yacc.yy and sql_yacc_ora.yy has a number of different %type declarations, which are distributed all around the file.
In order to unify the two files easier, let's collect different declarations in a single chunk, like this:

  • in sql_yacc.cc:

    /* Start of sql_mode=DEFAULT specific declarations */
    %type <NONE> sp_tail
    %type <NONE> sp_unlabeled_block_not_atomic
    %type <NONE> sp_proc_stmt_in_returns_clause
    %type <lex_str> sp_label
    %type <spblock> sp_decl_handler
    %type <spblock> sp_decls
    %type <spblock> sp_decl
    %type <spblock> sp_decl_body
    %type <spblock> sp_decl_variable_list
    /* End of sql_mode=DEFAULT specific declarations */
    

  • in sql_yacc_ora.yy:

    /* Start of sql_mode=ORACLE specific declarations */
    %type <NONE> set_assign
    %type <NONE> sp_tail_standalone
    %type <NONE> sp_labelable_stmt
    %type <simple_string> remember_end_opt
    %type <lex_str> opt_package_routine_end_name
    %type <lex_str> label_declaration_oracle
    %type <lex_str> labels_declaration_oracle
    %type <kwd> keyword_directly_assignable
    %type <ident_sys> ident_directly_assignable
    %type <ident_cli> ident_cli_directly_assignable
    %type <spname> opt_sp_name
    %type <spblock> sp_decl_body_list
    %type <spblock> opt_sp_decl_body_list
    %type <spblock> sp_decl_vars
    %type <spblock> sp_decl_non_handler
    %type <spblock> sp_decl_non_handler_list
    %type <spblock> sp_decl_handler
    %type <spblock> sp_decl_handler_list
    %type <spblock> opt_sp_decl_handler_list
    %type <spblock> package_implementation_routine_definition
    %type <spblock> package_implementation_item_declaration
    %type <spblock> package_implementation_declare_section
    %type <spblock> package_implementation_declare_section_list1
    %type <spblock> package_implementation_declare_section_list2
    %type <spblock_handlers> sp_block_statements_and_exceptions
    %type <spblock_handlers> package_implementation_executable_section
    %type <sp_instr_addr> sp_instr_addr
    %type <num> opt_exception_clause exception_handlers
    %type <lex> remember_lex
    %type <lex> package_routine_lex
    %type <lex> package_specification_function
    %type <lex> package_specification_procedure
    /* End of sql_mode=ORACLE specific declarations */
    

so that later we can cut the sql_mode=DEFAULT specific block and replace it to the sql_mode=ORACLE specific block.


Generated at Thu Feb 08 09:04:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.