1 #ifndef VISITORS_TYPE_CHECKER_VISITOR_HH
2 # define VISITORS_TYPE_CHECKER_VISITOR_HH
7 # include <ozulis/visitors/visitor.hh>
13 /// @defgroup Visitors
15 * @brief Check ast's type is semanticaly correct
18 class TypeChecker
: public Visitor
<TypeChecker
>
22 virtual ~TypeChecker();
24 /** @brief type check the node, and may replace it */
28 /** @brief initialise the visitor's table */
29 static void initBase();
31 /** @brief add a cast to a member if it is needed */
32 static void homogenizeTypes(ast::BinaryExp
& node
);
33 void pointerArith(ast::Exp
* pointer
, ast::Exp
* offset
);
35 ast::FunctionPtr currentFunction
;
37 ast::NodePtr replacement
;
42 #endif /* !VISITORS_TYPE_CHECKER_VISITOR_HH */