Changes in src/SynTree/Expression.h [6c3a988f:d5556a3]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.h
r6c3a988f rd5556a3 54 54 }; 55 55 56 struct ParamEntry;57 typedef std::map< UniqueId, ParamEntry > InferredParams;58 59 56 /// ParamEntry contains the i.d. of a declaration and a type that is derived from that declaration, 60 57 /// but subject to decay-to-pointer and type parameter renaming 61 58 struct 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 ) {} 64 61 ParamEntry( const ParamEntry &other ); 65 62 ~ParamEntry(); … … 70 67 Type *formalType; 71 68 Expression* expr; 72 std::unique_ptr< InferredParams > inferParams; 73 }; 69 }; 70 71 typedef std::map< UniqueId, ParamEntry > InferredParams; 74 72 75 73 /// ApplicationExpr represents the application of a function to a set of parameters. This is the result of running an … … 636 634 }; 637 635 638 /// UntypedTupleExpr represents a tuple expression ( [a, b, c] ) before resolution639 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 655 636 /// TupleExpr represents a tuple expression ( [a, b, c] ) 656 637 class TupleExpr : public Expression { 657 638 public: 658 TupleExpr( const std::list< Expression * > & exprs , Expression *_aname = nullptr );639 TupleExpr( const std::list< Expression * > & exprs = std::list< Expression * >(), Expression *_aname = nullptr ); 659 640 TupleExpr( const TupleExpr &other ); 660 641 virtual ~TupleExpr(); 661 642 643 void set_exprs( std::list<Expression*> newValue ) { exprs = newValue; } 662 644 std::list<Expression*>& get_exprs() { return exprs; } 663 645
Note:
See TracChangeset
for help on using the changeset viewer.