|
CS 536 Fall 2007, Project 5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectASTNode
ExprNode
IdNode
public class IdNode
An AST node representing an identifier.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ASTNode |
---|
ASTNode.Opcode |
Field Summary |
---|
Fields inherited from class ExprNode |
---|
column, line, type |
Constructor Summary | |
---|---|
IdNode(String name,
int line,
int column)
Creates a new IdNode. |
Method Summary | |
---|---|
String |
getAddress()
Generates a SPIM address for this id, either "_id" or "-nnn($fp)" depending on this id's offset. |
String |
getName()
Returns the string name of this identifier. |
Symbol |
getSymbol()
Returns the Symbol bound to this identifier. |
void |
resolveNames(SymbolTable symtab)
Resolves all applied uses of identifiers in the tree rooted at this node. |
void |
resolveTypes(ProcDeclNode proc)
Fills in types for all Symbols bound to IdNodes. |
void |
unparse(PrintWriter p,
int level)
Prints a source representation of the tree rooted at this node on output stream p. |
Methods inherited from class ExprNode |
---|
codeGen, codeGen |
Methods inherited from class ASTNode |
---|
indent, toString |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IdNode(String name, int line, int column)
name
- the name of the identifier.line
- the line on which this identifier appears.column
- the column of the first character of this identifier.Method Detail |
---|
public Symbol getSymbol()
public String getName()
public void unparse(PrintWriter p, int level)
unparse
in class ASTNode
p
- the place to display the output.level
- the number of levels of indentation to use if the output
requires more than one line.public void resolveNames(SymbolTable symtab)
resolveNames
in class ASTNode
symtab
- the symbol table to be used.public void resolveTypes(ProcDeclNode proc)
resolveTypes
in class ASTNode
proc
- the smallest enclosing procedure or function declaration.public String getAddress()
|
CS 536 Fall 2007, Project 5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |