Skip to content

Implement SQL parser foundation: core types, arena, tokenizer, classifier #3

@renecannao

Description

@renecannao

Summary

Build the foundational parser pipeline for a new hand-written recursive descent SQL parser to replace the existing Flex/Bison POC. This covers:

  • Core types (StringRef, Dialect enum, StmtType, NodeType)
  • Arena allocator (block-chained, zero-copy, sub-microsecond reset)
  • Dialect-templated tokenizer (MySQL + PostgreSQL)
  • Statement classifier (switch dispatch on first token)
  • Tier 2 extractors (table name extraction for DML/DDL, transaction classification, USE database)

Design Spec

docs/superpowers/specs/2026-03-24-sql-parser-design.md

Implementation Plan

docs/superpowers/plans/2026-03-24-sql-parser-foundation.md

Tasks

  • Build system setup (Makefile.new, Google Test)
  • Core types — StringRef, enums
  • Arena allocator
  • AstNode (32-byte) and ParseResult
  • Token types and keyword tables (MySQL + PostgreSQL)
  • Tokenizer (dialect-templated, header-only)
  • Classifier and Tier 2 extractors
  • Integration smoke test

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions