Changeset c5d7701 for src/SynTree


Ignore:
Timestamp:
Jun 14, 2018, 5:34:39 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
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
Message:

Add QualifiedType? node

Location:
src/SynTree
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Mutator.h

    r29f9e20 rc5d7701  
    101101        virtual Type * mutate( ArrayType * arrayType ) = 0;
    102102        virtual Type * mutate( ReferenceType * refType ) = 0;
     103        virtual Type * mutate( QualifiedType * qualType ) = 0;
    103104        virtual Type * mutate( FunctionType * functionType ) = 0;
    104105        virtual Type * mutate( StructInstType * aggregateUseType ) = 0;
  • src/SynTree/SynTree.h

    r29f9e20 rc5d7701  
    110110class ArrayType;
    111111class ReferenceType;
     112class QualifiedType;
    112113class FunctionType;
    113114class ReferenceToType;
  • src/SynTree/Type.cc

    r29f9e20 rc5d7701  
    105105}
    106106
     107
     108QualifiedType::QualifiedType( const Type::Qualifiers & tq, const std::list< Type * > & types ) : Type( tq, {} ), types( types ) {
     109}
     110
     111QualifiedType::QualifiedType( const QualifiedType & other ) : Type( other ) {
     112        cloneAll( other.types, types );
     113}
     114
     115QualifiedType::~QualifiedType() {
     116        deleteAll( types );
     117}
     118
     119void 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
    107126// Empty Variable declarations:
    108127const Type::FuncSpecifiers noFuncSpecifiers;
  • src/SynTree/Type.h

    r29f9e20 rc5d7701  
    315315};
    316316
     317class QualifiedType : public Type {
     318public:
     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
    317331class ReferenceType : public Type {
    318332public:
  • src/SynTree/Visitor.h

    r29f9e20 rc5d7701  
    103103        virtual void visit( ArrayType * arrayType ) = 0;
    104104        virtual void visit( ReferenceType * refType ) = 0;
     105        virtual void visit( QualifiedType * qualType ) = 0;
    105106        virtual void visit( FunctionType * functionType ) = 0;
    106107        virtual void visit( StructInstType * aggregateUseType ) = 0;
Note: See TracChangeset for help on using the changeset viewer.