Changeset 100 in dev for BasicCompiler_Common/hash.cpp


Ignore:
Timestamp:
Apr 24, 2007, 3:17:29 AM (17 years ago)
Author:
dai_9181
Message:

名前空間機能をグローバル関数に適用。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler_Common/hash.cpp

    r97 r100  
    6868    char NestMember[VN_SIZE];   //入れ子メンバ
    6969    bool isObjectMember = SplitMemberName( name, ObjName, NestMember );
    70     if( !isObjectMember ) lstrcpy(ObjName,name);
    7170
    7271    if(isObjectMember){
     
    8281            //"->"によってオブジェクトを指定する通常のメンバ関数呼び出し
    8382            Type type;
    84             GetVarType(ObjName,type,0);
    85             pobj_c = &type.GetClass();
    86             if((NATURAL_TYPE(type.GetBasicType())!=DEF_OBJECT)){
     83            if( GetVarType(ObjName,type,0) ){
     84                pobj_c = &type.GetClass();
     85            }
     86            else{
    8787                pobj_c=pobj_DBClass->check(ObjName);
    8888                if( pobj_c ){
    8989                    isStatic = true;
    9090                }
    91                 else{
    92                     return;
    93                 }
    9491            }
    9592        }
    9693
    97         if( isStatic ){
    98             // 静的メソッドから列挙
    99             pobj_c->EnumStaticMethod( NestMember, subs );
    100         }
    101         else{
    102             //動的メソッドから列挙
    103             pobj_c->EnumMethod( NestMember, subs );
     94        if( pobj_c ){
     95            if( isStatic ){
     96                // 静的メソッドから列挙
     97                pobj_c->EnumStaticMethod( NestMember, subs );
     98            }
     99            else{
     100                //動的メソッドから列挙
     101                pobj_c->EnumMethod( NestMember, subs );
     102            }
     103            return;
    104104        }
    105105    }
    106     else{
    107         //オブジェクトが明示的に指定されていないとき
    108106
    109         if(pobj_CompilingClass){
    110             //自身のオブジェクトのメンバ関数を検索
    111107
    112             // 静的メソッド
    113             pobj_CompilingClass->EnumStaticMethod( name, subs );
     108    if(pobj_CompilingClass){
     109        //自身のオブジェクトのメンバ関数を検索
    114110
    115             // 動的メソッド
    116             pobj_CompilingClass->EnumMethod( name, subs );
     111        // 静的メソッド
     112        pobj_CompilingClass->EnumStaticMethod( name, subs );
     113
     114        // 動的メソッド
     115        pobj_CompilingClass->EnumMethod( name, subs );
     116    }
     117
     118
     119    ///////////////////////////
     120    // グローバル関数を検索
     121    ///////////////////////////
     122
     123    //ハッシュ値を取得
     124    int key;
     125    key=hash_default(NestMember);
     126
     127    //格納位置を取得
     128    extern GlobalProc **ppSubHash;
     129    GlobalProc *pUserProc;
     130    pUserProc=ppSubHash[key];
     131    while(pUserProc){
     132        if(!pUserProc->GetParentClassPtr()){
     133            if( pUserProc->EqualName( name ) ){
     134                subs.push_back( pUserProc );
     135            }
    117136        }
    118137
    119 
    120         ///////////////////////////
    121         // グローバル関数を検索
    122         ///////////////////////////
    123 
    124         //ハッシュ値を取得
    125         int key;
    126         key=hash_default(name);
    127 
    128         //格納位置を取得
    129         extern UserProc **ppSubHash;
    130         UserProc *pUserProc;
    131         pUserProc=ppSubHash[key];
    132         while(pUserProc){
    133             if(!pUserProc->GetParentClassPtr()){
    134                 if( pUserProc->GetName() == name ){
    135                     subs.push_back( pUserProc );
    136                 }
    137             }
    138 
    139             pUserProc=pUserProc->pNextData;
    140         }
    141 
     138        pUserProc=pUserProc->pNextData;
    142139    }
    143140}
Note: See TracChangeset for help on using the changeset viewer.