|
CS 536 Fall 2007, Project 5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectASTNode
BlockNode
public class BlockNode
An AST node representing a block (procedure or function body): "decls BEGIN stmts END".
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ASTNode |
---|
ASTNode.Opcode |
Field Summary | |
---|---|
List<DeclNode> |
decls
List of variables, functions, and procedures declared locally in the block. |
List<StmtNode> |
stmts
List of statements in the block. |
Constructor Summary | |
---|---|
BlockNode()
|
Method Summary | |
---|---|
void |
codeGen(StmtNode loop)
Generates code for this block and all its contents. |
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 ASTNode |
---|
indent, toString |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public List<DeclNode> decls
public List<StmtNode> stmts
Constructor Detail |
---|
public BlockNode()
Method Detail |
---|
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 void codeGen(StmtNode loop)
loop
- the smallest enclosing ForStmtNode or WhileStmtNode, if any.
|
CS 536 Fall 2007, Project 5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |