Changeset f6e3e34 for src/SynTree
- Timestamp:
- Apr 3, 2018, 11:13:10 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 92fea32
- Parents:
- 3d2b7bc
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.cc
r3d2b7bc rf6e3e34 81 81 82 82 83 StaticAssertDecl::StaticAssertDecl( Expression * condition, ConstantExpr * message ) : Declaration( "", Type::StorageClasses(), LinkageSpec::C ), condition( condition ), message( message ) { 84 } 85 86 StaticAssertDecl::StaticAssertDecl( const StaticAssertDecl & other ) : Declaration( other ), condition( maybeClone( other.condition ) ), message( maybeClone( other.message ) ) { 87 } 88 89 StaticAssertDecl::~StaticAssertDecl() { 90 delete condition; 91 delete message; 92 } 93 94 void StaticAssertDecl::print( std::ostream &os, Indenter indent ) const { 95 os << "Static Assert with condition: "; 96 condition->print( os, indent+1 ); 97 os << std::endl << indent << "and message: "; 98 message->print( os, indent+1 ); 99 os << std::endl; 100 } 101 102 void StaticAssertDecl::printShort( std::ostream &os, Indenter indent ) const { 103 print( os, indent ); 104 } 105 83 106 // Local Variables: // 84 107 // tab-width: 4 // -
src/SynTree/Declaration.h
r3d2b7bc rf6e3e34 365 365 }; 366 366 367 class StaticAssertDecl : public Declaration { 368 public: 369 Expression * condition; 370 ConstantExpr * message; // string literal 371 372 StaticAssertDecl( Expression * condition, ConstantExpr * message ); 373 StaticAssertDecl( const StaticAssertDecl & other ); 374 virtual ~StaticAssertDecl(); 375 376 virtual StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); } 377 virtual void accept( Visitor &v ) override { v.visit( this ); } 378 virtual StaticAssertDecl * acceptMutator( Mutator &m ) override { return m.mutate( this ); } 379 virtual void print( std::ostream &os, Indenter indent = {} ) const override; 380 virtual void printShort( std::ostream &os, Indenter indent = {} ) const override; 381 }; 382 367 383 std::ostream & operator<<( std::ostream & os, const TypeDecl::Data & data ); 368 384 -
src/SynTree/Mutator.h
r3d2b7bc rf6e3e34 34 34 virtual Declaration * mutate( TypedefDecl * typeDecl ) = 0; 35 35 virtual AsmDecl * mutate( AsmDecl * asmDecl ) = 0; 36 virtual StaticAssertDecl * mutate( StaticAssertDecl * assertDecl ) = 0; 36 37 37 38 virtual CompoundStmt * mutate( CompoundStmt * compoundStmt ) = 0; -
src/SynTree/SynTree.h
r3d2b7bc rf6e3e34 38 38 class TypedefDecl; 39 39 class AsmDecl; 40 class StaticAssertDecl; 40 41 41 42 class Statement; -
src/SynTree/Visitor.h
r3d2b7bc rf6e3e34 36 36 virtual void visit( TypedefDecl * typeDecl ) = 0; 37 37 virtual void visit( AsmDecl * asmDecl ) = 0; 38 virtual void visit( StaticAssertDecl * assertDecl ) = 0; 38 39 39 40 virtual void visit( CompoundStmt * compoundStmt ) = 0;
Note:
See TracChangeset
for help on using the changeset viewer.