File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,17 @@ diagnostic infrastructure in `rustc`. Instead it provides diagnostics as plain
137
137
data which are emitted in ` rustc_parse::lexer::mod ` as real diagnostics.
138
138
The lexer preserves full fidelity information for both IDEs and proc macros.
139
139
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
+
140
151
141
152
[ String interning ] : https://en.wikipedia.org/wiki/String_interning
142
153
[ `rustc_lexer` ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lexer/index.html
You can’t perform that action at this time.
0 commit comments