Changeset 340 in dev


Ignore:
Timestamp:
Oct 6, 2007, 12:56:37 AM (17 years ago)
Author:
dai_9181
Message:

Implements修飾子を作り始めた

Location:
trunk/abdev/BasicCompiler_Common
Files:
6 edited

Legend:

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

    r332 r340  
    855855                        temporary[i2]=ESC_INHERITS;
    856856                    }
     857                    else if( lstrcmpi( temporary + i3, "Implements" ) == 0 )
     858                    {
     859                        i2 = i3;
     860                        temporary[i2++] = 1;
     861                        temporary[i2] = ESC_IMPLEMENTS;
     862                    }
    857863                    else if(lstrcmpi(temporary+i3,"Interface")==0){
    858864                        i2=i3;
  • trunk/abdev/BasicCompiler_Common/Intermediate_Step2.cpp

    r322 r340  
    313313
    314314            case ESC_INHERITS:
     315            case ESC_IMPLEMENTS:
    315316            case ESC_VIRTUAL:
    316317            case ESC_OVERRIDE:
  • trunk/abdev/BasicCompiler_Common/error.cpp

    r337 r340  
    202202    if(num==135) lstrcpy( msg, "クラスまたはインターフェイス以外の型を継承元として指定することはできません。" );
    203203    if(num==136) lstrcpy( msg, "非仮想関数に対してオーバーライドしようとしました。" );
     204    if(num==137) lstrcpy(msg,"ImplementsはClass定義内の先頭に記述する必要があります。");
    204205
    205206    //Enum関連
  • trunk/abdev/BasicCompiler_Common/include/Class.h

    r325 r340  
    294294    bool IsInheritsInterface( const CClass *pInterfaceClass ) const;
    295295
    296     //継承させる
     296    // クラス継承
    297297    bool Inherits( const char *inheritNames, int nowLine );
    298298    bool InheritsClass( const CClass &inheritsClass, const Types &actualTypeParameters, int nowLine );
    299299    bool InheritsInterface( const CClass &inheritsClass, int nowLine );
     300
     301    // インターフェイス実装
     302    bool Implements( const char *interfaceNames, int nowLine );
    300303
    301304    //メンバ、メソッドの追加
  • trunk/abdev/BasicCompiler_Common/include/ver.h

    r338 r340  
    66// バージョン付加文字列
    77#ifdef _AMD64_
    8 #define VER_INFO        "(x64) (rev.343)"
     8#define VER_INFO        "(x64) (rev.351)"
    99#else
    10 #define VER_INFO        "(rev.343)"
     10#define VER_INFO        "(rev.351)"
    1111#endif
  • trunk/abdev/BasicCompiler_Common/src/Class.cpp

    r326 r340  
    398398    return true;
    399399}
     400
     401bool CClass::Implements( const char *interfaceNames, int nowLine )
     402{
     403    Jenga::Common::Strings paramStrs;
     404    SplitParameter( interfaceNames, paramStrs );
     405
     406    // TODO: 実装
     407    return true;
     408}
     409
    400410CMember *CClass::CreateMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine )
    401411{
     
    12731283                    break;
    12741284                }
     1285                else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPLEMENTS )
     1286                {
     1287                    SetError(137, NULL, i );
     1288                    break;
     1289                }
    12751290
    12761291                sub_address=i;
     
    14121427            }
    14131428            else{
    1414                 bool isInherits = false;
    1415                 if(basbuf[i+1]==1&&basbuf[i+2]==ESC_INHERITS){
    1416                     //継承を行う場合
    1417                     isInherits = true;
    1418 
     1429                if(basbuf[i+1]==1&&basbuf[i+2]==ESC_INHERITS)
     1430                {
     1431                    // クラス継承先が指定されているとき
    14191432                    i += 3;
    14201433                    GetCommandToken( temporary, basbuf, i );
     
    14251438                    }
    14261439                }
    1427 
    1428                 if( !isInherits ){
    1429                     //Objectを継承する
     1440                else
     1441                {
     1442                    // 何の指定もないときはObjectクラスを継承する
    14301443                    lstrcpy( temporary, "Object" );
    14311444                }
    1432 
    14331445                pobj_c->Inherits( temporary, i );
     1446
     1447                if( basbuf[i+1] == 1 && basbuf[i+2] == ESC_IMPLEMENTS )
     1448                {
     1449                    // インターフェイス実装を行う場合
     1450                    i += 3;
     1451                    GetCommandToken( temporary, basbuf, i );
     1452
     1453                    pobj_c->Implements( temporary, i );
     1454                }
    14341455            }
    14351456InheritsError:
     
    14481469                if(basbuf[i]==1&&basbuf[i+1]==ESC_INHERITS){
    14491470                    SetError(111,NULL,i);
     1471                    break;
     1472                }
     1473                else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPLEMENTS )
     1474                {
     1475                    SetError(137, NULL, i );
    14501476                    break;
    14511477                }
Note: See TracChangeset for help on using the changeset viewer.