-
Notifications
You must be signed in to change notification settings - Fork 543
WIP: Started working on the Parser #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here I think I would link to the relevant chapter of the guide -- oh, wait, do we not have a chapter for the AST? We should add one =) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was thinking the AST would fall under the parser section, maybe as a short sub-chapter. |
||
|
||
|
||
[libsyntax]: https://github.com/rust-lang/rust/tree/master/src/libsyntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to wikipedia? Maybe pointless?