Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r630a82a re04ef3a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Apr  8 17:18:06 2016
    13 // Update Count     : 21
     12// Last Modified On : Wed Jun  8 17:05:30 2016
     13// Update Count     : 22
    1414//
    1515
     
    2222#include "Mutator.h"
    2323#include "Constant.h"
     24#include "Common/UniqueName.h"
    2425
    2526/// Expression is the root type for all expressions
     
    3738        Expression *get_argName() const { return argName; }
    3839        void set_argName( Expression *name ) { argName = name; }
     40        bool get_extension() const { return extension; }
     41        void set_extension( bool exten ) { extension = exten; }
    3942
    4043        virtual Expression *clone() const = 0;
     
    4649        TypeSubstitution *env;
    4750        Expression* argName; // if expression is used as an argument, it can be "designated" by this name
     51        bool extension = false;
    4852};
    4953
     
    362366};
    363367
     368/// Expression representing a pack of field-offsets for a generic type
     369class OffsetPackExpr : public Expression {
     370public:
     371        OffsetPackExpr( StructInstType *type_, Expression *aname_ = 0 );
     372        OffsetPackExpr( const OffsetPackExpr &other );
     373        virtual ~OffsetPackExpr();
     374
     375        StructInstType *get_type() const { return type; }
     376        void set_type( StructInstType *newValue ) { type = newValue; }
     377
     378        virtual OffsetPackExpr *clone() const { return new OffsetPackExpr( *this ); }
     379        virtual void accept( Visitor &v ) { v.visit( this ); }
     380        virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     381
     382        virtual void print( std::ostream &os, int indent = 0 ) const;
     383
     384private:
     385        StructInstType *type;
     386};
     387
    364388/// AttrExpr represents an @attribute expression (like sizeof, but user-defined)
    365389class AttrExpr : public Expression {
     
    539563};
    540564
     565/// ImplicitCopyCtorExpr represents the application of a function to a set of parameters,
     566/// along with a set of copy constructor calls, one for each argument.
     567class ImplicitCopyCtorExpr : public Expression {
     568public:
     569        ImplicitCopyCtorExpr( ApplicationExpr * callExpr );
     570        ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other );
     571        virtual ~ImplicitCopyCtorExpr();
     572
     573        ApplicationExpr *get_callExpr() const { return callExpr; }
     574        void set_callExpr( ApplicationExpr *newValue ) { callExpr = newValue; }
     575
     576        std::list< ObjectDecl * > & get_tempDecls() { return tempDecls; }
     577        void set_tempDecls( std::list< ObjectDecl * > newValue ) { tempDecls = newValue; }
     578
     579        std::list< ObjectDecl * > & get_returnDecls() { return returnDecls; }
     580        void set_returnDecls( std::list< ObjectDecl * > newValue ) { returnDecls = newValue; }
     581
     582        std::list< Expression * > & get_dtors() { return dtors; }
     583        void set_dtors( std::list< Expression * > newValue ) { dtors = newValue; }
     584
     585        virtual ImplicitCopyCtorExpr *clone() const { return new ImplicitCopyCtorExpr( *this ); }
     586        virtual void accept( Visitor &v ) { v.visit( this ); }
     587        virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     588        virtual void print( std::ostream &os, int indent = 0 ) const;
     589  private:
     590        ApplicationExpr * callExpr;
     591        std::list< ObjectDecl * > tempDecls;
     592        std::list< ObjectDecl * > returnDecls;
     593        std::list< Expression * > dtors;
     594};
     595
    541596/// ValofExpr represents a GCC 'lambda expression'
    542597class UntypedValofExpr : public Expression {
Note: See TracChangeset for help on using the changeset viewer.