|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSymbol
Each Symbol object represents one entry in a SymbolTable.
Constructor Summary | |
Symbol(java.lang.String name,
int t)
Construct a new Symbol with the given name and type. |
Method Summary | |
java.lang.Object |
getAttribute(java.lang.String key)
Get an attribute from a Symbol. |
java.lang.String |
getLabel()
Get the label attribute of this object. |
int |
getType()
Get the type of this Symbol. |
void |
putAttribute(java.lang.String key,
java.lang.Object att)
Put an attribute in the HashMap of a Symbol. |
void |
setLabel(java.lang.String name)
Set the label attribute of this object. |
void |
setType(int t)
Set the type of this Symbol. |
java.lang.String |
toString()
Provide the String that describes this Symbol. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Symbol(java.lang.String name, int t)
name
- the label by which the program being compiled
refers to this Symbolt
- the symbol type, an int value. Can be one of the
type values defined by the Symbol class or some other class
like Token.Method Detail |
public java.lang.String getLabel()
public void setLabel(java.lang.String name)
name
- the Symbol labelpublic int getType()
public void setType(int t)
t
- the Symbol typepublic void putAttribute(java.lang.String key, java.lang.Object att)
key
- the name of the attributeatt
- the Object that holds the attribute's valuepublic java.lang.Object getAttribute(java.lang.String key)
key
- the name of the attribute to get
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |