Changes in src/AST/Expr.hpp [e67991f:cf32116]
- File:
-
- 1 edited
-
src/AST/Expr.hpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/AST/Expr.hpp
re67991f rcf32116 9 9 // Author : Aaron B. Moss 10 10 // Created On : Fri May 10 10:30:00 2019 11 // Last Modified By : A aron B. Moss12 // Created On : Fri May 10 10:30:00 201913 // Update Count : 111 // Last Modified By : Andrew Beach 12 // Created On : Thr Sep 26 12:51:00 2019 13 // Update Count : 2 14 14 // 15 15 … … 30 30 31 31 // Must be included in *all* AST classes; should be #undef'd at the end of the file 32 #define MUTATE_FRIEND template<typename node_t> friend node_t * mutate(const node_t * node); 32 #define MUTATE_FRIEND \ 33 template<typename node_t> friend node_t * mutate(const node_t * node); \ 34 template<typename node_t> friend node_t * shallowCopy(const node_t * node); 35 33 36 34 37 class ConverterOldToNew; … … 184 187 185 188 Expr * set_extension( bool ex ) { extension = ex; return this; } 189 virtual bool get_lvalue() const; 186 190 187 191 virtual const Expr * accept( Visitor & v ) const override = 0; … … 200 204 ApplicationExpr( const CodeLocation & loc, const Expr * f, std::vector<ptr<Expr>> && as = {} ); 201 205 206 bool get_lvalue() const final; 207 202 208 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 203 209 private: … … 214 220 UntypedExpr( const CodeLocation & loc, const Expr * f, std::vector<ptr<Expr>> && as = {} ) 215 221 : Expr( loc ), func( f ), args( std::move(as) ) {} 222 223 bool get_lvalue() const final; 216 224 217 225 /// Creates a new dereference expression … … 290 298 CastExpr( const Expr * a ) : CastExpr( a->location, a, GeneratedCast ) {} 291 299 300 bool get_lvalue() const final; 301 292 302 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 293 303 private: … … 337 347 : Expr( loc ), member( mem ), aggregate( agg ) { assert( aggregate ); } 338 348 349 bool get_lvalue() const final; 350 339 351 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 340 352 private: … … 351 363 MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg ); 352 364 365 bool get_lvalue() const final; 366 353 367 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 354 368 private: 355 369 MemberExpr * clone() const override { return new MemberExpr{ *this }; } 356 370 MUTATE_FRIEND 371 372 // Custructor overload meant only for AST conversion 373 enum NoOpConstruction { NoOpConstructionChosen }; 374 MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg, 375 NoOpConstruction overloadSelector ); 376 friend class ::ConverterOldToNew; 377 friend class ::ConverterNewToOld; 357 378 }; 358 379 … … 364 385 VariableExpr( const CodeLocation & loc ); 365 386 VariableExpr( const CodeLocation & loc, const DeclWithType * v ); 387 388 bool get_lvalue() const final; 366 389 367 390 /// generates a function pointer for a given function … … 531 554 532 555 CommaExpr( const CodeLocation & loc, const Expr * a1, const Expr * a2 ) 533 : Expr( loc ), arg1( a1 ), arg2( a2 ) {} 556 : Expr( loc ), arg1( a1 ), arg2( a2 ) { 557 this->result = a2->result; 558 } 559 560 bool get_lvalue() const final; 534 561 535 562 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } … … 604 631 CompoundLiteralExpr( const CodeLocation & loc, const Type * t, const Init * i ); 605 632 633 bool get_lvalue() const final; 634 606 635 const Expr * accept( Visitor & v ) const override { return v.visit( this ); } 607 636 private: … … 659 688 660 689 TupleIndexExpr( const CodeLocation & loc, const Expr * t, unsigned i ); 690 691 bool get_lvalue() const final; 661 692 662 693 const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
Note:
See TracChangeset
for help on using the changeset viewer.