[db27767] | 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 |
---|
[2d019af] | 11 | // Last Modified By : Peter A. Buhr |
---|
[3b0bc16] | 12 | // Last Modified On : Tue Feb 1 09:09:34 2022 |
---|
| 13 | // Update Count : 2 |
---|
[db27767] | 14 | // |
---|
| 15 | |
---|
| 16 | #pragma once |
---|
| 17 | |
---|
| 18 | #include "Fwd.hpp" |
---|
| 19 | |
---|
| 20 | namespace ast { |
---|
| 21 | |
---|
| 22 | class Visitor { |
---|
| 23 | public: |
---|
[6d51bd7] | 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; |
---|
[2d019af] | 33 | virtual const ast::DirectiveDecl * visit( const ast::DirectiveDecl * ) = 0; |
---|
[6d51bd7] | 34 | virtual const ast::StaticAssertDecl * visit( const ast::StaticAssertDecl * ) = 0; |
---|
[19a8c40] | 35 | virtual const ast::DeclWithType * visit( const ast::InlineMemberDecl * ) = 0; |
---|
[6d51bd7] | 36 | virtual const ast::CompoundStmt * visit( const ast::CompoundStmt * ) = 0; |
---|
| 37 | virtual const ast::Stmt * visit( const ast::ExprStmt * ) = 0; |
---|
| 38 | virtual const ast::Stmt * visit( const ast::AsmStmt * ) = 0; |
---|
| 39 | virtual const ast::Stmt * visit( const ast::DirectiveStmt * ) = 0; |
---|
| 40 | virtual const ast::Stmt * visit( const ast::IfStmt * ) = 0; |
---|
[3b0bc16] | 41 | virtual const ast::Stmt * visit( const ast::WhileDoStmt * ) = 0; |
---|
[6d51bd7] | 42 | virtual const ast::Stmt * visit( const ast::ForStmt * ) = 0; |
---|
| 43 | virtual const ast::Stmt * visit( const ast::SwitchStmt * ) = 0; |
---|
[400b8be] | 44 | virtual const ast::CaseClause * visit( const ast::CaseClause * ) = 0; |
---|
[6d51bd7] | 45 | virtual const ast::Stmt * visit( const ast::BranchStmt * ) = 0; |
---|
| 46 | virtual const ast::Stmt * visit( const ast::ReturnStmt * ) = 0; |
---|
| 47 | virtual const ast::Stmt * visit( const ast::ThrowStmt * ) = 0; |
---|
| 48 | virtual const ast::Stmt * visit( const ast::TryStmt * ) = 0; |
---|
[400b8be] | 49 | virtual const ast::CatchClause * visit( const ast::CatchClause * ) = 0; |
---|
| 50 | virtual const ast::FinallyClause * visit( const ast::FinallyClause * ) = 0; |
---|
[37cdd97] | 51 | virtual const ast::Stmt * visit( const ast::SuspendStmt * ) = 0; |
---|
[c86b08d] | 52 | virtual const ast::WhenClause * visit( const ast::WhenClause * ) = 0; |
---|
[6d51bd7] | 53 | virtual const ast::Stmt * visit( const ast::WaitForStmt * ) = 0; |
---|
[f6e6a55] | 54 | virtual const ast::WaitForClause * visit( const ast::WaitForClause * ) = 0; |
---|
[c86b08d] | 55 | virtual const ast::Stmt * visit( const ast::WaitUntilStmt * ) = 0; |
---|
[e67991f] | 56 | virtual const ast::Decl * visit( const ast::WithStmt * ) = 0; |
---|
[6d51bd7] | 57 | virtual const ast::NullStmt * visit( const ast::NullStmt * ) = 0; |
---|
| 58 | virtual const ast::Stmt * visit( const ast::DeclStmt * ) = 0; |
---|
| 59 | virtual const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * ) = 0; |
---|
[6cebfef] | 60 | virtual const ast::Stmt * visit( const ast::MutexStmt * ) = 0; |
---|
[eb779d5] | 61 | virtual const ast::Stmt * visit( const ast::CorunStmt * ) = 0; |
---|
[3d9d017] | 62 | virtual const ast::Stmt * visit( const ast::CoforStmt * ) = 0; |
---|
[6d51bd7] | 63 | virtual const ast::Expr * visit( const ast::ApplicationExpr * ) = 0; |
---|
| 64 | virtual const ast::Expr * visit( const ast::UntypedExpr * ) = 0; |
---|
| 65 | virtual const ast::Expr * visit( const ast::NameExpr * ) = 0; |
---|
[b0d9ff7] | 66 | virtual const ast::Expr * visit( const ast::QualifiedNameExpr * ) = 0; |
---|
[6d51bd7] | 67 | virtual const ast::Expr * visit( const ast::AddressExpr * ) = 0; |
---|
| 68 | virtual const ast::Expr * visit( const ast::LabelAddressExpr * ) = 0; |
---|
| 69 | virtual const ast::Expr * visit( const ast::CastExpr * ) = 0; |
---|
| 70 | virtual const ast::Expr * visit( const ast::KeywordCastExpr * ) = 0; |
---|
| 71 | virtual const ast::Expr * visit( const ast::VirtualCastExpr * ) = 0; |
---|
| 72 | virtual const ast::Expr * visit( const ast::UntypedMemberExpr * ) = 0; |
---|
| 73 | virtual const ast::Expr * visit( const ast::MemberExpr * ) = 0; |
---|
| 74 | virtual const ast::Expr * visit( const ast::VariableExpr * ) = 0; |
---|
| 75 | virtual const ast::Expr * visit( const ast::ConstantExpr * ) = 0; |
---|
| 76 | virtual const ast::Expr * visit( const ast::SizeofExpr * ) = 0; |
---|
[525f7ad] | 77 | virtual const ast::Expr * visit( const ast::CountExpr * ) = 0; |
---|
[6d51bd7] | 78 | virtual const ast::Expr * visit( const ast::AlignofExpr * ) = 0; |
---|
| 79 | virtual const ast::Expr * visit( const ast::UntypedOffsetofExpr * ) = 0; |
---|
| 80 | virtual const ast::Expr * visit( const ast::OffsetofExpr * ) = 0; |
---|
| 81 | virtual const ast::Expr * visit( const ast::OffsetPackExpr * ) = 0; |
---|
| 82 | virtual const ast::Expr * visit( const ast::LogicalExpr * ) = 0; |
---|
| 83 | virtual const ast::Expr * visit( const ast::ConditionalExpr * ) = 0; |
---|
| 84 | virtual const ast::Expr * visit( const ast::CommaExpr * ) = 0; |
---|
| 85 | virtual const ast::Expr * visit( const ast::TypeExpr * ) = 0; |
---|
[4ec9513] | 86 | virtual const ast::Expr * visit( const ast::DimensionExpr * ) = 0; |
---|
[6d51bd7] | 87 | virtual const ast::Expr * visit( const ast::AsmExpr * ) = 0; |
---|
| 88 | virtual const ast::Expr * visit( const ast::ImplicitCopyCtorExpr * ) = 0; |
---|
| 89 | virtual const ast::Expr * visit( const ast::ConstructorExpr * ) = 0; |
---|
| 90 | virtual const ast::Expr * visit( const ast::CompoundLiteralExpr * ) = 0; |
---|
| 91 | virtual const ast::Expr * visit( const ast::RangeExpr * ) = 0; |
---|
| 92 | virtual const ast::Expr * visit( const ast::UntypedTupleExpr * ) = 0; |
---|
| 93 | virtual const ast::Expr * visit( const ast::TupleExpr * ) = 0; |
---|
| 94 | virtual const ast::Expr * visit( const ast::TupleIndexExpr * ) = 0; |
---|
| 95 | virtual const ast::Expr * visit( const ast::TupleAssignExpr * ) = 0; |
---|
| 96 | virtual const ast::Expr * visit( const ast::StmtExpr * ) = 0; |
---|
| 97 | virtual const ast::Expr * visit( const ast::UniqueExpr * ) = 0; |
---|
| 98 | virtual const ast::Expr * visit( const ast::UntypedInitExpr * ) = 0; |
---|
| 99 | virtual const ast::Expr * visit( const ast::InitExpr * ) = 0; |
---|
| 100 | virtual const ast::Expr * visit( const ast::DeletedExpr * ) = 0; |
---|
| 101 | virtual const ast::Expr * visit( const ast::DefaultArgExpr * ) = 0; |
---|
| 102 | virtual const ast::Expr * visit( const ast::GenericExpr * ) = 0; |
---|
| 103 | virtual const ast::Type * visit( const ast::VoidType * ) = 0; |
---|
| 104 | virtual const ast::Type * visit( const ast::BasicType * ) = 0; |
---|
| 105 | virtual const ast::Type * visit( const ast::PointerType * ) = 0; |
---|
| 106 | virtual const ast::Type * visit( const ast::ArrayType * ) = 0; |
---|
| 107 | virtual const ast::Type * visit( const ast::ReferenceType * ) = 0; |
---|
| 108 | virtual const ast::Type * visit( const ast::QualifiedType * ) = 0; |
---|
| 109 | virtual const ast::Type * visit( const ast::FunctionType * ) = 0; |
---|
| 110 | virtual const ast::Type * visit( const ast::StructInstType * ) = 0; |
---|
| 111 | virtual const ast::Type * visit( const ast::UnionInstType * ) = 0; |
---|
| 112 | virtual const ast::Type * visit( const ast::EnumInstType * ) = 0; |
---|
| 113 | virtual const ast::Type * visit( const ast::TraitInstType * ) = 0; |
---|
| 114 | virtual const ast::Type * visit( const ast::TypeInstType * ) = 0; |
---|
| 115 | virtual const ast::Type * visit( const ast::TupleType * ) = 0; |
---|
| 116 | virtual const ast::Type * visit( const ast::TypeofType * ) = 0; |
---|
[3945abe] | 117 | virtual const ast::Type * visit( const ast::VTableType * ) = 0; |
---|
[6d51bd7] | 118 | virtual const ast::Type * visit( const ast::VarArgsType * ) = 0; |
---|
| 119 | virtual const ast::Type * visit( const ast::ZeroType * ) = 0; |
---|
| 120 | virtual const ast::Type * visit( const ast::OneType * ) = 0; |
---|
| 121 | virtual const ast::Type * visit( const ast::GlobalScopeType * ) = 0; |
---|
| 122 | virtual const ast::Designation * visit( const ast::Designation * ) = 0; |
---|
| 123 | virtual const ast::Init * visit( const ast::SingleInit * ) = 0; |
---|
| 124 | virtual const ast::Init * visit( const ast::ListInit * ) = 0; |
---|
| 125 | virtual const ast::Init * visit( const ast::ConstructorInit * ) = 0; |
---|
| 126 | virtual const ast::Attribute * visit( const ast::Attribute * ) = 0; |
---|
| 127 | virtual const ast::TypeSubstitution * visit( const ast::TypeSubstitution * ) = 0; |
---|
[db27767] | 128 | }; |
---|
| 129 | |
---|
| 130 | } |
---|
| 131 | |
---|
| 132 | // Local Variables: // |
---|
| 133 | // tab-width: 4 // |
---|
| 134 | // mode: c++ // |
---|
| 135 | // compile-command: "make install" // |
---|
| 136 | // End: // |
---|