Skip to content

Commit 3c98b0f

Browse files
Started working on the parser chapter
1 parent e7b1ed0 commit 3c98b0f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/the-parser.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
# The parser
1+
# The Parser
2+
3+
The parser is responsible for converting raw Rust source code into a structured
4+
form which is easier for the compiler to work with, usually called an *Abstract
5+
Syntax Tree*. The bulk of the parser lives in the [libsyntax] crate.
6+
7+
The parsing process is made up of roughly 3 stages,
8+
9+
- lexical analysis - turn a stream of characters into a stream of token trees
10+
- macro expansion - run `proc-macros` and expand `macro_rules` macros
11+
- parsing - turn the token trees into an AST
12+
13+
14+
[libsyntax]: https://github.com/rust-lang/rust/tree/master/src/libsyntax

0 commit comments

Comments
 (0)