liveBook · Manning

Abstract syntax

As explained in Building User-Friendly DSLs

The structural form of language content that represents its essential constructs without surface-level notation details.

Abstract syntax represents DSL content as structured data containing its essential information while omitting the notational details of concrete syntax. It makes language structure explicit and suitable for programmatic manipulation. section 2.2 section 2.0

Derive abstract syntax from concrete DSL content by:

  • Identifying visual cues such as keywords, symbols, boxes, arrows, and other markers. section 2.2
  • Representing each essential construct as an object with a concept label and properties. section 2.2
  • Connecting nested objects through containment relations and representing cross-links as reference relations. section 2.2
  • Recording values such as names, types, numbers, and references in the resulting structured data. section 2.2

Rental record type

A Rental record type becomes one Record Type object named Rental. Its four attributes become connected attribute objects, each carrying properties such as name, type, and initial value. Ignoring reference relations, the resulting object-relation diagram can be laid out as an abstract syntax tree. section 2.2 section 2.3

Figure 2.18 The extracted ORD (without the reference relation) laid out as a tree
figure

Inspect the extracted object-relation diagram as a tree, then compare its structure with the original Rental notation. section 2.2

How Building User-Friendly DSLs covers it

How deep it goes
Explains extraction from visual cues through objects, properties, containment, references, and tree-shaped ORDs.
Examples
Uses a Rental record type with four attributes, property values, containment links, reference links, ORDs, and AST layouts.
What it assumes
Builds from concrete DSL notation and visual cues, introducing abstract syntax, ORDs, and ASTs through a worked example.
What you can do after
Evaluate/understand DSL structure by extracting its essential content into an ORD or AST.
How it connects
Connects concrete syntax, object-relation diagrams, abstract syntax trees, containment relations, and reference relations.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building User-Friendly DSLs. The section links point to the parts of the book it draws on.