Translate
Class Exp.Cx

java.lang.Object
  extended by Translate.Exp
      extended by Translate.Exp.Cx
Direct Known Subclasses:
Exp.Cx.IfThenElseExp, Exp.Cx.Rel
Enclosing class:
Exp

public abstract static class Exp.Cx
extends Exp

A wrapper for tree code that may be used both to compute a Boolean value and to effect transfer of control. Concrete subclasses of Cx are used to capture evaluation of different kinds of conditional.


Nested Class Summary
static class Exp.Cx.IfThenElseExp
          A wrapper for short-circuiting conditional expressions (e.g., &&, ||).
static class Exp.Cx.Rel
          A wrapper for relational operators that may be used for both their Boolean value and for control transfer.
 
Nested classes/interfaces inherited from class Translate.Exp
Exp.Cx, Exp.Ex, Exp.Nx
 
Constructor Summary
Exp.Cx()
           
 
Method Summary
abstract  Tree.Stm unCx(Temp.Label t, Temp.Label f)
          Unwrap this expression, to obtain code that causes transfer of control based on the Boolean value of the expression.
 Tree.Exp unEx()
          Unwrap this expression, to obtain tree code that computes a value.
 Tree.Stm unNx()
          Unwrap this expression, to obtain tree code that should be executed only for its side-effects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exp.Cx

public Exp.Cx()
Method Detail

unEx

public Tree.Exp unEx()
Description copied from class: Exp
Unwrap this expression, to obtain tree code that computes a value.

Specified by:
unEx in class Exp
Returns:
the tree code that computes the value

unNx

public Tree.Stm unNx()
Description copied from class: Exp
Unwrap this expression, to obtain tree code that should be executed only for its side-effects.

Specified by:
unNx in class Exp
Returns:
the tree code to be executed for its side-effects

unCx

public abstract Tree.Stm unCx(Temp.Label t,
                              Temp.Label f)
Description copied from class: Exp
Unwrap this expression, to obtain code that causes transfer of control based on the Boolean value of the expression.

Specified by:
unCx in class Exp
Parameters:
t - label to branch to on true
f - label to branch to on false
Returns:
the tree code to evaluate the expression and effect the transfer of control.