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