Lecture 2: Declarative Syntax Definition
In this lecture we study declarative syntax definition, i.e. syntax definition that focuses on the definition of the structure (abstract syntax) and notation (concrete syntax) of programs, and abstracts from the implementation of parsers.
In this lecture we take a further look at declarative syntax definition, with the specification of lexical syntax and the desugaring of context-free syntax and lexical syntax into a core grammar formalism.
Topics
- program structure, syntactic categories, language constructs
- abstract syntax, signatures, sorts, constructors
- context-free grammars
- concrete syntax, notation
- lexical syntax, literals, keywords
- ambiguity, disambiguation, associativity, priority
Slides
Reading material
-
Lennart C. L. Kats, Eelco Visser, Guido Wachsmuth. Pure and declarative syntax definition: paradise lost and regained. In William R. Cook, Siobhán Clarke, Martin C. Rinard, editors, Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010, October 17-21, 2010, Reno/Tahoe, Nevada, USA. pages 918-932, ACM, Reno/Tahoe, Nevada, 2010. https://doi.org/10.1145/1932682.1869535
-
Lennart C. L. Kats, Rob Vermaas, Eelco Visser. Integrated language definition testing: enabling test-driven language development. In Cristina Videira Lopes, Kathleen Fisher, editors, Proceedings of the 26th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2011, part of SPLASH 2011, Portland, OR, USA, October 22 - 27, 2011. pages 139-154, ACM, 2011. https://doi.org/10.1145/2076021.2048080
-
Syntax Definition with SDF3. Documentation of the SDF3 syntax definition formalism