[0dd3a2f] | 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 | //
|
---|
[71f4e4f] | 7 | // Visitor.cc --
|
---|
[0dd3a2f] | 8 | //
|
---|
| 9 | // Author : Richard C. Bilson
|
---|
| 10 | // Created On : Mon May 18 07:44:20 2015
|
---|
[71f4e4f] | 11 | // Last Modified By : Rob Schluntz
|
---|
[4ffdd63] | 12 | // Last Modified On : Wed Apr 27 17:07:40 2016
|
---|
[71f4e4f] | 13 | // Update Count : 18
|
---|
[0dd3a2f] | 14 | //
|
---|
| 15 |
|
---|
[51b73452] | 16 | #include <cassert>
|
---|
| 17 | #include "Visitor.h"
|
---|
| 18 | #include "Initializer.h"
|
---|
| 19 | #include "Statement.h"
|
---|
| 20 | #include "Type.h"
|
---|
| 21 | #include "Declaration.h"
|
---|
| 22 | #include "Expression.h"
|
---|
| 23 | #include "Constant.h"
|
---|
| 24 |
|
---|
[d9a0e76] | 25 | Visitor::Visitor() {}
|
---|
[51b73452] | 26 |
|
---|
[d9a0e76] | 27 | Visitor::~Visitor() {}
|
---|
[51b73452] | 28 |
|
---|
[0dd3a2f] | 29 | void Visitor::visit( ObjectDecl *objectDecl ) {
|
---|
| 30 | maybeAccept( objectDecl->get_type(), *this );
|
---|
| 31 | maybeAccept( objectDecl->get_init(), *this );
|
---|
| 32 | maybeAccept( objectDecl->get_bitfieldWidth(), *this );
|
---|
[51b73452] | 33 | }
|
---|
| 34 |
|
---|
[0dd3a2f] | 35 | void Visitor::visit( FunctionDecl *functionDecl ) {
|
---|
| 36 | maybeAccept( functionDecl->get_functionType(), *this );
|
---|
| 37 | acceptAll( functionDecl->get_oldDecls(), *this );
|
---|
| 38 | maybeAccept( functionDecl->get_statements(), *this );
|
---|
[51b73452] | 39 | }
|
---|
| 40 |
|
---|
[0dd3a2f] | 41 | void Visitor::visit( AggregateDecl *aggregateDecl ) {
|
---|
| 42 | acceptAll( aggregateDecl->get_parameters(), *this );
|
---|
| 43 | acceptAll( aggregateDecl->get_members(), *this );
|
---|
[51b73452] | 44 | }
|
---|
| 45 |
|
---|
[0dd3a2f] | 46 | void Visitor::visit( StructDecl *aggregateDecl ) {
|
---|
| 47 | visit( static_cast< AggregateDecl* >( aggregateDecl ) );
|
---|
[51b73452] | 48 | }
|
---|
| 49 |
|
---|
[0dd3a2f] | 50 | void Visitor::visit( UnionDecl *aggregateDecl ) {
|
---|
| 51 | visit( static_cast< AggregateDecl* >( aggregateDecl ) );
|
---|
[51b73452] | 52 | }
|
---|
| 53 |
|
---|
[0dd3a2f] | 54 | void Visitor::visit( EnumDecl *aggregateDecl ) {
|
---|
| 55 | visit( static_cast< AggregateDecl* >( aggregateDecl ) );
|
---|
[51b73452] | 56 | }
|
---|
| 57 |
|
---|
[4040425] | 58 | void Visitor::visit( TraitDecl *aggregateDecl ) {
|
---|
[0dd3a2f] | 59 | visit( static_cast< AggregateDecl* >( aggregateDecl ) );
|
---|
[51b73452] | 60 | }
|
---|
| 61 |
|
---|
[0dd3a2f] | 62 | void Visitor::visit( NamedTypeDecl *typeDecl ) {
|
---|
| 63 | acceptAll( typeDecl->get_parameters(), *this );
|
---|
| 64 | acceptAll( typeDecl->get_assertions(), *this );
|
---|
| 65 | maybeAccept( typeDecl->get_base(), *this );
|
---|
[51b73452] | 66 | }
|
---|
| 67 |
|
---|
[0dd3a2f] | 68 | void Visitor::visit( TypeDecl *typeDecl ) {
|
---|
| 69 | visit( static_cast< NamedTypeDecl* >( typeDecl ) );
|
---|
[51b73452] | 70 | }
|
---|
| 71 |
|
---|
[0dd3a2f] | 72 | void Visitor::visit( TypedefDecl *typeDecl ) {
|
---|
| 73 | visit( static_cast< NamedTypeDecl* >( typeDecl ) );
|
---|
[51b73452] | 74 | }
|
---|
| 75 |
|
---|
[0dd3a2f] | 76 | void Visitor::visit( CompoundStmt *compoundStmt ) {
|
---|
| 77 | acceptAll( compoundStmt->get_kids(), *this );
|
---|
[51b73452] | 78 | }
|
---|
| 79 |
|
---|
[0dd3a2f] | 80 | void Visitor::visit( ExprStmt *exprStmt ) {
|
---|
| 81 | maybeAccept( exprStmt->get_expr(), *this );
|
---|
[51b73452] | 82 | }
|
---|
| 83 |
|
---|
[7f5566b] | 84 | void Visitor::visit( AsmStmt *asmStmt ) {
|
---|
| 85 | maybeAccept( asmStmt->get_instruction(), *this );
|
---|
| 86 | acceptAll( asmStmt->get_output(), *this );
|
---|
| 87 | acceptAll( asmStmt->get_input(), *this );
|
---|
| 88 | acceptAll( asmStmt->get_clobber(), *this );
|
---|
| 89 | }
|
---|
| 90 |
|
---|
[0dd3a2f] | 91 | void Visitor::visit( IfStmt *ifStmt ) {
|
---|
| 92 | maybeAccept( ifStmt->get_condition(), *this );
|
---|
| 93 | maybeAccept( ifStmt->get_thenPart(), *this );
|
---|
| 94 | maybeAccept( ifStmt->get_elsePart(), *this );
|
---|
[51b73452] | 95 | }
|
---|
| 96 |
|
---|
[0dd3a2f] | 97 | void Visitor::visit( WhileStmt *whileStmt ) {
|
---|
| 98 | maybeAccept( whileStmt->get_condition(), *this );
|
---|
| 99 | maybeAccept( whileStmt->get_body(), *this );
|
---|
[51b73452] | 100 | }
|
---|
| 101 |
|
---|
[0dd3a2f] | 102 | void Visitor::visit( ForStmt *forStmt ) {
|
---|
[145f1fc] | 103 | acceptAll( forStmt->get_initialization(), *this );
|
---|
[0dd3a2f] | 104 | maybeAccept( forStmt->get_condition(), *this );
|
---|
| 105 | maybeAccept( forStmt->get_increment(), *this );
|
---|
| 106 | maybeAccept( forStmt->get_body(), *this );
|
---|
[51b73452] | 107 | }
|
---|
| 108 |
|
---|
[0dd3a2f] | 109 | void Visitor::visit( SwitchStmt *switchStmt ) {
|
---|
| 110 | maybeAccept( switchStmt->get_condition(), *this );
|
---|
| 111 | acceptAll( switchStmt->get_branches(), *this );
|
---|
[51b73452] | 112 | }
|
---|
| 113 |
|
---|
[0dd3a2f] | 114 | void Visitor::visit( ChooseStmt *switchStmt ) {
|
---|
| 115 | maybeAccept( switchStmt->get_condition(), *this );
|
---|
| 116 | acceptAll( switchStmt->get_branches(), *this );
|
---|
[51b73452] | 117 | }
|
---|
| 118 |
|
---|
[a08ba92] | 119 | void Visitor::visit( FallthruStmt *fallthruStmt ) {}
|
---|
[51b73452] | 120 |
|
---|
[0dd3a2f] | 121 | void Visitor::visit( CaseStmt *caseStmt ) {
|
---|
| 122 | maybeAccept( caseStmt->get_condition(), *this );
|
---|
| 123 | acceptAll( caseStmt->get_statements(), *this );
|
---|
[51b73452] | 124 | }
|
---|
| 125 |
|
---|
[0dd3a2f] | 126 | void Visitor::visit( BranchStmt *branchStmt ) {
|
---|
[51b73452] | 127 | }
|
---|
| 128 |
|
---|
[0dd3a2f] | 129 | void Visitor::visit( ReturnStmt *returnStmt ) {
|
---|
| 130 | maybeAccept( returnStmt->get_expr(), *this );
|
---|
[51b73452] | 131 | }
|
---|
| 132 |
|
---|
[0dd3a2f] | 133 | void Visitor::visit( TryStmt *tryStmt ) {
|
---|
| 134 | maybeAccept( tryStmt->get_block(), *this );
|
---|
| 135 | acceptAll( tryStmt->get_catchers(), *this );
|
---|
[51b73452] | 136 | }
|
---|
| 137 |
|
---|
[0dd3a2f] | 138 | void Visitor::visit( CatchStmt *catchStmt ) {
|
---|
| 139 | maybeAccept( catchStmt->get_decl(), *this );
|
---|
| 140 | maybeAccept( catchStmt->get_body(), *this );
|
---|
[51b73452] | 141 | }
|
---|
| 142 |
|
---|
[0dd3a2f] | 143 | void Visitor::visit( FinallyStmt *finalStmt ) {
|
---|
| 144 | maybeAccept( finalStmt->get_block(), *this );
|
---|
[51b73452] | 145 | }
|
---|
| 146 |
|
---|
[0dd3a2f] | 147 | void Visitor::visit( NullStmt *nullStmt ) {
|
---|
[51b73452] | 148 | }
|
---|
| 149 |
|
---|
[0dd3a2f] | 150 | void Visitor::visit( DeclStmt *declStmt ) {
|
---|
| 151 | maybeAccept( declStmt->get_decl(), *this );
|
---|
[51b73452] | 152 | }
|
---|
| 153 |
|
---|
[f1b1e4c] | 154 | void Visitor::visit( ImplicitCtorDtorStmt *impCtorDtorStmt ) {
|
---|
| 155 | maybeAccept( impCtorDtorStmt->get_callStmt(), *this );
|
---|
| 156 | }
|
---|
| 157 |
|
---|
[0dd3a2f] | 158 | void Visitor::visit( ApplicationExpr *applicationExpr ) {
|
---|
| 159 | acceptAll( applicationExpr->get_results(), *this );
|
---|
| 160 | maybeAccept( applicationExpr->get_function(), *this );
|
---|
| 161 | acceptAll( applicationExpr->get_args(), *this );
|
---|
[51b73452] | 162 | }
|
---|
| 163 |
|
---|
[0dd3a2f] | 164 | void Visitor::visit( UntypedExpr *untypedExpr ) {
|
---|
| 165 | acceptAll( untypedExpr->get_results(), *this );
|
---|
| 166 | acceptAll( untypedExpr->get_args(), *this );
|
---|
[51b73452] | 167 | }
|
---|
| 168 |
|
---|
[0dd3a2f] | 169 | void Visitor::visit( NameExpr *nameExpr ) {
|
---|
| 170 | acceptAll( nameExpr->get_results(), *this );
|
---|
[51b73452] | 171 | }
|
---|
| 172 |
|
---|
[0dd3a2f] | 173 | void Visitor::visit( AddressExpr *addressExpr ) {
|
---|
| 174 | acceptAll( addressExpr->get_results(), *this );
|
---|
| 175 | maybeAccept( addressExpr->get_arg(), *this );
|
---|
[51b73452] | 176 | }
|
---|
| 177 |
|
---|
[0dd3a2f] | 178 | void Visitor::visit( LabelAddressExpr *labAddressExpr ) {
|
---|
| 179 | acceptAll( labAddressExpr->get_results(), *this );
|
---|
| 180 | maybeAccept( labAddressExpr->get_arg(), *this );
|
---|
[51b73452] | 181 | }
|
---|
| 182 |
|
---|
[0dd3a2f] | 183 | void Visitor::visit( CastExpr *castExpr ) {
|
---|
| 184 | acceptAll( castExpr->get_results(), *this );
|
---|
| 185 | maybeAccept( castExpr->get_arg(), *this );
|
---|
[51b73452] | 186 | }
|
---|
| 187 |
|
---|
[0dd3a2f] | 188 | void Visitor::visit( UntypedMemberExpr *memberExpr ) {
|
---|
| 189 | acceptAll( memberExpr->get_results(), *this );
|
---|
| 190 | maybeAccept( memberExpr->get_aggregate(), *this );
|
---|
[51b73452] | 191 | }
|
---|
| 192 |
|
---|
[0dd3a2f] | 193 | void Visitor::visit( MemberExpr *memberExpr ) {
|
---|
| 194 | acceptAll( memberExpr->get_results(), *this );
|
---|
| 195 | maybeAccept( memberExpr->get_aggregate(), *this );
|
---|
[51b73452] | 196 | }
|
---|
| 197 |
|
---|
[0dd3a2f] | 198 | void Visitor::visit( VariableExpr *variableExpr ) {
|
---|
| 199 | acceptAll( variableExpr->get_results(), *this );
|
---|
[51b73452] | 200 | }
|
---|
| 201 |
|
---|
[0dd3a2f] | 202 | void Visitor::visit( ConstantExpr *constantExpr ) {
|
---|
| 203 | acceptAll( constantExpr->get_results(), *this );
|
---|
| 204 | maybeAccept( constantExpr->get_constant(), *this );
|
---|
[51b73452] | 205 | }
|
---|
| 206 |
|
---|
[0dd3a2f] | 207 | void Visitor::visit( SizeofExpr *sizeofExpr ) {
|
---|
| 208 | acceptAll( sizeofExpr->get_results(), *this );
|
---|
| 209 | if ( sizeofExpr->get_isType() ) {
|
---|
| 210 | maybeAccept( sizeofExpr->get_type(), *this );
|
---|
| 211 | } else {
|
---|
| 212 | maybeAccept( sizeofExpr->get_expr(), *this );
|
---|
| 213 | }
|
---|
[51b73452] | 214 | }
|
---|
| 215 |
|
---|
[47534159] | 216 | void Visitor::visit( AlignofExpr *alignofExpr ) {
|
---|
| 217 | acceptAll( alignofExpr->get_results(), *this );
|
---|
| 218 | if ( alignofExpr->get_isType() ) {
|
---|
| 219 | maybeAccept( alignofExpr->get_type(), *this );
|
---|
| 220 | } else {
|
---|
| 221 | maybeAccept( alignofExpr->get_expr(), *this );
|
---|
| 222 | }
|
---|
| 223 | }
|
---|
| 224 |
|
---|
[2a4b088] | 225 | void Visitor::visit( UntypedOffsetofExpr *offsetofExpr ) {
|
---|
| 226 | acceptAll( offsetofExpr->get_results(), *this );
|
---|
| 227 | maybeAccept( offsetofExpr->get_type(), *this );
|
---|
| 228 | }
|
---|
| 229 |
|
---|
[25a054f] | 230 | void Visitor::visit( OffsetofExpr *offsetofExpr ) {
|
---|
| 231 | acceptAll( offsetofExpr->get_results(), *this );
|
---|
| 232 | maybeAccept( offsetofExpr->get_type(), *this );
|
---|
| 233 | maybeAccept( offsetofExpr->get_member(), *this );
|
---|
| 234 | }
|
---|
| 235 |
|
---|
[afc1045] | 236 | void Visitor::visit( OffsetPackExpr *offsetPackExpr ) {
|
---|
| 237 | acceptAll( offsetPackExpr->get_results(), *this );
|
---|
| 238 | maybeAccept( offsetPackExpr->get_type(), *this );
|
---|
| 239 | }
|
---|
| 240 |
|
---|
[0dd3a2f] | 241 | void Visitor::visit( AttrExpr *attrExpr ) {
|
---|
| 242 | acceptAll( attrExpr->get_results(), *this );
|
---|
| 243 | if ( attrExpr->get_isType() ) {
|
---|
| 244 | maybeAccept( attrExpr->get_type(), *this );
|
---|
| 245 | } else {
|
---|
| 246 | maybeAccept( attrExpr->get_expr(), *this );
|
---|
| 247 | }
|
---|
[51b73452] | 248 | }
|
---|
| 249 |
|
---|
[0dd3a2f] | 250 | void Visitor::visit( LogicalExpr *logicalExpr ) {
|
---|
| 251 | acceptAll( logicalExpr->get_results(), *this );
|
---|
| 252 | maybeAccept( logicalExpr->get_arg1(), *this );
|
---|
| 253 | maybeAccept( logicalExpr->get_arg2(), *this );
|
---|
[51b73452] | 254 | }
|
---|
| 255 |
|
---|
[0dd3a2f] | 256 | void Visitor::visit( ConditionalExpr *conditionalExpr ) {
|
---|
| 257 | acceptAll( conditionalExpr->get_results(), *this );
|
---|
| 258 | maybeAccept( conditionalExpr->get_arg1(), *this );
|
---|
| 259 | maybeAccept( conditionalExpr->get_arg2(), *this );
|
---|
| 260 | maybeAccept( conditionalExpr->get_arg3(), *this );
|
---|
[51b73452] | 261 | }
|
---|
| 262 |
|
---|
[0dd3a2f] | 263 | void Visitor::visit( CommaExpr *commaExpr ) {
|
---|
| 264 | acceptAll( commaExpr->get_results(), *this );
|
---|
| 265 | maybeAccept( commaExpr->get_arg1(), *this );
|
---|
| 266 | maybeAccept( commaExpr->get_arg2(), *this );
|
---|
[51b73452] | 267 | }
|
---|
| 268 |
|
---|
[0dd3a2f] | 269 | void Visitor::visit( TupleExpr *tupleExpr ) {
|
---|
| 270 | acceptAll( tupleExpr->get_results(), *this );
|
---|
| 271 | acceptAll( tupleExpr->get_exprs(), *this );
|
---|
[51b73452] | 272 | }
|
---|
| 273 |
|
---|
[0dd3a2f] | 274 | void Visitor::visit( SolvedTupleExpr *tupleExpr ) {
|
---|
| 275 | acceptAll( tupleExpr->get_results(), *this );
|
---|
| 276 | acceptAll( tupleExpr->get_exprs(), *this );
|
---|
[51b73452] | 277 | }
|
---|
| 278 |
|
---|
[0dd3a2f] | 279 | void Visitor::visit( TypeExpr *typeExpr ) {
|
---|
| 280 | acceptAll( typeExpr->get_results(), *this );
|
---|
| 281 | maybeAccept( typeExpr->get_type(), *this );
|
---|
[51b73452] | 282 | }
|
---|
| 283 |
|
---|
[7f5566b] | 284 | void Visitor::visit( AsmExpr *asmExpr ) {
|
---|
| 285 | maybeAccept( asmExpr->get_inout(), *this );
|
---|
| 286 | maybeAccept( asmExpr->get_constraint(), *this );
|
---|
| 287 | maybeAccept( asmExpr->get_operand(), *this );
|
---|
| 288 | }
|
---|
| 289 |
|
---|
[db4ecc5] | 290 | void Visitor::visit( ImplicitCopyCtorExpr *impCpCtorExpr ) {
|
---|
| 291 | maybeAccept( impCpCtorExpr->get_callExpr(), *this );
|
---|
| 292 | acceptAll( impCpCtorExpr->get_tempDecls(), *this );
|
---|
[dc2e7e0] | 293 | acceptAll( impCpCtorExpr->get_returnDecls(), *this );
|
---|
[db4ecc5] | 294 | }
|
---|
| 295 |
|
---|
[0dd3a2f] | 296 | void Visitor::visit( UntypedValofExpr *valofExpr ) {
|
---|
| 297 | acceptAll( valofExpr->get_results(), *this );
|
---|
| 298 | maybeAccept( valofExpr->get_body(), *this );
|
---|
[51b73452] | 299 | }
|
---|
| 300 |
|
---|
[630a82a] | 301 | void Visitor::visit( CompoundLiteralExpr *compLitExpr ) {
|
---|
| 302 | acceptAll( compLitExpr->get_results(), *this );
|
---|
| 303 | maybeAccept( compLitExpr->get_type(), *this );
|
---|
| 304 | maybeAccept( compLitExpr->get_initializer(), *this );
|
---|
| 305 | }
|
---|
| 306 |
|
---|
[0dd3a2f] | 307 | void Visitor::visit( VoidType *voidType ) {
|
---|
| 308 | acceptAll( voidType->get_forall(), *this );
|
---|
[51b73452] | 309 | }
|
---|
| 310 |
|
---|
[0dd3a2f] | 311 | void Visitor::visit( BasicType *basicType ) {
|
---|
| 312 | acceptAll( basicType->get_forall(), *this );
|
---|
[51b73452] | 313 | }
|
---|
| 314 |
|
---|
[0dd3a2f] | 315 | void Visitor::visit( PointerType *pointerType ) {
|
---|
| 316 | acceptAll( pointerType->get_forall(), *this );
|
---|
| 317 | maybeAccept( pointerType->get_base(), *this );
|
---|
[51b73452] | 318 | }
|
---|
| 319 |
|
---|
[0dd3a2f] | 320 | void Visitor::visit( ArrayType *arrayType ) {
|
---|
| 321 | acceptAll( arrayType->get_forall(), *this );
|
---|
| 322 | maybeAccept( arrayType->get_dimension(), *this );
|
---|
| 323 | maybeAccept( arrayType->get_base(), *this );
|
---|
[51b73452] | 324 | }
|
---|
| 325 |
|
---|
[0dd3a2f] | 326 | void Visitor::visit( FunctionType *functionType ) {
|
---|
| 327 | acceptAll( functionType->get_forall(), *this );
|
---|
| 328 | acceptAll( functionType->get_returnVals(), *this );
|
---|
| 329 | acceptAll( functionType->get_parameters(), *this );
|
---|
[51b73452] | 330 | }
|
---|
| 331 |
|
---|
[0dd3a2f] | 332 | void Visitor::visit( ReferenceToType *aggregateUseType ) {
|
---|
| 333 | acceptAll( aggregateUseType->get_forall(), *this );
|
---|
| 334 | acceptAll( aggregateUseType->get_parameters(), *this );
|
---|
[51b73452] | 335 | }
|
---|
| 336 |
|
---|
[0dd3a2f] | 337 | void Visitor::visit( StructInstType *aggregateUseType ) {
|
---|
[7f5566b] | 338 | visit( static_cast< ReferenceToType * >( aggregateUseType ) );
|
---|
[51b73452] | 339 | }
|
---|
| 340 |
|
---|
[0dd3a2f] | 341 | void Visitor::visit( UnionInstType *aggregateUseType ) {
|
---|
[7f5566b] | 342 | visit( static_cast< ReferenceToType * >( aggregateUseType ) );
|
---|
[51b73452] | 343 | }
|
---|
| 344 |
|
---|
[0dd3a2f] | 345 | void Visitor::visit( EnumInstType *aggregateUseType ) {
|
---|
[7f5566b] | 346 | visit( static_cast< ReferenceToType * >( aggregateUseType ) );
|
---|
[51b73452] | 347 | }
|
---|
| 348 |
|
---|
[4040425] | 349 | void Visitor::visit( TraitInstType *aggregateUseType ) {
|
---|
[7f5566b] | 350 | visit( static_cast< ReferenceToType * >( aggregateUseType ) );
|
---|
[0dd3a2f] | 351 | acceptAll( aggregateUseType->get_members(), *this );
|
---|
[51b73452] | 352 | }
|
---|
| 353 |
|
---|
[0dd3a2f] | 354 | void Visitor::visit( TypeInstType *aggregateUseType ) {
|
---|
[7f5566b] | 355 | visit( static_cast< ReferenceToType * >( aggregateUseType ) );
|
---|
[51b73452] | 356 | }
|
---|
| 357 |
|
---|
[0dd3a2f] | 358 | void Visitor::visit( TupleType *tupleType ) {
|
---|
| 359 | acceptAll( tupleType->get_forall(), *this );
|
---|
| 360 | acceptAll( tupleType->get_types(), *this );
|
---|
[51b73452] | 361 | }
|
---|
| 362 |
|
---|
[0dd3a2f] | 363 | void Visitor::visit( TypeofType *typeofType ) {
|
---|
| 364 | assert( typeofType->get_expr() );
|
---|
| 365 | typeofType->get_expr()->accept( *this );
|
---|
[51b73452] | 366 | }
|
---|
| 367 |
|
---|
[0dd3a2f] | 368 | void Visitor::visit( AttrType *attrType ) {
|
---|
| 369 | if ( attrType->get_isType() ) {
|
---|
| 370 | assert( attrType->get_type() );
|
---|
| 371 | attrType->get_type()->accept( *this );
|
---|
| 372 | } else {
|
---|
| 373 | assert( attrType->get_expr() );
|
---|
| 374 | attrType->get_expr()->accept( *this );
|
---|
| 375 | } // if
|
---|
[51b73452] | 376 | }
|
---|
| 377 |
|
---|
[44b7088] | 378 | void Visitor::visit( VarArgsType *varArgsType ) {
|
---|
| 379 | acceptAll( varArgsType->get_forall(), *this );
|
---|
| 380 | }
|
---|
| 381 |
|
---|
[0dd3a2f] | 382 | void Visitor::visit( SingleInit *singleInit ) {
|
---|
| 383 | singleInit->get_value()->accept( *this );
|
---|
[51b73452] | 384 | }
|
---|
| 385 |
|
---|
[0dd3a2f] | 386 | void Visitor::visit( ListInit *listInit ) {
|
---|
| 387 | acceptAll( listInit->get_designators(), *this );
|
---|
| 388 | acceptAll( listInit->get_initializers(), *this );
|
---|
[51b73452] | 389 | }
|
---|
| 390 |
|
---|
[71f4e4f] | 391 | void Visitor::visit( ConstructorInit *ctorInit ) {
|
---|
| 392 | maybeAccept( ctorInit->get_ctor(), *this );
|
---|
| 393 | maybeAccept( ctorInit->get_init(), *this );
|
---|
| 394 | }
|
---|
| 395 |
|
---|
[0dd3a2f] | 396 | void Visitor::visit( Subrange *subrange ) {}
|
---|
[51b73452] | 397 |
|
---|
[0dd3a2f] | 398 | void Visitor::visit( Constant *constant ) {}
|
---|
| 399 | // Local Variables: //
|
---|
| 400 | // tab-width: 4 //
|
---|
| 401 | // mode: c++ //
|
---|
| 402 | // compile-command: "make install" //
|
---|
| 403 | // End: //
|
---|