Available on crate feature
parser only.Expand description
The concrete syntax tree (CST) and the parser that produces it.
The parser itself is generated at build time by lelwel from the grammar in src/parser/wright.llw and
included here. This module implements the ParserCallbacks trait that the generated code relies on for:
- Tokenization (delegated to crate::lexer, see
lexer.rsin this module). - Creating Diagnostics for syntax errors.
- The semantic predicates (
?N) and actions (#N) referenced by the grammar.
The CST is lossless – every token from the source (including whitespace and comments) is in it. It’s mostly useful as an intermediate step to the AST, but is also exposed via SyntaxTree for tooling such as formatters that need every token.
Structs§
- Cst
- A concrete syntax tree (CST) type.
- CstChildren
- An iterator for child nodes of a CST node.
- CstData
- CstIndex
64-bit - NodeRef
- Parse
Context - Context carried through a parse and used by the semantic predicates and actions.
- Parser
- Syntax
Tree - A lossless concrete syntax tree for a Source, as produced by the generated parser.