Started working on the parser chapter

This commit is contained in:
Michael Bryan 2018-01-20 22:13:39 +08:00
parent 50978bf706
commit 20970b6b85
1 changed files with 14 additions and 1 deletions

View File

@ -1 +1,14 @@
# The parser
# The Parser
The parser is responsible for converting raw Rust source code into a structured
form which is easier for the compiler to work with, usually called an *Abstract
Syntax Tree*. The bulk of the parser lives in the [libsyntax] crate.
The parsing process is made up of roughly 3 stages,
- lexical analysis - turn a stream of characters into a stream of token trees
- macro expansion - run `proc-macros` and expand `macro_rules` macros
- parsing - turn the token trees into an AST
[libsyntax]: https://github.com/rust-lang/rust/tree/master/src/libsyntax