|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.ClassTreeNode
public class ClassTreeNode
The ClassTreeNode class represents a node in the class hierarchy tree. To perform semantic analysis the class hierarchy tree must be constructed and used when building the environment and type checking. A ClassTreeNode represents one class in the class hierarchy tree and contains all the relevant information about that class (AST node, parent, children, symbol table, etc.).
SemanticAnalyzer| Constructor Summary | |
|---|---|
ClassTreeNode(Class_ astNode,
boolean builtin,
boolean extendable,
java.util.Hashtable<java.lang.String,ClassTreeNode> classMap)
ClassTreeNode constructor |
|
| Method Summary | |
|---|---|
void |
addChild(ClassTreeNode child)
Add an immediate subclass to this class Also makes child's parent this class (if not already) |
Class_ |
getASTNode()
Get the AST node for this class |
java.util.Iterator<ClassTreeNode> |
getChildrenList()
Get an iterator of class tree nodes representing the immediate subclasses of this class |
SymbolTable |
getMethodSymbolTable()
Get the method symbol table of the class |
java.lang.String |
getName()
Get the name of the class |
int |
getNumChildren()
Get the number of children of this class |
int |
getNumDescendants()
Get the number of descendants (strict subclasses) of this class |
ClassTreeNode |
getParent()
Get the parent class tree node of the class |
SymbolTable |
getVarSymbolTable()
Get the variable symbol table of the class |
boolean |
isBuiltIn()
Is this class built-in? |
boolean |
isExtendable()
Is this class extendable? |
ClassTreeNode |
lookupClass(java.lang.String className)
Lookup a class tree node |
void |
setParent(ClassTreeNode parent)
Set the parent class tree node of this class Also adds this class to list of parent's children (if not already there) In addition, sets variable and method symbol tables to the parent's symbol tables |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassTreeNode(Class_ astNode,
boolean builtin,
boolean extendable,
java.util.Hashtable<java.lang.String,ClassTreeNode> classMap)
astNode - the AST node for this classbuiltin - boolean indicating whether this class was built-inextendable - boolean indicating whether this class is extendableclassMap - class map for accessing class tree nodes| Method Detail |
|---|
public java.lang.String getName()
public Class_ getASTNode()
public boolean isBuiltIn()
public boolean isExtendable()
public ClassTreeNode getParent()
public void setParent(ClassTreeNode parent)
parent - the class tree node of the parent classpublic void addChild(ClassTreeNode child)
child - the class tree node of the immediate subclasspublic java.util.Iterator<ClassTreeNode> getChildrenList()
public int getNumChildren()
public int getNumDescendants()
public SymbolTable getVarSymbolTable()
public SymbolTable getMethodSymbolTable()
public ClassTreeNode lookupClass(java.lang.String className)
className - the name of the class to lookup
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||