Changeset 4a60488 for src/SynTree/Expression.h
- Timestamp:
- Sep 27, 2019, 3:35:46 PM (6 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 90ce35aa
- Parents:
- 8e1467d (diff), 849720f (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
r8e1467d r4a60488 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Peter A. Buhr12 // Last Modified On : Mon Feb 18 18:29:51201913 // Update Count : 4911 // Last Modified By : Andrew Beach 12 // Last Modified On : Thr Aug 15 13:46:00 2019 13 // Update Count : 54 14 14 // 15 15 … … 71 71 const Type * get_result() const { return result; } 72 72 void set_result( Type * newValue ) { result = newValue; } 73 virtual bool get_lvalue() const; 73 74 74 75 TypeSubstitution * get_env() const { return env; } … … 98 99 virtual ~ApplicationExpr(); 99 100 101 bool get_lvalue() const final; 102 100 103 Expression * get_function() const { return function; } 101 104 void set_function( Expression * newValue ) { function = newValue; } … … 120 123 UntypedExpr( const UntypedExpr & other ); 121 124 virtual ~UntypedExpr(); 125 126 bool get_lvalue() const final; 122 127 123 128 Expression * get_function() const { return function; } … … 208 213 virtual ~CastExpr(); 209 214 215 bool get_lvalue() const final; 216 210 217 Expression * get_arg() const { return arg; } 211 218 void set_arg( Expression * newValue ) { arg = newValue; } … … 268 275 virtual ~UntypedMemberExpr(); 269 276 277 bool get_lvalue() const final; 278 270 279 Expression * get_member() const { return member; } 271 280 void set_member( Expression * newValue ) { member = newValue; } … … 291 300 virtual ~MemberExpr(); 292 301 302 bool get_lvalue() const final; 303 293 304 DeclarationWithType * get_member() const { return member; } 294 305 void set_member( DeclarationWithType * newValue ) { member = newValue; } … … 313 324 VariableExpr( const VariableExpr & other ); 314 325 virtual ~VariableExpr(); 326 327 bool get_lvalue() const final; 315 328 316 329 DeclarationWithType * get_var() const { return var; } … … 463 476 }; 464 477 465 /// AttrExpr represents an @attribute expression (like sizeof, but user-defined)466 class AttrExpr : public Expression {467 public:468 Expression * attr;469 Expression * expr;470 Type * type;471 bool isType;472 473 AttrExpr(Expression * attr, Expression * expr );474 AttrExpr( const AttrExpr & other );475 AttrExpr( Expression * attr, Type * type );476 virtual ~AttrExpr();477 478 Expression * get_attr() const { return attr; }479 void set_attr( Expression * newValue ) { attr = newValue; }480 Expression * get_expr() const { return expr; }481 void set_expr( Expression * newValue ) { expr = newValue; }482 Type * get_type() const { return type; }483 void set_type( Type * newValue ) { type = newValue; }484 bool get_isType() const { return isType; }485 void set_isType( bool newValue ) { isType = newValue; }486 487 virtual AttrExpr * clone() const override { return new AttrExpr( * this ); }488 virtual void accept( Visitor & v ) override { v.visit( this ); }489 virtual void accept( Visitor & v ) const override { v.visit( this ); }490 virtual Expression * acceptMutator( Mutator & m ) override { return m.mutate( this ); }491 virtual void print( std::ostream & os, Indenter indent = {} ) const override;492 };493 494 478 /// LogicalExpr represents a short-circuit boolean expression (&& or ||) 495 479 class LogicalExpr : public Expression { … … 528 512 ConditionalExpr( const ConditionalExpr & other ); 529 513 virtual ~ConditionalExpr(); 514 515 bool get_lvalue() const final; 530 516 531 517 Expression * get_arg1() const { return arg1; } … … 553 539 virtual ~CommaExpr(); 554 540 541 bool get_lvalue() const final; 542 555 543 Expression * get_arg1() const { return arg1; } 556 544 void set_arg1( Expression * newValue ) { arg1 = newValue; } … … 639 627 ~ConstructorExpr(); 640 628 629 bool get_lvalue() const final; 630 641 631 Expression * get_callExpr() const { return callExpr; } 642 632 void set_callExpr( Expression * newValue ) { callExpr = newValue; } … … 657 647 CompoundLiteralExpr( const CompoundLiteralExpr & other ); 658 648 virtual ~CompoundLiteralExpr(); 649 650 bool get_lvalue() const final; 659 651 660 652 Initializer * get_initializer() const { return initializer; } … … 715 707 virtual ~TupleExpr(); 716 708 709 bool get_lvalue() const final; 710 717 711 std::list<Expression*>& get_exprs() { return exprs; } 718 712 … … 733 727 TupleIndexExpr( const TupleIndexExpr & other ); 734 728 virtual ~TupleIndexExpr(); 729 730 bool get_lvalue() const final; 735 731 736 732 Expression * get_tuple() const { return tuple; } … … 782 778 StmtExpr( const StmtExpr & other ); 783 779 virtual ~StmtExpr(); 780 781 bool get_lvalue() const final; 784 782 785 783 CompoundStmt * get_statements() const { return statements; }
Note:
See TracChangeset
for help on using the changeset viewer.