Fork me on GitHub

Overview

Language spec and compiler construction - part 1

Introduction


Dynamic structure of a compiler :


Static structure of a compiler:


Grammars: four components


EBNF (Extended Backus-Naur form) for writing grammar


Start symbols:


Successors:

terminal symbols can follow a nonterminal in the grammar -> Follow(Expr)=”)”, eof (eof: end of file)


Strings


Derivation


Recursion: can be used to represent repetitions and nested structures


Chomsky’s classification of grammar