Expand description
§dbt-antlr4 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
- lexer
- Lexer implementation
- lexer_
atn_ simulator - Implementation of lexer automata(DFA)
- parser
- Base parser implementation
- parser_
atn_ simulator - Base parser implementation
- parser_
rule_ context - Full parser node
- 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 - impl_
deref - impl_
listener_ dispatch - impl_
node_ inner - impl_
node_ kind - impl_
node_ kind_ common - impl_
parser_ rule_ context - impl_
rule_ context - impl_
token_ source - impl_
tree - impl_
tree_ trait_ delegates - impl_
visitable - maybe_
grow_ stack
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).