Skip to content

Commit f2d471c

Browse files
committed
chore: remove old Flex/Bison parser code, rename Makefile.new to Makefile (#14)
Delete legacy parser directories (src/mysql_parser/, src/pgsql_parser/, include/mysql_parser/, include/pgsql_parser/) and examples/. Remove old Makefile and rename Makefile.new -> Makefile. Update all references in CI workflow, scripts, and documentation.
1 parent 4e9a633 commit f2d471c

23 files changed

Lines changed: 180 additions & 3260 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
- name: Build and test
2020
env:
2121
CXX: ${{ matrix.compiler }}
22-
run: make -f Makefile.new clean && make -f Makefile.new all
22+
run: make -f Makefile clean && make -f Makefile all
2323

2424
macos:
2525
runs-on: macos-latest
2626
steps:
2727
- uses: actions/checkout@v4
2828

2929
- name: Build and test
30-
run: make -f Makefile.new clean && make -f Makefile.new all
30+
run: make -f Makefile clean && make -f Makefile all
3131

3232
benchmark:
3333
runs-on: ubuntu-24.04
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Build release and run benchmarks
3838
run: |
39-
sed 's/-g -O2/-O3/' Makefile.new > /tmp/Makefile.release
39+
sed 's/-g -O2/-O3/' Makefile > /tmp/Makefile.release
4040
make -f /tmp/Makefile.release clean
4141
make -f /tmp/Makefile.release lib
4242
make -f /tmp/Makefile.release test
@@ -55,7 +55,7 @@ jobs:
5555
- uses: actions/checkout@v4
5656

5757
- name: Build
58-
run: make -f Makefile.new all && make -f Makefile.new build-corpus-test
58+
run: make -f Makefile all && make -f Makefile build-corpus-test
5959

6060
- name: Test against SQLGlot
6161
run: |

.gitignore

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,9 @@
3131
*.out
3232
*.app
3333

34-
mysql_stdin_parser_example
35-
set_mysql_example
36-
mysql_example
37-
pgsql_example
38-
libpgsqlparser.a
39-
src/*_parser/*_parser.tab.c
40-
src/*_parser/*_parser.tab.h
41-
src/*_parser/*_lexer.yy.c
42-
src/*_parser/*_parser.output
43-
src/*_parser/*_parser.report
44-
45-
# New parser build artifacts
34+
# Build artifacts
4635
libsqlparser.a
36+
sqlengine
4737
run_tests
4838
run_bench
4939
run_bench_compare

CLAUDE.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@ High-performance hand-written recursive descent SQL parser and query engine for
99
## Build Commands
1010

1111
```bash
12-
make -f Makefile.new all # Build library + run all 871 tests
13-
make -f Makefile.new lib # Build only libsqlparser.a
14-
make -f Makefile.new test # Build + run tests
15-
make -f Makefile.new bench # Build + run benchmarks
16-
make -f Makefile.new bench-compare # Run comparison vs libpg_query (requires libpg_query built)
17-
make -f Makefile.new build-corpus-test # Build corpus test harness
18-
make -f Makefile.new clean # Remove all build artifacts
12+
make all # Build library + run all 871 tests
13+
make lib # Build only libsqlparser.a
14+
make test # Build + run tests
15+
make bench # Build + run benchmarks
16+
make bench-compare # Run comparison vs libpg_query (requires libpg_query built)
17+
make build-corpus-test # Build corpus test harness
18+
make clean # Remove all build artifacts
1919
```
2020

21-
For release benchmarks: `sed 's/-g -O2/-O3/' Makefile.new > /tmp/Makefile.release && make -f /tmp/Makefile.release bench`
22-
23-
**Note:** The old `Makefile` (no `.new`) is for the legacy Flex/Bison parser — do not use it for new code.
21+
For release benchmarks: `sed 's/-g -O2/-O3/' Makefile > /tmp/Makefile.release && make -f /tmp/Makefile.release bench`
2422

2523
## Parser Architecture
2624

@@ -51,7 +49,7 @@ Everything is in `namespace sql_parser`. All templates are parameterized on `Dia
5149
6. Add emit methods to `emitter.h`
5250
7. Add `is_keyword_as_identifier()` entries in `expression_parser.h` for new keywords
5351
8. Update `is_alias_start()` blocklist in `table_ref_parser.h` for clause-starting keywords
54-
9. Write tests in `tests/test_xxx.cpp`, add to `Makefile.new` TEST_SRCS
52+
9. Write tests in `tests/test_xxx.cpp`, add to `Makefile` TEST_SRCS
5553

5654
### Expression parsing
5755

0 commit comments

Comments
 (0)