Abstract syntax tree
An abstract syntax tree is a hierarchical tree representation of the syntactic structure of parsed source code or other language input, typically omitting superficial formatting details.
Building User-Friendly DSLs
A structured representation of language content in which nodes represent syntactic constructs independently of surface notation.
- How it is used
- Anchors projectional DSL editing, code generation, language services, and structural evolution in a shared representation.
- How deep it goes
- Defines extraction and tree shape, then implements JavaScript encoding, navigation, recursive traversal, and migrations; defers parsing mechanics.
- Examples
- Builds a Rental record AST with attributes, numeric initial values, and an attribute-reference initial value.
- What you can do after
- Apply it via JavaScript to encode, inspect, modify, traverse, and migrate DSL content represented as ASTs.
Read how Building User-Friendly DSLs explains abstract syntax tree →
Write Powerful Rust Macros
An abstract syntax tree is a hierarchical representation of a program's syntactic structure and relevant semantic elements.
- How it is used
- Supports procedural macros that inspect Rust input structure and generate replacement or additional code.
- How deep it goes
- Demonstrates parsing, re-emitting, testing, and traversing AST nodes; defers compiler parsing internals.
- Examples
- Uses `1 + 11`, struct reconstruction, builder-output tests, and `String` versus `u8` fields.
- What you can do after
- Apply it via `syn` to inspect Rust declarations, verify generated output, and vary macro expansion by field type.
Read how Write Powerful Rust Macros explains abstract syntax tree →
Related concepts
- parsingproduced by · Parsing is the analysis of input according to structural or syntactic rules to identify its components and produce a structured, usable representation.
- edit statecontrasts with · A book-specific object stored outside the abstract syntax tree that tracks editing state, including the original value and update operation for a projected DSL value.
- build systemused by · A build system is software that automates transforming source code and project inputs into artifacts through tasks such as compiling, testing, and packaging.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

