Skip to content

Commit

Permalink
Initial refactoring.
Browse files Browse the repository at this point in the history
- Renamed most rules starting with select_ to the names used in the SQL
  standard, <query expression>, <query expression body>, <query term>, <query
  primary> and <subquery>, respectively.

- Added %expect 0

- The previous rule for UNION/INTERSECT syntax was right-recursive, and so the
  parse tree is right-deep. This patch only changes the rule, you don't want
  right-recursion in an LALR parser, and moreover it's not standard. It doesn't
  change the parse tree structure, so we need an extra wrinkle to build the
  parse tree top-down.

- Indentation follows the most common standard, found in MySQL and Postgres.

Future work: INTERSECT has higher priority than UNION in the standard, but these
rules give them the same priority.
  • Loading branch information
Martin Hansson committed Sep 12, 2024
1 parent 73921a3 commit 4f220ed
Show file tree
Hide file tree
Showing 5 changed files with 1,850 additions and 1,767 deletions.
Loading

0 comments on commit 4f220ed

Please sign in to comment.