Changeset 561354f for src/SynTree
- Timestamp:
- May 17, 2023, 1:33:39 AM (2 years ago)
- Branches:
- ADT
- Children:
- d6c464d
- Parents:
- 28f8f15
- Location:
- src/SynTree
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r28f8f15 r561354f 342 342 enum EnumHiding { Visible, Hide } hide; 343 343 344 std::list<StructDecl*> data_constructors;345 UnionDecl * data_union;346 EnumDecl * tags;347 StructDecl * tag_union;348 349 344 EnumDecl( const std::string & name, 350 345 const std::list< Attribute * > & attributes = std::list< class Attribute * >(), … … 367 362 }; 368 363 364 class AdtDecl : public AggregateDecl { 365 typedef AggregateDecl Parent; 366 public: 367 std::list<StructDecl*> data_constructors; 368 UnionDecl * data_union; 369 EnumDecl * tag; 370 StructDecl * tag_union; 371 372 AdtDecl( const std::string & name, 373 const std::list< Attribute * > & attributes = std::list< class Attribute * >(), 374 LinkageSpec::Spec linkage = LinkageSpec::Cforall, 375 const std::list< StructDecl* > data_constructors = std::list< StructDecl * >(), 376 UnionDecl * data_union = nullptr, EnumDecl * tag = nullptr, StructDecl * tag_union = nullptr ) 377 : Parent( name, attributes, linkage ), data_constructors(data_constructors), 378 data_union( data_union ), tag( tag ), tag_union( tag_union ) {} 379 380 AdtDecl( const AdtDecl & other ) 381 : Parent( other ) {} 382 383 virtual AdtDecl * clone() const override { return new AdtDecl( *this ); } 384 virtual void accept( Visitor & v ) override { v.visit( this ); } 385 virtual void accept( Visitor & v ) const override { v.visit( this ); } 386 387 virtual Declaration * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 388 virtual void print( std::ostream & os, Indenter indent = {} ) const override final { 389 os << "AdtDecl ... " << indent; 390 } 391 392 private: 393 virtual const char * typeString() const override { 394 return "AdtDecl"; 395 } 396 }; 397 369 398 class TraitDecl : public AggregateDecl { 370 399 typedef AggregateDecl Parent; -
src/SynTree/Mutator.h
r28f8f15 r561354f 30 30 virtual Declaration * mutate( UnionDecl * aggregateDecl ) = 0; 31 31 virtual Declaration * mutate( EnumDecl * aggregateDecl ) = 0; 32 virtual Declaration * mutate( AdtDecl * aggregateDecl ) = 0; 32 33 virtual Declaration * mutate( TraitDecl * aggregateDecl ) = 0; 33 34 virtual Declaration * mutate( TypeDecl * typeDecl ) = 0; -
src/SynTree/SynTree.h
r28f8f15 r561354f 31 31 class UnionDecl; 32 32 class EnumDecl; 33 class AdtDecl; 33 34 class TraitDecl; 34 35 class NamedTypeDecl; -
src/SynTree/Visitor.h
r28f8f15 r561354f 37 37 virtual void visit( EnumDecl * node ) { visit( const_cast<const EnumDecl *>(node) ); } 38 38 virtual void visit( const EnumDecl * aggregateDecl ) = 0; 39 virtual void visit( AdtDecl * node ) { visit( const_cast<const AdtDecl *>(node) ); } 40 virtual void visit( const AdtDecl * node ) = 0; 39 41 virtual void visit( TraitDecl * node ) { visit( const_cast<const TraitDecl *>(node) ); } 40 42 virtual void visit( const TraitDecl * aggregateDecl ) = 0;
Note:
See TracChangeset
for help on using the changeset viewer.