Changeset c5d7701 for src/SynTree
- Timestamp:
- Jun 14, 2018, 5:34:39 PM (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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 704d11e
- Parents:
- 29f9e20
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Mutator.h
r29f9e20 rc5d7701 101 101 virtual Type * mutate( ArrayType * arrayType ) = 0; 102 102 virtual Type * mutate( ReferenceType * refType ) = 0; 103 virtual Type * mutate( QualifiedType * qualType ) = 0; 103 104 virtual Type * mutate( FunctionType * functionType ) = 0; 104 105 virtual Type * mutate( StructInstType * aggregateUseType ) = 0; -
src/SynTree/SynTree.h
r29f9e20 rc5d7701 110 110 class ArrayType; 111 111 class ReferenceType; 112 class QualifiedType; 112 113 class FunctionType; 113 114 class ReferenceToType; -
src/SynTree/Type.cc
r29f9e20 rc5d7701 105 105 } 106 106 107 108 QualifiedType::QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types ) : Type( tq, {} ), types( types ) { 109 } 110 111 QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ) { 112 cloneAll( other.types, types ); 113 } 114 115 QualifiedType::~QualifiedType() { 116 deleteAll( types ); 117 } 118 119 void QualifiedType::print( std::ostream & os, Indenter indent ) const { 120 os << "Qualified Type: "; 121 printAll( types, os, indent+1 ); 122 Type::print( os, indent+1 ); 123 } 124 125 107 126 // Empty Variable declarations: 108 127 const Type::FuncSpecifiers noFuncSpecifiers; -
src/SynTree/Type.h
r29f9e20 rc5d7701 315 315 }; 316 316 317 class QualifiedType : public Type { 318 public: 319 std::list<Type *> types; 320 321 QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types ); 322 QualifiedType( const QualifiedType & tq ); 323 virtual ~QualifiedType(); 324 325 virtual QualifiedType *clone() const override { return new QualifiedType( *this ); } 326 virtual void accept( Visitor & v ) override { v.visit( this ); } 327 virtual Type *acceptMutator( Mutator & m ) override { return m.mutate( this ); } 328 virtual void print( std::ostream & os, Indenter indent = {} ) const override; 329 }; 330 317 331 class ReferenceType : public Type { 318 332 public: -
src/SynTree/Visitor.h
r29f9e20 rc5d7701 103 103 virtual void visit( ArrayType * arrayType ) = 0; 104 104 virtual void visit( ReferenceType * refType ) = 0; 105 virtual void visit( QualifiedType * qualType ) = 0; 105 106 virtual void visit( FunctionType * functionType ) = 0; 106 107 virtual void visit( StructInstType * aggregateUseType ) = 0;
Note:
See TracChangeset
for help on using the changeset viewer.