Changeset 75 in dev for BasicCompiler_Common/Object.cpp
- Timestamp:
- Mar 20, 2007, 4:36:16 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Object.cpp
r73 r75 9 9 extern HANDLE hHeap; 10 10 11 void CallConstructor(char *ObjectName,int *SubScripts,TYPEINFO &TypeInfo,char *Parameter){ 12 if(TypeInfo.type!=DEF_OBJECT) return; 11 void CallConstructor( const char *ObjectName,const int *SubScripts,const Type &type,const char *Parameter){ 12 if( !type.IsObject() ){ 13 return; 14 } 13 15 14 16 ///////////////////////////////////// … … 16 18 // ※コンストラクタの呼び出し 17 19 ///////////////////////////////////// 18 CClass *pobj_c;19 pobj_c=(CClass *)TypeInfo.u.lpIndex;20 20 21 SubInfo *psi;22 p si=GetMethodHash(ObjectName,pobj_c->name,Parameter);23 if(!p si){24 if(Parameter[0]) SetError(113, pobj_c->name,cp);21 UserProc *pUserProc; 22 pUserProc=GetMethodHash(ObjectName,type.GetClass().name,Parameter); 23 if(!pUserProc){ 24 if(Parameter[0]) SetError(113,type.GetClass().name,cp); 25 25 return; 26 26 } … … 52 52 lstrcat(temporary,"]"); 53 53 54 LONG_PTR lp;55 sprintf(temporary+lstrlen(temporary),".%s", pobj_c->name);56 CallProc( PROC_DEFAULT,57 p si,54 Type dummyType; 55 sprintf(temporary+lstrlen(temporary),".%s",type.GetClass().name); 56 CallProc( PROC_DEFAULT, 57 pUserProc, 58 58 temporary, 59 59 Parameter, 60 &lp);60 dummyType ); 61 61 62 62 ss[0]++; … … 72 72 } 73 73 else{ 74 LONG_PTR lp;75 sprintf(temporary,"%s.%s",ObjectName, pobj_c->name);76 CallProc( PROC_DEFAULT,77 p si,74 Type dummyType; 75 sprintf(temporary,"%s.%s",ObjectName,type.GetClass().name); 76 CallProc( PROC_DEFAULT, 77 pUserProc, 78 78 temporary, 79 79 Parameter, 80 &lp);80 dummyType ); 81 81 } 82 82 } 83 84 bool Operator_New( const char *expression, const Type &baseType, Type &resultType ){ 85 char CreateParameter[VN_SIZE],objectSizeStr[VN_SIZE]; 86 int i,i2; 87 88 i=0; 89 90 if(expression[0]=='['){ 91 i=GetStringInBracket(objectSizeStr,expression); 92 93 SlideString(objectSizeStr+1,-1); 94 objectSizeStr[i-2]=0; 95 } 96 else objectSizeStr[0]=0; 97 98 char typeName[VN_SIZE]; 99 for(i2=0;;i++,i2++){ 100 if(expression[i]=='('){ 101 typeName[i2]=0; 102 103 //コンストラクタに渡すパラメータを取得 104 i2=GetStringInPare(CreateParameter,expression+i); 105 RemoveStringPare(CreateParameter); 106 i+=i2; 107 if(expression[i]!='\0'){ 108 SetError(42,NULL,cp); 109 return false; 110 } 111 break; 112 } 113 typeName[i2]=expression[i]; 114 if(expression[i]=='\0'){ 115 CreateParameter[0]=0; 116 break; 117 } 118 } 119 120 if( !Type::StringToType( typeName, resultType ) ){ 121 SetError(3,typeName,cp); 122 return false; 123 } 124 125 if( !resultType.IsObject() ){ 126 //////////////////////// 127 // 通常のデータ型の場合 128 //////////////////////// 129 130 SetError(121,NULL,cp); 131 return false; 132 } 133 134 Operator_New( resultType.GetClass(), objectSizeStr, CreateParameter, baseType ); 135 136 if( !baseType.IsObject() ){ 137 // オブジェクトポインタ向け 138 resultType.SetBasicType( DEF_PTR_OBJECT ); 139 } 140 141 return true; 142 }
Note:
See TracChangeset
for help on using the changeset viewer.