Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    rcf32116 re67991f  
    99// Author           : Aaron B. Moss
    1010// Created On       : Fri May 10 10:30:00 2019
    11 // Last Modified By : Andrew Beach
    12 // Created On       : Thr Sep 26 12:51:00 2019
    13 // Update Count     : 2
     11// Last Modified By : Aaron B. Moss
     12// Created On       : Fri May 10 10:30:00 2019
     13// Update Count     : 1
    1414//
    1515
     
    3030
    3131// 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);
    3633
    3734class ConverterOldToNew;
     
    187184
    188185        Expr * set_extension( bool ex ) { extension = ex; return this; }
    189         virtual bool get_lvalue() const;
    190186
    191187        virtual const Expr * accept( Visitor & v ) const override = 0;
     
    204200        ApplicationExpr( const CodeLocation & loc, const Expr * f, std::vector<ptr<Expr>> && as = {} );
    205201
    206         bool get_lvalue() const final;
    207 
    208202        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    209203private:
     
    220214        UntypedExpr( const CodeLocation & loc, const Expr * f, std::vector<ptr<Expr>> && as = {} )
    221215        : Expr( loc ), func( f ), args( std::move(as) ) {}
    222 
    223         bool get_lvalue() const final;
    224216
    225217        /// Creates a new dereference expression
     
    298290        CastExpr( const Expr * a ) : CastExpr( a->location, a, GeneratedCast ) {}
    299291
    300         bool get_lvalue() const final;
    301 
    302292        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    303293private:
     
    347337        : Expr( loc ), member( mem ), aggregate( agg ) { assert( aggregate ); }
    348338
    349         bool get_lvalue() const final;
    350 
    351339        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    352340private:
     
    363351        MemberExpr( const CodeLocation & loc, const DeclWithType * mem, const Expr * agg );
    364352
    365         bool get_lvalue() const final;
    366 
    367353        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    368354private:
    369355        MemberExpr * clone() const override { return new MemberExpr{ *this }; }
    370356        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;
    378357};
    379358
     
    385364        VariableExpr( const CodeLocation & loc );
    386365        VariableExpr( const CodeLocation & loc, const DeclWithType * v );
    387 
    388         bool get_lvalue() const final;
    389366
    390367        /// generates a function pointer for a given function
     
    554531
    555532        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 ) {}
    561534
    562535        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
     
    631604        CompoundLiteralExpr( const CodeLocation & loc, const Type * t, const Init * i );
    632605
    633         bool get_lvalue() const final;
    634 
    635606        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
    636607private:
     
    688659
    689660        TupleIndexExpr( const CodeLocation & loc, const Expr * t, unsigned i );
    690 
    691         bool get_lvalue() const final;
    692661
    693662        const Expr * accept( Visitor & v ) const override { return v.visit( this ); }
Note: See TracChangeset for help on using the changeset viewer.