Expand description
The Rust parser.
NOTE: The crate is undergoing refactors, donβt believe everything the docs say :-)
The parser doesnβt know about concrete representation of tokens
and syntax trees. Abstract Input and Output traits are
used to provide tokens instead. As a consequence, this crate does
not contain a lexer.
The Parser struct from the parser module is a cursor into the
sequence of tokens. Parsing routines use Parser to inspect current
state and advance the parsing.
The actual parsing happens in the grammar module.
Tests for this crate live in the syntax crate.
ModulesΒ§
- event π
- This module provides a way to construct a
File. It is intended to be completely decoupled from the parser, so as to allow to evolve the tree representation and the parser algorithm independently. - frontmatter π
- grammar π
- This is the actual βgrammarβ of the Rust language.
- input π
- See
Input. - lexed_
str π - Lexing
&strinto a sequence of Rust tokens. - output π
- See
Output - parser π
- See
Parser. - shortcuts π
- Shortcuts that span lexer/parser abstraction.
- syntax_
kind π - Defines
SyntaxKindβ a fieldless enum of all possible syntactic constructs of the Rust language. - token_
set π - A bit-set of
SyntaxKinds.
MacrosΒ§
StructsΒ§
- Input
- Input for the parser β a sequence of tokens.
- Lexed
Str - Output
- Output of the parser β a DFS traversal of a concrete syntax tree.
- Reparser
- A parsing function for a specific braced-block.
EnumsΒ§
- Edition
- Prefix
Entry Point - Parse a prefix of the input as a given syntactic construct.
- Step
- StrStep
- Syntax
Kind - The kind of syntax node, e.g.
IDENT,USE_KW, orSTRUCT. - TopEntry
Point - Parse the whole of the input as a given syntactic construct.