Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Type.h

    r5ccb10d rea6332d  
    1616#pragma once
    1717
    18 #include "BaseSyntaxNode.h"
    19 #include "Mutator.h"
    20 #include "SynTree.h"
    21 #include "Visitor.h"
    22 #include <strings.h>                                                                    // ffs
     18#include <strings.h>         // for ffs
     19#include <cassert>           // for assert, assertf
     20#include <list>              // for list, _List_iterator
     21#include <ostream>           // for ostream, operator<<, basic_ostream
     22#include <string>            // for string
     23
     24#include "BaseSyntaxNode.h"  // for BaseSyntaxNode
     25#include "Common/utility.h"  // for operator+
     26#include "Mutator.h"         // for Mutator
     27#include "SynTree.h"         // for AST nodes
     28#include "Visitor.h"         // for Visitor
    2329
    2430class Type : public BaseSyntaxNode {
     
    162168
    163169        /// return type without outer pointers and arrays
    164         Type * stripDeclarator();
    165 
    166         /// return type without outer references
    167         Type * stripReferences();
    168 
    169         /// return the number of references occuring consecutively on the outermost layer of this type (i.e. do not count references nested within other types)
    170         virtual int referenceDepth() const;
     170        Type *stripDeclarator();
    171171
    172172        virtual bool isComplete() const { return true; }
     
    262262        bool is_array() const { return isStatic || isVarLen || dimension; }
    263263
    264         virtual bool isComplete() const { return ! isVarLen; }
    265 
    266264        virtual PointerType *clone() const { return new PointerType( *this ); }
    267265        virtual void accept( Visitor & v ) { v.visit( this ); }
     
    298296};
    299297
    300 class ReferenceType : public Type {
    301 public:
    302         Type *base;
    303 
    304         ReferenceType( const Type::Qualifiers & tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
    305         ReferenceType( const ReferenceType & );
    306         virtual ~ReferenceType();
    307 
    308         Type *get_base() { return base; }
    309         void set_base( Type *newValue ) { base = newValue; }
    310 
    311         virtual int referenceDepth() const;
    312 
    313         // Since reference types act like value types, their size is the size of the base.
    314         // This makes it simple to cast the empty tuple to a reference type, since casts that increase
    315         // the number of values are disallowed.
    316         virtual unsigned size() const { return base->size(); }
    317 
    318         virtual ReferenceType *clone() const { return new ReferenceType( *this ); }
    319         virtual void accept( Visitor & v ) { v.visit( this ); }
    320         virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
    321         virtual void print( std::ostream & os, int indent = 0 ) const;
    322 };
    323 
    324298class FunctionType : public Type {
    325299  public:
Note: See TracChangeset for help on using the changeset viewer.