|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Const interface
Const (constant) class interface. A constant in source program is recorded as a Const instance by using its character string representation as its name. There are access methods to get the value of constants and to record a constant giving its value. Constants are usually represented by symbol table instance in order to represent attributes attached to them. Subclasses of Const is not so fine as type, foe example, int, short, long, unsigned int, unsigned short, unsigned long all belongs to IntConst. To see the type of Const object, use getSymType() of SymInterface.
| Field Summary |
| Fields inherited from interface coins.sym.Sym |
KIND_NAME, VISIBILITY |
| Method Summary | |
char |
charValue()
charValue |
double |
doubleValue()
doubleValue |
java.lang.Object |
evaluateAsObject()
Get the value of this constant symbol. |
float |
floatValue()
floatValue |
Const |
getConstSym()
getConstSym |
int |
intValue()
intValue Get the value of this constant. |
long |
longValue()
longValue |
short |
shortValue()
shortValue |
| Methods inherited from interface coins.sym.Sym0 |
charConst, definedType, defineElem, defineLabel, defineParam, defineSubp, defineVar, enumType, floatConst, getDefinedFile, getDefinedIn, getFlag, getName, getNextSym, getRecordedIn, getSymKind, getSymType, getUniqueName, intConst, isGlobal, namedConst, pointerType, setFlag, stringConst, structType, subpType, unionType, vectorType, vectorTypeUnfixed |
| Method Detail |
public int intValue()
public short shortValue()
Get the value of this constant. If type conversion is required, the returned value is the result of conversion. "this" should be a constant of type integer, short integer, long integer, or character of either signed or unsigned.
public long longValue()
Get the value of this constant. If type conversion is required, the returned value is the result of conversion. "this" should be a constant of type integer, short integer, long integer, or character of either signed or unsigned.
public char charValue()
Get the value of this constant. If type conversion is required, the returned value is the result of conversion. "this" should be a constant of type integer, short integer, long integer, or character of either signed or unsigned.
public float floatValue()
Get floating value of this constant. If type conversion is required, the returned value is the result of conversion. "this" should be a constant of type float, or double.
public double doubleValue()
Get double value of this constant. If type conversion is required, the returned value is the result of conversion. "this" should be a constant of type float, or double.
public Const getConstSym()
If boolean true then return symRoot.intConst1 else if boolean false then return symRoot.intConst0 else if enumeration constant then return corresponding IntConst else return this.
public java.lang.Object evaluateAsObject()
Get the value of this constant symbol.
This method is overrided as follows:
class returned value
IntConst Long
FloatConst Double
StringConst String
Var Initail value (ExpListExp, etc.) if qualified by const,
else null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||