Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r5d00425 r312029a  
    99// Author           : Richard C. Bilson
    1010// Created On       : Mon May 18 07:44:20 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Thr Aug 15 13:46:00 2019
    13 // Update Count     : 54
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Dec 11 16:50:19 2019
     13// Update Count     : 60
    1414//
    1515
     
    2828#include "Label.h"                // for Label
    2929#include "Mutator.h"              // for Mutator
     30#include "Declaration.h"          // for Aggregate
    3031#include "SynTree.h"              // for UniqueId
    3132#include "Visitor.h"              // for Visitor
     
    229230public:
    230231        Expression * arg;
    231         enum Target {
    232                 Coroutine, Thread, Monitor, NUMBER_OF_TARGETS
    233         } target;
    234 
    235         KeywordCastExpr( Expression * arg, Target target );
     232        struct Concrete {
     233                std::string field;
     234                std::string getter;
     235        };
     236        AggregateDecl::Aggregate target;
     237        Concrete concrete_target;
     238
     239        KeywordCastExpr( Expression * arg, AggregateDecl::Aggregate target );
    236240        KeywordCastExpr( const KeywordCastExpr & other );
    237241        virtual ~KeywordCastExpr();
    238242
    239         const std::string & targetString() const;
     243        const char * targetString() const;
    240244
    241245        virtual KeywordCastExpr * clone() const override { return new KeywordCastExpr( * this ); }
     
    274278        UntypedMemberExpr( const UntypedMemberExpr & other );
    275279        virtual ~UntypedMemberExpr();
     280
     281        bool get_lvalue() const final;
    276282
    277283        Expression * get_member() const { return member; }
     
    573579class AsmExpr : public Expression {
    574580  public:
    575         Expression * inout;
     581        std::string inout;
    576582        Expression * constraint;
    577583        Expression * operand;
    578584
    579         AsmExpr( Expression * inout, Expression * constraint, Expression * operand ) : inout( inout ), constraint( constraint ), operand( operand ) {}
     585        AsmExpr( const std::string * _inout, Expression * constraint, Expression * operand ) : inout( _inout ? *_inout : "" ), constraint( constraint ), operand( operand ) { delete _inout; }
    580586        AsmExpr( const AsmExpr & other );
    581         virtual ~AsmExpr() { delete inout; delete constraint; delete operand; };
    582 
    583         Expression * get_inout() const { return inout; }
    584         void set_inout( Expression * newValue ) { inout = newValue; }
    585 
    586         Expression * get_constraint() const { return constraint; }
    587         void set_constraint( Expression * newValue ) { constraint = newValue; }
    588 
    589         Expression * get_operand() const { return operand; }
    590         void set_operand( Expression * newValue ) { operand = newValue; }
     587        virtual ~AsmExpr() { delete constraint; delete operand; };
    591588
    592589        virtual AsmExpr * clone() const override { return new AsmExpr( * this ); }
Note: See TracChangeset for help on using the changeset viewer.