Usando o padrao Visitor de forma decente. Verificacao semantica meio pronta.
[toypasc.git] / typecheck_visitor.h
blob6c6ec8a01008f2c7203e4fb570cb5e34937910fe
1 #ifndef TYPECHECK_VISITOR_H
2 #define TYPECHECK_VISITOR_H
4 #include "ast.h"
5 #include "base.h"
6 #include "symbol_table.h"
8 //static bool is_vardecl = FALSE;
9 static Type declared_type = NONE_TYPE;
10 static Symbol *symtab;
11 static Symbol *global_symtab;
13 Visitor *typecheck_new();
15 void typecheck_visit_program (struct AstNode *node);
16 void typecheck_visit_programdecl (struct AstNode *node);
17 void typecheck_visit_procfunc_list (struct AstNode *node);
18 void typecheck_visit_procfunc(struct AstNode *node);
19 void typecheck_visit_vardecl_list (struct AstNode *node);
20 void typecheck_visit_vardecl (struct AstNode *node);
21 void typecheck_visit_parameter (struct AstNode *node);
22 void typecheck_visit_statement_list(struct AstNode *node);
23 void typecheck_visit_print_stmt (struct AstNode *node);
24 void typecheck_visit_assignment_stmt (struct AstNode *node);
25 void typecheck_visit_if_stmt (struct AstNode *node);
26 void typecheck_visit_while_stmt (struct AstNode *node);
27 void typecheck_visit_for_stmt (struct AstNode *node);
28 void typecheck_visit_binary_expr (struct AstNode *node);
29 void typecheck_visit_notfactor (struct AstNode *node);
30 void typecheck_visit_call (struct AstNode *node);
31 void typecheck_visit_callparam_list (struct AstNode *node);
32 void typecheck_visit_identifier (struct AstNode *node);
34 void typecheck_visit_donothing(struct AstNode *node);
36 #endif // TYPECHECK_VISITOR_H