Changeset 182 in dev for trunk/abdev/BasicCompiler_Common/Subroutine.cpp
- Timestamp:
- Jun 24, 2007, 6:49:13 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler_Common/Subroutine.cpp
r169 r182 1 #include <jenga/include/smoothie/Smoothie.h> 2 #include <jenga/include/smoothie/LexicalAnalysis.h> 3 4 #include <ProcedureImpl.h> 5 1 6 #include "../BasicCompiler_Common/common.h" 2 7 … … 83 88 } 84 89 } 85 bool SplitMemberName( const char *desc, char *object, char *member, CClass::RefType &refType ){86 int lastIndex = -1;87 for( int i=0; desc[i]; i++ ){88 if( desc[i] == '(' ){89 i=JumpStringInPare(desc,i+1);90 continue;91 }92 else if( desc[i] == '[' ){93 i=JumpStringInBracket(desc,i+1);94 continue;95 }96 else if(desc[i]=='.'||(desc[i]==1&&desc[i+1]==ESC_PSMEM)){97 lastIndex = i;98 }99 }100 if( lastIndex == -1 ){101 lstrcpy( member, desc );102 return false;103 }104 105 if(desc[lastIndex]=='.'){106 lstrcpy(member,desc+lastIndex+1);107 refType = CClass::Dot;108 }109 else{110 lstrcpy(member,desc+lastIndex+2);111 refType = CClass::Pointer;112 }113 114 if( object ){115 lstrcpy( object, desc );116 object[lastIndex]=0;117 }118 119 return true;120 }121 bool SplitMemberName( const char *desc, char *object, char *member ){122 CClass::RefType dummyRefType;123 return SplitMemberName( desc, object, member, dummyRefType );124 }125 90 126 91 bool CallProc( int kind, const void *pProc, const char *fullCallName, const char *lpszParms, Type &resultType, bool isCallOn ){ … … 199 164 GetVarType(fullCallName,type,false); 200 165 201 ProcPointer *pProcPtr = Smoothie:: meta.procPointers[type.GetIndex()];166 ProcPointer *pProcPtr = Smoothie::GetMeta().GetProcPointers()[type.GetIndex()]; 202 167 resultType = pProcPtr->ReturnType(); 203 168 … … 402 367 403 368 // オブジェクトを生成 404 DllProc *pDllProc = new DllProc ( namespaceScopes, procName, kind, isCdecl, dllFileName, alias );369 DllProc *pDllProc = new DllProcImpl( namespaceScopes, procName, kind, isCdecl, dllFileName, alias ); 405 370 406 371 // パラメータを解析 … … 409 374 410 375 // パラメータのエラーチェック 411 foreach( const Parameter *pParam, pDllProc->Params() ){376 BOOST_FOREACH( const Parameter *pParam, pDllProc->Params() ){ 412 377 if( pParam->IsObject() ){ 413 378 SetError(25,pParam->GetVarName(),nowLine); … … 662 627 663 628 // 名前空間管理 664 NamespaceScopes &namespaceScopes = Smoothie:: Lexical::liveingNamespaceScopes;629 NamespaceScopes &namespaceScopes = Smoothie::Temp::liveingNamespaceScopes; 665 630 namespaceScopes.clear(); 666 631 … … 852 817 } 853 818 854 855 856 ///////////////////////857 // 関数ポインタの管理858 ///////////////////////859 860 int AddProcPtrInfo( const string &typeExpression, int nowLine ){861 DWORD dwProcType = (DWORD)typeExpression[2];862 const string ¶mStr = typeExpression.substr( 3 );863 864 Procedure::Kind kind = Procedure::Sub;865 if( dwProcType == ESC_FUNCTION ){866 kind = Procedure::Function;867 }868 869 ProcPointer *pProcPointer = new ProcPointer( kind );870 871 //buffer[0]は'('となっている872 pProcPointer->SetParamsAndReturnType( paramStr.c_str(), nowLine );873 874 Smoothie::meta.procPointers.push_back( pProcPointer );875 876 return (int)Smoothie::meta.procPointers.size()-1;877 }878 void DeleteProcPtrInfo(void){879 BOOST_FOREACH( ProcPointer *pProcPointer, Smoothie::meta.procPointers ){880 delete pProcPointer;881 }882 883 Smoothie::meta.procPointers.clear();884 }885 886 887 888 819 bool IsNeedProcCompile(){ 889 820 for(int i2=0;i2<MAX_HASH;i2++){
Note:
See TracChangeset
for help on using the changeset viewer.