Architecture¶
cl-parser-kit is organized as a small stack of layers. Each layer stays
intentionally narrow so the behavior remains easy to reason about and test.
Layering¶
spansmodel source locations.tokensattach lexical meaning and source metadata to text.tokenizerturns raw text into token vectors.diagnosticscapture structured failures and fix-it data.combinatorsprovide small parser primitives over token vectors.prattbuilds expression parsers on top of token streams.parserties tokenization and parser execution together.astandcstprovide tree-shaped outputs for downstream consumers.testingsupplies the local assertion helpers used by the suite.
Dependency Direction¶
Dependencies flow downward. Higher layers may use lower layers, but lower layers do not depend on higher ones.
- tokenizers depend on spans and tokens
- diagnostics depend on spans and tokens
- combinators depend on tokens and diagnostics
- parser entry points depend on tokenizer and combinator layers
- tree helpers depend on spans and tokens
This keeps the public surface modular without introducing multiple packages for every concept.
Invariants¶
- parse failures preserve the furthest known position when possible
- parser entry points consume the full token stream when
parse-allis used - token spans remain attached end-to-end so diagnostics and trees can share the same location data
- examples are expected to stay REPL-friendly and dependency-light
Public Shape¶
The repository intentionally exports one package, :cl-parser-kit, so the
common path stays simple for consumers. See API Reference for
the full exported surface grouped by concern.