[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; |
---|
| 35 | virtual const ast::CompoundStmt * visit( const ast::CompoundStmt * ) = 0; |
---|
| 36 | virtual const ast::Stmt * visit( const ast::ExprStmt * ) = 0; |
---|
| 37 | virtual const ast::Stmt * visit( const ast::AsmStmt * ) = 0; |
---|
| 38 | virtual const ast::Stmt * visit( const ast::DirectiveStmt * ) = 0; |
---|
| 39 | virtual const ast::Stmt * visit( const ast::IfStmt * ) = 0; |
---|
[3b0bc16] | 40 | virtual const ast::Stmt * visit( const ast::WhileDoStmt * ) = 0; |
---|
[6d51bd7] | 41 | virtual const ast::Stmt * visit( const ast::ForStmt * ) = 0; |
---|
| 42 | virtual const ast::Stmt * visit( const ast::SwitchStmt * ) = 0; |
---|
| 43 | virtual const ast::Stmt * visit( const ast::CaseStmt * ) = 0; |
---|
| 44 | virtual const ast::Stmt * visit( const ast::BranchStmt * ) = 0; |
---|
| 45 | virtual const ast::Stmt * visit( const ast::ReturnStmt * ) = 0; |
---|
| 46 | virtual const ast::Stmt * visit( const ast::ThrowStmt * ) = 0; |
---|
| 47 | virtual const ast::Stmt * visit( const ast::TryStmt * ) = 0; |
---|
| 48 | virtual const ast::Stmt * visit( const ast::CatchStmt * ) = 0; |
---|
| 49 | virtual const ast::Stmt * visit( const ast::FinallyStmt * ) = 0; |
---|
[37cdd97] | 50 | virtual const ast::Stmt * visit( const ast::SuspendStmt * ) = 0; |
---|
[6d51bd7] | 51 | virtual const ast::Stmt * visit( const ast::WaitForStmt * ) = 0; |
---|
[e67991f] | 52 | virtual const ast::Decl * visit( const ast::WithStmt * ) = 0; |
---|
[6d51bd7] | 53 | virtual const ast::NullStmt * visit( const ast::NullStmt * ) = 0; |
---|
| 54 | virtual const ast::Stmt * visit( const ast::DeclStmt * ) = 0; |
---|
| 55 | virtual const ast::Stmt * visit( const ast::ImplicitCtorDtorStmt * ) = 0; |
---|
[6cebfef] | 56 | virtual const ast::Stmt * visit( const ast::MutexStmt * ) = 0; |
---|
[6d51bd7] | 57 | virtual const ast::Expr * visit( const ast::ApplicationExpr * ) = 0; |
---|
| 58 | virtual const ast::Expr * visit( const ast::UntypedExpr * ) = 0; |
---|
| 59 | virtual const ast::Expr * visit( const ast::NameExpr * ) = 0; |
---|
| 60 | virtual const ast::Expr * visit( const ast::AddressExpr * ) = 0; |
---|
| 61 | virtual const ast::Expr * visit( const ast::LabelAddressExpr * ) = 0; |
---|
| 62 | virtual const ast::Expr * visit( const ast::CastExpr * ) = 0; |
---|
| 63 | virtual const ast::Expr * visit( const ast::KeywordCastExpr * ) = 0; |
---|
| 64 | virtual const ast::Expr * visit( const ast::VirtualCastExpr * ) = 0; |
---|
| 65 | virtual const ast::Expr * visit( const ast::UntypedMemberExpr * ) = 0; |
---|
| 66 | virtual const ast::Expr * visit( const ast::MemberExpr * ) = 0; |
---|
| 67 | virtual const ast::Expr * visit( const ast::VariableExpr * ) = 0; |
---|
| 68 | virtual const ast::Expr * visit( const ast::ConstantExpr * ) = 0; |
---|
| 69 | virtual const ast::Expr * visit( const ast::SizeofExpr * ) = 0; |
---|
| 70 | virtual const ast::Expr * visit( const ast::AlignofExpr * ) = 0; |
---|
| 71 | virtual const ast::Expr * visit( const ast::UntypedOffsetofExpr * ) = 0; |
---|
| 72 | virtual const ast::Expr * visit( const ast::OffsetofExpr * ) = 0; |
---|
| 73 | virtual const ast::Expr * visit( const ast::OffsetPackExpr * ) = 0; |
---|
| 74 | virtual const ast::Expr * visit( const ast::LogicalExpr * ) = 0; |
---|
| 75 | virtual const ast::Expr * visit( const ast::ConditionalExpr * ) = 0; |
---|
| 76 | virtual const ast::Expr * visit( const ast::CommaExpr * ) = 0; |
---|
| 77 | virtual const ast::Expr * visit( const ast::TypeExpr * ) = 0; |
---|
| 78 | virtual const ast::Expr * visit( const ast::AsmExpr * ) = 0; |
---|
| 79 | virtual const ast::Expr * visit( const ast::ImplicitCopyCtorExpr * ) = 0; |
---|
| 80 | virtual const ast::Expr * visit( const ast::ConstructorExpr * ) = 0; |
---|
| 81 | virtual const ast::Expr * visit( const ast::CompoundLiteralExpr * ) = 0; |
---|
| 82 | virtual const ast::Expr * visit( const ast::RangeExpr * ) = 0; |
---|
| 83 | virtual const ast::Expr * visit( const ast::UntypedTupleExpr * ) = 0; |
---|
| 84 | virtual const ast::Expr * visit( const ast::TupleExpr * ) = 0; |
---|
| 85 | virtual const ast::Expr * visit( const ast::TupleIndexExpr * ) = 0; |
---|
| 86 | virtual const ast::Expr * visit( const ast::TupleAssignExpr * ) = 0; |
---|
| 87 | virtual const ast::Expr * visit( const ast::StmtExpr * ) = 0; |
---|
| 88 | virtual const ast::Expr * visit( const ast::UniqueExpr * ) = 0; |
---|
| 89 | virtual const ast::Expr * visit( const ast::UntypedInitExpr * ) = 0; |
---|
| 90 | virtual const ast::Expr * visit( const ast::InitExpr * ) = 0; |
---|
| 91 | virtual const ast::Expr * visit( const ast::DeletedExpr * ) = 0; |
---|
| 92 | virtual const ast::Expr * visit( const ast::DefaultArgExpr * ) = 0; |
---|
| 93 | virtual const ast::Expr * visit( const ast::GenericExpr * ) = 0; |
---|
| 94 | virtual const ast::Type * visit( const ast::VoidType * ) = 0; |
---|
| 95 | virtual const ast::Type * visit( const ast::BasicType * ) = 0; |
---|
| 96 | virtual const ast::Type * visit( const ast::PointerType * ) = 0; |
---|
| 97 | virtual const ast::Type * visit( const ast::ArrayType * ) = 0; |
---|
| 98 | virtual const ast::Type * visit( const ast::ReferenceType * ) = 0; |
---|
| 99 | virtual const ast::Type * visit( const ast::QualifiedType * ) = 0; |
---|
| 100 | virtual const ast::Type * visit( const ast::FunctionType * ) = 0; |
---|
| 101 | virtual const ast::Type * visit( const ast::StructInstType * ) = 0; |
---|
| 102 | virtual const ast::Type * visit( const ast::UnionInstType * ) = 0; |
---|
| 103 | virtual const ast::Type * visit( const ast::EnumInstType * ) = 0; |
---|
| 104 | virtual const ast::Type * visit( const ast::TraitInstType * ) = 0; |
---|
| 105 | virtual const ast::Type * visit( const ast::TypeInstType * ) = 0; |
---|
| 106 | virtual const ast::Type * visit( const ast::TupleType * ) = 0; |
---|
| 107 | virtual const ast::Type * visit( const ast::TypeofType * ) = 0; |
---|
[3945abe] | 108 | virtual const ast::Type * visit( const ast::VTableType * ) = 0; |
---|
[6d51bd7] | 109 | virtual const ast::Type * visit( const ast::VarArgsType * ) = 0; |
---|
| 110 | virtual const ast::Type * visit( const ast::ZeroType * ) = 0; |
---|
| 111 | virtual const ast::Type * visit( const ast::OneType * ) = 0; |
---|
| 112 | virtual const ast::Type * visit( const ast::GlobalScopeType * ) = 0; |
---|
| 113 | virtual const ast::Designation * visit( const ast::Designation * ) = 0; |
---|
| 114 | virtual const ast::Init * visit( const ast::SingleInit * ) = 0; |
---|
| 115 | virtual const ast::Init * visit( const ast::ListInit * ) = 0; |
---|
| 116 | virtual const ast::Init * visit( const ast::ConstructorInit * ) = 0; |
---|
| 117 | virtual const ast::Attribute * visit( const ast::Attribute * ) = 0; |
---|
| 118 | virtual const ast::TypeSubstitution * visit( const ast::TypeSubstitution * ) = 0; |
---|
[db27767] | 119 | }; |
---|
| 120 | |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | // Local Variables: // |
---|
| 124 | // tab-width: 4 // |
---|
| 125 | // mode: c++ // |
---|
| 126 | // compile-command: "make install" // |
---|
| 127 | // End: // |
---|