|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--xrel.parser.SymElement
This class is a symbol table element. A symbol table element can be a type name, a pattern, a variable or an expression (expressions are the parameters of printf statements).
Constructor Summary | |
SymElement(SymTable st,
int scope,
java.lang.String nm,
int k,
SimpleNode nd)
This is the only constructor you can use to initialize an object of the symbol table. |
Method Summary | |
java.lang.String |
getAutomatonName()
|
int |
getCode()
Returns the code for the element. |
TASimple |
getElementAutomaton(int BuildPhases,
boolean debug)
Gets the internal automaton associated to the element and if it doesn't exist it creates it. |
TA |
getInferredType()
|
int |
getKind()
Gets the kind of the element. |
java.lang.String |
getName()
Gets the name of the element. |
SimpleNode |
getNode()
Gets the subtree of the syntax tree associated to the element. |
int |
getScope()
Gets the scope of the element. |
java.lang.String |
getScopeStr()
Gets the name of the scope, that is "document" for the import statement and "case n" for the n-th clause in the typeswitch instruction. |
java.lang.String |
getUniqueName()
For variables returns the name with a unique identifier. |
SimpleNode |
getValue()
Gets the value associated to this variable after a binding. |
boolean |
hasAutomaton()
|
void |
setInferredType(TA aut)
|
void |
setNode(SimpleNode n)
Sets the subtree associated to the element. |
void |
setValue(SimpleNode v)
Sets the value associated to this variable as a result of a binding. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SymElement(SymTable st, int scope, java.lang.String nm, int k, SimpleNode nd)
st
- the symbol tablescope
- the integer representing the scope of the elementnm
- the name of the elementk
- the kind of the element (type, variable, pattern, expression)nd
- the root of the subtree associated to the elementMethod Detail |
public java.lang.String getName()
public int getCode()
Returns the code for the element.
It's an incremental number for patterns and variables.
public java.lang.String getUniqueName()
public SimpleNode getNode()
public void setNode(SimpleNode n)
n
- the new root node for the variablepublic SimpleNode getValue()
public void setValue(SimpleNode v)
public int getKind()
public int getScope()
public java.lang.String getScopeStr()
public TA getInferredType()
public void setInferredType(TA aut)
public java.lang.String getAutomatonName()
public boolean hasAutomaton()
public TASimple getElementAutomaton(int BuildPhases, boolean debug)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |