|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectspiglet.translate.KangaResult
public final class KangaResult
The result of visiting an expression subtree in a translation step to Kanga. A result wraps a simple expression.
| Constructor Summary | |
|---|---|
KangaResult(SimpleExp exp)
Wraps an expression as a result. |
|
| Method Summary | |
|---|---|
SimpleExp |
getExp()
Returns the wrapped result as an expression. |
KangaReg |
processAsReg(KangaReg scratch,
KangaContext context)
Processes this result's simple exp, if it is a Reg, return a Reg object that corresponds to it, otherwise inject a MOVE statement to a
scratch register (as defined in KangaTranslator), then returns
the Reg object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KangaResult(SimpleExp exp)
exp - the expression result| Method Detail |
|---|
public SimpleExp getExp()
public KangaReg processAsReg(KangaReg scratch,
KangaContext context)
MOVE statement to a
scratch register (as defined in KangaTranslator), then returns
the Reg object.
scratch - the scratch register to where evaluation of the
expression is moved, if need be; this is also the register
returned if such evaluation happens.context - the context to which a potential MOVE statement
is attached
KangaReg.SCRATCH_0,
KangaReg.SCRATCH_1
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||