Changeset 2162c2c for src/SynTree/Expression.h
- Timestamp:
- Jan 11, 2017, 4:11:02 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 075734f
- Parents:
- bb82c03 (diff), d3a85240 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/Expression.h
rbb82c03 r2162c2c 54 54 }; 55 55 56 struct ParamEntry; 57 typedef std::map< UniqueId, ParamEntry > InferredParams; 58 56 59 /// ParamEntry contains the i.d. of a declaration and a type that is derived from that declaration, 57 60 /// but subject to decay-to-pointer and type parameter renaming 58 61 struct ParamEntry { 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 ) {}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 ) {} 61 64 ParamEntry( const ParamEntry &other ); 62 65 ~ParamEntry(); … … 67 70 Type *formalType; 68 71 Expression* expr; 69 }; 70 71 typedef std::map< UniqueId, ParamEntry > InferredParams; 72 std::unique_ptr< InferredParams > inferParams; 73 }; 72 74 73 75 /// ApplicationExpr represents the application of a function to a set of parameters. This is the result of running an … … 634 636 }; 635 637 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 636 655 /// TupleExpr represents a tuple expression ( [a, b, c] ) 637 656 class TupleExpr : public Expression { 638 657 public: 639 TupleExpr( const std::list< Expression * > & exprs = std::list< Expression * >(), Expression *_aname = nullptr );658 TupleExpr( const std::list< Expression * > & exprs, Expression *_aname = nullptr ); 640 659 TupleExpr( const TupleExpr &other ); 641 660 virtual ~TupleExpr(); 642 661 643 void set_exprs( std::list<Expression*> newValue ) { exprs = newValue; }644 662 std::list<Expression*>& get_exprs() { return exprs; } 645 663
Note:
See TracChangeset
for help on using the changeset viewer.