public class BuildSymbolTables extends StaticAnalysis
| Constructor and Description |
|---|
BuildSymbolTables() |
| Modifier and Type | Method and Description |
|---|---|
void |
finalizeScope()
Pop the stack and move outwards one scope level.
|
SymbolTable |
getCurrentTable()
Return the innermost active symbol table.
|
SymbolTable |
initializeScope()
Create a new innermost symbol table scope and push it on the stack.
|
void |
insertFunctionSymbol(ASTFunction node)
Add a symbol for the given function to the current (innermost) scope.
|
void |
insertParamSymbol(ASTFunction.Parameter p)
Add a symbol for the given function parameter to the current (innermost) scope.
|
void |
insertPrintFunctionSymbol(String name,
ASTNode.DataType type)
Add a symbol for a hard-coded function to the current (innermost) scope.
|
void |
insertVariableSymbol(ASTVariable node)
Add a symbol for the given variable to the current (innermost) scope.
|
void |
postVisit(ASTBlock node) |
void |
postVisit(ASTFunction node) |
void |
postVisit(ASTProgram node) |
void |
preVisit(ASTBlock node) |
void |
preVisit(ASTFunction node) |
void |
preVisit(ASTProgram node) |
void |
preVisit(ASTVariable node) |
addError, addError, getErrors, getErrorString, resetErrorsdefaultInVisit, defaultPostVisit, defaultPreVisit, inVisit, postVisit, postVisit, postVisit, postVisit, postVisit, postVisit, postVisit, postVisit, postVisit, postVisit, postVisit, postVisit, postVisit, preVisit, preVisit, preVisit, preVisit, preVisit, preVisit, preVisit, preVisit, preVisit, preVisit, preVisit, preVisitpublic SymbolTable getCurrentTable()
public SymbolTable initializeScope()
public void finalizeScope()
public void insertFunctionSymbol(ASTFunction node)
node - Function to addpublic void insertVariableSymbol(ASTVariable node)
node - Variable to addpublic void insertParamSymbol(ASTFunction.Parameter p)
p - Parameter to addpublic void insertPrintFunctionSymbol(String name, ASTNode.DataType type)
name - Function nametype - Function argument typepublic void preVisit(ASTProgram node)
preVisit in interface ASTVisitorpreVisit in class DefaultASTVisitorpublic void postVisit(ASTProgram node)
postVisit in interface ASTVisitorpostVisit in class DefaultASTVisitorpublic void preVisit(ASTFunction node)
preVisit in interface ASTVisitorpreVisit in class DefaultASTVisitorpublic void postVisit(ASTFunction node)
postVisit in interface ASTVisitorpostVisit in class DefaultASTVisitorpublic void preVisit(ASTBlock node)
preVisit in interface ASTVisitorpreVisit in class DefaultASTVisitorpublic void postVisit(ASTBlock node)
postVisit in interface ASTVisitorpostVisit in class DefaultASTVisitorpublic void preVisit(ASTVariable node)
preVisit in interface ASTVisitorpreVisit in class DefaultASTVisitorCopyright © 2019. All rights reserved.