Changeset 106 in dev
- Timestamp:
- May 4, 2007, 5:04:50 PM (18 years ago)
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_Var.cpp
r104 r106 352 352 bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss){ 353 353 int i; 354 char variable[VN_SIZE] ,member[VN_SIZE],VarName[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];354 char variable[VN_SIZE]; 355 355 356 356 if(NameBuffer[0]=='.'){ … … 360 360 else lstrcpy(variable,NameBuffer); 361 361 362 // 名前空間を分離 363 char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE]; 364 Smoothie::Meta::namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName ); 365 366 // 先頭オブジェクトまたはクラス名と入れ子メンバに分割 362 367 CClass::RefType refType; 363 if( FormatUseProcReturnObject( variable, VarName, array, refType, member ) ){ 364 // 戻り値オブジェクトのメンバを直接参照しているとき 365 //例: func().member 366 367 void *pInfo; 368 int idProc=GetProc(VarName,(void **)&pInfo); 369 370 if(idProc){ 371 pRelativeVar->dwKind=VAR_DIRECTMEM; 372 373 Type type; 374 375 376 //////////////// 377 // 呼び出し 378 //////////////// 379 380 CallProc(idProc,pInfo,VarName,array,type); 381 382 //戻り値をecxにコピー 383 op_mov_RR( REG_ECX, REG_EAX ); 384 385 386 if(!_member_offset( 387 isErrorEnabled, 388 isWriteAccess, 389 type.GetClass(), 390 member,pRelativeVar,resultType,0)) return false; 391 392 return true; 393 } 394 } 395 396 397 lstrcpy(VarName,variable); 398 GetVarFormatString(VarName,array,lpPtrOffset,member,refType); 368 char member[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE]; 369 GetVarFormatString(simpleName,array,lpPtrOffset,member,refType); 370 371 // 名前空間を分離していた場合は結合 372 char VarName[VN_SIZE]; 373 if( namespaceStr[0] ){ 374 sprintf( VarName, "%s.%s", namespaceStr, simpleName ); 375 } 376 else{ 377 lstrcpy( VarName, simpleName ); 378 } 399 379 400 380 const int *pSubScripts; -
BasicCompiler32/NumOpe.cpp
r103 r106 272 272 return TermMemberOpe( leftType.GetClass(), baseType, resultType, termFull, termLeft, member ); 273 273 } 274 globalArea: 274 275 275 276 … … 289 290 // グローバル属性エリア 290 291 ///////////////////////////////////////////////////////////////// 291 globalArea:292 292 293 293 const int useReg = REG_EAX; -
BasicCompiler64/Compile_Var.cpp
r103 r106 388 388 else lstrcpy(variable,NameBuffer); 389 389 390 // 名前空間を分離 391 char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE]; 392 Smoothie::Meta::namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName ); 393 394 // 先頭オブジェクトまたはクラス名と入れ子メンバに分割 390 395 CClass::RefType refType; 391 if( FormatUseProcReturnObject( variable, VarName, array, refType, member ) ){ 392 // 戻り値オブジェクトのメンバを直接参照しているとき 393 //例: func().member 394 395 // TODO: 消す 396 SetError(); 397 return false; 398 /* 399 void *pInfo; 400 int idProc=GetProc(VarName,(void **)&pInfo); 401 402 if(idProc){ 403 pRelativeVar->dwKind=VAR_DIRECTMEM; 404 405 Type type; 406 407 ////////////////////////////////////////////////////// 408 ///// レジスタ資源のバックアップ 409 { BACKUP_REGISTER_RESOURCE 410 ////////////////////////////////////////////////////// 411 412 //////////////// 413 // 呼び出し 414 //////////////// 415 416 CallProc(idProc,pInfo,VarName,array,type); 417 418 //戻り値をr11にコピー 419 op_mov_RR( REG_R11, REG_RAX ); 420 421 ///////////////////////////////////////////// 422 ////// レジスタ資源を復元 423 RESTORE_REGISTER_RESOURCE 424 }//////////////////////////////////////////// 425 426 if(!_member_offset( 427 isErrorEnabled, 428 isWriteAccess, 429 type.GetClass(), 430 member,pRelativeVar,resultType,0)) return false; 431 432 return true; 433 }*/ 434 } 435 436 437 438 lstrcpy(VarName,variable); 439 GetVarFormatString(VarName,array,lpPtrOffset,member,refType); 396 char member[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE]; 397 GetVarFormatString(simpleName,array,lpPtrOffset,member,refType); 398 399 // 名前空間を分離していた場合は結合 400 char VarName[VN_SIZE]; 401 if( namespaceStr[0] ){ 402 sprintf( VarName, "%s.%s", namespaceStr, simpleName ); 403 } 404 else{ 405 lstrcpy( VarName, simpleName ); 406 } 440 407 441 408 const int *pSubScripts; -
BasicCompiler_Common/Class.cpp
r102 r106 91 91 92 92 while(pobj_DBClass->Iterator_HasNext()){ 93 CClass *pobj_c; 94 pobj_c=pobj_DBClass->Iterator_GetNext(); 93 CClass &objClass = *pobj_DBClass->Iterator_GetNext(); 94 95 // 名前空間をセット 96 Smoothie::Lexical::liveingNamespaceScopes = objClass.GetNamespaceScopes(); 95 97 96 98 int i=0; 97 foreach( CMember *member, pobj_c->staticMembers ){99 foreach( CMember *member, objClass.staticMembers ){ 98 100 char temporary[VN_SIZE]; 99 sprintf(temporary,"%s.%s", pobj_c->name,member->name);101 sprintf(temporary,"%s.%s",objClass.name,member->name); 100 102 dim( 101 103 temporary, … … 112 114 } 113 115 } 116 117 Smoothie::Lexical::liveingNamespaceScopes.clear(); 114 118 115 119 cp=back_cp; -
BasicCompiler_Common/VariableOpe.cpp
r103 r106 249 249 } 250 250 251 /*TODO: 消す 251 252 bool FormatUseProcReturnObject( const char *term, char *procName, char *parameter, CClass::RefType &refType, char *member ){ 252 253 int p1 = 0, p2 = 0; … … 294 295 295 296 return true; 296 } 297 }*/ 297 298 298 299 BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember,CClass::RefType &refType){ … … 632 633 bool GetVarType( const char *nameBuffer, Type &resultType, bool isErrorEnabled){ 633 634 int i; 634 char variable[VN_SIZE] ,member[VN_SIZE],VarName[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];635 char variable[VN_SIZE]; 635 636 636 637 if(nameBuffer[0]=='.'){ … … 640 641 else lstrcpy(variable,nameBuffer); 641 642 642 643 // 名前空間を分離 644 char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE]; 645 Smoothie::Meta::namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName ); 646 647 // 先頭オブジェクトまたはクラス名と入れ子メンバに分割 643 648 CClass::RefType refType; 644 if( FormatUseProcReturnObject( variable, VarName, array, refType, member ) ){ 645 // 戻り値オブジェクトのメンバを直接参照しているとき 646 //例: func().member 647 648 void *pProc; 649 int idProc=GetProc(VarName,(void **)&pProc); 650 651 if(idProc){ 652 Type type; 653 if( !CallProc( idProc, pProc, VarName, array,type, false) ){ 654 return false; 655 } 656 657 return GetMemberType( type.GetClass() ,member,resultType,1,isErrorEnabled); 658 } 659 } 660 661 662 663 lstrcpy(VarName,variable); 664 GetVarFormatString(VarName,array,lpPtrOffset,member,refType); 649 char member[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE]; 650 GetVarFormatString(simpleName,array,lpPtrOffset,member,refType); 651 652 // 名前空間を分離していた場合は結合 653 char VarName[VN_SIZE]; 654 if( namespaceStr[0] ){ 655 sprintf( VarName, "%s.%s", namespaceStr, simpleName ); 656 } 657 else{ 658 lstrcpy( VarName, simpleName ); 659 } 665 660 666 661 const Variable *pVar = NULL; -
BasicCompiler_Common/VariableOpe.h
r97 r106 15 15 BOOL GetTypeName(int type,LONG_PTR lpIndex,char *name); 16 16 void GetWithName(char *buffer); 17 bool FormatUseProcReturnObject( const char *term, char *procName, char *parameter, CClass::RefType &refType, char *member );18 17 BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember, CClass::RefType &refType ); 19 18 void GetArrayElement( const char *buffer,char *variable,char *array_element);
Note:
See TracChangeset
for help on using the changeset viewer.