An abstract syntax tree (AST) represents DSL content as structured data rather than its written or visual notation. Concrete syntax is reduced by annotating visible cues and extracting objects, settings, and relations. When reference relations are disregarded, the resulting object-relation diagram can be laid out as a tree; that tree-shaped abstract syntax is an AST. section 2.3 section 2.2
An AST separates what content means structurally from how an editor displays it. A projectional editor starts from the AST, reconstructs concrete syntax for display, and lets domain experts edit the structure directly. This makes the AST the central representation for editing and later processing DSL content. section 2.0 section 12.0
Rental record type
A Rental record type becomes a Record Type object containing Data Attribute objects. Each attribute has settings such as name and type. Initial values become separate objects: a Number holds a numeric value, while an Attribute Reference holds a reference to another attribute. The containment structure forms the tree; the attribute reference is an additional non-tree relation. section 2.2 section 2.3
In JavaScript, encode each AST object as an object with concept and settings properties. Store simple settings and containment values directly; use arrays for multivalued settings. Encode a reference relation as a reference object whose ref property points to its target. Navigate containment through settings and references through .ref, or visit the tree with recursive depth-first traversal. section 3.4 section 3.2.1
Figure 2.18 The extracted ORD (without the reference relation) laid out as a tree
This tree layout makes the extracted Rental structure visible while deliberately omitting its reference relation, clarifying why an AST is tree-shaped only under that condition. section 2.2
ASTs also support change. When a DSL renames or removes concepts or properties, a migration transforms existing ASTs to the new structure, commonly with a depth-first traversal. ASTs can also represent expressions, where evaluation order shapes the tree even when the projected notation looks like a linear formula. section 10.3.2 section 12.0
A textual DSL reaches an AST differently: a parser processes text into a parse tree that may already be an AST or may require transformation. Once produced, the AST can feed language services such as content assist, constraint checking, syntax highlighting, and type information. section 15.1 section 1.2

