about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/rustc-dev-guide/src/the-parser.md15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/doc/rustc-dev-guide/src/the-parser.md b/src/doc/rustc-dev-guide/src/the-parser.md
index ab756895ae6..a43ae3398fc 100644
--- a/src/doc/rustc-dev-guide/src/the-parser.md
+++ b/src/doc/rustc-dev-guide/src/the-parser.md
@@ -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