CS450 Compiler Design
20
Concrete and Abstract Syntax
•
The previous grammar specified the
concrete syntax
of Mini-Triangle.
•
The
concrete syntax
is important for the programmer who needs to know
exactly
how to write syntactically well-formed programs.
•
The
abstract syntax
omits irrelevant syntactic details and
only specifies
the essential structure
of programs.
Example: different concrete syntaxes for an assignment
v := e
(set! v e)
e -> v
v = e