COMS W4115
Programming Languages and Translators
Lecture 12: The Compiler Front End
March 2, 2015

Lecture Outline

  1. The compiler front end
  2. Producing abstract syntax trees
  3. Semantic analysis
  4. Intermediate representations
  5. Directed acyclic graphs (DAGs)

1. The Compiler Front End

2. Producing Abstract Syntax Trees

3. Semantic Analysis

4. Intermediate Representations

5. Directed acyclic graphs

6. Practice Problems

  1. Construct a DAG for the expression
  2. ((x + y) - ((x + y) * (x - y))) + ((x + y) * (x - y))
  3. Translate the following assignments into (a) syntax trees, (b) quadruples, (c) triples, (d) three-address code:
    1. x = a + -(b+c)
    2. x[i] = y[i] + z[i]
    3. x = f(y+1) + 2

7. Reading



aho@cs.columbia.edu