HANDBOOK / GENTLE PRIMER / Optimal Rule Selection /

Code Generation for Expressions

Here, we discuss how to generate code for expressions.

For the sake of simplicity we let the abstract syntax of expressions be defined as


   'type' Stmnt
      assign(Variable, Expr)

   'type' Expr
      plus(Expr, Expr)
      minus(Expr, Expr)
      var(Variable)