Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Expression.h

    r6c3a988f rd5556a3  
    5454};
    5555
    56 struct ParamEntry;
    57 typedef std::map< UniqueId, ParamEntry > InferredParams;
    58 
    5956/// ParamEntry contains the i.d. of a declaration and a type that is derived from that declaration,
    6057/// but subject to decay-to-pointer and type parameter renaming
    6158struct ParamEntry {
    62         ParamEntry(): decl( 0 ), actualType( 0 ), formalType( 0 ), expr( 0 ), inferParams( new InferredParams ) {}
    63         ParamEntry( UniqueId decl, Type *actualType, Type *formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ), inferParams( new InferredParams ) {}
     59        ParamEntry(): decl( 0 ), actualType( 0 ), formalType( 0 ), expr( 0 ) {}
     60        ParamEntry( UniqueId decl, Type *actualType, Type *formalType, Expression* expr ): decl( decl ), actualType( actualType ), formalType( formalType ), expr( expr ) {}
    6461        ParamEntry( const ParamEntry &other );
    6562        ~ParamEntry();
     
    7067        Type *formalType;
    7168        Expression* expr;
    72         std::unique_ptr< InferredParams > inferParams;
    73 };
     69};
     70
     71typedef std::map< UniqueId, ParamEntry > InferredParams;
    7472
    7573/// ApplicationExpr represents the application of a function to a set of parameters.  This is the result of running an
     
    636634};
    637635
    638 /// UntypedTupleExpr represents a tuple expression ( [a, b, c] ) before resolution
    639 class UntypedTupleExpr : public Expression {
    640   public:
    641         UntypedTupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr );
    642         UntypedTupleExpr( const UntypedTupleExpr &other );
    643         virtual ~UntypedTupleExpr();
    644 
    645         std::list<Expression*>& get_exprs() { return exprs; }
    646 
    647         virtual UntypedTupleExpr *clone() const { return new UntypedTupleExpr( *this ); }
    648         virtual void accept( Visitor &v ) { v.visit( this ); }
    649         virtual Expression *acceptMutator( Mutator &m ) { return m.mutate( this ); }
    650         virtual void print( std::ostream &os, int indent = 0 ) const;
    651   private:
    652         std::list<Expression*> exprs;
    653 };
    654 
    655636/// TupleExpr represents a tuple expression ( [a, b, c] )
    656637class TupleExpr : public Expression {
    657638  public:
    658         TupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr );
     639        TupleExpr( const std::list< Expression * > & exprs = std::list< Expression * >(), Expression *_aname = nullptr );
    659640        TupleExpr( const TupleExpr &other );
    660641        virtual ~TupleExpr();
    661642
     643        void set_exprs( std::list<Expression*> newValue ) { exprs = newValue; }
    662644        std::list<Expression*>& get_exprs() { return exprs; }
    663645
Note: See TracChangeset for help on using the changeset viewer.