1 | // |
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
3 | // |
---|
4 | // The contents of this file are covered under the licence agreement in the |
---|
5 | // file "LICENCE" distributed with Cforall. |
---|
6 | // |
---|
7 | // Visitor.hpp -- Interface of a class that visits ast nodes. |
---|
8 | // |
---|
9 | // Author : Andrew Beach |
---|
10 | // Created On : Thr May 9 15:28:00 2019 |
---|
11 | // Last Modified By : Andrew Beach |
---|
12 | // Last Modified On : Thr May 9 15:33:00 2019 |
---|
13 | // Update Count : 0 |
---|
14 | // |
---|
15 | |
---|
16 | #pragma once |
---|
17 | |
---|
18 | #include "Fwd.hpp" |
---|
19 | |
---|
20 | namespace ast { |
---|
21 | |
---|
22 | class Visitor { |
---|
23 | public: |
---|
24 | virtual const ast::DeclWithType * visit( const ast::ObjectDecl * ) = 0; |
---|
25 | virtual const ast::DeclWithType * visit( const ast::FunctionDecl * ) = 0; |
---|
26 | virtual const ast::Decl * visit( const ast::StructDecl * ) = 0; |
---|
27 | virtual const ast::Decl * visit( const ast::UnionDecl * ) = 0; |
---|
28 | virtual const ast::Decl * visit( const ast::EnumDecl * ) = 0; |
---|
29 | virtual const ast::Decl * visit( const ast::TraitDecl * ) = 0; |
---|
30 | virtual const ast::Decl * visit( const ast::TypeDecl * ) = 0; |
---|
31 | virtual const ast::Decl * visit( const ast::TypedefDecl * ) = 0; |
---|
32 | virtual const ast::AsmDecl * visit( const ast::AsmDecl * ) = 0; |
---|
33 | virtual const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * ) = 0; |
---|
34 | virtual const ast::CompoundStmt * visit( const ast::CompoundStmt * ) = 0; |
---|
35 | virtual const ast::Stmt * visit( const ast::ExprStmt * ) = 0; |
---|
36 | virtual const ast::Stmt * visit( const ast::AsmStmt * ) = 0; |
---|
37 | virtual const ast::Stmt * visit( const ast::DirectiveStmt * ) = 0; |
---|
38 | virtual const ast::Stmt * visit( const ast::IfStmt * ) = 0; |
---|
39 | virtual const ast::Stmt * visit( const ast::WhileStmt * ) = 0; |
---|
40 | virtual const ast::Stmt * visit( const ast::ForStmt * ) = 0; |
---|
41 | virtual const ast::Stmt * visit( const ast::SwitchStmt * ) = 0; |
---|
42 | virtual const ast::Stmt * visit( const ast::CaseStmt * ) = 0; |
---|
43 | virtual const ast::Stmt * visit( const ast::BranchStmt * ) = 0; |
---|
44 | virtual const ast::Stmt * visit( const ast::ReturnStmt * ) = 0; |
---|
45 | virtual const ast::Stmt * visit( const ast::ThrowStmt * ) = 0; |
---|
46 | virtual const ast::Stmt * visit( const ast::TryStmt * ) = 0; |
---|
47 | virtual const ast::Stmt * visit( const ast::CatchStmt * ) = 0; |
---|
48 | virtual const ast::Stmt * visit( const ast::FinallyStmt * ) = 0; |
---|
49 | virtual const ast::Stmt * visit( const ast::WaitForStmt * ) = 0; |
---|
50 | virtual const ast::Stmt * visit( const ast::WithStmt * ) = 0; |
---|
51 | virtual const ast::NullStmt * visit( const ast::NullStmt * ) = 0; |
---|
52 | virtual const ast::Stmt * visit( const ast::DeclStmt * ) = 0; |
---|
53 | virtual const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * ) = 0; |
---|
54 | virtual const ast::Expr * visit( const ast::ApplicationExpr * ) = 0; |
---|
55 | virtual const ast::Expr * visit( const ast::UntypedExpr * ) = 0; |
---|
56 | virtual const ast::Expr * visit( const ast::NameExpr * ) = 0; |
---|
57 | virtual const ast::Expr * visit( const ast::AddressExpr * ) = 0; |
---|
58 | virtual const ast::Expr * visit( const ast::LabelAddressExpr * ) = 0; |
---|
59 | virtual const ast::Expr * visit( const ast::CastExpr * ) = 0; |
---|
60 | virtual const ast::Expr * visit( const ast::KeywordCastExpr * ) = 0; |
---|
61 | virtual const ast::Expr * visit( const ast::VirtualCastExpr * ) = 0; |
---|
62 | virtual const ast::Expr * visit( const ast::UntypedMemberExpr * ) = 0; |
---|
63 | virtual const ast::Expr * visit( const ast::MemberExpr * ) = 0; |
---|
64 | virtual const ast::Expr * visit( const ast::VariableExpr * ) = 0; |
---|
65 | virtual const ast::Expr * visit( const ast::ConstantExpr * ) = 0; |
---|
66 | virtual const ast::Expr * visit( const ast::SizeofExpr * ) = 0; |
---|
67 | virtual const ast::Expr * visit( const ast::AlignofExpr * ) = 0; |
---|
68 | virtual const ast::Expr * visit( const ast::UntypedOffsetofExpr * ) = 0; |
---|
69 | virtual const ast::Expr * visit( const ast::OffsetofExpr * ) = 0; |
---|
70 | virtual const ast::Expr * visit( const ast::OffsetPackExpr * ) = 0; |
---|
71 | virtual const ast::Expr * visit( const ast::AttrExpr * ) = 0; |
---|
72 | virtual const ast::Expr * visit( const ast::LogicalExpr * ) = 0; |
---|
73 | virtual const ast::Expr * visit( const ast::ConditionalExpr * ) = 0; |
---|
74 | virtual const ast::Expr * visit( const ast::CommaExpr * ) = 0; |
---|
75 | virtual const ast::Expr * visit( const ast::TypeExpr * ) = 0; |
---|
76 | virtual const ast::Expr * visit( const ast::AsmExpr * ) = 0; |
---|
77 | virtual const ast::Expr * visit( const ast::ImplicitCopyCtorExpr * ) = 0; |
---|
78 | virtual const ast::Expr * visit( const ast::ConstructorExpr * ) = 0; |
---|
79 | virtual const ast::Expr * visit( const ast::CompoundLiteralExpr * ) = 0; |
---|
80 | virtual const ast::Expr * visit( const ast::RangeExpr * ) = 0; |
---|
81 | virtual const ast::Expr * visit( const ast::UntypedTupleExpr * ) = 0; |
---|
82 | virtual const ast::Expr * visit( const ast::TupleExpr * ) = 0; |
---|
83 | virtual const ast::Expr * visit( const ast::TupleIndexExpr * ) = 0; |
---|
84 | virtual const ast::Expr * visit( const ast::TupleAssignExpr * ) = 0; |
---|
85 | virtual const ast::Expr * visit( const ast::StmtExpr * ) = 0; |
---|
86 | virtual const ast::Expr * visit( const ast::UniqueExpr * ) = 0; |
---|
87 | virtual const ast::Expr * visit( const ast::UntypedInitExpr * ) = 0; |
---|
88 | virtual const ast::Expr * visit( const ast::InitExpr * ) = 0; |
---|
89 | virtual const ast::Expr * visit( const ast::DeletedExpr * ) = 0; |
---|
90 | virtual const ast::Expr * visit( const ast::DefaultArgExpr * ) = 0; |
---|
91 | virtual const ast::Expr * visit( const ast::GenericExpr * ) = 0; |
---|
92 | virtual const ast::Type * visit( const ast::VoidType * ) = 0; |
---|
93 | virtual const ast::Type * visit( const ast::BasicType * ) = 0; |
---|
94 | virtual const ast::Type * visit( const ast::PointerType * ) = 0; |
---|
95 | virtual const ast::Type * visit( const ast::ArrayType * ) = 0; |
---|
96 | virtual const ast::Type * visit( const ast::ReferenceType * ) = 0; |
---|
97 | virtual const ast::Type * visit( const ast::QualifiedType * ) = 0; |
---|
98 | virtual const ast::Type * visit( const ast::FunctionType * ) = 0; |
---|
99 | virtual const ast::Type * visit( const ast::StructInstType * ) = 0; |
---|
100 | virtual const ast::Type * visit( const ast::UnionInstType * ) = 0; |
---|
101 | virtual const ast::Type * visit( const ast::EnumInstType * ) = 0; |
---|
102 | virtual const ast::Type * visit( const ast::TraitInstType * ) = 0; |
---|
103 | virtual const ast::Type * visit( const ast::TypeInstType * ) = 0; |
---|
104 | virtual const ast::Type * visit( const ast::TupleType * ) = 0; |
---|
105 | virtual const ast::Type * visit( const ast::TypeofType * ) = 0; |
---|
106 | virtual const ast::Type * visit( const ast::AttrType * ) = 0; |
---|
107 | virtual const ast::Type * visit( const ast::VarArgsType * ) = 0; |
---|
108 | virtual const ast::Type * visit( const ast::ZeroType * ) = 0; |
---|
109 | virtual const ast::Type * visit( const ast::OneType * ) = 0; |
---|
110 | virtual const ast::Type * visit( const ast::GlobalScopeType * ) = 0; |
---|
111 | virtual const ast::Designation * visit( const ast::Designation * ) = 0; |
---|
112 | virtual const ast::Init * visit( const ast::SingleInit * ) = 0; |
---|
113 | virtual const ast::Init * visit( const ast::ListInit * ) = 0; |
---|
114 | virtual const ast::Init * visit( const ast::ConstructorInit * ) = 0; |
---|
115 | virtual const ast::Constant * visit( const ast::Constant * ) = 0; |
---|
116 | virtual const ast::Attribute * visit( const ast::Attribute * ) = 0; |
---|
117 | virtual const ast::TypeSubstitution * visit( const ast::TypeSubstitution * ) = 0; |
---|
118 | }; |
---|
119 | |
---|
120 | } |
---|
121 | |
---|
122 | // Local Variables: // |
---|
123 | // tab-width: 4 // |
---|
124 | // mode: c++ // |
---|
125 | // compile-command: "make install" // |
---|
126 | // End: // |
---|