Changeset c957e7f
- Timestamp:
- May 22, 2019, 5:58:56 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 0b57626, b0ec971
- Parents:
- 489bacf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Print.cpp
r489bacf rc957e7f 22 22 #include "TypeSubstitution.hpp" 23 23 24 #include "Common/utility.h" // for group_iterate 24 25 25 26 namespace ast { … … 475 476 476 477 virtual const ast::Designation * visit( const ast::Designation * node ) { 478 if ( node->designators.empty() ) return node; 479 os << "... designated by: " << std::endl; 480 ++indent; 481 for ( const ast::Expr * d : node->designators ) { 482 os << indent; 483 d->accept( *this ); 484 os << std::endl; 485 } 486 --indent; 477 487 return node; 478 488 } 479 489 480 490 virtual const ast::Init * visit( const ast::SingleInit * node ) { 491 os << "Simple Initializer: "; 492 node->value->accept( *this ); 481 493 return node; 482 494 } 483 495 484 496 virtual const ast::Init * visit( const ast::ListInit * node ) { 497 os << "Compound initializer: " << std::endl; 498 ++indent; 499 for ( auto p : group_iterate( node->designations, node->initializers ) ) { 500 const ast::Designation * d = std::get<0>(p); 501 const ast::Init * init = std::get<1>(p); 502 os << indent; 503 init->accept( *this ); 504 os << std::endl; 505 if ( ! d->designators.empty() ) { 506 os << indent; 507 d->accept( *this ); 508 } 509 } 510 --indent; 485 511 return node; 486 512 } 487 513 488 514 virtual const ast::Init * visit( const ast::ConstructorInit * node ) { 515 os << "Constructor initializer: " << std::endl; 516 if ( node->ctor ) { 517 os << indent << "... initially constructed with "; 518 ++indent; 519 node->ctor->accept( *this ); 520 --indent; 521 } 522 523 if ( node->dtor ) { 524 os << indent << "... destructed with "; 525 ++indent; 526 node->dtor->accept( *this ); 527 --indent; 528 } 529 530 if ( node->init ) { 531 os << indent << "... with fallback C-style initializer: "; 532 ++indent; 533 node->init->accept( *this ); 534 --indent; 535 } 489 536 return node; 490 537 }
Note: See TracChangeset
for help on using the changeset viewer.