tan  0.0.1
register_declarations.h
1 #ifndef __TAN_ANALYSIS_REGISTER_DECLARATIONS_H__
2 #define __TAN_ANALYSIS_REGISTER_DECLARATIONS_H__
3 
4 #include "analysis/analysis_action.h"
5 
6 namespace tanlang {
7 
8 /**
9  * \brief Register all declarations (including local) in the corresponding scopes.
10  * Run this stage early to easily obtain a list of top-level declarations from each source file.
11  */
12 class RegisterDeclarations : public SemanticAnalysisAction<RegisterDeclarations, Program *, void> {
13 public:
14  void run_impl(Program *p);
15 
16  DECLARE_AST_VISITOR_IMPL(Program);
17  // DECLARE_AST_VISITOR_IMPL(Identifier);
18  DECLARE_AST_VISITOR_IMPL(Parenthesis);
19  DECLARE_AST_VISITOR_IMPL(If);
20  DECLARE_AST_VISITOR_IMPL(VarDecl);
21  DECLARE_AST_VISITOR_IMPL(ArgDecl);
22  DECLARE_AST_VISITOR_IMPL(CompoundStmt);
23  DECLARE_AST_VISITOR_IMPL(BinaryOrUnary);
24  DECLARE_AST_VISITOR_IMPL(BinaryOperator);
25  DECLARE_AST_VISITOR_IMPL(UnaryOperator);
26  DECLARE_AST_VISITOR_IMPL(Assignment);
27  DECLARE_AST_VISITOR_IMPL(FunctionDecl);
28  DECLARE_AST_VISITOR_IMPL(Intrinsic);
29  DECLARE_AST_VISITOR_IMPL(StructDecl);
30  DECLARE_AST_VISITOR_IMPL(Loop);
31 
32 private:
33  bool _within_test_comp_error = false;
34 
35 private:
36  void register_public_type_decl(const str& name, TypeDecl *decl);
37  void register_public_func_decl(FunctionDecl *decl);
38 };
39 
40 } // namespace tanlang
41 
42 #endif //__TAN_ANALYSIS_REGISTER_DECLARATIONS_H__
Represent if-[else] or if-elif-[else] statements.
Definition: stmt.h:144
A generic representation of Intrinsic variables/functions.
Definition: intrinsic.h:55
Register all declarations (including local) in the corresponding scopes. Run this stage early to easi...