Repository navigation
Commit 5eaef7a
committed
Wire the SQLite driver to the wordpress/mysql-parser package
Replace the hand-written recursive parser with the table-driven LALR(1)
parser generated from MySQL's official grammar, consumed as a Composer
dependency:
- Require wordpress/mysql-parser, resolved from the monorepo sibling
package via a Composer path repository, and load it through the
Composer autoloader in the driver loader.
- Drop the old parser machinery (WP_Parser, WP_Parser_Grammar, the
lexer, the parse tree classes, and mysql-grammar.php), all provided
by the parser package now, and the native parser fork, which is bound
to the old grammar contract.
- Parse multi-statement input by splitting the token stream on top-level
';' separators, as the grammar parses a single statement (this is how
MySQL clients split multi-statement input).
- Re-key the statement dispatch to the sql_yacc.yy rule names and map
keyword token constants to the grammar keyword table.
The translation layer still needs to be ported to the new AST shapes.1 parent 33cbf06 commit 5eaef7a
20 files changed
Lines changed: 477 additions & 4810 deletions
File tree
- packages/mysql-on-sqlite
- src
- mysql
- native
- parser
- sqlite
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
4 | 16 | | |
5 | 17 | | |
6 | 18 | | |
7 | 19 | | |
8 | 20 | | |
9 | 21 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 22 | + | |
14 | 23 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 15 | | |
37 | 16 | | |
38 | 17 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments