External domain-specific languages
In this part, we:
– introduce a running example of DSL (“Entities Language”)
– give a one-slide crash course on compilers
and we discuss:
– semantic models
– abstract syntax trees
– parser generators
List of sources for images in slides
– https://cliparts.zone/flowchart-cliparts
– https://en.wikipedia.org/wiki/Abstract_syntax_tree#/media/File:Abstract_syntax_tree_for_Euclidean_algorithm.svg
– https://en.wikipedia.org/wiki/Abstract_syntax_tree#/media/File:Abstract_syntax_tree_for_Euclidean_algorithm.svg
Remarks
- M. Fowler’s book Domain-specific languages on grammars and parsing:
- Section 3.2: The Workings of a Parser
 - Section 3.3: Grammars, Syntax, and Semantics
 
 - Slides on semantic models are based on M. Fowler’s book Domain-specific languages:
- Section 1.4: Languages and Semantic Model
 - Chapter 11: Semantic Model
 
 
Additional materials
- How a Compiler Works in ~1 minute (video)
 - M. Clarkson: Compilers Crash Course
 - Wikipedia page on abstract syntax trees
 - The Super Tiny Compiler
 - AST Explorer
 - Visualizer of abstract syntax trees for JavaScript and Scheme: http://visualispy.herokuapp.com/
 - Abstract Syntax Tree – PHP Development Tools
 - SharpLab.io
 - Online editor for grammars and AST visualization: The Ohm Editor (description, online tool, GitHub page)
 - Software Language Engineering Body of Knowledge (SLEBOK): Grammar Zoo