Changeset fa2c005 for src/SynTree
- Timestamp:
- Jun 8, 2023, 3:19:43 PM (3 years ago)
- Branches:
- ADT
- Parents:
- 044ae62
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Declaration.h
r044ae62 rfa2c005 365 365 typedef AggregateDecl Parent; 366 366 public: 367 std::list<StructDecl*> data_constructors;368 367 UnionDecl * data_union; 369 368 EnumDecl * tag; … … 373 372 const std::list< Attribute * > & attributes = std::list< class Attribute * >(), 374 373 LinkageSpec::Spec linkage = LinkageSpec::Cforall, 375 const std::list< StructDecl* > data_constructors = std::list< StructDecl * >(),376 374 UnionDecl * data_union = nullptr, EnumDecl * tag = nullptr, StructDecl * tag_union = nullptr ) 377 : Parent( name, attributes, linkage ), data_constructors(data_constructors),375 : Parent( name, attributes, linkage ), 378 376 data_union( data_union ), tag( tag ), tag_union( tag_union ) {} 379 377 -
src/SynTree/Mutator.h
r044ae62 rfa2c005 110 110 virtual Type * mutate( FunctionType * functionType ) = 0; 111 111 virtual Type * mutate( StructInstType * aggregateUseType ) = 0; 112 virtual Type * mutate( AdtInstType * aggregateUseType ) = 0; 112 113 virtual Type * mutate( UnionInstType * aggregateUseType ) = 0; 113 114 virtual Type * mutate( EnumInstType * aggregateUseType ) = 0; -
src/SynTree/SynTree.h
r044ae62 rfa2c005 119 119 class UnionInstType; 120 120 class EnumInstType; 121 class AdtInstType; 121 122 class TraitInstType; 122 123 class TypeInstType; -
src/SynTree/Type.h
r044ae62 rfa2c005 476 476 }; 477 477 478 class AdtInstType : public ReferenceToType { 479 typedef ReferenceToType Parent; 480 public: 481 AdtDecl * baseAdt; 482 483 AdtInstType( const Type::Qualifiers & tq, const std::string & name, const std::list< Attribute * > & attributes = std::list< Attribute * >() ) : Parent( tq, name, attributes ), baseAdt( 0 ) {} 484 AdtInstType( const Type::Qualifiers & tq, AdtDecl * baseAdt, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 485 AdtInstType( const AdtInstType & other ) : Parent( other ), baseAdt( other.baseAdt ) {} 486 487 AdtDecl * get_baseAdt() const { return baseAdt; } 488 void set_baseAdt( AdtDecl * newValue ) { baseAdt = newValue; } 489 490 std::list<TypeDecl*> * get_baseParameters(); 491 const std::list<TypeDecl*> * get_baseParameters() const; 492 493 virtual bool isComplete() const override; 494 495 virtual AggregateDecl * getAggr() const override; 496 497 virtual TypeSubstitution genericSubstitution() const override; 498 499 void lookup( const std::string & name, std::list< Declaration* > & foundDecls ) const override; 500 501 virtual AdtInstType * clone() const override { return new AdtInstType( * this ); } 502 virtual void accept( Visitor & v ) override { v.visit( this ); } 503 virtual void accept( Visitor & v ) const override { v.visit( this ); } 504 virtual Type * acceptMutator( Mutator & m ) override { return m.mutate( this ); } 505 506 virtual void print( std::ostream & os, Indenter indenter = {} ) const override; 507 private: 508 virtual std::string typeString() const override; 509 }; 510 478 511 class UnionInstType : public ReferenceToType { 479 512 typedef ReferenceToType Parent; -
src/SynTree/Visitor.h
r044ae62 rfa2c005 196 196 virtual void visit( UnionInstType * node ) { visit( const_cast<const UnionInstType *>(node) ); } 197 197 virtual void visit( const UnionInstType * aggregateUseType ) = 0; 198 virtual void visit( AdtInstType * node ) { visit( const_cast<const AdtInstType *>(node) ); } 199 virtual void visit( const AdtInstType * node ) = 0; 198 200 virtual void visit( EnumInstType * node ) { visit( const_cast<const EnumInstType *>(node) ); } 199 201 virtual void visit( const EnumInstType * aggregateUseType ) = 0;
Note:
See TracChangeset
for help on using the changeset viewer.