Compiler Construction bio photo

Compiler Construction

Twitter Github

Edit on GitHub

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.


  • 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


CS4200 2019 | Lecture 2 | syntax-definition from Eelco Visser

Reading material