Changeset 14388c1
- Timestamp:
- Aug 13, 2019, 2:03:37 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 1118b8b
- Parents:
- 7d01cf44
- Location:
- src/SynTree
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/ApplicationExpr.cc
r7d01cf44 r14388c1 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Tue Apr 26 12:41:06 201613 // Update Count : 411 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Aug 12 14:28:00 2019 13 // Update Count : 5 14 14 // 15 15 … … 76 76 } 77 77 78 bool ApplicationExpr::get_lvalue() const { 79 return result->get_lvalue(); 80 } 81 78 82 void ApplicationExpr::print( std::ostream &os, Indenter indent ) const { 79 83 os << "Application of" << std::endl << indent+1; -
src/SynTree/CommaExpr.cc
r7d01cf44 r14388c1 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Mon May 02 15:19:44201613 // Update Count : 111 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Arg 12 16:11:00 2016 13 // Update Count : 2 14 14 // 15 15 … … 39 39 } 40 40 41 bool CommaExpr::get_lvalue() const { 42 // xxx - as above, shouldn't be an lvalue but that information is used anyways. 43 return result->get_lvalue(); 44 } 45 41 46 void CommaExpr::print( std::ostream &os, Indenter indent ) const { 42 47 os << "Comma Expression:" << std::endl; -
src/SynTree/Expression.cc
r7d01cf44 r14388c1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 7 17:03:00 201913 // Update Count : 6 212 // Last Modified On : Tue Aug 13 11:31:00 2019 13 // Update Count : 63 14 14 // 15 15 … … 64 64 65 65 bool Expression::get_lvalue() const { 66 return result->get_lvalue(); 66 assert( !result->get_lvalue() ); 67 return false; 67 68 } 68 69 … … 138 139 } 139 140 141 bool VariableExpr::get_lvalue() const { 142 return result->get_lvalue(); 143 } 144 140 145 VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) { 141 146 VariableExpr * funcExpr = new VariableExpr( func ); … … 269 274 CastExpr::~CastExpr() { 270 275 delete arg; 276 } 277 278 bool CastExpr::get_lvalue() const { 279 return result->get_lvalue(); 271 280 } 272 281 … … 380 389 // don't delete the member declaration, since it points somewhere else in the tree 381 390 delete aggregate; 391 } 392 393 bool MemberExpr::get_lvalue() const { 394 assert( result->get_lvalue() ); 395 return true; 382 396 } 383 397 … … 432 446 } 433 447 448 bool UntypedExpr::get_lvalue() const { 449 return result->get_lvalue(); 450 } 434 451 435 452 void UntypedExpr::print( std::ostream & os, Indenter indent ) const { … … 490 507 delete arg2; 491 508 delete arg3; 509 } 510 511 bool ConditionalExpr::get_lvalue() const { 512 return result->get_lvalue(); 492 513 } 493 514 … … 548 569 } 549 570 571 bool ConstructorExpr::get_lvalue() const { 572 return result->get_lvalue(); 573 } 574 550 575 void ConstructorExpr::print( std::ostream & os, Indenter indent ) const { 551 576 os << "Constructor Expression: " << std::endl << indent+1; … … 565 590 CompoundLiteralExpr::~CompoundLiteralExpr() { 566 591 delete initializer; 592 } 593 594 bool CompoundLiteralExpr::get_lvalue() const { 595 assert( result->get_lvalue() ); 596 return true; 567 597 } 568 598 -
src/SynTree/Expression.h
r7d01cf44 r14388c1 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Andrew Beach 12 // Last Modified On : Wed Aug 7 16:56:00 201913 // Update Count : 5 112 // Last Modified On : Tue Aug 13 11:30:00 2019 13 // Update Count : 52 14 14 // 15 15 … … 71 71 const Type * get_result() const { return result; } 72 72 void set_result( Type * newValue ) { result = newValue; } 73 bool get_lvalue() const;73 virtual bool get_lvalue() const; 74 74 75 75 TypeSubstitution * get_env() const { return env; } … … 99 99 virtual ~ApplicationExpr(); 100 100 101 bool get_lvalue() const final; 102 101 103 Expression * get_function() const { return function; } 102 104 void set_function( Expression * newValue ) { function = newValue; } … … 121 123 UntypedExpr( const UntypedExpr & other ); 122 124 virtual ~UntypedExpr(); 125 126 bool get_lvalue() const final; 123 127 124 128 Expression * get_function() const { return function; } … … 209 213 virtual ~CastExpr(); 210 214 215 bool get_lvalue() const final; 216 211 217 Expression * get_arg() const { return arg; } 212 218 void set_arg( Expression * newValue ) { arg = newValue; } … … 292 298 virtual ~MemberExpr(); 293 299 300 bool get_lvalue() const final; 301 294 302 DeclarationWithType * get_member() const { return member; } 295 303 void set_member( DeclarationWithType * newValue ) { member = newValue; } … … 314 322 VariableExpr( const VariableExpr & other ); 315 323 virtual ~VariableExpr(); 324 325 bool get_lvalue() const final; 316 326 317 327 DeclarationWithType * get_var() const { return var; } … … 501 511 virtual ~ConditionalExpr(); 502 512 513 bool get_lvalue() const final; 514 503 515 Expression * get_arg1() const { return arg1; } 504 516 void set_arg1( Expression * newValue ) { arg1 = newValue; } … … 525 537 virtual ~CommaExpr(); 526 538 539 bool get_lvalue() const final; 540 527 541 Expression * get_arg1() const { return arg1; } 528 542 void set_arg1( Expression * newValue ) { arg1 = newValue; } … … 611 625 ~ConstructorExpr(); 612 626 627 bool get_lvalue() const final; 628 613 629 Expression * get_callExpr() const { return callExpr; } 614 630 void set_callExpr( Expression * newValue ) { callExpr = newValue; } … … 629 645 CompoundLiteralExpr( const CompoundLiteralExpr & other ); 630 646 virtual ~CompoundLiteralExpr(); 647 648 bool get_lvalue() const final; 631 649 632 650 Initializer * get_initializer() const { return initializer; } … … 705 723 TupleIndexExpr( const TupleIndexExpr & other ); 706 724 virtual ~TupleIndexExpr(); 725 726 bool get_lvalue() const final; 707 727 708 728 Expression * get_tuple() const { return tuple; } -
src/SynTree/TupleExpr.cc
r7d01cf44 r14388c1 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 : Fri Mar 17 09:42:29 201713 // Update Count : 311 // Last Modified By : Andrew Beach 12 // Last Modified On : Mon Aug 12 14:22:00 2019 13 // Update Count : 4 14 14 // 15 15 … … 78 78 } 79 79 80 bool TupleIndexExpr::get_lvalue() const { 81 assert( result->get_lvalue() ); 82 return true; 83 } 84 80 85 void TupleIndexExpr::print( std::ostream &os, Indenter indent ) const { 81 86 os << "Tuple Index Expression, with tuple:" << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.