Changeset 290 in dev for trunk/abdev/BasicCompiler_Common/include
- Timestamp:
- Aug 21, 2007, 11:00:25 PM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/Class.h
r282 r290 9 9 10 10 class UserProc; 11 class CClass; 11 12 12 13 class InheritedInterface … … 48 49 // importされている名前空間 49 50 NamespaceScopesCollection importedNamespaces; 50 51 52 // 型パラメータ 53 GenericTypes formalGenericTypes; 54 51 55 // 継承クラス 52 56 const CClass *pSuperClass; … … 108 112 , classType( Class ) 109 113 , pSuperClass( NULL ) 114 , blittableType( Type() ) 110 115 , isReady( false ) 111 116 , fixedAlignment( 0 ) … … 124 129 , classType() 125 130 , pSuperClass( NULL ) 131 , blittableType( Type() ) 126 132 , isReady( false ) 127 133 , fixedAlignment( 0 ) … … 173 179 } 174 180 181 // 型パラメータ 182 void AddFormalGenericType( GenericType genericType ) 183 { 184 this->formalGenericTypes.push_back( genericType ); 185 } 186 bool IsExistFormalGenericTypeParameter( const std::string &name ) const 187 { 188 BOOST_FOREACH( const GenericType &genericType, formalGenericTypes ) 189 { 190 if( genericType.GetName() == name ) 191 { 192 return true; 193 } 194 } 195 return false; 196 } 197 175 198 // 継承元クラス 176 199 bool HasSuperClass() const -
trunk/abdev/BasicCompiler_Common/include/Type.h
r271 r290 16 16 17 17 class CClass; 18 19 class GenericType; 20 typedef std::vector<GenericType> GenericTypes; 18 21 19 22 class Type{ … … 23 26 const CClass *pClass; 24 27 }; 28 GenericTypes actualGenericTypes; 25 29 26 30 // XMLシリアライズ用 … … 52 56 index( -1 ){} 53 57 54 Type( int basicType, LONG_PTR index ): 55 basicType( basicType ), 56 index( index ){} 58 Type( int basicType, LONG_PTR index ) 59 : basicType( basicType ) 60 , index( index ) 61 { 62 } 57 63 58 64 Type( int basicType, const CClass &objClass ): … … 60 66 index( (LONG_PTR)&objClass ){} 61 67 62 Type( const Type &type ): 63 basicType( type.basicType ), 64 index( type.index ){} 68 Type( const Type &type ) 69 : basicType( type.basicType ) 70 , index( type.index ) 71 , actualGenericTypes( type.actualGenericTypes ) 72 { 73 } 74 75 ~Type(); 76 77 void operator= ( const Type &type ) 78 { 79 basicType = type.basicType; 80 index = type.index; 81 actualGenericTypes = type.actualGenericTypes; 82 } 65 83 66 84 __inline int GetBasicType() const … … 72 90 return index; 73 91 } 74 const CClass &GetClass() const 75 { 76 return *pClass; 77 } 92 const CClass &GetClass() const; 78 93 79 94 void SetBasicType( int basicType ){ … … 85 100 void SetClassPtr( const CClass *pClass ) 86 101 { 102 int naturalBasicType = NATURAL_TYPE( basicType ); 103 if( !HasMember() ) 104 { 105 Jenga::Throw( "クラスまたは構造体でない型に対してSetClassPtrを呼び出した" ); 106 } 87 107 this->pClass = pClass; 88 108 } … … 98 118 SetBasicType( basicType ); 99 119 this->pClass = pClass; 120 } 121 void SetActualGenericTypes( const GenericTypes &genericTypes ) 122 { 123 this->actualGenericTypes = genericTypes; 100 124 } 101 125 … … 142 166 bool IsObject() const; 143 167 bool IsObjectPtr() const; 168 bool IsTypeParameter() const; 144 169 bool IsObjectClass() const; 145 170 bool IsStringClass() const; … … 150 175 bool HasMember() const; 151 176 152 void operator= ( const Type &type ){ 153 basicType = type.basicType; 154 index = type.index; 155 } 177 // 未完成 178 const Type &GetDummyActualGenericType() const; 179 bool HasActualGenericType() const; 156 180 157 181 … … 163 187 static const char *Type::BasicTypeToCharPtr( const Type &type ); 164 188 static int GetBasicTypeFromSimpleName( const char *variable ); 189 }; 190 191 class GenericType 192 { 193 std::string name; 194 Type type; 195 public: 196 GenericType( const std::string &name, const Type &type ) 197 : name( name ) 198 , type( type ) 199 { 200 } 201 GenericType() 202 { 203 } 204 ~GenericType() 205 { 206 } 207 208 const std::string &GetName() const 209 { 210 return name; 211 } 212 const Type &GetType() const 213 { 214 return type; 215 } 165 216 }; 166 217
Note:
See TracChangeset
for help on using the changeset viewer.