|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.util.Utils
at.dms.compiler.Phylum
at.dms.kjc.JPhylum
at.dms.kjc.JLocalVariable
public abstract class JLocalVariable
This class represents a local variable declaration
Field Summary | |
---|---|
static int |
DES_CATCH_PARAMETER
|
static int |
DES_GENERATED
|
static int |
DES_LOCAL_VAR
|
static int |
DES_PARAMETER
|
protected JExpression |
expr
|
protected int |
modifiers
|
protected String |
name
|
protected CType |
type
|
Fields inherited from class at.dms.util.Utils |
---|
EMPTY_LIST, getForLoopCallers |
Fields inherited from interface at.dms.kjc.Constants |
---|
CMP_VERSION, JAV_CLASS, JAV_CLONE, JAV_CLONEABLE, JAV_CONSTRUCTOR, JAV_ERROR, JAV_EXCEPTION, JAV_INIT, JAV_LENGTH, JAV_NAME_SEPARATOR, JAV_OBJECT, JAV_OUTER_THIS, JAV_RUNTIME, JAV_RUNTIME_EXCEPTION, JAV_STATIC_INIT, JAV_STRING, JAV_STRINGBUFFER, JAV_THIS, JAV_THROWABLE, OPE_BAND, OPE_BNOT, OPE_BOR, OPE_BSR, OPE_BXOR, OPE_EQ, OPE_GE, OPE_GT, OPE_LE, OPE_LNOT, OPE_LT, OPE_MINUS, OPE_NE, OPE_PERCENT, OPE_PLUS, OPE_POSTDEC, OPE_POSTINC, OPE_PREDEC, OPE_PREINC, OPE_SIMPLE, OPE_SL, OPE_SLASH, OPE_SR, OPE_STAR, TID_ARRAY, TID_BIT, TID_BOOLEAN, TID_BYTE, TID_CHAR, TID_CLASS, TID_DOUBLE, TID_FLOAT, TID_INT, TID_LONG, TID_SHORT, TID_VECTOR, TID_VOID, VECTOR_EMPTY |
Constructor Summary | |
---|---|
protected |
JLocalVariable()
|
|
JLocalVariable(TokenReference where,
int modifiers,
int kind,
CType type,
String name,
JExpression expr)
Constructs a local variable definition |
Method Summary | |
---|---|
Object |
deepClone()
Returns a deep clone of this object. |
protected void |
deepCloneInto(JLocalVariable other)
Clones all fields of this into |
void |
genLoad(CodeSequence code)
Generates a sequence of bytecode to load the value of the variable on the stack |
void |
genStore(CodeSequence code)
Generates a sequence of bytescodes |
int |
getDescription()
|
String |
getIdent()
|
int |
getIndex()
|
int |
getModifiers()
|
int |
getPosition()
|
CType |
getType()
|
JExpression |
getValue()
|
boolean |
isAssigned()
|
boolean |
isConstant()
Tests whether this expression denotes a compile-time constant (JLS 15.28). |
boolean |
isFinal()
Returns if this variable is final |
boolean |
isGenerated()
Returns the variable definied by this formal parameter |
boolean |
isLoopVariable()
|
boolean |
isStatic()
Returns if this variable is static |
boolean |
isUsed()
|
boolean |
isVolatile()
Returns true if this variable is declared volatile. |
protected Object |
readResolve()
|
void |
setAssigned(TokenReference ref,
CBodyContext context)
|
void |
setExpression(JExpression expr)
Sets the expression of this. |
void |
setIdent(String name)
|
void |
setIndex(int index)
|
void |
setIsLoopVariable()
|
void |
setPosition(int position)
|
void |
setType(CType type)
|
void |
setUsed()
|
String |
toString()
|
void |
unsetIsLoopVariable()
|
Methods inherited from class at.dms.kjc.JPhylum |
---|
accept, accept, assertMutable, check, check, check, check, deepCloneInto, fail, setLineNumber |
Methods inherited from class at.dms.compiler.Phylum |
---|
deepCloneInto, getTokenReference, setTokenReference |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DES_LOCAL_VAR
public static final int DES_PARAMETER
public static final int DES_CATCH_PARAMETER
public static final int DES_GENERATED
protected int modifiers
protected String name
protected CType type
protected JExpression expr
Constructor Detail |
---|
protected JLocalVariable()
public JLocalVariable(TokenReference where, int modifiers, int kind, CType type, String name, JExpression expr)
where
- the line of this node in the source codemodifiers
- the modifiers of this variablekind
- the kind of this variabletype
- the type of this variablename
- the name of this variableexpr
- the initial valueMethod Detail |
---|
protected Object readResolve() throws Exception
Exception
public boolean isVolatile()
public boolean isFinal()
public boolean isStatic()
public boolean isGenerated()
public int getModifiers()
public String getIdent()
public String toString()
toString
in class Object
public void setIdent(String name)
public CType getType()
public void setType(CType type)
public JExpression getValue()
public boolean isConstant()
public int getIndex()
public void setIndex(int index)
public void setExpression(JExpression expr)
public int getDescription()
public int getPosition()
public void setPosition(int position)
public void setUsed()
public boolean isUsed()
public void setAssigned(TokenReference ref, CBodyContext context)
public boolean isAssigned()
public void setIsLoopVariable()
public void unsetIsLoopVariable()
public boolean isLoopVariable()
public void genLoad(CodeSequence code)
code
- the code sequencepublic void genStore(CodeSequence code)
code
- the code sequencepublic Object deepClone()
deepClone
in interface DeepCloneable
deepClone
in class JPhylum
protected void deepCloneInto(JLocalVariable other)
other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |