Expand description
§dbt-antlr-runtime runtime
This is a Rust runtime for ANTLR4 parser generator. It is required to use parsers and lexers generated by ANTLR4 parser generator
This documentation refers to particular api used by generated parsers,lexers and syntax trees.
For info on what is ANTLR4 and how to generate parser please refer to:
Documentation for this crate is still a work in progress, but you can find some docs in the source code, and also refer to the Java runtime documentation for general concepts and architecture of the runtime, as well as for documentation of internal modules that are not yet documented in Rust.
Re-exports§
pub use input_stream::InputStream;
Modules§
- char_
stream IntStreamextension for Lexer that allows subslicing of underlying data- common_
token_ stream - Channel based
TokenStream - error_
listener - Error reporting
- error_
strategy - Error handling and recovery
- errors
- Error types
- input_
stream - Input to lexer
- int_
stream - <ost generic stream of symbols
- interpreter_
rule_ context - Parse tree node types used by crate::parser_interpreter::ParserInterpreter.
- lexer
- Lexer implementation
- lexer_
atn_ simulator - Implementation of lexer automata(DFA)
- lexer_
interpreter - A lexer simulator that mimics what ANTLR’s generated lexer code does.
- parser
- Base parser implementation
- parser_
atn_ simulator - Base parser implementation
- parser_
interpreter - A parser simulator that mimics what ANTLR’s generated parser code does.
- parser_
rule_ context - Full parser node
- predict_
timing - Optional timing of ALL(*) prediction: how much of a parse is spent deciding which alternative to take, and how much of that is stage-2 full-LL.
- prelude
- Glob-import module for generated recognizers.
- rule_
context - Minimal parser node
- token
- Symbols that parser works on
- token_
factory - How Lexer should produce tokens
- token_
stream IntStreamthat produces tokens for Parser- tree
- General AST
- trees
- A set of utility routines useful for all kinds of ANTLR trees.
- vocabulary
- Mapping from symbol type to its string representation
Macros§
- cast_
unchecked - check_
version - Compile-time compatibility gate between generated code and the runtime.
- impl_
ctx - impl_
deref - impl_
lexer_ recog - impl_
listener_ dispatch - impl_
node_ inner - impl_
node_ kind - impl_
node_ kind_ common - impl_
parser_ recog - impl_
parser_ rule_ context - impl_
rule_ context - impl_
token_ source - impl_
tree - impl_
tree_ trait_ delegates - impl_
visitable - maybe_
grow_ stack - parse_
rule
Structs§
- Arena
- Bail
Error Strategy - This implementation of
ANTLRErrorStrategyresponds to syntax errors by immediately canceling the parse operation with aParseCancellationException. The implementation ensures that theParserRuleContext.exceptionfield is set for all parse tree nodes that were not completed prior to encountering the error. - Base
Lexer - Default implementation of Lexer
- Base
Parser - Abstract base parser implementation
- Default
Error Strategy - This is the default implementation of
ErrorStrategyused for error reporting and recovery in ANTLR parsers. - Listener
Id - Allows to safely cast listener back to user type
Enums§
- Prediction
Mode - This enum defines the prediction modes available in ANTLR 4 along with utility methods for analyzing configuration sets for conflicts and/or ambiguities.
Constants§
Traits§
- Error
Strategy - The interface for defining strategies to deal with syntax errors encountered during a parse by ANTLR-generated parsers. We distinguish between three different kinds of errors:
- Lexer
- Lexer functionality required by
LexerATNSimulatorto work properly - Parser
- parser functionality required for
ParserATNSimulatorto work - Token
Source - Produces tokens to be used by parser (aka Lexer).