Ignore:
Timestamp:
Sep 27, 2019, 3:35:46 PM (6 years ago)
Author:
Andrew Beach <ajbeach@…>
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.
Message:

Merged from master taking the lvalue changes to expression and everything before that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r8e1467d r4a60488  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Feb 18 18:29:51 2019
    13 // Update Count     : 49
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Thr Aug 15 13:46:00 2019
     13// Update Count     : 54
    1414//
    1515
     
    7171        const Type * get_result() const { return result; }
    7272        void set_result( Type * newValue ) { result = newValue; }
     73        virtual bool get_lvalue() const;
    7374
    7475        TypeSubstitution * get_env() const { return env; }
     
    9899        virtual ~ApplicationExpr();
    99100
     101        bool get_lvalue() const final;
     102
    100103        Expression * get_function() const { return function; }
    101104        void set_function( Expression * newValue ) { function = newValue; }
     
    120123        UntypedExpr( const UntypedExpr & other );
    121124        virtual ~UntypedExpr();
     125
     126        bool get_lvalue() const final;
    122127
    123128        Expression * get_function() const { return function; }
     
    208213        virtual ~CastExpr();
    209214
     215        bool get_lvalue() const final;
     216
    210217        Expression * get_arg() const { return arg; }
    211218        void set_arg( Expression * newValue ) { arg = newValue; }
     
    268275        virtual ~UntypedMemberExpr();
    269276
     277        bool get_lvalue() const final;
     278
    270279        Expression * get_member() const { return member; }
    271280        void set_member( Expression * newValue ) { member = newValue; }
     
    291300        virtual ~MemberExpr();
    292301
     302        bool get_lvalue() const final;
     303
    293304        DeclarationWithType * get_member() const { return member; }
    294305        void set_member( DeclarationWithType * newValue ) { member = newValue; }
     
    313324        VariableExpr( const VariableExpr & other );
    314325        virtual ~VariableExpr();
     326
     327        bool get_lvalue() const final;
    315328
    316329        DeclarationWithType * get_var() const { return var; }
     
    463476};
    464477
    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 
    494478/// LogicalExpr represents a short-circuit boolean expression (&& or ||)
    495479class LogicalExpr : public Expression {
     
    528512        ConditionalExpr( const ConditionalExpr & other );
    529513        virtual ~ConditionalExpr();
     514
     515        bool get_lvalue() const final;
    530516
    531517        Expression * get_arg1() const { return arg1; }
     
    553539        virtual ~CommaExpr();
    554540
     541        bool get_lvalue() const final;
     542
    555543        Expression * get_arg1() const { return arg1; }
    556544        void set_arg1( Expression * newValue ) { arg1 = newValue; }
     
    639627        ~ConstructorExpr();
    640628
     629        bool get_lvalue() const final;
     630
    641631        Expression * get_callExpr() const { return callExpr; }
    642632        void set_callExpr( Expression * newValue ) { callExpr = newValue; }
     
    657647        CompoundLiteralExpr( const CompoundLiteralExpr & other );
    658648        virtual ~CompoundLiteralExpr();
     649
     650        bool get_lvalue() const final;
    659651
    660652        Initializer * get_initializer() const { return initializer; }
     
    715707        virtual ~TupleExpr();
    716708
     709        bool get_lvalue() const final;
     710
    717711        std::list<Expression*>& get_exprs() { return exprs; }
    718712
     
    733727        TupleIndexExpr( const TupleIndexExpr & other );
    734728        virtual ~TupleIndexExpr();
     729
     730        bool get_lvalue() const final;
    735731
    736732        Expression * get_tuple() const { return tuple; }
     
    782778        StmtExpr( const StmtExpr & other );
    783779        virtual ~StmtExpr();
     780
     781        bool get_lvalue() const final;
    784782
    785783        CompoundStmt * get_statements() const { return statements; }
Note: See TracChangeset for help on using the changeset viewer.