Changeset 49 in dev for BasicCompiler_Common/Variable.cpp
- Timestamp:
- Feb 10, 2007, 6:13:37 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Variable.cpp
r46 r49 297 297 TYPEINFO TypeInfo = { DEF_OBJECT, (LONG_PTR)pobj_StringClass }; 298 298 return TypeInfo; 299 } 300 301 bool FormatUseProcReturnObject( const char *term, char *procName, char *parameter, int &RefType, char *member ){ 302 int p1 = 0, p2 = 0; 303 304 for( int i=0; term[i]!='\0' ; i++ ){ 305 306 if( term[i] == '[' ){ 307 i = JumpStringInBracket( term, i + 1 ); 308 continue; 309 } 310 if( term[i] == '(' ){ 311 int temp_p = i; 312 i = JumpStringInPare( term, i + 1 ) + 1; 313 if( term[i] == '.' 314 || term[i] == 1 && term[i] == ESC_PSMEM ){ 315 p1 = temp_p; 316 p2 = i; 317 } 318 continue; 319 } 320 } 321 if( !p1 ) return false; 322 323 //メソッド名 324 memcpy( procName, term, p1 ); 325 procName[p1] = 0; 326 327 //パラメータ 328 memcpy( parameter, term + p1 + 1, p2 - p1 - 2 ); 329 parameter[ p2 - p1 - 2 ] = 0; 330 331 //参照タイプ 332 if( term[p2] == '.' ){ 333 RefType = DEF_OBJECT; 334 } 335 else{ 336 RefType = DEF_PTR_OBJECT; 337 p2++; 338 } 339 340 //メンバ 341 lstrcpy( member, term + p2 + 1 ); 342 343 return true; 299 344 } 300 345 … … 632 677 extern BOOL bCompilingGlobal; 633 678 int i; 679 LONG_PTR lpIndex; 634 680 char variable[VN_SIZE],member[VN_SIZE],VarName[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE]; 635 681 … … 640 686 else lstrcpy(variable,NameBuffer); 641 687 688 689 int RefType; 690 if( FormatUseProcReturnObject( variable, VarName, array, RefType, member ) ){ 691 // 戻り値オブジェクトのメンバを直接参照しているとき 692 //例: func().member 693 694 void *pInfo; 695 int idProc=GetProc(VarName,&pInfo); 696 697 if(idProc){ 698 699 int type=GetReturnTypeOfProc(idProc,pInfo,VarName,array,&lpIndex); 700 701 return GetMemberType((CClass *)lpIndex,member,plpIndex,1,bError); 702 } 703 } 704 705 706 642 707 lstrcpy(VarName,variable); 643 GetVarFormatString(VarName,array,lpPtrOffset,member,& i);708 GetVarFormatString(VarName,array,lpPtrOffset,member,&RefType); 644 709 645 710 int *pSubScripts; 646 711 int type; 647 LONG_PTR lpIndex;648 712 649 713 extern int MaxGlobalVarNum;
Note:
See TracChangeset
for help on using the changeset viewer.