Changeset 379 in dev for trunk


Ignore:
Timestamp:
Dec 17, 2007, 2:41:25 AM (16 years ago)
Author:
dai_9181
Message:

ジェネリクスインターフェイスをサポートした

Location:
trunk/abdev/BasicCompiler_Common
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/calculation.cpp

    r290 r379  
    13751375            temporary[i2]=0;
    13761376
    1377             if((stack[sp-1]%100)==CALC_AS&&Command[i]=='*'){
    1378                 for(i3=0;i3<i2;i3++){
    1379                     if(temporary[i2]!='*') break;
    1380                 }
    1381                 if(i3==i2){
    1382                     //"*"をポインタ指定文字として認識する
    1383                     temporary[i2]=Command[i];
    1384                     continue;
     1377            if( sp > 0 && (stack[sp-1]%100) == CALC_AS )
     1378            {
     1379                if( Command[i] == '*' )
     1380                {
     1381                    for(i3=0;i3<i2;i3++){
     1382                        if(temporary[i2]!='*') break;
     1383                    }
     1384                    if(i3==i2){
     1385                        //"*"をポインタ指定文字として認識する
     1386                        temporary[i2]=Command[i];
     1387                        continue;
     1388                    }
     1389                }
     1390                else if( Command[i] == '<' )
     1391                {
     1392                    Type type;
     1393                    if( compiler.StringToType( temporary, type ) )
     1394                    {
     1395                        if( type.HasMember() && type.GetClass().IsGeneric() )
     1396                        {
     1397                            char temp2[1024];
     1398                            int i5 = 1;
     1399                            for( i3=i, i4=0; ; i3++, i4++ )
     1400                            {
     1401                                if( Command[i3] == '<' )
     1402                                {
     1403                                    i5++;
     1404                                }
     1405                                if( Command[i3] == '>' )
     1406                                {
     1407                                    i5--;
     1408                                    if( i5 == 0 )
     1409                                    {
     1410                                        temp2[i4] = 0;
     1411                                        break;
     1412                                    }
     1413                                }
     1414                                temp2[i4] = Command[i3];
     1415                                if( Command[i3] == '\0' )
     1416                                {
     1417                                    break;
     1418                                }
     1419                            }
     1420                            if( Command[i] )
     1421                            {
     1422                                i = i3;
     1423                                i2 += i4;
     1424                                lstrcat( temporary, temp2 );
     1425                            }
     1426
     1427                            if( Command[i] == '\0' )
     1428                            {
     1429                                goto FinishLoop;
     1430                            }
     1431                        }
     1432                    }
    13851433                }
    13861434            }
     
    14451493        temporary[i2]=Command[i];
    14461494        if(Command[i]=='\0'){
     1495FinishLoop:
    14471496            calc[*pnum]=0;
    14481497
  • trunk/abdev/BasicCompiler_Common/include/Class.h

    r378 r379  
    315315        return false;
    316316    }
     317    bool IsGeneric() const
     318    {
     319        return ( this->formalGenericTypes.size() != 0 );
     320    }
    317321
    318322    // 継承元クラス
  • trunk/abdev/BasicCompiler_Common/src/Class.cpp

    r378 r379  
    545545    else
    546546    {
    547         ts(buffer);
    548547        // インターフェイス メソッドのオーバーライド
    549548        BOOST_FOREACH( ::Interface *pInterface, pobj_c->GetInterfaces() )
  • trunk/abdev/BasicCompiler_Common/src/Class_Collect.cpp

    r378 r379  
    328328            CClass *pobj_c = const_cast<CClass *>( this->Find(namespaceScopes, className) );
    329329            if(!pobj_c) continue;
     330
     331            compiler.pCompilingClass = pobj_c;
    330332
    331333            if(lpszInheritsClass){
Note: See TracChangeset for help on using the changeset viewer.