Changeset 7527e63 for src/SynTree/Expression.h
- Timestamp:
- Aug 16, 2016, 3:20:06 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 1f6d4624
- Parents:
- 950f7a7 (diff), 7880579 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.h
r950f7a7 r7527e63 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jul 4 14:45:32201613 // Update Count : 2312 // Last Modified On : Sat Aug 6 08:52:53 2016 13 // Update Count : 35 14 14 // 15 15 … … 18 18 19 19 #include <map> 20 #include <memory> 20 21 #include "SynTree.h" 21 22 #include "Visitor.h" … … 27 28 class Expression { 28 29 public: 29 Expression( Expression *_aname = 0);30 Expression( Expression *_aname = nullptr ); 30 31 Expression( const Expression &other ); 31 32 virtual ~Expression(); … … 69 70 typedef std::map< UniqueId, ParamEntry > InferredParams; 70 71 71 /// ApplicationExpr represents the application of a function to a set of parameters. This is the 72 /// result of running anUntypedExpr through the expression analyzer.72 /// ApplicationExpr represents the application of a function to a set of parameters. This is the result of running an 73 /// UntypedExpr through the expression analyzer. 73 74 class ApplicationExpr : public Expression { 74 75 public: … … 92 93 }; 93 94 94 /// UntypedExpr represents the application of a function to a set of parameters, but where the 95 /// particular overload for the function name has not yet been determined. Most operators are96 /// converted into functional form automatically, topermit operator overloading.95 /// UntypedExpr represents the application of a function to a set of parameters, but where the particular overload for 96 /// the function name has not yet been determined. Most operators are converted into functional form automatically, to 97 /// permit operator overloading. 97 98 class UntypedExpr : public Expression { 98 99 public: 99 UntypedExpr( Expression *function, Expression *_aname = 0);100 UntypedExpr( Expression *function, Expression *_aname = nullptr ); 100 101 UntypedExpr( const UntypedExpr &other ); 101 UntypedExpr( Expression *function, std::list<Expression *> &args, Expression *_aname = 0);102 UntypedExpr( Expression *function, std::list<Expression *> &args, Expression *_aname = nullptr ); 102 103 virtual ~UntypedExpr(); 103 104 … … 123 124 class NameExpr : public Expression { 124 125 public: 125 NameExpr( std::string name, Expression *_aname = 0);126 NameExpr( std::string name, Expression *_aname = nullptr ); 126 127 NameExpr( const NameExpr &other ); 127 128 virtual ~NameExpr(); … … 144 145 class AddressExpr : public Expression { 145 146 public: 146 AddressExpr( Expression *arg, Expression *_aname = 0);147 AddressExpr( Expression *arg, Expression *_aname = nullptr ); 147 148 AddressExpr( const AddressExpr &other ); 148 149 virtual ~AddressExpr(); … … 180 181 class CastExpr : public Expression { 181 182 public: 182 CastExpr( Expression *arg, Expression *_aname = 0);183 CastExpr( Expression *arg, Type *toType, Expression *_aname = 0);183 CastExpr( Expression *arg, Expression *_aname = nullptr ); 184 CastExpr( Expression *arg, Type *toType, Expression *_aname = nullptr ); 184 185 CastExpr( const CastExpr &other ); 185 186 virtual ~CastExpr(); … … 199 200 class UntypedMemberExpr : public Expression { 200 201 public: 201 UntypedMemberExpr( std::string member, Expression *aggregate, Expression *_aname = 0);202 UntypedMemberExpr( std::string member, Expression *aggregate, Expression *_aname = nullptr ); 202 203 UntypedMemberExpr( const UntypedMemberExpr &other ); 203 204 virtual ~UntypedMemberExpr(); … … 220 221 class MemberExpr : public Expression { 221 222 public: 222 MemberExpr( DeclarationWithType *member, Expression *aggregate, Expression *_aname = 0);223 MemberExpr( DeclarationWithType *member, Expression *aggregate, Expression *_aname = nullptr ); 223 224 MemberExpr( const MemberExpr &other ); 224 225 virtual ~MemberExpr(); … … 241 242 class VariableExpr : public Expression { 242 243 public: 243 VariableExpr( DeclarationWithType *var, Expression *_aname = 0);244 VariableExpr( DeclarationWithType *var, Expression *_aname = nullptr ); 244 245 VariableExpr( const VariableExpr &other ); 245 246 virtual ~VariableExpr(); … … 259 260 class ConstantExpr : public Expression { 260 261 public: 261 ConstantExpr( Constant constant, Expression *_aname = 0);262 ConstantExpr( Constant constant, Expression *_aname = nullptr ); 262 263 ConstantExpr( const ConstantExpr &other ); 263 264 virtual ~ConstantExpr(); … … 277 278 class SizeofExpr : public Expression { 278 279 public: 279 SizeofExpr( Expression *expr, Expression *_aname = 0);280 SizeofExpr( Expression *expr, Expression *_aname = nullptr ); 280 281 SizeofExpr( const SizeofExpr &other ); 281 SizeofExpr( Type *type, Expression *_aname = 0);282 SizeofExpr( Type *type, Expression *_aname = nullptr ); 282 283 virtual ~SizeofExpr(); 283 284 … … 302 303 class AlignofExpr : public Expression { 303 304 public: 304 AlignofExpr( Expression *expr, Expression *_aname = 0);305 AlignofExpr( Expression *expr, Expression *_aname = nullptr ); 305 306 AlignofExpr( const AlignofExpr &other ); 306 AlignofExpr( Type *type, Expression *_aname = 0);307 AlignofExpr( Type *type, Expression *_aname = nullptr ); 307 308 virtual ~AlignofExpr(); 308 309 … … 327 328 class UntypedOffsetofExpr : public Expression { 328 329 public: 329 UntypedOffsetofExpr( Type *type, const std::string &member, Expression *_aname = 0);330 UntypedOffsetofExpr( Type *type, const std::string &member, Expression *_aname = nullptr ); 330 331 UntypedOffsetofExpr( const UntypedOffsetofExpr &other ); 331 332 virtual ~UntypedOffsetofExpr(); … … 348 349 class OffsetofExpr : public Expression { 349 350 public: 350 OffsetofExpr( Type *type, DeclarationWithType *member, Expression *_aname = 0);351 OffsetofExpr( Type *type, DeclarationWithType *member, Expression *_aname = nullptr ); 351 352 OffsetofExpr( const OffsetofExpr &other ); 352 353 virtual ~OffsetofExpr(); … … 389 390 class AttrExpr : public Expression { 390 391 public: 391 AttrExpr(Expression *attr, Expression *expr, Expression *_aname = 0);392 AttrExpr(Expression *attr, Expression *expr, Expression *_aname = nullptr ); 392 393 AttrExpr( const AttrExpr &other ); 393 AttrExpr( Expression *attr, Type *type, Expression *_aname = 0);394 AttrExpr( Expression *attr, Type *type, Expression *_aname = nullptr ); 394 395 virtual ~AttrExpr(); 395 396 … … 417 418 class LogicalExpr : public Expression { 418 419 public: 419 LogicalExpr( Expression *arg1, Expression *arg2, bool andp = true, Expression *_aname = 0);420 LogicalExpr( Expression *arg1, Expression *arg2, bool andp = true, Expression *_aname = nullptr ); 420 421 LogicalExpr( const LogicalExpr &other ); 421 422 virtual ~LogicalExpr(); … … 440 441 class ConditionalExpr : public Expression { 441 442 public: 442 ConditionalExpr( Expression *arg1, Expression *arg2, Expression *arg3, Expression *_aname = 0);443 ConditionalExpr( Expression *arg1, Expression *arg2, Expression *arg3, Expression *_aname = nullptr ); 443 444 ConditionalExpr( const ConditionalExpr &other ); 444 445 virtual ~ConditionalExpr(); … … 464 465 class CommaExpr : public Expression { 465 466 public: 466 CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname = 0);467 CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname = nullptr ); 467 468 CommaExpr( const CommaExpr &other ); 468 469 virtual ~CommaExpr(); … … 485 486 class TupleExpr : public Expression { 486 487 public: 487 TupleExpr( Expression *_aname = 0);488 TupleExpr( Expression *_aname = nullptr ); 488 489 TupleExpr( const TupleExpr &other ); 489 490 virtual ~TupleExpr(); … … 503 504 class SolvedTupleExpr : public Expression { 504 505 public: 505 SolvedTupleExpr( Expression *_aname = 0) : Expression( _aname ) {}506 SolvedTupleExpr( std::list<Expression *> &, Expression *_aname = 0);506 SolvedTupleExpr( Expression *_aname = nullptr ) : Expression( _aname ) {} 507 SolvedTupleExpr( std::list<Expression *> &, Expression *_aname = nullptr ); 507 508 SolvedTupleExpr( const SolvedTupleExpr &other ); 508 509 virtual ~SolvedTupleExpr() {} … … 597 598 class UntypedValofExpr : public Expression { 598 599 public: 599 UntypedValofExpr( Statement *_body, Expression *_aname = 0) : Expression( _aname ), body ( _body ) {}600 UntypedValofExpr( Statement *_body, Expression *_aname = nullptr ) : Expression( _aname ), body ( _body ) {} 600 601 UntypedValofExpr( const UntypedValofExpr & other ); 601 602 virtual ~UntypedValofExpr(); … … 632 633 Type * type; 633 634 Initializer * initializer; 635 }; 636 637 class RangeExpr : public Expression { 638 public: 639 RangeExpr( Expression *low, Expression *high ); 640 RangeExpr( const RangeExpr &other ); 641 642 Expression * get_low() const { return low; } 643 Expression * get_high() const { return high; } 644 RangeExpr * set_low( Expression *low ) { RangeExpr::low = low; return this; } 645 RangeExpr * set_high( Expression *high ) { RangeExpr::high = high; return this; } 646 647 virtual RangeExpr *clone() const { return new RangeExpr( *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 private: 652 Expression *low, *high; 634 653 }; 635 654
Note:
See TracChangeset
for help on using the changeset viewer.