Changeset 290 in dev for trunk/abdev/BasicCompiler_Common/src/Class.cpp
- Timestamp:
- Aug 21, 2007, 11:00:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/src/Class.cpp
r282 r290 908 908 source[i+1]==ESC_TYPE|| 909 909 source[i+1]==ESC_INTERFACE 910 )){ 911 int nowLine; 912 nowLine=i; 910 )) 911 { 912 int nowLine = i; 913 i += 2; 914 915 Type blittableType; 916 if(memicmp(source.GetBuffer()+i,"Align(",6)==0){ 917 //アラインメント修飾子 918 i+=6; 919 i=JumpStringInPare(source.GetBuffer(),i)+1; 920 } 921 else if( memicmp( source.GetBuffer() + i, "Blittable(", 10 ) == 0 ){ 922 // Blittable修飾子 923 i+=10; 924 i+=GetStringInPare_RemovePare(temporary,source.GetBuffer()+i)+1; 925 compiler.StringToType( temporary, blittableType ); 926 } 927 928 bool isEnum = false; 929 if( source[i] == 1 && source[i+1] == ESC_ENUM ){ 930 // 列挙型の場合 931 isEnum = true; 913 932 914 933 i+=2; 915 Type blittableType; 916 if(memicmp(source.GetBuffer()+i,"Align(",6)==0){ 917 //アラインメント修飾子 918 i+=6; 919 i=JumpStringInPare(source.GetBuffer(),i)+1; 920 } 921 else if( memicmp( source.GetBuffer() + i, "Blittable(", 10 ) == 0 ){ 922 // Blittable修飾子 923 i+=10; 924 i+=GetStringInPare_RemovePare(temporary,source.GetBuffer()+i)+1; 925 compiler.StringToType( temporary, blittableType ); 926 } 927 928 bool isEnum = false; 929 if( source[i] == 1 && source[i+1] == ESC_ENUM ){ 930 // 列挙型の場合 931 isEnum = true; 932 933 i+=2; 934 } 935 936 int i2; 937 char temporary[VN_SIZE]; 938 for(i2=0;;i++,i2++){ 939 if(!IsVariableChar(source[i])){ 940 temporary[i2]=0; 941 break; 942 } 943 temporary[i2]=source[i]; 944 } 945 946 //クラスを追加 947 CClass *pClass = this->Add(namespaceScopes, importedNamespaces, temporary,nowLine); 948 if( pClass ){ 949 if( source[nowLine+1] == ESC_CLASS ){ 950 if( isEnum ){ 951 pClass->SetClassType( CClass::Enum ); 952 } 953 else{ 954 pClass->SetClassType( CClass::Class ); 955 } 956 } 957 else if( source[nowLine+1] == ESC_INTERFACE ){ 958 pClass->SetClassType( CClass::Interface ); 934 } 935 936 for(i2=0;;i++,i2++){ 937 if(!IsVariableChar(source[i])){ 938 temporary[i2]=0; 939 break; 940 } 941 temporary[i2]=source[i]; 942 } 943 944 //クラスを追加 945 CClass *pClass = this->Add(namespaceScopes, importedNamespaces, temporary,nowLine); 946 if( pClass ){ 947 if( source[nowLine+1] == ESC_CLASS ){ 948 if( isEnum ){ 949 pClass->SetClassType( CClass::Enum ); 959 950 } 960 951 else{ 961 pClass->SetClassType( CClass:: Structure);952 pClass->SetClassType( CClass::Class ); 962 953 } 963 954 } 964 965 // Blittable型の場合 966 if( !blittableType.IsNull() ){ 967 pClass->SetBlittableType( blittableType ); 968 969 // Blittable型として登録 970 compiler.GetObjectModule().meta.GetBlittableTypes().push_back( BlittableType( blittableType, pClass ) ); 971 } 955 else if( source[nowLine+1] == ESC_INTERFACE ){ 956 pClass->SetClassType( CClass::Interface ); 957 } 958 else{ 959 pClass->SetClassType( CClass::Structure ); 960 } 961 } 962 963 // Blittable型の場合 964 if( !blittableType.IsNull() ){ 965 pClass->SetBlittableType( blittableType ); 966 967 // Blittable型として登録 968 compiler.GetObjectModule().meta.GetBlittableTypes().push_back( BlittableType( blittableType, pClass ) ); 969 } 972 970 } 973 971 } … … 1266 1264 if(!pobj_c) continue; 1267 1265 1266 compiler.pCompilingClass = pobj_c; 1267 1268 1268 if(lpszInheritsClass){ 1269 1269 if( pobj_c->GetName() != lpszInheritsClass ){ … … 1277 1277 continue; 1278 1278 } 1279 1280 1281 ///////////////////////////////////////////////////////// 1282 // ☆★☆ ジェネリクスサポート ☆★☆ 1283 if( basbuf[i] == '<' ) 1284 { 1285 // 型パラメータを取得 1286 i++; 1287 GetIdentifierToken( temporary, basbuf, i ); 1288 1289 pobj_c->AddFormalGenericType( GenericType( temporary, Type(DEF_OBJECT,*GetObjectClassPtr()) ) ); 1290 1291 if( basbuf[i] == '>' ) 1292 { 1293 i++; 1294 } 1295 else 1296 { 1297 SetError(); 1298 } 1299 } 1300 ///////////////////////////////////////////////////////// 1301 1279 1302 1280 1303 pobj_c->SetFixedAlignment( iAlign );
Note:
See TracChangeset
for help on using the changeset viewer.