Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r630a82a rdb4ecc5  
    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 : Fri Apr  8 17:18:06 2016
    13 // Update Count     : 21
     11// Last Modified By : Rob Schluntz
     12// Last Modified On : Thu Apr 14 12:04:58 2016
     13// Update Count     : 19
    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
     
    539540};
    540541
     542/// ImplicitCopyCtorExpr represents the application of a function to a set of parameters,
     543/// along with a set of copy constructor calls, one for each argument.
     544class ImplicitCopyCtorExpr : public Expression {
     545public:
     546        ImplicitCopyCtorExpr( ApplicationExpr * callExpr );
     547        ImplicitCopyCtorExpr( const ImplicitCopyCtorExpr & other );
     548        virtual ~ImplicitCopyCtorExpr();
     549
     550        ApplicationExpr *get_callExpr() const { return callExpr; }
     551        void set_callExpr( ApplicationExpr *newValue ) { callExpr = newValue; }
     552
     553        std::list< Expression * > & get_copyCtors() { return copyCtors; }
     554        void set_copyCtors( std::list< Expression * > newValue ) { copyCtors = newValue; }
     555
     556        std::list< ObjectDecl * > & get_tempDecls() { return tempDecls; }
     557        void set_tempDecls( std::list< ObjectDecl * > newValue ) { tempDecls = newValue; }
     558
     559        std::list< ObjectDecl * > & get_returnDecls() { return returnDecls; }
     560        void set_returnDecls( std::list< ObjectDecl * > newValue ) { returnDecls = newValue; }
     561
     562        std::list< Expression * > & get_dtors() { return dtors; }
     563        void set_dtors( std::list< Expression * > newValue ) { dtors = newValue; }
     564
     565        virtual ImplicitCopyCtorExpr *clone() const { return new ImplicitCopyCtorExpr( *this ); }
     566        virtual void accept( Visitor &v ) { v.visit( this ); }
     567        virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
     568        virtual void print( std::ostream &os, int indent = 0 ) const;
     569  private:
     570        ApplicationExpr * callExpr;
     571        std::list< Expression * > copyCtors;
     572        std::list< ObjectDecl * > tempDecls;
     573        std::list< ObjectDecl * > returnDecls;
     574        std::list< Expression * > dtors;
     575};
     576
    541577/// ValofExpr represents a GCC 'lambda expression'
    542578class UntypedValofExpr : public Expression {
     
    555591  private:
    556592        Statement *body;
    557 };
    558 
    559 /// CompoundLiteralExpr represents a C99 'compound literal'
    560 class CompoundLiteralExpr : public Expression {
    561   public:
    562         CompoundLiteralExpr( Type * type, Initializer * initializer );
    563         CompoundLiteralExpr( const CompoundLiteralExpr &other );
    564         ~CompoundLiteralExpr();
    565 
    566         Type * get_type() const { return type; }
    567         void set_type( Type * t ) { type = t; }
    568 
    569         Initializer * get_initializer() const { return initializer; }
    570         void set_initializer( Initializer * i ) { initializer = i; }
    571 
    572         virtual CompoundLiteralExpr *clone() const { return new CompoundLiteralExpr( *this ); }
    573         virtual void accept( Visitor &v ) { v.visit( this ); }
    574         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    575         virtual void print( std::ostream &os, int indent = 0 ) const;
    576   private:
    577         Type * type;
    578         Initializer * initializer;
    579593};
    580594
Note: See TracChangeset for help on using the changeset viewer.