tipc
A TIP to LLVM compiler
|
Stores the results of semantic analysis passes. More...
#include <SemanticAnalysis.h>
Public Member Functions | |
SemanticAnalysis (std::shared_ptr< SymbolTable > s, std::shared_ptr< TypeInference > t, std::shared_ptr< CallGraph > cg) | |
SymbolTable * | getSymbolTable () |
Returns the symbol table computed for the program. More... | |
TypeInference * | getTypeResults () |
Returns the type inference results. More... | |
CallGraph * | getCallGraph () |
Returns the call graph for the program. More... | |
Static Public Member Functions | |
static std::shared_ptr< SemanticAnalysis > | analyze (ASTProgram *ast, bool polyInf) |
Perform semantic analysis on program AST. More... | |
Stores the results of semantic analysis passes.
This class provides the analyze method to run a set of semantic analyses, including l-value checking for assignment statements, proper use of symbols, and type checking and control flow analysis
|
inline |
|
static |
Perform semantic analysis on program AST.
Run weeding, symbol, and type checking and control flow analysis. Errors in any of these result in a SemanticError. If no errors then ownership of semantic analysis results are transferred to caller.
ast | The program AST |
polyInf | Indicate whether polymorphic type inference should be performed. |
SemanticAnalysis::getCallGraph | ( | ) |
Returns the call graph for the program.
SemanticAnalysis::getSymbolTable | ( | ) |
Returns the symbol table computed for the program.
SemanticAnalysis::getTypeResults | ( | ) |
Returns the type inference results.