Skip to content

Commit 5ee6d33

Browse files
committed
edit parsing
1 parent b744e7e commit 5ee6d33

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/overview.md

+11
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,17 @@ diagnostic infrastructure in `rustc`. Instead it provides diagnostics as plain
137137
data which are emitted in `rustc_parse::lexer::mod` as real diagnostics.
138138
The lexer preserves full fidelity information for both IDEs and proc macros.
139139

140+
The *parser* [translates the token stream from the lexer into an Abstract Syntax
141+
Tree (AST)][parser]. It uses a recursive descent (top-down) approach to syntax
142+
analysis. The crate entry points for the parser are the
143+
[`Parser::parse_crate_mod()`][parse_crate_mod] and [`Parser::parse_mod()`][parse_mod]
144+
methods found in [`rustc_parse::parser::Parser`]. The external module parsing
145+
entry point is [`rustc_expand::module::parse_external_mod`][parse_external_mod].
146+
And the macro parser entry point is [`Parser::parse_nonterminal()`][parse_nonterminal].
147+
148+
Parsing is performed with a set of `Parser` utility methods including `bump`,
149+
`check`, `eat`, `expect`, `look_ahead`.
150+
140151

141152
[String interning]: https://en.wikipedia.org/wiki/String_interning
142153
[`rustc_lexer`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lexer/index.html

0 commit comments

Comments
 (0)