Changes in src/SynTree/TypeSubstitution.h [540de412:4040425]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SynTree/TypeSubstitution.h
r540de412 r4040425 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TypeSubstitution.h -- 7 // TypeSubstitution.h -- 8 8 // 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Fri Apr 29 15:00:20201611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Mar 2 17:33:19 2016 13 13 // Update Count : 2 14 14 // … … 33 33 TypeSubstitution( const TypeSubstitution &other ); 34 34 virtual ~TypeSubstitution(); 35 35 36 36 TypeSubstitution &operator=( const TypeSubstitution &other ); 37 37 38 38 template< typename SynTreeClass > int apply( SynTreeClass *&input ); 39 39 template< typename SynTreeClass > int applyFree( SynTreeClass *&input ); 40 40 41 41 void add( std::string formalType, Type *actualType ); 42 42 void add( const TypeSubstitution &other ); … … 44 44 Type *lookup( std::string formalType ) const; 45 45 bool empty() const; 46 46 47 47 template< typename FormalIterator, typename ActualIterator > 48 48 void add( FormalIterator formalBegin, FormalIterator formalEnd, ActualIterator actualBegin ); 49 50 /// this function is unused... 49 51 50 template< typename TypeInstListIterator > 52 51 void extract( TypeInstListIterator begin, TypeInstListIterator end, TypeSubstitution &result ); 53 52 54 53 void normalize(); 55 54 … … 64 63 /// Records type variable bindings from forall-statements and instantiations of generic types 65 64 template< typename TypeClass > Type *handleAggregateType( TypeClass *type ); 66 65 67 66 virtual Type* mutate(VoidType *basicType); 68 67 virtual Type* mutate(BasicType *basicType); … … 76 75 virtual Type* mutate(TupleType *tupleType); 77 76 virtual Type* mutate(VarArgsType *varArgsType); 78 77 79 78 // TODO: worry about traversing into a forall-qualified function type or type decl with assertions 80 79 81 80 void initialize( const TypeSubstitution &src, TypeSubstitution &dest ); 82 81 … … 137 136 return subCount; 138 137 } 139 138 140 139 template< typename SynTreeClass > 141 140 int TypeSubstitution::applyFree( SynTreeClass *&input ) { … … 150 149 return subCount; 151 150 } 152 151 153 152 template< typename TypeInstListIterator > 154 153 void TypeSubstitution::extract( TypeInstListIterator begin, TypeInstListIterator end, TypeSubstitution &result ) { 155 // xxx - this function doesn't extract varEnv - is this intentional?156 154 while ( begin != end ) { 157 155 TypeEnvType::iterator cur = typeEnv.find( (*begin++)->get_name() ); … … 175 173 } 176 174 177 std::ostream & operator<<( std::ostream & out, const TypeSubstitution & sub );178 179 175 #endif // TYPESUBSTITUTION_H 180 176
Note: See TracChangeset
for help on using the changeset viewer.