Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    rbaf7fee r2a4b088  
    319319};
    320320
     321/// UntypedOffsetofExpr represents an offsetof expression before resolution
     322class UntypedOffsetofExpr : public Expression {
     323  public:
     324        UntypedOffsetofExpr( Type *type, const std::string &member, Expression *_aname = 0 );
     325        UntypedOffsetofExpr( const UntypedOffsetofExpr &other );
     326        virtual ~UntypedOffsetofExpr();
     327
     328        std::string get_member() const { return member; }
     329        void set_member( const std::string &newValue ) { member = newValue; }
     330        Type *get_type() const { return type; }
     331        void set_type( Type *newValue ) { type = newValue; }
     332
     333        virtual UntypedOffsetofExpr *clone() const { return new UntypedOffsetofExpr( *this ); }
     334        virtual void accept( Visitor &v ) { v.visit( this ); }
     335        virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     336        virtual void print( std::ostream &os, int indent = 0 ) const;
     337  private:
     338        Type *type;
     339        std::string member;
     340};
     341
     342/// OffsetofExpr represents an offsetof expression
     343class OffsetofExpr : public Expression {
     344  public:
     345        OffsetofExpr( Type *type, DeclarationWithType *member, Expression *_aname = 0 );
     346        OffsetofExpr( const OffsetofExpr &other );
     347        virtual ~OffsetofExpr();
     348
     349        Type *get_type() const { return type; }
     350        void set_type( Type *newValue ) { type = newValue; }
     351        DeclarationWithType *get_member() const { return member; }
     352        void set_member( DeclarationWithType *newValue ) { member = newValue; }
     353
     354        virtual OffsetofExpr *clone() const { return new OffsetofExpr( *this ); }
     355        virtual void accept( Visitor &v ) { v.visit( this ); }
     356        virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     357        virtual void print( std::ostream &os, int indent = 0 ) const;
     358  private:
     359        Type *type;
     360        DeclarationWithType *member;
     361};
     362
    321363/// AttrExpr represents an @attribute expression (like sizeof, but user-defined)
    322364class AttrExpr : public Expression {
Note: See TracChangeset for help on using the changeset viewer.