Changeset c194661 for src/SynTree
- Timestamp:
- Jun 20, 2018, 11:23:42 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- 0b3b2ae
- Parents:
- 9a7a3b6
- Location:
- src/SynTree
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Type.cc
r9a7a3b6 rc194661 106 106 107 107 108 QualifiedType::QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types ) : Type( tq, {} ), types( types) {108 QualifiedType::QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child ) : Type( tq, {} ), parent( parent ), child( child ) { 109 109 } 110 110 111 QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ) { 112 cloneAll( other.types, types ); 111 QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ), parent( maybeClone( other.parent ) ), child( maybeClone( other.child ) ) { 113 112 } 114 113 115 114 QualifiedType::~QualifiedType() { 116 deleteAll( types ); 115 delete parent; 116 delete child; 117 117 } 118 118 119 119 void QualifiedType::print( std::ostream & os, Indenter indent ) const { 120 120 os << "Qualified Type: " << endl; 121 printAll( types, os, indent+1 ); 121 os << indent+1; 122 parent->print( os, indent+1 ); 123 os << endl << indent+1; 124 child->print( os, indent+1 ); 125 os << endl; 122 126 Type::print( os, indent+1 ); 123 127 } -
src/SynTree/Type.h
r9a7a3b6 rc194661 317 317 class QualifiedType : public Type { 318 318 public: 319 std::list<Type *> types; 320 321 QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types ); 319 Type * parent; 320 Type * child; 321 322 QualifiedType( const Type::Qualifiers & tq, Type * parent, Type * child ); 322 323 QualifiedType( const QualifiedType & tq ); 323 324 virtual ~QualifiedType();
Note:
See TracChangeset
for help on using the changeset viewer.