Changeset 206 in dev for trunk/abdev/BasicCompiler_Common/hash.cpp
- Timestamp:
- Jul 12, 2007, 2:58:26 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/hash.cpp
r193 r206 1 #include "stdafx.h" 2 1 3 #include <jenga/include/smoothie/Smoothie.h> 2 4 … … 21 23 } 22 24 23 CONSTINFO *GetConstHash(const char *name){24 //ハッシュ値を取得25 int key;26 key=hash_default(name);27 28 //格納位置を取得29 extern CONSTINFO **ppConstHash;30 CONSTINFO *pci;31 pci=ppConstHash[key];32 while(pci){33 if(lstrcmp(pci->name,name)==0) break;34 35 pci=pci->pNextData;36 }37 38 return pci;39 }40 41 25 DllProc *GetDeclareHash(char *fullName){ 42 26 char ObjName[VN_SIZE]; //オブジェクト変数 43 27 char NestMember[VN_SIZE]; //入れ子メンバ 44 bool isObjectMember = CClass::SplitName( fullName, ObjName, NestMember );28 bool isObjectMember = SplitMemberName( fullName, ObjName, NestMember ); 45 29 46 30 //ハッシュ値を取得 … … 64 48 } 65 49 66 void GetOverloadSubHash( const char *lpszName, std::vector< UserProc *> &subs ){50 void GetOverloadSubHash( const char *lpszName, std::vector<const UserProc *> &subs ){ 67 51 char name[VN_SIZE]; 68 52 … … 75 59 char ObjName[VN_SIZE]; //オブジェクト変数 76 60 char NestMember[VN_SIZE]; //入れ子メンバ 77 bool isObjectMember = CClass::SplitName( name, ObjName, NestMember );61 bool isObjectMember = SplitMemberName( name, ObjName, NestMember ); 78 62 79 63 if(isObjectMember){ … … 84 68 if(lstrcmpi(ObjName,"Super")==0){ 85 69 //クラスメンバ関数内から基底クラスの呼び出し 86 pobj_c= Smoothie::Temp::pCompilingClass;70 pobj_c=compiler.pCompilingClass; 87 71 } 88 72 else{ … … 114 98 115 99 116 if( Smoothie::Temp::pCompilingClass){100 if(compiler.pCompilingClass){ 117 101 //自身のオブジェクトのメンバ関数を検索 118 102 119 103 // 静的メソッド 120 Smoothie::Temp::pCompilingClass->GetStaticMethods().Enum( name, subs );104 compiler.pCompilingClass->GetStaticMethods().Enum( name, subs ); 121 105 122 106 // 動的メソッド 123 Smoothie::Temp::pCompilingClass->GetMethods().Enum( name, subs );107 compiler.pCompilingClass->GetMethods().Enum( name, subs ); 124 108 } 125 109 126 110 127 ///////////////////////////128 111 // グローバル関数を検索 129 /////////////////////////// 130 131 //ハッシュ値を取得 132 int key; 133 key=hash_default(NestMember); 134 135 //格納位置を取得 136 extern GlobalProc **ppSubHash; 137 GlobalProc *pUserProc; 138 pUserProc=ppSubHash[key]; 139 while(pUserProc){ 140 if(!pUserProc->GetParentClassPtr()){ 141 if( pUserProc->IsEqualSymbol( name ) ){ 142 subs.push_back( pUserProc ); 143 } 144 } 145 146 pUserProc=pUserProc->pNextData; 147 } 112 compiler.GetMeta().GetUserProcs().EnumGlobalProcs( NestMember, name, subs ); 148 113 } 149 114 150 115 //オーバーロードされていない関数を取得(昔のコンパイラソースコードとの互換性保持) 151 UserProc *GetSubHash(const char *lpszName,BOOL bError){152 std::vector< UserProc *> subs;116 const UserProc *GetSubHash(const char *lpszName,BOOL bError){ 117 std::vector<const UserProc *> subs; 153 118 GetOverloadSubHash(lpszName,subs); 154 119 … … 166 131 } 167 132 168 UserProc *pUserProc; 169 pUserProc = subs[0]; 133 const UserProc *pUserProc = subs[0]; 170 134 171 135 return pUserProc; 172 136 } 173 UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError){137 const UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError){ 174 138 char temporary[VN_SIZE]; 175 139 sprintf(temporary,"%s.%s",ObjectName,MethodName); 176 140 177 std::vector<UserProc *> subs; 178 UserProc *pUserProc; 141 std::vector<const UserProc *> subs; 179 142 GetOverloadSubHash(temporary,subs); 180 143 … … 185 148 186 149 //オーバーロードを解決 187 pUserProc=OverloadSolutionWithStrParam(temporary,subs,Parameter,ObjectName);150 const UserProc *pUserProc = OverloadSolutionWithStrParam(temporary,subs,Parameter,ObjectName); 188 151 189 152 return pUserProc; 190 153 } 191 154 192 UserProc *GetClassMethod( const char *className, const char *methodName ){155 const UserProc *GetClassMethod( const char *className, const char *methodName ){ 193 156 const CClass *pClass = compiler.GetMeta().GetClasses().Find( className ); 194 157 if( pClass ){ 195 vector< UserProc *> userProcs;158 vector<const UserProc *> userProcs; 196 159 pClass->GetMethods().Enum( methodName, userProcs ); 197 160 if( userProcs.size() == 1 ){
Note:
See TracChangeset
for help on using the changeset viewer.