22 std::shared_ptr<Unifier> unifier;
26 : symbols(s), unifier(u) {}
45 static std::shared_ptr<TypeInference>
66 void print(std::ostream &os);
Class for declaring a name, e.g., function, parameter, variable.
Definition: ASTDeclNode.h:7
Class for a program which is a name and a list of functions.
Definition: ASTProgram.h:11
Performs control flow analysis and records results for subsequent phases Generates call graph of a pr...
Definition: CallGraph.h:22
Performs symbol analysis and records results for subsequent phases.
Definition: SymbolTable.h:17
Perform type inference and checking.
Definition: TypeInference.h:17
static std::shared_ptr< TypeInference > run(ASTProgram *ast, bool polyInf, CallGraph *cg, SymbolTable *symbols)
Generate and solve type constraints and report any errors.
Definition: TypeInference.cpp:190
TypeInference(SymbolTable *s, std::shared_ptr< Unifier > u)
Definition: TypeInference.h:25
std::shared_ptr< TipType > getInferredType(ASTDeclNode *node)
Returns the type expression inferred for the given ASTDeclNode.
Definition: TypeInference.cpp:196
void print(std::ostream &os)
Print type inference results to output stream.
Definition: TypeInference.cpp:201