Changeset 5ded739 for src/SynTree


Ignore:
Timestamp:
Jan 18, 2017, 4:58:22 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
f8b6d921
Parents:
44a81853
Message:

code formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r44a81853 r5ded739  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Aug  6 08:52:53 2016
    13 // Update Count     : 35
     12// Last Modified On : Sat Jan 14 14:37:54 2017
     13// Update Count     : 37
    1414//
    1515
     
    2828class Expression {
    2929  public:
    30         Expression( Expression *_aname = nullptr );
    31         Expression( const Expression &other );
     30        Expression( Expression * _aname = nullptr );
     31        Expression( const Expression & other );
    3232        virtual ~Expression();
    3333
    3434        Type *& get_result() { return result; }
    35         void set_result( Type *newValue ) { result = newValue; }
     35        void set_result( Type * newValue ) { result = newValue; }
    3636        bool has_result() const { return result != nullptr; }
    3737
    38         TypeSubstitution *get_env() const { return env; }
    39         void set_env( TypeSubstitution *newValue ) { env = newValue; }
    40         Expression *get_argName() const { return argName; }
    41         void set_argName( Expression *name ) { argName = name; }
     38        TypeSubstitution * get_env() const { return env; }
     39        void set_env( TypeSubstitution * newValue ) { env = newValue; }
     40        Expression * get_argName() const { return argName; }
     41        void set_argName( Expression * name ) { argName = name; }
    4242        bool get_extension() const { return extension; }
    4343        Expression * set_extension( bool exten ) { extension = exten; return this; }
    4444
    45         virtual Expression *clone() const = 0;
    46         virtual void accept( Visitor &v ) = 0;
    47         virtual Expression *acceptMutator( Mutator &m ) = 0;
    48         virtual void print( std::ostream &os, int indent = 0 ) const;
     45        virtual Expression * clone() const = 0;
     46        virtual void accept( Visitor & v ) = 0;
     47        virtual Expression * acceptMutator( Mutator & m ) = 0;
     48        virtual void print( std::ostream & os, int indent = 0 ) const;
    4949  protected:
    5050        Type * result;
    51         TypeSubstitution *env;
    52         Expression* argName; // if expression is used as an argument, it can be "designated" by this name
     51        TypeSubstitution * env;
     52        Expression * argName; // if expression is used as an argument, it can be "designated" by this name
    5353        bool extension = false;
    5454};
     
    6161struct ParamEntry {
    6262        ParamEntry(): decl( 0 ), actualType( 0 ), formalType( 0 ), expr( 0 ), inferParams( new InferredParams ) {}
    63         ParamEntry( UniqueId decl, Type *actualType, Type *formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {}
    64         ParamEntry( const ParamEntry &other );
     63        ParamEntry( UniqueId decl, Type * actualType, Type * formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {}
     64        ParamEntry( const ParamEntry & other );
    6565        ~ParamEntry();
    66         ParamEntry &operator=( const ParamEntry &other );
     66        ParamEntry & operator=( const ParamEntry & other );
    6767
    6868        UniqueId decl;
    69         Type *actualType;
    70         Type *formalType;
     69        Type * actualType;
     70        Type * formalType;
    7171        Expression* expr;
    7272        std::unique_ptr< InferredParams > inferParams;
     
    7777class ApplicationExpr : public Expression {
    7878  public:
    79         ApplicationExpr( Expression *function );
    80         ApplicationExpr( const ApplicationExpr &other );
     79        ApplicationExpr( Expression * function );
     80        ApplicationExpr( const ApplicationExpr & other );
    8181        virtual ~ApplicationExpr();
    8282
    83         Expression *get_function() const { return function; }
    84         void set_function( Expression *newValue ) { function = newValue; }
     83        Expression * get_function() const { return function; }
     84        void set_function( Expression * newValue ) { function = newValue; }
    8585        std::list<Expression *>& get_args() { return args; }
    86         InferredParams &get_inferParams() { return inferParams; }
    87 
    88         virtual ApplicationExpr *clone() const { return new ApplicationExpr( *this ); }
    89         virtual void accept( Visitor &v ) { v.visit( this ); }
    90         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    91         virtual void print( std::ostream &os, int indent = 0 ) const;
    92   private:
    93         Expression *function;
     86        InferredParams & get_inferParams() { return inferParams; }
     87
     88        virtual ApplicationExpr * clone() const { return new ApplicationExpr( * this ); }
     89        virtual void accept( Visitor & v ) { v.visit( this ); }
     90        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     91        virtual void print( std::ostream & os, int indent = 0 ) const;
     92  private:
     93        Expression * function;
    9494        std::list<Expression *> args;
    9595        InferredParams inferParams;
     
    101101class UntypedExpr : public Expression {
    102102  public:
    103         UntypedExpr( Expression *function, const std::list<Expression *> &args = std::list< Expression * >(), Expression *_aname = nullptr );
    104         UntypedExpr( const UntypedExpr &other );
     103        UntypedExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >(), Expression *_aname = nullptr );
     104        UntypedExpr( const UntypedExpr & other );
    105105        virtual ~UntypedExpr();
    106106
    107         Expression *get_function() const { return function; }
    108         void set_function( Expression *newValue ) { function = newValue; }
    109 
    110         void set_args( std::list<Expression *> &listArgs ) { args = listArgs; }
     107        Expression * get_function() const { return function; }
     108        void set_function( Expression * newValue ) { function = newValue; }
     109
     110        void set_args( std::list<Expression *> & listArgs ) { args = listArgs; }
    111111        std::list<Expression*>::iterator begin_args() { return args.begin(); }
    112112        std::list<Expression*>::iterator end_args() { return args.end(); }
     
    116116        static UntypedExpr * createAssign( Expression * arg1, Expression * arg2 );
    117117
    118         virtual UntypedExpr *clone() const { return new UntypedExpr( *this ); }
    119         virtual void accept( Visitor &v ) { v.visit( this ); }
    120         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    121         virtual void print( std::ostream &os, int indent = 0 ) const;
    122         virtual void printArgs(std::ostream &os, int indent = 0) const;
    123   private:
    124         Expression *function;
     118        virtual UntypedExpr * clone() const { return new UntypedExpr( * this ); }
     119        virtual void accept( Visitor & v ) { v.visit( this ); }
     120        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     121        virtual void print( std::ostream & os, int indent = 0 ) const;
     122        virtual void printArgs(std::ostream & os, int indent = 0) const;
     123  private:
     124        Expression * function;
    125125        std::list<Expression*> args;
    126126};
     
    130130  public:
    131131        NameExpr( std::string name, Expression *_aname = nullptr );
    132         NameExpr( const NameExpr &other );
     132        NameExpr( const NameExpr & other );
    133133        virtual ~NameExpr();
    134134
    135         const std::string &get_name() const { return name; }
     135        const std::string & get_name() const { return name; }
    136136        void set_name( std::string newValue ) { name = newValue; }
    137137
    138         virtual NameExpr *clone() const { return new NameExpr( *this ); }
    139         virtual void accept( Visitor &v ) { v.visit( this ); }
    140         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    141         virtual void print( std::ostream &os, int indent = 0 ) const;
     138        virtual NameExpr * clone() const { return new NameExpr( * this ); }
     139        virtual void accept( Visitor & v ) { v.visit( this ); }
     140        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     141        virtual void print( std::ostream & os, int indent = 0 ) const;
    142142  private:
    143143        std::string name;
     
    147147// function-call format.
    148148
    149 /// AddressExpr represents a address-of expression, e.g. &e
     149/// AddressExpr represents a address-of expression, e.g. & e
    150150class AddressExpr : public Expression {
    151151  public:
    152         AddressExpr( Expression *arg, Expression *_aname = nullptr );
    153         AddressExpr( const AddressExpr &other );
     152        AddressExpr( Expression * arg, Expression *_aname = nullptr );
     153        AddressExpr( const AddressExpr & other );
    154154        virtual ~AddressExpr();
    155155
    156         Expression *get_arg() const { return arg; }
    157         void set_arg(Expression *newValue ) { arg = newValue; }
    158 
    159         virtual AddressExpr *clone() const { return new AddressExpr( *this ); }
    160         virtual void accept( Visitor &v ) { v.visit( this ); }
    161         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    162         virtual void print( std::ostream &os, int indent = 0 ) const;
    163   private:
    164         Expression *arg;
     156        Expression * get_arg() const { return arg; }
     157        void set_arg(Expression * newValue ) { arg = newValue; }
     158
     159        virtual AddressExpr * clone() const { return new AddressExpr( * this ); }
     160        virtual void accept( Visitor & v ) { v.visit( this ); }
     161        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     162        virtual void print( std::ostream & os, int indent = 0 ) const;
     163  private:
     164        Expression * arg;
    165165};
    166166
     
    168168class LabelAddressExpr : public Expression {
    169169  public:
    170         LabelAddressExpr( Expression *arg );
    171         LabelAddressExpr( const LabelAddressExpr &other );
     170        LabelAddressExpr( Expression * arg );
     171        LabelAddressExpr( const LabelAddressExpr & other );
    172172        virtual ~LabelAddressExpr();
    173173
    174         Expression *get_arg() const { return arg; }
    175         void set_arg(Expression *newValue ) { arg = newValue; }
    176 
    177         virtual LabelAddressExpr *clone() const { return new LabelAddressExpr( *this ); }
    178         virtual void accept( Visitor &v ) { v.visit( this ); }
    179         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    180         virtual void print( std::ostream &os, int indent = 0 ) const;
    181   private:
    182         Expression *arg;
     174        Expression * get_arg() const { return arg; }
     175        void set_arg(Expression * newValue ) { arg = newValue; }
     176
     177        virtual LabelAddressExpr * clone() const { return new LabelAddressExpr( * this ); }
     178        virtual void accept( Visitor & v ) { v.visit( this ); }
     179        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     180        virtual void print( std::ostream & os, int indent = 0 ) const;
     181  private:
     182        Expression * arg;
    183183};
    184184
     
    186186class CastExpr : public Expression {
    187187  public:
    188         CastExpr( Expression *arg, Expression *_aname = nullptr );
    189         CastExpr( Expression *arg, Type *toType, Expression *_aname = nullptr );
    190         CastExpr( const CastExpr &other );
     188        CastExpr( Expression * arg, Expression *_aname = nullptr );
     189        CastExpr( Expression * arg, Type * toType, Expression *_aname = nullptr );
     190        CastExpr( const CastExpr & other );
    191191        virtual ~CastExpr();
    192192
    193         Expression *get_arg() const { return arg; }
    194         void set_arg(Expression *newValue ) { arg = newValue; }
    195 
    196         virtual CastExpr *clone() const { return new CastExpr( *this ); }
    197         virtual void accept( Visitor &v ) { v.visit( this ); }
    198         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    199         virtual void print( std::ostream &os, int indent = 0 ) const;
    200   private:
    201         Expression *arg;
     193        Expression * get_arg() const { return arg; }
     194        void set_arg(Expression * newValue ) { arg = newValue; }
     195
     196        virtual CastExpr * clone() const { return new CastExpr( * this ); }
     197        virtual void accept( Visitor & v ) { v.visit( this ); }
     198        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     199        virtual void print( std::ostream & os, int indent = 0 ) const;
     200  private:
     201        Expression * arg;
    202202};
    203203
     
    205205class UntypedMemberExpr : public Expression {
    206206  public:
    207         UntypedMemberExpr( Expression *member, Expression *aggregate, Expression *_aname = nullptr );
    208         UntypedMemberExpr( const UntypedMemberExpr &other );
     207        UntypedMemberExpr( Expression * member, Expression * aggregate, Expression *_aname = nullptr );
     208        UntypedMemberExpr( const UntypedMemberExpr & other );
    209209        virtual ~UntypedMemberExpr();
    210210
    211211        Expression * get_member() const { return member; }
    212212        void set_member( Expression * newValue ) { member = newValue; }
    213         Expression *get_aggregate() const { return aggregate; }
    214         void set_aggregate( Expression *newValue ) { aggregate = newValue; }
    215 
    216         virtual UntypedMemberExpr *clone() const { return new UntypedMemberExpr( *this ); }
    217         virtual void accept( Visitor &v ) { v.visit( this ); }
    218         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    219         virtual void print( std::ostream &os, int indent = 0 ) const;
    220   private:
    221         Expression *member;
    222         Expression *aggregate;
     213        Expression * get_aggregate() const { return aggregate; }
     214        void set_aggregate( Expression * newValue ) { aggregate = newValue; }
     215
     216        virtual UntypedMemberExpr * clone() const { return new UntypedMemberExpr( * this ); }
     217        virtual void accept( Visitor & v ) { v.visit( this ); }
     218        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     219        virtual void print( std::ostream & os, int indent = 0 ) const;
     220  private:
     221        Expression * member;
     222        Expression * aggregate;
    223223};
    224224
     
    226226class MemberExpr : public Expression {
    227227  public:
    228         MemberExpr( DeclarationWithType *member, Expression *aggregate, Expression *_aname = nullptr );
    229         MemberExpr( const MemberExpr &other );
     228        MemberExpr( DeclarationWithType * member, Expression * aggregate, Expression *_aname = nullptr );
     229        MemberExpr( const MemberExpr & other );
    230230        virtual ~MemberExpr();
    231231
    232         DeclarationWithType *get_member() const { return member; }
    233         void set_member( DeclarationWithType *newValue ) { member = newValue; }
    234         Expression *get_aggregate() const { return aggregate; }
    235         void set_aggregate( Expression *newValue ) { aggregate = newValue; }
    236 
    237         virtual MemberExpr *clone() const { return new MemberExpr( *this ); }
    238         virtual void accept( Visitor &v ) { v.visit( this ); }
    239         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    240         virtual void print( std::ostream &os, int indent = 0 ) const;
    241   private:
    242         DeclarationWithType *member;
    243         Expression *aggregate;
     232        DeclarationWithType * get_member() const { return member; }
     233        void set_member( DeclarationWithType * newValue ) { member = newValue; }
     234        Expression * get_aggregate() const { return aggregate; }
     235        void set_aggregate( Expression * newValue ) { aggregate = newValue; }
     236
     237        virtual MemberExpr * clone() const { return new MemberExpr( * this ); }
     238        virtual void accept( Visitor & v ) { v.visit( this ); }
     239        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     240        virtual void print( std::ostream & os, int indent = 0 ) const;
     241  private:
     242        DeclarationWithType * member;
     243        Expression * aggregate;
    244244};
    245245
     
    247247class VariableExpr : public Expression {
    248248  public:
    249         VariableExpr( DeclarationWithType *var, Expression *_aname = nullptr );
    250         VariableExpr( const VariableExpr &other );
     249        VariableExpr( DeclarationWithType * var, Expression *_aname = nullptr );
     250        VariableExpr( const VariableExpr & other );
    251251        virtual ~VariableExpr();
    252252
    253         DeclarationWithType *get_var() const { return var; }
    254         void set_var( DeclarationWithType *newValue ) { var = newValue; }
    255 
    256         virtual VariableExpr *clone() const { return new VariableExpr( *this ); }
    257         virtual void accept( Visitor &v ) { v.visit( this ); }
    258         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    259         virtual void print( std::ostream &os, int indent = 0 ) const;
    260   private:
    261         DeclarationWithType *var;
     253        DeclarationWithType * get_var() const { return var; }
     254        void set_var( DeclarationWithType * newValue ) { var = newValue; }
     255
     256        virtual VariableExpr * clone() const { return new VariableExpr( * this ); }
     257        virtual void accept( Visitor & v ) { v.visit( this ); }
     258        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     259        virtual void print( std::ostream & os, int indent = 0 ) const;
     260  private:
     261        DeclarationWithType * var;
    262262};
    263263
     
    266266  public:
    267267        ConstantExpr( Constant constant, Expression *_aname = nullptr );
    268         ConstantExpr( const ConstantExpr &other );
     268        ConstantExpr( const ConstantExpr & other );
    269269        virtual ~ConstantExpr();
    270270
    271         Constant *get_constant() { return &constant; }
    272         void set_constant( const Constant &newValue ) { constant = newValue; }
    273 
    274         virtual ConstantExpr *clone() const { return new ConstantExpr( *this ); }
    275         virtual void accept( Visitor &v ) { v.visit( this ); }
    276         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    277         virtual void print( std::ostream &os, int indent = 0 ) const;
     271        Constant * get_constant() { return & constant; }
     272        void set_constant( const Constant & newValue ) { constant = newValue; }
     273
     274        virtual ConstantExpr * clone() const { return new ConstantExpr( * this ); }
     275        virtual void accept( Visitor & v ) { v.visit( this ); }
     276        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     277        virtual void print( std::ostream & os, int indent = 0 ) const;
    278278  private:
    279279        Constant constant;
     
    283283class SizeofExpr : public Expression {
    284284  public:
    285         SizeofExpr( Expression *expr, Expression *_aname = nullptr );
    286         SizeofExpr( const SizeofExpr &other );
    287         SizeofExpr( Type *type, Expression *_aname = nullptr );
     285        SizeofExpr( Expression * expr, Expression *_aname = nullptr );
     286        SizeofExpr( const SizeofExpr & other );
     287        SizeofExpr( Type * type, Expression *_aname = nullptr );
    288288        virtual ~SizeofExpr();
    289289
    290         Expression *get_expr() const { return expr; }
    291         void set_expr( Expression *newValue ) { expr = newValue; }
    292         Type *get_type() const { return type; }
    293         void set_type( Type *newValue ) { type = newValue; }
     290        Expression * get_expr() const { return expr; }
     291        void set_expr( Expression * newValue ) { expr = newValue; }
     292        Type * get_type() const { return type; }
     293        void set_type( Type * newValue ) { type = newValue; }
    294294        bool get_isType() const { return isType; }
    295295        void set_isType( bool newValue ) { isType = newValue; }
    296296
    297         virtual SizeofExpr *clone() const { return new SizeofExpr( *this ); }
    298         virtual void accept( Visitor &v ) { v.visit( this ); }
    299         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    300         virtual void print( std::ostream &os, int indent = 0 ) const;
    301   private:
    302         Expression *expr;
    303         Type *type;
     297        virtual SizeofExpr * clone() const { return new SizeofExpr( * this ); }
     298        virtual void accept( Visitor & v ) { v.visit( this ); }
     299        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     300        virtual void print( std::ostream & os, int indent = 0 ) const;
     301  private:
     302        Expression * expr;
     303        Type * type;
    304304        bool isType;
    305305};
     
    308308class AlignofExpr : public Expression {
    309309  public:
    310         AlignofExpr( Expression *expr, Expression *_aname = nullptr );
    311         AlignofExpr( const AlignofExpr &other );
    312         AlignofExpr( Type *type, Expression *_aname = nullptr );
     310        AlignofExpr( Expression * expr, Expression *_aname = nullptr );
     311        AlignofExpr( const AlignofExpr & other );
     312        AlignofExpr( Type * type, Expression *_aname = nullptr );
    313313        virtual ~AlignofExpr();
    314314
    315         Expression *get_expr() const { return expr; }
    316         void set_expr( Expression *newValue ) { expr = newValue; }
    317         Type *get_type() const { return type; }
    318         void set_type( Type *newValue ) { type = newValue; }
     315        Expression * get_expr() const { return expr; }
     316        void set_expr( Expression * newValue ) { expr = newValue; }
     317        Type * get_type() const { return type; }
     318        void set_type( Type * newValue ) { type = newValue; }
    319319        bool get_isType() const { return isType; }
    320320        void set_isType( bool newValue ) { isType = newValue; }
    321321
    322         virtual AlignofExpr *clone() const { return new AlignofExpr( *this ); }
    323         virtual void accept( Visitor &v ) { v.visit( this ); }
    324         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    325         virtual void print( std::ostream &os, int indent = 0 ) const;
    326   private:
    327         Expression *expr;
    328         Type *type;
     322        virtual AlignofExpr * clone() const { return new AlignofExpr( * this ); }
     323        virtual void accept( Visitor & v ) { v.visit( this ); }
     324        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     325        virtual void print( std::ostream & os, int indent = 0 ) const;
     326  private:
     327        Expression * expr;
     328        Type * type;
    329329        bool isType;
    330330};
     
    333333class UntypedOffsetofExpr : public Expression {
    334334  public:
    335         UntypedOffsetofExpr( Type *type, const std::string &member, Expression *_aname = nullptr );
    336         UntypedOffsetofExpr( const UntypedOffsetofExpr &other );
     335        UntypedOffsetofExpr( Type * type, const std::string & member, Expression *_aname = nullptr );
     336        UntypedOffsetofExpr( const UntypedOffsetofExpr & other );
    337337        virtual ~UntypedOffsetofExpr();
    338338
    339339        std::string get_member() const { return member; }
    340         void set_member( const std::string &newValue ) { member = newValue; }
    341         Type *get_type() const { return type; }
    342         void set_type( Type *newValue ) { type = newValue; }
    343 
    344         virtual UntypedOffsetofExpr *clone() const { return new UntypedOffsetofExpr( *this ); }
    345         virtual void accept( Visitor &v ) { v.visit( this ); }
    346         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    347         virtual void print( std::ostream &os, int indent = 0 ) const;
    348   private:
    349         Type *type;
     340        void set_member( const std::string & newValue ) { member = newValue; }
     341        Type * get_type() const { return type; }
     342        void set_type( Type * newValue ) { type = newValue; }
     343
     344        virtual UntypedOffsetofExpr * clone() const { return new UntypedOffsetofExpr( * this ); }
     345        virtual void accept( Visitor & v ) { v.visit( this ); }
     346        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     347        virtual void print( std::ostream & os, int indent = 0 ) const;
     348  private:
     349        Type * type;
    350350        std::string member;
    351351};
     
    354354class OffsetofExpr : public Expression {
    355355  public:
    356         OffsetofExpr( Type *type, DeclarationWithType *member, Expression *_aname = nullptr );
    357         OffsetofExpr( const OffsetofExpr &other );
     356        OffsetofExpr( Type * type, DeclarationWithType * member, Expression *_aname = nullptr );
     357        OffsetofExpr( const OffsetofExpr & other );
    358358        virtual ~OffsetofExpr();
    359359
    360         Type *get_type() const { return type; }
    361         void set_type( Type *newValue ) { type = newValue; }
    362         DeclarationWithType *get_member() const { return member; }
    363         void set_member( DeclarationWithType *newValue ) { member = newValue; }
    364 
    365         virtual OffsetofExpr *clone() const { return new OffsetofExpr( *this ); }
    366         virtual void accept( Visitor &v ) { v.visit( this ); }
    367         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    368         virtual void print( std::ostream &os, int indent = 0 ) const;
    369   private:
    370         Type *type;
    371         DeclarationWithType *member;
     360        Type * get_type() const { return type; }
     361        void set_type( Type * newValue ) { type = newValue; }
     362        DeclarationWithType * get_member() const { return member; }
     363        void set_member( DeclarationWithType * newValue ) { member = newValue; }
     364
     365        virtual OffsetofExpr * clone() const { return new OffsetofExpr( * this ); }
     366        virtual void accept( Visitor & v ) { v.visit( this ); }
     367        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     368        virtual void print( std::ostream & os, int indent = 0 ) const;
     369  private:
     370        Type * type;
     371        DeclarationWithType * member;
    372372};
    373373
     
    375375class OffsetPackExpr : public Expression {
    376376public:
    377         OffsetPackExpr( StructInstType *type_, Expression *aname_ = 0 );
    378         OffsetPackExpr( const OffsetPackExpr &other );
     377        OffsetPackExpr( StructInstType * type_, Expression * aname_ = 0 );
     378        OffsetPackExpr( const OffsetPackExpr & other );
    379379        virtual ~OffsetPackExpr();
    380380
    381         StructInstType *get_type() const { return type; }
    382         void set_type( StructInstType *newValue ) { type = newValue; }
    383 
    384         virtual OffsetPackExpr *clone() const { return new OffsetPackExpr( *this ); }
    385         virtual void accept( Visitor &v ) { v.visit( this ); }
    386         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    387 
    388         virtual void print( std::ostream &os, int indent = 0 ) const;
     381        StructInstType * get_type() const { return type; }
     382        void set_type( StructInstType * newValue ) { type = newValue; }
     383
     384        virtual OffsetPackExpr * clone() const { return new OffsetPackExpr( * this ); }
     385        virtual void accept( Visitor & v ) { v.visit( this ); }
     386        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     387
     388        virtual void print( std::ostream & os, int indent = 0 ) const;
    389389
    390390private:
    391         StructInstType *type;
     391        StructInstType * type;
    392392};
    393393
     
    395395class AttrExpr : public Expression {
    396396  public:
    397         AttrExpr(Expression *attr, Expression *expr, Expression *_aname = nullptr );
    398         AttrExpr( const AttrExpr &other );
    399         AttrExpr( Expression *attr, Type *type, Expression *_aname = nullptr );
     397        AttrExpr(Expression * attr, Expression * expr, Expression *_aname = nullptr );
     398        AttrExpr( const AttrExpr & other );
     399        AttrExpr( Expression * attr, Type * type, Expression *_aname = nullptr );
    400400        virtual ~AttrExpr();
    401401
    402         Expression *get_attr() const { return attr; }
    403         void set_attr( Expression *newValue ) { attr = newValue; }
    404         Expression *get_expr() const { return expr; }
    405         void set_expr( Expression *newValue ) { expr = newValue; }
    406         Type *get_type() const { return type; }
    407         void set_type( Type *newValue ) { type = newValue; }
     402        Expression * get_attr() const { return attr; }
     403        void set_attr( Expression * newValue ) { attr = newValue; }
     404        Expression * get_expr() const { return expr; }
     405        void set_expr( Expression * newValue ) { expr = newValue; }
     406        Type * get_type() const { return type; }
     407        void set_type( Type * newValue ) { type = newValue; }
    408408        bool get_isType() const { return isType; }
    409409        void set_isType( bool newValue ) { isType = newValue; }
    410410
    411         virtual AttrExpr *clone() const { return new AttrExpr( *this ); }
    412         virtual void accept( Visitor &v ) { v.visit( this ); }
    413         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    414         virtual void print( std::ostream &os, int indent = 0 ) const;
    415   private:
    416         Expression *attr;
    417         Expression *expr;
    418         Type *type;
     411        virtual AttrExpr * clone() const { return new AttrExpr( * this ); }
     412        virtual void accept( Visitor & v ) { v.visit( this ); }
     413        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     414        virtual void print( std::ostream & os, int indent = 0 ) const;
     415  private:
     416        Expression * attr;
     417        Expression * expr;
     418        Type * type;
    419419        bool isType;
    420420};
     
    423423class LogicalExpr : public Expression {
    424424  public:
    425         LogicalExpr( Expression *arg1, Expression *arg2, bool andp = true, Expression *_aname = nullptr );
    426         LogicalExpr( const LogicalExpr &other );
     425        LogicalExpr( Expression * arg1, Expression * arg2, bool andp = true, Expression *_aname = nullptr );
     426        LogicalExpr( const LogicalExpr & other );
    427427        virtual ~LogicalExpr();
    428428
    429429        bool get_isAnd() const { return isAnd; }
    430         Expression *get_arg1() { return arg1; }
    431         void set_arg1( Expression *newValue ) { arg1 = newValue; }
    432         Expression *get_arg2() const { return arg2; }
    433         void set_arg2( Expression *newValue ) { arg2 = newValue; }
    434 
    435         virtual LogicalExpr *clone() const { return new LogicalExpr( *this ); }
    436         virtual void accept( Visitor &v ) { v.visit( this ); }
    437         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    438         virtual void print( std::ostream &os, int indent = 0 ) const;
    439   private:
    440         Expression *arg1;
    441         Expression *arg2;
     430        Expression * get_arg1() { return arg1; }
     431        void set_arg1( Expression * newValue ) { arg1 = newValue; }
     432        Expression * get_arg2() const { return arg2; }
     433        void set_arg2( Expression * newValue ) { arg2 = newValue; }
     434
     435        virtual LogicalExpr * clone() const { return new LogicalExpr( * this ); }
     436        virtual void accept( Visitor & v ) { v.visit( this ); }
     437        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     438        virtual void print( std::ostream & os, int indent = 0 ) const;
     439  private:
     440        Expression * arg1;
     441        Expression * arg2;
    442442        bool isAnd;
    443443};
     
    446446class ConditionalExpr : public Expression {
    447447  public:
    448         ConditionalExpr( Expression *arg1, Expression *arg2, Expression *arg3, Expression *_aname = nullptr );
    449         ConditionalExpr( const ConditionalExpr &other );
     448        ConditionalExpr( Expression * arg1, Expression * arg2, Expression * arg3, Expression *_aname = nullptr );
     449        ConditionalExpr( const ConditionalExpr & other );
    450450        virtual ~ConditionalExpr();
    451451
    452         Expression *get_arg1() const { return arg1; }
    453         void set_arg1( Expression *newValue ) { arg1 = newValue; }
    454         Expression *get_arg2() const { return arg2; }
    455         void set_arg2( Expression *newValue ) { arg2 = newValue; }
    456         Expression *get_arg3() const { return arg3; }
    457         void set_arg3( Expression *newValue ) { arg3 = newValue; }
    458 
    459         virtual ConditionalExpr *clone() const { return new ConditionalExpr( *this ); }
    460         virtual void accept( Visitor &v ) { v.visit( this ); }
    461         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    462         virtual void print( std::ostream &os, int indent = 0 ) const;
    463   private:
    464         Expression *arg1;
    465         Expression *arg2;
    466         Expression *arg3;
     452        Expression * get_arg1() const { return arg1; }
     453        void set_arg1( Expression * newValue ) { arg1 = newValue; }
     454        Expression * get_arg2() const { return arg2; }
     455        void set_arg2( Expression * newValue ) { arg2 = newValue; }
     456        Expression * get_arg3() const { return arg3; }
     457        void set_arg3( Expression * newValue ) { arg3 = newValue; }
     458
     459        virtual ConditionalExpr * clone() const { return new ConditionalExpr( * this ); }
     460        virtual void accept( Visitor & v ) { v.visit( this ); }
     461        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     462        virtual void print( std::ostream & os, int indent = 0 ) const;
     463  private:
     464        Expression * arg1;
     465        Expression * arg2;
     466        Expression * arg3;
    467467};
    468468
     
    470470class CommaExpr : public Expression {
    471471  public:
    472         CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname = nullptr );
    473         CommaExpr( const CommaExpr &other );
     472        CommaExpr( Expression * arg1, Expression * arg2, Expression *_aname = nullptr );
     473        CommaExpr( const CommaExpr & other );
    474474        virtual ~CommaExpr();
    475475
    476         Expression *get_arg1() const { return arg1; }
    477         void set_arg1( Expression *newValue ) { arg1 = newValue; }
    478         Expression *get_arg2() const { return arg2; }
    479         void set_arg2( Expression *newValue ) { arg2 = newValue; }
    480 
    481         virtual CommaExpr *clone() const { return new CommaExpr( *this ); }
    482         virtual void accept( Visitor &v ) { v.visit( this ); }
    483         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    484         virtual void print( std::ostream &os, int indent = 0 ) const;
    485   private:
    486         Expression *arg1;
    487         Expression *arg2;
     476        Expression * get_arg1() const { return arg1; }
     477        void set_arg1( Expression * newValue ) { arg1 = newValue; }
     478        Expression * get_arg2() const { return arg2; }
     479        void set_arg2( Expression * newValue ) { arg2 = newValue; }
     480
     481        virtual CommaExpr * clone() const { return new CommaExpr( * this ); }
     482        virtual void accept( Visitor & v ) { v.visit( this ); }
     483        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     484        virtual void print( std::ostream & os, int indent = 0 ) const;
     485  private:
     486        Expression * arg1;
     487        Expression * arg2;
    488488};
    489489
     
    491491class TypeExpr : public Expression {
    492492  public:
    493         TypeExpr( Type *type );
    494         TypeExpr( const TypeExpr &other );
     493        TypeExpr( Type * type );
     494        TypeExpr( const TypeExpr & other );
    495495        virtual ~TypeExpr();
    496496
    497         Type *get_type() const { return type; }
    498         void set_type( Type *newValue ) { type = newValue; }
    499 
    500         virtual TypeExpr *clone() const { return new TypeExpr( *this ); }
    501         virtual void accept( Visitor &v ) { v.visit( this ); }
    502         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    503         virtual void print( std::ostream &os, int indent = 0 ) const;
    504   private:
    505         Type *type;
     497        Type * get_type() const { return type; }
     498        void set_type( Type * newValue ) { type = newValue; }
     499
     500        virtual TypeExpr * clone() const { return new TypeExpr( * this ); }
     501        virtual void accept( Visitor & v ) { v.visit( this ); }
     502        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     503        virtual void print( std::ostream & os, int indent = 0 ) const;
     504  private:
     505        Type * type;
    506506};
    507507
     
    509509class AsmExpr : public Expression {
    510510  public:
    511         AsmExpr( Expression *inout, ConstantExpr *constraint, Expression *operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}
     511        AsmExpr( Expression * inout, ConstantExpr * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}
    512512        AsmExpr( const AsmExpr & other );
    513513        virtual ~AsmExpr() { delete inout; delete constraint; delete operand; };
    514514
    515         Expression *get_inout() const { return inout; }
    516         void set_inout( Expression *newValue ) { inout = newValue; }
    517 
    518         ConstantExpr *get_constraint() const { return constraint; }
    519         void set_constraint( ConstantExpr *newValue ) { constraint = newValue; }
    520 
    521         Expression *get_operand() const { return operand; }
    522         void set_operand( Expression *newValue ) { operand = newValue; }
    523 
    524         virtual AsmExpr *clone() const { return new AsmExpr( *this ); }
    525         virtual void accept( Visitor &v ) { v.visit( this ); }
    526         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    527         virtual void print( std::ostream &os, int indent = 0 ) const;
     515        Expression * get_inout() const { return inout; }
     516        void set_inout( Expression * newValue ) { inout = newValue; }
     517
     518        ConstantExpr * get_constraint() const { return constraint; }
     519        void set_constraint( ConstantExpr * newValue ) { constraint = newValue; }
     520
     521        Expression * get_operand() const { return operand; }
     522        void set_operand( Expression * newValue ) { operand = newValue; }
     523
     524        virtual AsmExpr * clone() const { return new AsmExpr( * this ); }
     525        virtual void accept( Visitor & v ) { v.visit( this ); }
     526        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     527        virtual void print( std::ostream & os, int indent = 0 ) const;
    528528  private:
    529529        // https://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/Machine-Constraints.html#Machine-Constraints
    530         Expression *inout;
    531         ConstantExpr *constraint;
    532         Expression *operand;
     530        Expression * inout;
     531        ConstantExpr * constraint;
     532        Expression * operand;
    533533};
    534534
     
    541541        virtual ~ImplicitCopyCtorExpr();
    542542
    543         ApplicationExpr *get_callExpr() const { return callExpr; }
    544         void set_callExpr( ApplicationExpr *newValue ) { callExpr = newValue; }
     543        ApplicationExpr * get_callExpr() const { return callExpr; }
     544        void set_callExpr( ApplicationExpr * newValue ) { callExpr = newValue; }
    545545
    546546        std::list< ObjectDecl * > & get_tempDecls() { return tempDecls; }
     
    548548        std::list< Expression * > & get_dtors() { return dtors; }
    549549
    550         virtual ImplicitCopyCtorExpr *clone() const { return new ImplicitCopyCtorExpr( *this ); }
    551         virtual void accept( Visitor &v ) { v.visit( this ); }
    552         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    553         virtual void print( std::ostream &os, int indent = 0 ) const;
     550        virtual ImplicitCopyCtorExpr * clone() const { return new ImplicitCopyCtorExpr( * this ); }
     551        virtual void accept( Visitor & v ) { v.visit( this ); }
     552        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     553        virtual void print( std::ostream & os, int indent = 0 ) const;
    554554  private:
    555555        ApplicationExpr * callExpr;
     
    566566        ~ConstructorExpr();
    567567
    568         Expression *get_callExpr() const { return callExpr; }
    569         void set_callExpr( Expression *newValue ) { callExpr = newValue; }
    570 
    571         virtual ConstructorExpr *clone() const { return new ConstructorExpr( *this ); }
    572         virtual void accept( Visitor &v ) { v.visit( this ); }
    573         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    574         virtual void print( std::ostream &os, int indent = 0 ) const;
     568        Expression * get_callExpr() const { return callExpr; }
     569        void set_callExpr( Expression * newValue ) { callExpr = newValue; }
     570
     571        virtual ConstructorExpr * clone() const { return new ConstructorExpr( * this ); }
     572        virtual void accept( Visitor & v ) { v.visit( this ); }
     573        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     574        virtual void print( std::ostream & os, int indent = 0 ) const;
    575575private:
    576576        Expression * callExpr;
     
    581581  public:
    582582        CompoundLiteralExpr( Type * type, Initializer * initializer );
    583         CompoundLiteralExpr( const CompoundLiteralExpr &other );
     583        CompoundLiteralExpr( const CompoundLiteralExpr & other );
    584584        virtual ~CompoundLiteralExpr();
    585585
     
    590590        void set_initializer( Initializer * i ) { initializer = i; }
    591591
    592         virtual CompoundLiteralExpr *clone() const { return new CompoundLiteralExpr( *this ); }
    593         virtual void accept( Visitor &v ) { v.visit( this ); }
    594         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    595         virtual void print( std::ostream &os, int indent = 0 ) const;
     592        virtual CompoundLiteralExpr * clone() const { return new CompoundLiteralExpr( * this ); }
     593        virtual void accept( Visitor & v ) { v.visit( this ); }
     594        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     595        virtual void print( std::ostream & os, int indent = 0 ) const;
    596596  private:
    597597        Type * type;
     
    606606        virtual ~UntypedValofExpr();
    607607
    608         Expression *get_value();
    609         Statement *get_body() const { return body; }
    610 
    611         virtual UntypedValofExpr *clone() const { return new UntypedValofExpr( *this ); }
    612         virtual void accept( Visitor &v ) { v.visit( this ); }
    613         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    614         virtual void print( std::ostream &os, int indent = 0 ) const;
    615   private:
    616         Statement *body;
     608        Expression * get_value();
     609        Statement * get_body() const { return body; }
     610
     611        virtual UntypedValofExpr * clone() const { return new UntypedValofExpr( * this ); }
     612        virtual void accept( Visitor & v ) { v.visit( this ); }
     613        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     614        virtual void print( std::ostream & os, int indent = 0 ) const;
     615  private:
     616        Statement * body;
    617617};
    618618
     
    620620class RangeExpr : public Expression {
    621621  public:
    622         RangeExpr( Expression *low, Expression *high );
    623         RangeExpr( const RangeExpr &other );
     622        RangeExpr( Expression * low, Expression * high );
     623        RangeExpr( const RangeExpr & other );
    624624
    625625        Expression * get_low() const { return low; }
    626626        Expression * get_high() const { return high; }
    627         RangeExpr * set_low( Expression *low ) { RangeExpr::low = low; return this; }
    628         RangeExpr * set_high( Expression *high ) { RangeExpr::high = high; return this; }
    629 
    630         virtual RangeExpr *clone() const { return new RangeExpr( *this ); }
    631         virtual void accept( Visitor &v ) { v.visit( this ); }
    632         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    633         virtual void print( std::ostream &os, int indent = 0 ) const;
    634   private:
    635         Expression *low, *high;
     627        RangeExpr * set_low( Expression * low ) { RangeExpr::low = low; return this; }
     628        RangeExpr * set_high( Expression * high ) { RangeExpr::high = high; return this; }
     629
     630        virtual RangeExpr * clone() const { return new RangeExpr( * this ); }
     631        virtual void accept( Visitor & v ) { v.visit( this ); }
     632        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     633        virtual void print( std::ostream & os, int indent = 0 ) const;
     634  private:
     635        Expression * low, * high;
    636636};
    637637
     
    640640  public:
    641641        UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr );
    642         UntypedTupleExpr( const UntypedTupleExpr &other );
     642        UntypedTupleExpr( const UntypedTupleExpr & other );
    643643        virtual ~UntypedTupleExpr();
    644644
    645645        std::list<Expression*>& get_exprs() { return exprs; }
    646646
    647         virtual UntypedTupleExpr *clone() const { return new UntypedTupleExpr( *this ); }
    648         virtual void accept( Visitor &v ) { v.visit( this ); }
    649         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    650         virtual void print( std::ostream &os, int indent = 0 ) const;
     647        virtual UntypedTupleExpr * clone() const { return new UntypedTupleExpr( * this ); }
     648        virtual void accept( Visitor & v ) { v.visit( this ); }
     649        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     650        virtual void print( std::ostream & os, int indent = 0 ) const;
    651651  private:
    652652        std::list<Expression*> exprs;
     
    657657  public:
    658658        TupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr );
    659         TupleExpr( const TupleExpr &other );
     659        TupleExpr( const TupleExpr & other );
    660660        virtual ~TupleExpr();
    661661
    662662        std::list<Expression*>& get_exprs() { return exprs; }
    663663
    664         virtual TupleExpr *clone() const { return new TupleExpr( *this ); }
    665         virtual void accept( Visitor &v ) { v.visit( this ); }
    666         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    667         virtual void print( std::ostream &os, int indent = 0 ) const;
     664        virtual TupleExpr * clone() const { return new TupleExpr( * this ); }
     665        virtual void accept( Visitor & v ) { v.visit( this ); }
     666        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     667        virtual void print( std::ostream & os, int indent = 0 ) const;
    668668  private:
    669669        std::list<Expression*> exprs;
     
    674674  public:
    675675        TupleIndexExpr( Expression * tuple, unsigned int index );
    676         TupleIndexExpr( const TupleIndexExpr &other );
     676        TupleIndexExpr( const TupleIndexExpr & other );
    677677        virtual ~TupleIndexExpr();
    678678
    679679        Expression * get_tuple() const { return tuple; }
    680680        int get_index() const { return index; }
    681         TupleIndexExpr * set_tuple( Expression *newValue ) { tuple = newValue; return this; }
     681        TupleIndexExpr * set_tuple( Expression * newValue ) { tuple = newValue; return this; }
    682682        TupleIndexExpr * set_index( unsigned int newValue ) { index = newValue; return this; }
    683683
    684         virtual TupleIndexExpr *clone() const { return new TupleIndexExpr( *this ); }
    685         virtual void accept( Visitor &v ) { v.visit( this ); }
    686         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    687         virtual void print( std::ostream &os, int indent = 0 ) const;
     684        virtual TupleIndexExpr * clone() const { return new TupleIndexExpr( * this ); }
     685        virtual void accept( Visitor & v ) { v.visit( this ); }
     686        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     687        virtual void print( std::ostream & os, int indent = 0 ) const;
    688688  private:
    689689        Expression * tuple;
     
    695695  public:
    696696        MemberTupleExpr( Expression * member, Expression * aggregate, Expression * _aname = nullptr );
    697         MemberTupleExpr( const MemberTupleExpr &other );
     697        MemberTupleExpr( const MemberTupleExpr & other );
    698698        virtual ~MemberTupleExpr();
    699699
    700700        Expression * get_member() const { return member; }
    701701        Expression * get_aggregate() const { return aggregate; }
    702         MemberTupleExpr * set_member( Expression *newValue ) { member = newValue; return this; }
    703         MemberTupleExpr * set_aggregate( Expression *newValue ) { aggregate = newValue; return this; }
    704 
    705         virtual MemberTupleExpr *clone() const { return new MemberTupleExpr( *this ); }
    706         virtual void accept( Visitor &v ) { v.visit( this ); }
    707         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    708         virtual void print( std::ostream &os, int indent = 0 ) const;
     702        MemberTupleExpr * set_member( Expression * newValue ) { member = newValue; return this; }
     703        MemberTupleExpr * set_aggregate( Expression * newValue ) { aggregate = newValue; return this; }
     704
     705        virtual MemberTupleExpr * clone() const { return new MemberTupleExpr( * this ); }
     706        virtual void accept( Visitor & v ) { v.visit( this ); }
     707        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     708        virtual void print( std::ostream & os, int indent = 0 ) const;
    709709  private:
    710710        Expression * member;
     
    716716  public:
    717717        TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls, Expression * _aname = nullptr );
    718         TupleAssignExpr( const TupleAssignExpr &other );
     718        TupleAssignExpr( const TupleAssignExpr & other );
    719719        virtual ~TupleAssignExpr();
    720720
     
    722722        StmtExpr * get_stmtExpr() const { return stmtExpr; }
    723723
    724         virtual TupleAssignExpr *clone() const { return new TupleAssignExpr( *this ); }
    725         virtual void accept( Visitor &v ) { v.visit( this ); }
    726         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    727         virtual void print( std::ostream &os, int indent = 0 ) const;
     724        virtual TupleAssignExpr * clone() const { return new TupleAssignExpr( * this ); }
     725        virtual void accept( Visitor & v ) { v.visit( this ); }
     726        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     727        virtual void print( std::ostream & os, int indent = 0 ) const;
    728728  private:
    729729        StmtExpr * stmtExpr = nullptr;
     
    733733class StmtExpr : public Expression {
    734734public:
    735         StmtExpr( CompoundStmt *statements );
     735        StmtExpr( CompoundStmt * statements );
    736736        StmtExpr( const StmtExpr & other );
    737737        virtual ~StmtExpr();
     
    743743        std::list< Expression * > & get_dtors() { return dtors; }
    744744
    745         virtual StmtExpr *clone() const { return new StmtExpr( *this ); }
    746         virtual void accept( Visitor &v ) { v.visit( this ); }
    747         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    748         virtual void print( std::ostream &os, int indent = 0 ) const;
     745        virtual StmtExpr * clone() const { return new StmtExpr( * this ); }
     746        virtual void accept( Visitor & v ) { v.visit( this ); }
     747        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     748        virtual void print( std::ostream & os, int indent = 0 ) const;
    749749private:
    750750        CompoundStmt * statements;
     
    770770        int get_id() const { return id; }
    771771
    772         virtual UniqueExpr *clone() const { return new UniqueExpr( *this ); }
    773         virtual void accept( Visitor &v ) { v.visit( this ); }
    774         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    775         virtual void print( std::ostream &os, int indent = 0 ) const;
     772        virtual UniqueExpr * clone() const { return new UniqueExpr( * this ); }
     773        virtual void accept( Visitor & v ) { v.visit( this ); }
     774        virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
     775        virtual void print( std::ostream & os, int indent = 0 ) const;
    776776private:
    777777        Expression * expr;
Note: See TracChangeset for help on using the changeset viewer.