Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r8688ce1 r7bf7fb9  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug  3 17:08:44 2016
    13 // Update Count     : 27
     12// Last Modified On : Sat Aug  6 08:52:53 2016
     13// Update Count     : 35
    1414//
    1515
     
    2828class Expression {
    2929  public:
    30         Expression(Expression *_aname = 0 );
     30        Expression( Expression *_aname = nullptr );
    3131        Expression( const Expression &other );
    3232        virtual ~Expression();
     
    7070typedef std::map< UniqueId, ParamEntry > InferredParams;
    7171
    72 /// ApplicationExpr represents the application of a function to a set of parameters.  This is the
    73 /// result of running an UntypedExpr through the expression analyzer.
     72/// ApplicationExpr represents the application of a function to a set of parameters.  This is the result of running an
     73/// UntypedExpr through the expression analyzer.
    7474class ApplicationExpr : public Expression {
    7575  public:
     
    9393};
    9494
    95 /// UntypedExpr represents the application of a function to a set of parameters, but where the
    96 /// particular overload for the function name has not yet been determined.  Most operators are
    97 /// converted into functional form automatically, to permit operator overloading.
     95/// UntypedExpr represents the application of a function to a set of parameters, but where the particular overload for
     96/// the function name has not yet been determined.  Most operators are converted into functional form automatically, to
     97/// permit operator overloading.
    9898class UntypedExpr : public Expression {
    9999  public:
    100         UntypedExpr( Expression *function, Expression *_aname = 0 );
     100        UntypedExpr( Expression *function, Expression *_aname = nullptr );
    101101        UntypedExpr( const UntypedExpr &other );
    102         UntypedExpr( Expression *function, std::list<Expression *> &args, Expression *_aname = 0 );
     102        UntypedExpr( Expression *function, std::list<Expression *> &args, Expression *_aname = nullptr );
    103103        virtual ~UntypedExpr();
    104104
     
    124124class NameExpr : public Expression {
    125125  public:
    126         NameExpr( std::string name, Expression *_aname = 0 );
     126        NameExpr( std::string name, Expression *_aname = nullptr );
    127127        NameExpr( const NameExpr &other );
    128128        virtual ~NameExpr();
     
    145145class AddressExpr : public Expression {
    146146  public:
    147         AddressExpr( Expression *arg, Expression *_aname = 0 );
     147        AddressExpr( Expression *arg, Expression *_aname = nullptr );
    148148        AddressExpr( const AddressExpr &other );
    149149        virtual ~AddressExpr();
     
    181181class CastExpr : public Expression {
    182182  public:
    183         CastExpr( Expression *arg, Expression *_aname = 0 );
    184         CastExpr( Expression *arg, Type *toType, Expression *_aname = 0 );
     183        CastExpr( Expression *arg, Expression *_aname = nullptr );
     184        CastExpr( Expression *arg, Type *toType, Expression *_aname = nullptr );
    185185        CastExpr( const CastExpr &other );
    186186        virtual ~CastExpr();
     
    200200class UntypedMemberExpr : public Expression {
    201201  public:
    202         UntypedMemberExpr( std::string member, Expression *aggregate, Expression *_aname = 0 );
     202        UntypedMemberExpr( std::string member, Expression *aggregate, Expression *_aname = nullptr );
    203203        UntypedMemberExpr( const UntypedMemberExpr &other );
    204204        virtual ~UntypedMemberExpr();
     
    221221class MemberExpr : public Expression {
    222222  public:
    223         MemberExpr( DeclarationWithType *member, Expression *aggregate, Expression *_aname = 0 );
     223        MemberExpr( DeclarationWithType *member, Expression *aggregate, Expression *_aname = nullptr );
    224224        MemberExpr( const MemberExpr &other );
    225225        virtual ~MemberExpr();
     
    242242class VariableExpr : public Expression {
    243243  public:
    244         VariableExpr( DeclarationWithType *var, Expression *_aname = 0 );
     244        VariableExpr( DeclarationWithType *var, Expression *_aname = nullptr );
    245245        VariableExpr( const VariableExpr &other );
    246246        virtual ~VariableExpr();
     
    260260class ConstantExpr : public Expression {
    261261  public:
    262         ConstantExpr( Constant constant, Expression *_aname = 0 );
     262        ConstantExpr( Constant constant, Expression *_aname = nullptr );
    263263        ConstantExpr( const ConstantExpr &other );
    264264        virtual ~ConstantExpr();
     
    278278class SizeofExpr : public Expression {
    279279  public:
    280         SizeofExpr( Expression *expr, Expression *_aname = 0 );
     280        SizeofExpr( Expression *expr, Expression *_aname = nullptr );
    281281        SizeofExpr( const SizeofExpr &other );
    282         SizeofExpr( Type *type, Expression *_aname = 0 );
     282        SizeofExpr( Type *type, Expression *_aname = nullptr );
    283283        virtual ~SizeofExpr();
    284284
     
    303303class AlignofExpr : public Expression {
    304304  public:
    305         AlignofExpr( Expression *expr, Expression *_aname = 0 );
     305        AlignofExpr( Expression *expr, Expression *_aname = nullptr );
    306306        AlignofExpr( const AlignofExpr &other );
    307         AlignofExpr( Type *type, Expression *_aname = 0 );
     307        AlignofExpr( Type *type, Expression *_aname = nullptr );
    308308        virtual ~AlignofExpr();
    309309
     
    328328class UntypedOffsetofExpr : public Expression {
    329329  public:
    330         UntypedOffsetofExpr( Type *type, const std::string &member, Expression *_aname = 0 );
     330        UntypedOffsetofExpr( Type *type, const std::string &member, Expression *_aname = nullptr );
    331331        UntypedOffsetofExpr( const UntypedOffsetofExpr &other );
    332332        virtual ~UntypedOffsetofExpr();
     
    349349class OffsetofExpr : public Expression {
    350350  public:
    351         OffsetofExpr( Type *type, DeclarationWithType *member, Expression *_aname = 0 );
     351        OffsetofExpr( Type *type, DeclarationWithType *member, Expression *_aname = nullptr );
    352352        OffsetofExpr( const OffsetofExpr &other );
    353353        virtual ~OffsetofExpr();
     
    390390class AttrExpr : public Expression {
    391391  public:
    392         AttrExpr(Expression *attr, Expression *expr, Expression *_aname = 0 );
     392        AttrExpr(Expression *attr, Expression *expr, Expression *_aname = nullptr );
    393393        AttrExpr( const AttrExpr &other );
    394         AttrExpr( Expression *attr, Type *type, Expression *_aname = 0 );
     394        AttrExpr( Expression *attr, Type *type, Expression *_aname = nullptr );
    395395        virtual ~AttrExpr();
    396396
     
    418418class LogicalExpr : public Expression {
    419419  public:
    420         LogicalExpr( Expression *arg1, Expression *arg2, bool andp = true, Expression *_aname = 0 );
     420        LogicalExpr( Expression *arg1, Expression *arg2, bool andp = true, Expression *_aname = nullptr );
    421421        LogicalExpr( const LogicalExpr &other );
    422422        virtual ~LogicalExpr();
     
    441441class ConditionalExpr : public Expression {
    442442  public:
    443         ConditionalExpr( Expression *arg1, Expression *arg2, Expression *arg3, Expression *_aname = 0 );
     443        ConditionalExpr( Expression *arg1, Expression *arg2, Expression *arg3, Expression *_aname = nullptr );
    444444        ConditionalExpr( const ConditionalExpr &other );
    445445        virtual ~ConditionalExpr();
     
    465465class CommaExpr : public Expression {
    466466  public:
    467         CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname = 0 );
     467        CommaExpr( Expression *arg1, Expression *arg2, Expression *_aname = nullptr );
    468468        CommaExpr( const CommaExpr &other );
    469469        virtual ~CommaExpr();
     
    486486class TupleExpr : public Expression {
    487487  public:
    488         TupleExpr( Expression *_aname = 0 );
     488        TupleExpr( Expression *_aname = nullptr );
    489489        TupleExpr( const TupleExpr &other );
    490490        virtual ~TupleExpr();
     
    504504class SolvedTupleExpr : public Expression {
    505505  public:
    506         SolvedTupleExpr( Expression *_aname = 0 ) : Expression( _aname ) {}
    507         SolvedTupleExpr( std::list<Expression *> &, Expression *_aname = 0 );
     506        SolvedTupleExpr( Expression *_aname = nullptr ) : Expression( _aname ) {}
     507        SolvedTupleExpr( std::list<Expression *> &, Expression *_aname = nullptr );
    508508        SolvedTupleExpr( const SolvedTupleExpr &other );
    509509        virtual ~SolvedTupleExpr() {}
     
    598598class UntypedValofExpr : public Expression {
    599599  public:
    600         UntypedValofExpr( Statement *_body, Expression *_aname = 0 ) : Expression( _aname ), body ( _body ) {}
     600        UntypedValofExpr( Statement *_body, Expression *_aname = nullptr ) : Expression( _aname ), body ( _body ) {}
    601601        UntypedValofExpr( const UntypedValofExpr & other );
    602602        virtual ~UntypedValofExpr();
     
    637637class RangeExpr : public Expression {
    638638  public:
    639         RangeExpr( ConstantExpr *low, ConstantExpr *high );
     639        RangeExpr( Expression *low, Expression *high );
    640640        RangeExpr( const RangeExpr &other );
    641641
    642         ConstantExpr * get_low() const { return low.get(); }
    643         ConstantExpr * get_high() const { return high.get(); }
    644         RangeExpr * set_low( ConstantExpr *low ) { RangeExpr::low.reset( low ); return this; }
    645         RangeExpr * set_high( ConstantExpr *high ) { RangeExpr::high.reset( high ); return this; }
     642        Expression * get_low() const { return low; }
     643        Expression * get_high() const { return high; }
     644        RangeExpr * set_low( Expression *low ) { RangeExpr::low = low; return this; }
     645        RangeExpr * set_high( Expression *high ) { RangeExpr::high = high; return this; }
    646646
    647647        virtual RangeExpr *clone() const { return new RangeExpr( *this ); }
     
    650650        virtual void print( std::ostream &os, int indent = 0 ) const;
    651651  private:
    652         std::unique_ptr<ConstantExpr> low, high;
     652        Expression *low, *high;
    653653};
    654654
Note: See TracChangeset for help on using the changeset viewer.