Class PigletResult

  extended by minijava.translate.PigletResult

public final class PigletResult
extends java.lang.Object

A wrapper class that packages the objects returned by a visit method of the translator. Depending on what is being translated, a visit may return to its caller the expression subtree of the Piglet code in generation as well as the temporary that it assigns the expression to. If, in translating the expression, an expression is assigned to a temporary, its temporary number is described in result. Otherwise, it is null. (Note: the current use of this wrapper is only for its node, MiniJava expression subtree only yields Piglet expression subtree. No side effect is involved, so the temporary field of the wrapper is ignored.)

Santoso Wijaya

Field Summary
 Node node
 PigletTemp result
Constructor Summary
PigletResult(Node expr)
PigletResult(PigletTemp temp, Node expr)
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public final PigletTemp result


public final Node node
Constructor Detail


public PigletResult(PigletTemp temp,
                    Node expr)


public PigletResult(Node expr)