Changeset 299 in dev for trunk/abdev/BasicCompiler_Common/include
- Timestamp:
- Aug 23, 2007, 6:17:00 PM (17 years ago)
- Location:
- trunk/abdev/BasicCompiler_Common/include
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/include/Class.h
r293 r299 56 56 const CClass *pSuperClass; 57 57 58 // 継承クラスの型パラメータ(実パラメータ) 59 Types superClassActualTypeParameters; 60 58 61 // Blittable型情報 59 62 Type blittableType; … … 93 96 ar & BOOST_SERIALIZATION_NVP( formalGenericTypes ); 94 97 ar & boost::serialization::make_nvp( "pSuperClass", const_cast<CClass *&>(pSuperClass) ); 98 ar & BOOST_SERIALIZATION_NVP( superClassActualTypeParameters ); 95 99 ar & BOOST_SERIALIZATION_NVP( blittableType ); 96 100 //ar & BOOST_SERIALIZATION_NVP( interfaces ); … … 185 189 this->formalGenericTypes.push_back( genericType ); 186 190 } 191 int GetFormalGenericTypeParameterIndex( const std::string &name ) const 192 { 193 int i = 0; 194 BOOST_FOREACH( const GenericType &genericType, formalGenericTypes ) 195 { 196 if( genericType.GetName() == name ) 197 { 198 return i; 199 } 200 i++; 201 } 202 return -1; 203 } 187 204 bool IsExistFormalGenericTypeParameter( const std::string &name ) const 188 205 { … … 210 227 this->pSuperClass = pSuperClass; 211 228 } 229 const Types &GetSuperClassActualTypeParameters() const 230 { 231 return superClassActualTypeParameters; 232 } 233 void SetSuperClassActualTypeParameters( const Types &actualTypeParameters ) 234 { 235 this->superClassActualTypeParameters = actualTypeParameters; 236 } 212 237 213 238 // Blittable型 … … 270 295 //継承させる 271 296 bool Inherits( const char *inheritNames, int nowLine ); 272 bool InheritsClass( const CClass &inheritsClass, int nowLine );297 bool InheritsClass( const CClass &inheritsClass, const Types &actualTypeParameters, int nowLine ); 273 298 bool InheritsInterface( const CClass &inheritsClass, int nowLine ); 274 299 -
trunk/abdev/BasicCompiler_Common/include/Compiler.h
r294 r299 123 123 124 124 125 staticbool StringToType( const std::string &typeName, Type &type );126 staticconst std::string TypeToString( const Type &type );125 bool StringToType( const std::string &typeName, Type &type ); 126 const std::string TypeToString( const Type &type ); 127 127 128 128 // コンパイル中のクラス -
trunk/abdev/BasicCompiler_Common/include/Member.h
r266 r299 53 53 } 54 54 55 TypeGetType() const55 const Type &GetType() const 56 56 { 57 57 return type; 58 } 59 void ResetType( const Type &type ) 60 { 61 this->type = type; 58 62 } 59 63 -
trunk/abdev/BasicCompiler_Common/include/Type.h
r293 r299 26 26 const CClass *pClass; 27 27 }; 28 29 // ジェネリクス クラス インスタンス型の場合に使う 28 30 GenericTypes actualGenericTypes; 31 32 // 型パラメータで使う 33 std::string formalTypeName; // 型パラメータの名前 34 int formalTypeIndex; // 型パラメータの引数番号 29 35 30 36 // XMLシリアライズ用 … … 44 50 { 45 51 ar & BOOST_SERIALIZATION_NVP( index ); 52 } 53 54 if( IsTypeParameter() ) 55 { 56 ar & BOOST_SERIALIZATION_NVP( formalTypeName ); 57 ar & BOOST_SERIALIZATION_NVP( formalTypeIndex ); 46 58 } 47 59 } … … 71 83 , index( type.index ) 72 84 , actualGenericTypes( type.actualGenericTypes ) 85 , formalTypeName( type.formalTypeName ) 86 , formalTypeIndex( type.formalTypeIndex ) 73 87 { 74 88 } … … 81 95 index = type.index; 82 96 actualGenericTypes = type.actualGenericTypes; 97 formalTypeName = type.formalTypeName; 98 formalTypeIndex = type.formalTypeIndex; 83 99 } 84 100 … … 176 192 bool HasMember() const; 177 193 194 // 型パラメータの名前を取得 195 const std::string &GetFormalTypeName() const 196 { 197 if( !IsTypeParameter() ) 198 { 199 Jenga::Throw( "型パラメータでない型に対してGetFormalTypeNameメソッドが呼ばれた" ); 200 } 201 return formalTypeName; 202 } 203 void SetFormalTypeName( const std::string &formalTypeName ) 204 { 205 if( !IsTypeParameter() ) 206 { 207 Jenga::Throw( "型パラメータでない型に対してSetFormalTypeNameメソッドが呼ばれた" ); 208 } 209 this->formalTypeName = formalTypeName; 210 } 211 int GetFormalTypeIndex() const 212 { 213 if( !IsTypeParameter() ) 214 { 215 Jenga::Throw( "型パラメータでない型に対してGetFormalTypeIndexメソッドが呼ばれた" ); 216 } 217 return formalTypeIndex; 218 } 219 void SetFormalTypeIndex( int formalTypeIndex ) 220 { 221 if( !IsTypeParameter() ) 222 { 223 Jenga::Throw( "型パラメータでない型に対してSetFormalTypeIndexメソッドが呼ばれた" ); 224 } 225 this->formalTypeIndex = formalTypeIndex; 226 } 227 178 228 // 未完成 179 229 const Type &GetDummyActualGenericType() const; … … 189 239 static int GetBasicTypeFromSimpleName( const char *variable ); 190 240 }; 241 typedef std::vector<Type> Types; 242 243 void ResolveFormalGenericTypeParameter( Type &typeParameter, const Type &classType, const UserProc *pUserProc = NULL ); 191 244 192 245 class GenericType
Note:
See TracChangeset
for help on using the changeset viewer.