Changeset 63bde81 for src/SynTree
- Timestamp:
- Jul 19, 2021, 4:03:19 PM (5 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum, stuck-waitfor-destruct
- Children:
- f9b68d6
- Parents:
- 12a1013 (diff), fcaa1e4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Mutator.h
r12a1013 r63bde81 112 112 virtual Type * mutate( TupleType * tupleType ) = 0; 113 113 virtual Type * mutate( TypeofType * typeofType ) = 0; 114 virtual Type * mutate( VTableType * vtableType ) = 0; 114 115 virtual Type * mutate( AttrType * attrType ) = 0; 115 116 virtual Type * mutate( VarArgsType * varArgsType ) = 0; -
src/SynTree/SynTree.h
r12a1013 r63bde81 119 119 class TupleType; 120 120 class TypeofType; 121 class VTableType; 121 122 class AttrType; 122 123 class VarArgsType; -
src/SynTree/Type.cc
r12a1013 r63bde81 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Sun Dec 15 16:52:37 201913 // Update Count : 4911 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Jul 14 15:47:00 2021 13 // Update Count : 50 14 14 // 15 15 #include "Type.h" … … 178 178 } 179 179 180 VTableType::VTableType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes ) 181 : Type( tq, attributes ), base( base ) { 182 assertf( base, "VTableType with a null base created." ); 183 } 184 185 VTableType::VTableType( const VTableType &other ) 186 : Type( other ), base( other.base->clone() ) { 187 } 188 189 VTableType::~VTableType() { 190 delete base; 191 } 192 193 void VTableType::print( std::ostream &os, Indenter indent ) const { 194 Type::print( os, indent ); 195 os << "get virtual-table type of "; 196 if ( base ) { 197 base->print( os, indent ); 198 } // if 199 } 200 180 201 // Local Variables: // 181 202 // tab-width: 4 // -
src/SynTree/Type.h
r12a1013 r63bde81 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Sep 4 09:58:00 201913 // Update Count : 17 012 // Last Modified On : Wed Jul 14 15:40:00 2021 13 // Update Count : 171 14 14 // 15 15 … … 651 651 }; 652 652 653 class VTableType : public Type { 654 public: 655 Type *base; 656 657 VTableType( const Type::Qualifiers & tq, Type *base, 658 const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 659 VTableType( const VTableType & ); 660 virtual ~VTableType(); 661 662 Type *get_base() { return base; } 663 void set_base( Type *newValue ) { base = newValue; } 664 665 virtual VTableType *clone() const override { return new VTableType( *this ); } 666 virtual void accept( Visitor & v ) override { v.visit( this ); } 667 virtual void accept( Visitor & v ) const override { v.visit( this ); } 668 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 669 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 670 }; 671 653 672 class AttrType : public Type { 654 673 public: -
src/SynTree/Visitor.h
r12a1013 r63bde81 198 198 virtual void visit( TypeofType * node ) { visit( const_cast<const TypeofType *>(node) ); } 199 199 virtual void visit( const TypeofType * typeofType ) = 0; 200 virtual void visit( VTableType * node ) { visit( const_cast<const VTableType *>(node) ); } 201 virtual void visit( const VTableType * vtableType ) = 0; 200 202 virtual void visit( AttrType * node ) { visit( const_cast<const AttrType *>(node) ); } 201 203 virtual void visit( const AttrType * attrType ) = 0;
Note:
See TracChangeset
for help on using the changeset viewer.