Expand description
ANTLR v4 grammar compiler and Rust source generator for the dbt-antlr-runtime
runtime.
The emission layer renders recognizers from the minijinja template
templates/dbt/Rust.stg.jinja on top of the grammar analysis in grammar.
There are two ways to run a generation:
Config: the build-script API. Add this crate as a build dependency and call it frombuild.rs; the generated code compiles against thedbt-antlr-runtimecrate. No tool installation is needed.- The
dbt-antlr-codegenbinary: the Java-tool-like command line for one-shot or checked-in generation.
§Crate features
generator(default): the in-process grammar compiler and emission layer. Disable it to use this crate as a thin client.download: enablesConfig::pinned_release, which downloads and runs a pinned prebuilt release binary instead of compiling the generator.fancy(default): pretty miette diagnostics for the command line.atn-export: internal, for this workspace’s own tests.
Modules§
- atn_
export - Compiled ATN data export, available with the
atn-exportfeature. - cli
- Command-line interface of the dbt emission layer, mirroring the Java ANTLR tool’s argument syntax:
- emission
- Emission layer generating Rust recognizers for the
dbt-antlr-runtimeruntime.
Structs§
- Config
- Generator configuration, primarily for use from a
build.rsbuild script. - Diagnostic
- A grammar compiler diagnostic.
- Error
- Structured error returned by the emission entry points.
- Generation
- Files and non-fatal output of
Config::generate_detailed. - Optimization
Options - Optimization selection for one generation run.
Enums§
- Emit
Error - Errors of the emission layer.
- Error
Kind - Broad category of a generator failure.
- Severity
- Severity of one grammar diagnostic.
Constants§
- VERSION
- Version of this generator package.