[MDEV-21064] Add a new class sp_expr_lex and a new grammar rule expr_lex Created: 2019-11-15 Updated: 2020-01-23 Resolved: 2019-11-16 |
|
| 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: |
|
||||||||
| Description |
|
In some cases the code in *.yy files related to expression parsed in their own LEX is hard to modify: reset_lex() and its correspoding restore_lex() reside in different grammar rules or different LEX methods. In order to simplify this (and later join sql_yacc.yy and sql_yacc_ora.yy easier), let's add a class representing an expression (Item) pointer and its LEX (that was used to parse this expression). Additionally, let's
The tentative class structure is:
The new rule that creates sp_expr_lex (i.e. LEX+Item) will look like this:
After these changes, it will be much easier to move grammar rules, because reset_lex() and its corresponding restore_lex() will reside inside the same rule expr_lex. A lot of restore_lex() calls will be gone. |