|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.dms.kjc.common.ALocalVariable
public class ALocalVariable
Package up declaration statement and use expression for a local variable.
| Method Summary | |
|---|---|
JVariableDeclarationStatement |
getDecl()
|
JExpression |
getInitializer()
Get the expression for the initial value of the variable. |
String |
getName()
Get variable name |
JLocalVariableExpression |
getRef()
|
JVariableDefinition |
getVarDefn()
Get the definition of the variable (allowing hacking name, type, initializer...). |
static ALocalVariable |
makeTmp(CType typ)
Create a new local variable, don't care about name so long as it is likely to be unique. |
static ALocalVariable |
makeVar(CType typ,
String varName)
Create a new local variable with a specified name and type. |
void |
setInitializer(JExpression initExpr)
Set the initial value of the variable. |
void |
setName(String varName)
Change variable name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ALocalVariable makeTmp(CType typ)
typ - type for variable
ALocalVariable object with statement for declaration, expression for use.
public static ALocalVariable makeVar(CType typ,
String varName)
typ - type for variablevarName - name for variable
ALocalVariable object with statement for declaration, expression for use.public void setName(String varName)
varName - the new variable name to set (affects declaration and references)public String getName()
public void setInitializer(JExpression initExpr)
initExpr - expression that will be produced for the variable declaration.public JExpression getInitializer()
#setVarInitializer(JExpression) has been called (or equivalent hacking)public JVariableDeclarationStatement getDecl()
public JLocalVariableExpression getRef()
public JVariableDefinition getVarDefn()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||