Changeset 5ded739
- Timestamp:
- Jan 18, 2017, 4:58:22 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- f8b6d921
- Parents:
- 44a81853
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.h
r44a81853 r5ded739 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Aug 6 08:52:53 201613 // Update Count : 3 512 // Last Modified On : Sat Jan 14 14:37:54 2017 13 // Update Count : 37 14 14 // 15 15 … … 28 28 class Expression { 29 29 public: 30 Expression( Expression * _aname = nullptr );31 Expression( const Expression & other );30 Expression( Expression * _aname = nullptr ); 31 Expression( const Expression & other ); 32 32 virtual ~Expression(); 33 33 34 34 Type *& get_result() { return result; } 35 void set_result( Type * newValue ) { result = newValue; }35 void set_result( Type * newValue ) { result = newValue; } 36 36 bool has_result() const { return result != nullptr; } 37 37 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; } 42 42 bool get_extension() const { return extension; } 43 43 Expression * set_extension( bool exten ) { extension = exten; return this; } 44 44 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; 49 49 protected: 50 50 Type * result; 51 TypeSubstitution * env;52 Expression * argName; // if expression is used as an argument, it can be "designated" by this name51 TypeSubstitution * env; 52 Expression * argName; // if expression is used as an argument, it can be "designated" by this name 53 53 bool extension = false; 54 54 }; … … 61 61 struct ParamEntry { 62 62 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 ); 65 65 ~ParamEntry(); 66 ParamEntry & operator=( const ParamEntry &other );66 ParamEntry & operator=( const ParamEntry & other ); 67 67 68 68 UniqueId decl; 69 Type * actualType;70 Type * formalType;69 Type * actualType; 70 Type * formalType; 71 71 Expression* expr; 72 72 std::unique_ptr< InferredParams > inferParams; … … 77 77 class ApplicationExpr : public Expression { 78 78 public: 79 ApplicationExpr( Expression * function );80 ApplicationExpr( const ApplicationExpr & other );79 ApplicationExpr( Expression * function ); 80 ApplicationExpr( const ApplicationExpr & other ); 81 81 virtual ~ApplicationExpr(); 82 82 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; } 85 85 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; 94 94 std::list<Expression *> args; 95 95 InferredParams inferParams; … … 101 101 class UntypedExpr : public Expression { 102 102 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 ); 105 105 virtual ~UntypedExpr(); 106 106 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; } 111 111 std::list<Expression*>::iterator begin_args() { return args.begin(); } 112 112 std::list<Expression*>::iterator end_args() { return args.end(); } … … 116 116 static UntypedExpr * createAssign( Expression * arg1, Expression * arg2 ); 117 117 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; 125 125 std::list<Expression*> args; 126 126 }; … … 130 130 public: 131 131 NameExpr( std::string name, Expression *_aname = nullptr ); 132 NameExpr( const NameExpr & other );132 NameExpr( const NameExpr & other ); 133 133 virtual ~NameExpr(); 134 134 135 const std::string & get_name() const { return name; }135 const std::string & get_name() const { return name; } 136 136 void set_name( std::string newValue ) { name = newValue; } 137 137 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; 142 142 private: 143 143 std::string name; … … 147 147 // function-call format. 148 148 149 /// AddressExpr represents a address-of expression, e.g. & e149 /// AddressExpr represents a address-of expression, e.g. & e 150 150 class AddressExpr : public Expression { 151 151 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 ); 154 154 virtual ~AddressExpr(); 155 155 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; 165 165 }; 166 166 … … 168 168 class LabelAddressExpr : public Expression { 169 169 public: 170 LabelAddressExpr( Expression * arg );171 LabelAddressExpr( const LabelAddressExpr & other );170 LabelAddressExpr( Expression * arg ); 171 LabelAddressExpr( const LabelAddressExpr & other ); 172 172 virtual ~LabelAddressExpr(); 173 173 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; 183 183 }; 184 184 … … 186 186 class CastExpr : public Expression { 187 187 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 ); 191 191 virtual ~CastExpr(); 192 192 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; 202 202 }; 203 203 … … 205 205 class UntypedMemberExpr : public Expression { 206 206 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 ); 209 209 virtual ~UntypedMemberExpr(); 210 210 211 211 Expression * get_member() const { return member; } 212 212 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; 223 223 }; 224 224 … … 226 226 class MemberExpr : public Expression { 227 227 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 ); 230 230 virtual ~MemberExpr(); 231 231 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; 244 244 }; 245 245 … … 247 247 class VariableExpr : public Expression { 248 248 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 ); 251 251 virtual ~VariableExpr(); 252 252 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; 262 262 }; 263 263 … … 266 266 public: 267 267 ConstantExpr( Constant constant, Expression *_aname = nullptr ); 268 ConstantExpr( const ConstantExpr & other );268 ConstantExpr( const ConstantExpr & other ); 269 269 virtual ~ConstantExpr(); 270 270 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; 278 278 private: 279 279 Constant constant; … … 283 283 class SizeofExpr : public Expression { 284 284 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 ); 288 288 virtual ~SizeofExpr(); 289 289 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; } 294 294 bool get_isType() const { return isType; } 295 295 void set_isType( bool newValue ) { isType = newValue; } 296 296 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; 304 304 bool isType; 305 305 }; … … 308 308 class AlignofExpr : public Expression { 309 309 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 ); 313 313 virtual ~AlignofExpr(); 314 314 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; } 319 319 bool get_isType() const { return isType; } 320 320 void set_isType( bool newValue ) { isType = newValue; } 321 321 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; 329 329 bool isType; 330 330 }; … … 333 333 class UntypedOffsetofExpr : public Expression { 334 334 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 ); 337 337 virtual ~UntypedOffsetofExpr(); 338 338 339 339 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; 350 350 std::string member; 351 351 }; … … 354 354 class OffsetofExpr : public Expression { 355 355 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 ); 358 358 virtual ~OffsetofExpr(); 359 359 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; 372 372 }; 373 373 … … 375 375 class OffsetPackExpr : public Expression { 376 376 public: 377 OffsetPackExpr( StructInstType * type_, Expression *aname_ = 0 );378 OffsetPackExpr( const OffsetPackExpr & other );377 OffsetPackExpr( StructInstType * type_, Expression * aname_ = 0 ); 378 OffsetPackExpr( const OffsetPackExpr & other ); 379 379 virtual ~OffsetPackExpr(); 380 380 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; 389 389 390 390 private: 391 StructInstType * type;391 StructInstType * type; 392 392 }; 393 393 … … 395 395 class AttrExpr : public Expression { 396 396 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 ); 400 400 virtual ~AttrExpr(); 401 401 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; } 408 408 bool get_isType() const { return isType; } 409 409 void set_isType( bool newValue ) { isType = newValue; } 410 410 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; 419 419 bool isType; 420 420 }; … … 423 423 class LogicalExpr : public Expression { 424 424 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 ); 427 427 virtual ~LogicalExpr(); 428 428 429 429 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; 442 442 bool isAnd; 443 443 }; … … 446 446 class ConditionalExpr : public Expression { 447 447 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 ); 450 450 virtual ~ConditionalExpr(); 451 451 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; 467 467 }; 468 468 … … 470 470 class CommaExpr : public Expression { 471 471 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 ); 474 474 virtual ~CommaExpr(); 475 475 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; 488 488 }; 489 489 … … 491 491 class TypeExpr : public Expression { 492 492 public: 493 TypeExpr( Type * type );494 TypeExpr( const TypeExpr & other );493 TypeExpr( Type * type ); 494 TypeExpr( const TypeExpr & other ); 495 495 virtual ~TypeExpr(); 496 496 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; 506 506 }; 507 507 … … 509 509 class AsmExpr : public Expression { 510 510 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 ) {} 512 512 AsmExpr( const AsmExpr & other ); 513 513 virtual ~AsmExpr() { delete inout; delete constraint; delete operand; }; 514 514 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; 528 528 private: 529 529 // 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; 533 533 }; 534 534 … … 541 541 virtual ~ImplicitCopyCtorExpr(); 542 542 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; } 545 545 546 546 std::list< ObjectDecl * > & get_tempDecls() { return tempDecls; } … … 548 548 std::list< Expression * > & get_dtors() { return dtors; } 549 549 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; 554 554 private: 555 555 ApplicationExpr * callExpr; … … 566 566 ~ConstructorExpr(); 567 567 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; 575 575 private: 576 576 Expression * callExpr; … … 581 581 public: 582 582 CompoundLiteralExpr( Type * type, Initializer * initializer ); 583 CompoundLiteralExpr( const CompoundLiteralExpr & other );583 CompoundLiteralExpr( const CompoundLiteralExpr & other ); 584 584 virtual ~CompoundLiteralExpr(); 585 585 … … 590 590 void set_initializer( Initializer * i ) { initializer = i; } 591 591 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; 596 596 private: 597 597 Type * type; … … 606 606 virtual ~UntypedValofExpr(); 607 607 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; 617 617 }; 618 618 … … 620 620 class RangeExpr : public Expression { 621 621 public: 622 RangeExpr( Expression * low, Expression *high );623 RangeExpr( const RangeExpr & other );622 RangeExpr( Expression * low, Expression * high ); 623 RangeExpr( const RangeExpr & other ); 624 624 625 625 Expression * get_low() const { return low; } 626 626 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; 636 636 }; 637 637 … … 640 640 public: 641 641 UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr ); 642 UntypedTupleExpr( const UntypedTupleExpr & other );642 UntypedTupleExpr( const UntypedTupleExpr & other ); 643 643 virtual ~UntypedTupleExpr(); 644 644 645 645 std::list<Expression*>& get_exprs() { return exprs; } 646 646 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; 651 651 private: 652 652 std::list<Expression*> exprs; … … 657 657 public: 658 658 TupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr ); 659 TupleExpr( const TupleExpr & other );659 TupleExpr( const TupleExpr & other ); 660 660 virtual ~TupleExpr(); 661 661 662 662 std::list<Expression*>& get_exprs() { return exprs; } 663 663 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; 668 668 private: 669 669 std::list<Expression*> exprs; … … 674 674 public: 675 675 TupleIndexExpr( Expression * tuple, unsigned int index ); 676 TupleIndexExpr( const TupleIndexExpr & other );676 TupleIndexExpr( const TupleIndexExpr & other ); 677 677 virtual ~TupleIndexExpr(); 678 678 679 679 Expression * get_tuple() const { return tuple; } 680 680 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; } 682 682 TupleIndexExpr * set_index( unsigned int newValue ) { index = newValue; return this; } 683 683 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; 688 688 private: 689 689 Expression * tuple; … … 695 695 public: 696 696 MemberTupleExpr( Expression * member, Expression * aggregate, Expression * _aname = nullptr ); 697 MemberTupleExpr( const MemberTupleExpr & other );697 MemberTupleExpr( const MemberTupleExpr & other ); 698 698 virtual ~MemberTupleExpr(); 699 699 700 700 Expression * get_member() const { return member; } 701 701 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; 709 709 private: 710 710 Expression * member; … … 716 716 public: 717 717 TupleAssignExpr( const std::list< Expression * > & assigns, const std::list< ObjectDecl * > & tempDecls, Expression * _aname = nullptr ); 718 TupleAssignExpr( const TupleAssignExpr & other );718 TupleAssignExpr( const TupleAssignExpr & other ); 719 719 virtual ~TupleAssignExpr(); 720 720 … … 722 722 StmtExpr * get_stmtExpr() const { return stmtExpr; } 723 723 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; 728 728 private: 729 729 StmtExpr * stmtExpr = nullptr; … … 733 733 class StmtExpr : public Expression { 734 734 public: 735 StmtExpr( CompoundStmt * statements );735 StmtExpr( CompoundStmt * statements ); 736 736 StmtExpr( const StmtExpr & other ); 737 737 virtual ~StmtExpr(); … … 743 743 std::list< Expression * > & get_dtors() { return dtors; } 744 744 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; 749 749 private: 750 750 CompoundStmt * statements; … … 770 770 int get_id() const { return id; } 771 771 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; 776 776 private: 777 777 Expression * expr;
Note: See TracChangeset
for help on using the changeset viewer.