Ignore:
Timestamp:
Feb 25, 2020, 1:17:33 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
7dc2e015
Parents:
9fb8f01 (diff), dd9e1ca (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.
Message:

resolve conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    r9fb8f01 r3d5701e  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thr May  2 10:47:00 2019
    13 // Update Count     : 135
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Fri Dec 13 23:11:22 2019
     13// Update Count     : 157
    1414//
    1515
     
    2424#include "BaseSyntaxNode.h"      // for BaseSyntaxNode
    2525#include "Mutator.h"             // for Mutator
    26 #include "Parser/LinkageSpec.h"  // for Spec, Cforall
    27 #include "Parser/ParseNode.h"    // for DeclarationNode, DeclarationNode::Ag...
     26#include "LinkageSpec.h"         // for Spec, Cforall
    2827#include "SynTree.h"             // for UniqueId
    2928#include "SynTree/Type.h"        // for Type, Type::StorageClasses, Type::Fu...
     
    4443        bool extension = false;
    4544
    46         Declaration( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage );
    47         Declaration( const Declaration &other );
     45        Declaration( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage );
     46        Declaration( const Declaration & other );
    4847        virtual ~Declaration();
    4948
    50         const std::string &get_name() const { return name; }
     49        const std::string & get_name() const { return name; }
    5150        void set_name( std::string newValue ) { name = newValue; }
    5251
     
    5958
    6059        bool get_extension() const { return extension; }
    61         Declaration *set_extension( bool exten ) { extension = exten; return this; }
     60        Declaration * set_extension( bool exten ) { extension = exten; return this; }
    6261
    6362        void fixUniqueId( void );
    64         virtual Declaration *clone() const override = 0;
     63        virtual Declaration * clone() const override = 0;
    6564        virtual void accept( Visitor & v ) override = 0;
    6665        virtual void accept( Visitor & v ) const override = 0;
    67         virtual Declaration *acceptMutator( Mutator &m ) override = 0;
    68         virtual void print( std::ostream &os, Indenter indent = {} ) const override = 0;
    69         virtual void printShort( std::ostream &os, Indenter indent = {} ) const = 0;
     66        virtual Declaration * acceptMutator( Mutator & m ) override = 0;
     67        virtual void print( std::ostream & os, Indenter indent = {} ) const override = 0;
     68        virtual void printShort( std::ostream & os, Indenter indent = {} ) const = 0;
    7069
    7170        UniqueId uniqueId;
     
    8180        int scopeLevel = 0;
    8281
    83         Expression *asmName;
     82        Expression * asmName;
    8483        std::list< Attribute * > attributes;
    8584        bool isDeleted = false;
    8685
    87         DeclarationWithType( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs );
    88         DeclarationWithType( const DeclarationWithType &other );
     86        DeclarationWithType( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage, const std::list< Attribute * > & attributes, Type::FuncSpecifiers fs );
     87        DeclarationWithType( const DeclarationWithType & other );
    8988        virtual ~DeclarationWithType();
    9089
     
    9796        DeclarationWithType * set_scopeLevel( int newValue ) { scopeLevel = newValue; return this; }
    9897
    99         Expression *get_asmName() const { return asmName; }
    100         DeclarationWithType * set_asmName( Expression *newValue ) { asmName = newValue; return this; }
     98        Expression * get_asmName() const { return asmName; }
     99        DeclarationWithType * set_asmName( Expression * newValue ) { asmName = newValue; return this; }
    101100
    102101        std::list< Attribute * >& get_attributes() { return attributes; }
     
    106105        //void set_functionSpecifiers( Type::FuncSpecifiers newValue ) { fs = newValue; }
    107106
    108         virtual DeclarationWithType *clone() const override = 0;
    109         virtual DeclarationWithType *acceptMutator( Mutator &m )  override = 0;
     107        virtual DeclarationWithType * clone() const override = 0;
     108        virtual DeclarationWithType * acceptMutator( Mutator & m )  override = 0;
    110109
    111110        virtual Type * get_type() const = 0;
     
    119118        typedef DeclarationWithType Parent;
    120119  public:
    121         Type *type;
    122         Initializer *init;
    123         Expression *bitfieldWidth;
    124 
    125         ObjectDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Expression *bitfieldWidth, Type *type, Initializer *init,
     120        Type * type;
     121        Initializer * init;
     122        Expression * bitfieldWidth;
     123
     124        ObjectDecl( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage, Expression * bitfieldWidth, Type * type, Initializer * init,
    126125                                const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() );
    127         ObjectDecl( const ObjectDecl &other );
     126        ObjectDecl( const ObjectDecl & other );
    128127        virtual ~ObjectDecl();
    129128
    130129        virtual Type * get_type() const override { return type; }
    131         virtual void set_type(Type *newType) override { type = newType; }
    132 
    133         Initializer *get_init() const { return init; }
    134         void set_init( Initializer *newValue ) { init = newValue; }
    135 
    136         Expression *get_bitfieldWidth() const { return bitfieldWidth; }
    137         void set_bitfieldWidth( Expression *newValue ) { bitfieldWidth = newValue; }
     130        virtual void set_type(Type * newType) override { type = newType; }
     131
     132        Initializer * get_init() const { return init; }
     133        void set_init( Initializer * newValue ) { init = newValue; }
     134
     135        Expression * get_bitfieldWidth() const { return bitfieldWidth; }
     136        void set_bitfieldWidth( Expression * newValue ) { bitfieldWidth = newValue; }
    138137
    139138        static ObjectDecl * newObject( const std::string & name, Type * type, Initializer * init );
    140139
    141         virtual ObjectDecl *clone() const override { return new ObjectDecl( *this ); }
    142         virtual void accept( Visitor & v ) override { v.visit( this ); }
    143         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    144         virtual DeclarationWithType *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    145         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    146         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     140        virtual ObjectDecl * clone() const override { return new ObjectDecl( *this ); }
     141        virtual void accept( Visitor & v ) override { v.visit( this ); }
     142        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     143        virtual DeclarationWithType * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     144        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     145        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    147146};
    148147
     
    150149        typedef DeclarationWithType Parent;
    151150  public:
    152         FunctionType *type;
    153         CompoundStmt *statements;
     151        FunctionType * type;
     152        CompoundStmt * statements;
    154153        std::list< Expression * > withExprs;
    155154
    156         FunctionDecl( const std::string &name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType *type, CompoundStmt *statements,
     155        FunctionDecl( const std::string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage, FunctionType * type, CompoundStmt * statements,
    157156                                  const std::list< Attribute * > attributes = std::list< Attribute * >(), Type::FuncSpecifiers fs = Type::FuncSpecifiers() );
    158         FunctionDecl( const FunctionDecl &other );
     157        FunctionDecl( const FunctionDecl & other );
    159158        virtual ~FunctionDecl();
    160159
     
    163162
    164163        FunctionType * get_functionType() const { return type; }
    165         void set_functionType( FunctionType *newValue ) { type = newValue; }
    166         CompoundStmt *get_statements() const { return statements; }
    167         void set_statements( CompoundStmt *newValue ) { statements = newValue; }
     164        void set_functionType( FunctionType * newValue ) { type = newValue; }
     165        CompoundStmt * get_statements() const { return statements; }
     166        void set_statements( CompoundStmt * newValue ) { statements = newValue; }
    168167        bool has_body() const { return NULL != statements; }
    169168
    170169        static FunctionDecl * newFunction( const std::string & name, FunctionType * type, CompoundStmt * statements );
    171170
    172         virtual FunctionDecl *clone() const override { return new FunctionDecl( *this ); }
    173         virtual void accept( Visitor & v ) override { v.visit( this ); }
    174         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    175         virtual DeclarationWithType *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    176         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    177         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     171        virtual FunctionDecl * clone() const override { return new FunctionDecl( *this ); }
     172        virtual void accept( Visitor & v ) override { v.visit( this ); }
     173        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     174        virtual DeclarationWithType * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     175        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     176        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    178177};
    179178
     
    181180        typedef Declaration Parent;
    182181  public:
    183         Type *base;
    184         std::list< TypeDecl* > parameters;
    185         std::list< DeclarationWithType* > assertions;
    186 
    187         NamedTypeDecl( const std::string &name, Type::StorageClasses scs, Type *type );
    188         NamedTypeDecl( const NamedTypeDecl &other );
     182        Type * base;
     183        std::list< TypeDecl * > parameters;
     184        std::list< DeclarationWithType * > assertions;
     185
     186        NamedTypeDecl( const std::string & name, Type::StorageClasses scs, Type * type );
     187        NamedTypeDecl( const NamedTypeDecl & other );
    189188        virtual ~NamedTypeDecl();
    190189
    191         Type *get_base() const { return base; }
    192         void set_base( Type *newValue ) { base = newValue; }
    193         std::list< TypeDecl* >& get_parameters() { return parameters; }
    194         std::list< DeclarationWithType* >& get_assertions() { return assertions; }
    195 
    196         virtual std::string typeString() const = 0;
    197 
    198         virtual NamedTypeDecl *clone() const override = 0;
    199         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    200         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     190        Type * get_base() const { return base; }
     191        void set_base( Type * newValue ) { base = newValue; }
     192        std::list< TypeDecl* > & get_parameters() { return parameters; }
     193        std::list< DeclarationWithType * >& get_assertions() { return assertions; }
     194
     195        virtual const char * typeString() const = 0;
     196
     197        virtual NamedTypeDecl * clone() const override = 0;
     198        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     199        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    201200};
    202201
     
    204203        typedef NamedTypeDecl Parent;
    205204  public:
    206         enum Kind { Dtype, Ftype, Ttype, NUMBER_OF_KINDS };
    207 
     205        enum Kind { Dtype, Otype, Ftype, Ttype, NUMBER_OF_KINDS };
     206
     207        Kind kind;
     208        bool sized;
    208209        Type * init;
    209         bool sized;
    210210
    211211        /// Data extracted from a type decl
    212212        struct Data {
    213                 TypeDecl::Kind kind;
     213                Kind kind;
    214214                bool isComplete;
    215215
    216                 Data() : kind( (TypeDecl::Kind)-1 ), isComplete( false ) {}
    217                 Data( TypeDecl * typeDecl ) : Data( typeDecl->get_kind(), typeDecl->isComplete() ) {}
     216                Data() : kind( NUMBER_OF_KINDS ), isComplete( false ) {}
     217                Data( const TypeDecl * typeDecl ) : Data( typeDecl->get_kind(), typeDecl->isComplete() ) {}
    218218                Data( Kind kind, bool isComplete ) : kind( kind ), isComplete( isComplete ) {}
    219                 Data( const Data& d1, const Data& d2 )
    220                 : kind( d1.kind ), isComplete ( d1.isComplete || d2.isComplete ) {}
    221 
    222                 bool operator==(const Data & other) const { return kind == other.kind && isComplete == other.isComplete; }
    223                 bool operator!=(const Data & other) const { return !(*this == other);}
     219                Data( const Data & d1, const Data & d2 )
     220                        : kind( d1.kind ), isComplete( d1.isComplete || d2.isComplete ) {}
     221
     222                bool operator==( const Data & other ) const { return kind == other.kind && isComplete == other.isComplete; }
     223                bool operator!=( const Data & other ) const { return !(*this == other);}
    224224        };
    225225
    226         TypeDecl( const std::string &name, Type::StorageClasses scs, Type *type, Kind kind, bool sized, Type * init = nullptr );
    227         TypeDecl( const TypeDecl &other );
     226        TypeDecl( const std::string & name, Type::StorageClasses scs, Type * type, Kind kind, bool sized, Type * init = nullptr );
     227        TypeDecl( const TypeDecl & other );
    228228        virtual ~TypeDecl();
    229229
     
    237237        TypeDecl * set_sized( bool newValue ) { sized = newValue; return this; }
    238238
    239         virtual std::string typeString() const override;
    240         virtual std::string genTypeString() const;
    241 
    242         virtual TypeDecl *clone() const override { return new TypeDecl( *this ); }
    243         virtual void accept( Visitor & v ) override { v.visit( this ); }
    244         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    245         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    246         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    247 
    248         Kind kind;
     239        virtual const char * typeString() const override;
     240        virtual const char * genTypeString() const;
     241
     242        virtual TypeDecl * clone() const override { return new TypeDecl( *this ); }
     243        virtual void accept( Visitor & v ) override { v.visit( this ); }
     244        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     245        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     246        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
    249247};
    250248
     
    252250        typedef NamedTypeDecl Parent;
    253251  public:
    254         TypedefDecl( const std::string &name, CodeLocation location, Type::StorageClasses scs, Type *type, LinkageSpec::Spec spec = LinkageSpec::Cforall )
     252        TypedefDecl( const std::string & name, CodeLocation location, Type::StorageClasses scs, Type * type, LinkageSpec::Spec spec = LinkageSpec::Cforall )
    255253                : Parent( name, scs, type ) { set_linkage( spec ); this->location = location; }
    256254
    257         TypedefDecl( const TypedefDecl &other ) : Parent( other ) {}
    258 
    259         virtual std::string typeString() const override;
    260 
    261         virtual TypedefDecl *clone() const override { return new TypedefDecl( *this ); }
    262         virtual void accept( Visitor & v ) override { v.visit( this ); }
    263         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    264         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     255        TypedefDecl( const TypedefDecl & other ) : Parent( other ) {}
     256
     257        virtual const char * typeString() const override;
     258
     259        virtual TypedefDecl * clone() const override { return new TypedefDecl( *this ); }
     260        virtual void accept( Visitor & v ) override { v.visit( this ); }
     261        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     262        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
    265263  private:
    266264};
     
    269267        typedef Declaration Parent;
    270268  public:
     269        enum Aggregate { Struct, Union, Enum, Exception, Trait, Generator, Coroutine, Monitor, Thread, NoAggregate };
     270        static const char * aggrString( Aggregate aggr );
     271
    271272        std::list<Declaration*> members;
    272273        std::list<TypeDecl*> parameters;
     
    275276        AggregateDecl * parent = nullptr;
    276277
    277         AggregateDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall );
    278         AggregateDecl( const AggregateDecl &other );
     278        AggregateDecl( const std::string & name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall );
     279        AggregateDecl( const AggregateDecl & other );
    279280        virtual ~AggregateDecl();
    280281
     
    288289        AggregateDecl * set_body( bool body ) { AggregateDecl::body = body; return this; }
    289290
    290         virtual void print( std::ostream &os, Indenter indent = {} ) const override final;
    291         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     291        virtual void print( std::ostream & os, Indenter indent = {} ) const override final;
     292        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    292293  protected:
    293         virtual std::string typeString() const = 0;
     294        virtual const char * typeString() const = 0;
    294295};
    295296
     
    297298        typedef AggregateDecl Parent;
    298299  public:
    299         StructDecl( const std::string &name, DeclarationNode::Aggregate kind = DeclarationNode::Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {}
    300         StructDecl( const StructDecl &other ) : Parent( other ), kind( other.kind ) {}
    301 
    302         bool is_coroutine() { return kind == DeclarationNode::Coroutine; }
    303         bool is_monitor() { return kind == DeclarationNode::Monitor; }
    304         bool is_thread() { return kind == DeclarationNode::Thread; }
    305 
    306         virtual StructDecl *clone() const override { return new StructDecl( *this ); }
    307         virtual void accept( Visitor & v ) override { v.visit( this ); }
    308         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    309         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    310         DeclarationNode::Aggregate kind;
    311   private:
    312         virtual std::string typeString() const override;
     300        StructDecl( const std::string & name, Aggregate kind = Struct, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ), kind( kind ) {}
     301        StructDecl( const StructDecl & other ) : Parent( other ), kind( other.kind ) {}
     302
     303        bool is_coroutine() { return kind == Coroutine; }
     304        bool is_monitor() { return kind == Monitor; }
     305        bool is_thread() { return kind == Thread; }
     306
     307        virtual StructDecl * clone() const override { return new StructDecl( *this ); }
     308        virtual void accept( Visitor & v ) override { v.visit( this ); }
     309        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     310        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     311        Aggregate kind;
     312  private:
     313        virtual const char * typeString() const override;
    313314};
    314315
     
    316317        typedef AggregateDecl Parent;
    317318  public:
    318         UnionDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
    319         UnionDecl( const UnionDecl &other ) : Parent( other ) {}
    320 
    321         virtual UnionDecl *clone() const override { return new UnionDecl( *this ); }
    322         virtual void accept( Visitor & v ) override { v.visit( this ); }
    323         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    324         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    325   private:
    326         virtual std::string typeString() const override;
     319        UnionDecl( const std::string & name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
     320        UnionDecl( const UnionDecl & other ) : Parent( other ) {}
     321
     322        virtual UnionDecl * clone() const override { return new UnionDecl( *this ); }
     323        virtual void accept( Visitor & v ) override { v.visit( this ); }
     324        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     325        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     326  private:
     327        virtual const char * typeString() const override;
    327328};
    328329
     
    330331        typedef AggregateDecl Parent;
    331332  public:
    332         EnumDecl( const std::string &name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
    333         EnumDecl( const EnumDecl &other ) : Parent( other ) {}
     333        EnumDecl( const std::string & name, const std::list< Attribute * > & attributes = std::list< class Attribute * >(), LinkageSpec::Spec linkage = LinkageSpec::Cforall ) : Parent( name, attributes, linkage ) {}
     334        EnumDecl( const EnumDecl & other ) : Parent( other ) {}
    334335
    335336        bool valueOf( Declaration * enumerator, long long int & value );
    336337
    337         virtual EnumDecl *clone() const override { return new EnumDecl( *this ); }
    338         virtual void accept( Visitor & v ) override { v.visit( this ); }
    339         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    340         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
     338        virtual EnumDecl * clone() const override { return new EnumDecl( *this ); }
     339        virtual void accept( Visitor & v ) override { v.visit( this ); }
     340        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     341        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
    341342  private:
    342343        std::unordered_map< std::string, long long int > enumValues;
    343         virtual std::string typeString() const override;
     344        virtual const char * typeString() const override;
    344345};
    345346
     
    347348        typedef AggregateDecl Parent;
    348349  public:
    349         TraitDecl( const std::string &name, const std::list< Attribute * > & attributes, LinkageSpec::Spec linkage ) : Parent( name, attributes, linkage ) {
     350        TraitDecl( const std::string & name, const std::list< Attribute * > & attributes, LinkageSpec::Spec linkage ) : Parent( name, attributes, linkage ) {
    350351                assertf( attributes.empty(), "attribute unsupported for traits" );
    351352        }
    352         TraitDecl( const TraitDecl &other ) : Parent( other ) {}
    353 
    354         virtual TraitDecl *clone() const override { return new TraitDecl( *this ); }
    355         virtual void accept( Visitor & v ) override { v.visit( this ); }
    356         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    357         virtual Declaration *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    358   private:
    359         virtual std::string typeString() const override;
     353        TraitDecl( const TraitDecl & other ) : Parent( other ) {}
     354
     355        virtual TraitDecl * clone() const override { return new TraitDecl( *this ); }
     356        virtual void accept( Visitor & v ) override { v.visit( this ); }
     357        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     358        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     359  private:
     360        virtual const char * typeString() const override;
    360361};
    361362
     
    379380class AsmDecl : public Declaration {
    380381  public:
    381         AsmStmt *stmt;
    382 
    383         AsmDecl( AsmStmt *stmt );
    384         AsmDecl( const AsmDecl &other );
     382        AsmStmt * stmt;
     383
     384        AsmDecl( AsmStmt * stmt );
     385        AsmDecl( const AsmDecl & other );
    385386        virtual ~AsmDecl();
    386387
    387         AsmStmt *get_stmt() { return stmt; }
    388         void set_stmt( AsmStmt *newValue ) { stmt = newValue; }
    389 
    390         virtual AsmDecl *clone() const override { return new AsmDecl( *this ); }
    391         virtual void accept( Visitor & v ) override { v.visit( this ); }
    392         virtual void accept( Visitor & v ) const override { v.visit( this ); }
    393         virtual AsmDecl *acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    394         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    395         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     388        AsmStmt * get_stmt() { return stmt; }
     389        void set_stmt( AsmStmt * newValue ) { stmt = newValue; }
     390
     391        virtual AsmDecl * clone() const override { return new AsmDecl( *this ); }
     392        virtual void accept( Visitor & v ) override { v.visit( this ); }
     393        virtual void accept( Visitor & v ) const override { v.visit( this ); }
     394        virtual AsmDecl * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     395        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     396        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    396397};
    397398
     
    408409        virtual void accept( Visitor & v ) override { v.visit( this ); }
    409410        virtual void accept( Visitor & v ) const override { v.visit( this ); }
    410         virtual StaticAssertDecl * acceptMutator( Mutator &m )  override { return m.mutate( this ); }
    411         virtual void print( std::ostream &os, Indenter indent = {} ) const override;
    412         virtual void printShort( std::ostream &os, Indenter indent = {} ) const override;
     411        virtual StaticAssertDecl * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
     412        virtual void print( std::ostream & os, Indenter indent = {} ) const override;
     413        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    413414};
    414415
Note: See TracChangeset for help on using the changeset viewer.