Changeset 561 in dev
- Timestamp:
- May 5, 2008, 1:09:21 PM (17 years ago)
- Location:
- trunk/ab5.0/abdev
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp
r537 r561 190 190 tv.item.pszText=VarData; 191 191 192 BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){192 BOOST_FOREACH( Member *pMember, objClass.GetDynamicMembers() ){ 193 193 if(bPtr){ 194 194 lstrcpy(VarName,"->"); … … 473 473 } 474 474 475 BOOST_FOREACH( CMember *pMember, pUserProc->GetParentClassPtr()->GetDynamicMembers() ){475 BOOST_FOREACH( Member *pMember, pUserProc->GetParentClassPtr()->GetDynamicMembers() ){ 476 476 offset=pUserProc->GetParentClassPtr()->GetMemberOffset( pMember->GetName().c_str()); 477 477 -
trunk/ab5.0/abdev/BasicCompiler_Common/VariableOpe.cpp
r537 r561 450 450 if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return false; 451 451 452 const CMember *pMember = objClass.FindDynamicMember( VarName );452 const Member *pMember = objClass.FindDynamicMember( VarName ); 453 453 if( !pMember ){ 454 454 if(isErrorEnabled) compiler.errorMessenger.Output(103,VarName,cp); -
trunk/ab5.0/abdev/BasicCompiler_Common/WatchList.cpp
r537 r561 130 130 //////////////////////////// 131 131 132 const CMember *pMember = objClass.FindDynamicMember( VarName );132 const Member *pMember = objClass.FindDynamicMember( VarName ); 133 133 if( !pMember ) 134 134 { -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Class.h
r560 r561 145 145 { 146 146 // 動的メンバ 147 BOOST_FOREACH( CMember *member, dynamicMembers )147 BOOST_FOREACH( Member *member, dynamicMembers ) 148 148 { 149 149 delete member; … … 151 151 152 152 // 静的メンバ 153 BOOST_FOREACH( CMember *member, staticMembers )153 BOOST_FOREACH( Member *member, staticMembers ) 154 154 { 155 155 delete member; … … 320 320 321 321 //メンバ、メソッドの追加 322 CMember *CreateMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ); 323 void AddMember( Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine ); 324 void AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ); 322 void AddDynamicMember( Member *pMember ); 323 void AddStaticMember( Member *pMember ); 325 324 326 325 //重複チェック … … 345 344 } 346 345 347 const CMember *FindDynamicMember( const char *memberName ) const;346 const Member *FindDynamicMember( const char *memberName ) const; 348 347 bool HasDynamicMember( const char *memberName ) const 349 348 { -
trunk/ab5.0/abdev/BasicCompiler_Common/include/LexicalAnalyzer.h
r560 r561 44 44 45 45 // クラスを収集する 46 static Member *CreateMember( const CClass &_class, Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ); 46 47 static void AddMethod(CClass *pobj_c, UserProc *pUserProc, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract, 47 48 bool isVirtual, bool isOverride, const char *interfaceName, bool isAutoGeneration, int nowLine); -
trunk/ab5.0/abdev/BasicCompiler_Common/include/Member.h
r524 r561 3 3 class CClass; 4 4 5 class CMember : public MemberPrototype5 class Member : public MemberPrototype 6 6 { 7 7 std::string name; … … 19 19 template<class Archive> void serialize(Archive& ar, const unsigned int version) 20 20 { 21 trace_for_serialize( "serializing - CMember" );21 trace_for_serialize( "serializing - Member" ); 22 22 23 23 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP( MemberPrototype ); … … 71 71 } 72 72 73 CMember( Prototype::Accessibility accessibility, const std::string &name, const Type &newType, bool isConst, const Subscripts &subscripts, const std::string &initializeExpression, const std::string &constructParameter )73 Member( Prototype::Accessibility accessibility, const std::string &name, const Type &newType, bool isConst, const Subscripts &subscripts, const std::string &initializeExpression, const std::string &constructParameter ) 74 74 : MemberPrototype( accessibility ) 75 75 , name( name ) … … 81 81 { 82 82 } 83 CMember::CMember(CMember &member)83 Member::Member(Member &member) 84 84 : MemberPrototype( member.GetAccessibility() ) 85 85 , name( member.GetName() ) … … 91 91 source_code_address=member.source_code_address; 92 92 } 93 CMember()93 Member() 94 94 { 95 95 } 96 ~ CMember()96 ~Member() 97 97 { 98 98 } 99 99 }; 100 typedef std::vector< CMember *> Members;100 typedef std::vector<Member *> Members; -
trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
r560 r561 185 185 } 186 186 187 CMember *CClass::CreateMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ) 188 { 189 extern int cp; 190 191 //構文を解析 192 char VarName[VN_SIZE]; 193 char initBuffer[VN_SIZE]; 194 char lpszConstructParameter[VN_SIZE]; 195 Subscripts subscripts; 196 Type type; 197 GetDimentionFormat(buffer,VarName,subscripts,type,initBuffer,lpszConstructParameter); 198 199 //重複チェック 200 if(this->DupliCheckAll(VarName)){ 201 compiler.errorMessenger.Output(15,VarName,cp); 202 } 203 204 CMember *pMember = new CMember( accessibility, VarName, type, isConst, subscripts, initBuffer, lpszConstructParameter ); 205 pMember->source_code_address = nowLine; 206 return pMember; 207 } 208 void CClass::AddMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ){ 209 dynamicMembers.push_back( 210 CreateMember( accessibility, isConst, isRef, buffer, nowLine ) 211 ); 212 } 213 void CClass::AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ){ 214 staticMembers.push_back( 215 CreateMember( accessibility, isConst, isRef, buffer, nowLine ) 216 ); 187 void CClass::AddDynamicMember( Member *pMember ) 188 { 189 dynamicMembers.push_back( pMember ); 190 } 191 void CClass::AddStaticMember( Member *pMember ) 192 { 193 staticMembers.push_back( pMember ); 217 194 } 218 195 … … 247 224 248 225 // 動的メンバ 249 BOOST_FOREACH( CMember *pMember, dynamicMembers )226 BOOST_FOREACH( Member *pMember, dynamicMembers ) 250 227 { 251 228 if( GetName() == pMember->GetName() ) … … 256 233 257 234 // 静的メンバ 258 BOOST_FOREACH( CMember *pMember, staticMembers ){235 BOOST_FOREACH( Member *pMember, staticMembers ){ 259 236 if( GetName() == pMember->GetName() ){ 260 237 return true; … … 265 242 } 266 243 267 const CMember *CClass::FindDynamicMember( const char *memberName ) const244 const Member *CClass::FindDynamicMember( const char *memberName ) const 268 245 { 269 246 if( this->HasSuperClass() ) 270 247 { 271 248 // 基底クラスで検索 272 const CMember *result = this->GetSuperClass().FindDynamicMember( memberName );249 const Member *result = this->GetSuperClass().FindDynamicMember( memberName ); 273 250 if( result ) 274 251 { … … 277 254 } 278 255 279 BOOST_FOREACH( CMember *pMember, GetDynamicMembers() )256 BOOST_FOREACH( Member *pMember, GetDynamicMembers() ) 280 257 { 281 258 if( pMember->GetName() == memberName ) … … 373 350 } 374 351 375 BOOST_FOREACH( CMember *pMember, dynamicMembers )352 BOOST_FOREACH( Member *pMember, dynamicMembers ) 376 353 { 377 354 // メンバサイズ … … 479 456 } 480 457 481 BOOST_FOREACH( CMember *pMember, dynamicMembers )458 BOOST_FOREACH( Member *pMember, dynamicMembers ) 482 459 { 483 460 // メンバサイズ … … 580 557 } 581 558 582 BOOST_FOREACH( CMember *pMember, dynamicMembers )559 BOOST_FOREACH( Member *pMember, dynamicMembers ) 583 560 { 584 561 int tempAlignment = pMember->GetType().GetSize(); … … 761 738 762 739 int i=0; 763 BOOST_FOREACH( CMember *member, objClass.GetStaticMembers() )740 BOOST_FOREACH( Member *member, objClass.GetStaticMembers() ) 764 741 { 765 742 if( pEnumInfo ) … … 1017 994 std::string result; 1018 995 1019 BOOST_FOREACH( const CMember *pMember, dynamicMembers )996 BOOST_FOREACH( const Member *pMember, dynamicMembers ) 1020 997 { 1021 998 if( result.size() ) … … 1033 1010 std::string result; 1034 1011 1035 BOOST_FOREACH( const CMember *pMember, dynamicMembers )1012 BOOST_FOREACH( const Member *pMember, dynamicMembers ) 1036 1013 { 1037 1014 if( result.size() ) … … 1049 1026 std::string result; 1050 1027 1051 BOOST_FOREACH( const CMember *pMember, dynamicMembers )1028 BOOST_FOREACH( const Member *pMember, dynamicMembers ) 1052 1029 { 1053 1030 if( result.size() ) … … 1070 1047 { 1071 1048 const CClass &thisClass = *this; 1072 BOOST_FOREACH( const CMember *pMember, thisClass.GetDynamicMembers() )1049 BOOST_FOREACH( const Member *pMember, thisClass.GetDynamicMembers() ) 1073 1050 { 1074 1051 if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() ) -
trunk/ab5.0/abdev/BasicCompiler_Common/src/DataTable.cpp
r524 r561 131 131 132 132 // メンバを取得 133 const CMember *member = objClass.FindDynamicMember( memberName );133 const Member *member = objClass.FindDynamicMember( memberName ); 134 134 135 135 // メンバオフセットを取得 -
trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Class.cpp
r560 r561 224 224 225 225 bool result = true; 226 BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){226 BOOST_FOREACH( Member *pMember, objClass.GetDynamicMembers() ){ 227 227 if(pMember->GetType().IsStruct()){ 228 228 //循環参照でないかをチェック … … 268 268 } 269 269 270 Member *LexicalAnalyzer::CreateMember( const CClass &_class, Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ) 271 { 272 extern int cp; 273 274 //構文を解析 275 char VarName[VN_SIZE]; 276 char initBuffer[VN_SIZE]; 277 char lpszConstructParameter[VN_SIZE]; 278 Subscripts subscripts; 279 Type type; 280 GetDimentionFormat(buffer,VarName,subscripts,type,initBuffer,lpszConstructParameter); 281 282 //重複チェック 283 if( _class.DupliCheckAll( VarName ) ){ 284 compiler.errorMessenger.Output(15,VarName,cp); 285 } 286 287 Member *pMember = new Member( accessibility, VarName, type, isConst, subscripts, initBuffer, lpszConstructParameter ); 288 pMember->source_code_address = nowLine; 289 return pMember; 290 } 291 270 292 void LexicalAnalyzer::AddMethod(CClass *pobj_c, UserProc *pUserProc, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract, 271 293 bool isVirtual, bool isOverride, const char *interfaceName, bool isAutoGeneration, int nowLine) … … 1160 1182 //静的メンバを追加 1161 1183 cp=i; //エラー用 1162 pobj_c->AddStaticMember( accessibility, isConst, false, temporary, i); 1184 pobj_c->AddStaticMember( 1185 LexicalAnalyzer::CreateMember( *pobj_c, accessibility, isConst, false, temporary, i ) 1186 ); 1163 1187 } 1164 1188 else{ 1165 1189 //メンバを追加 1166 1190 cp=i; //エラー用 1167 pobj_c->AddMember( accessibility, isConst, false, temporary, i ); 1191 pobj_c->AddDynamicMember( 1192 LexicalAnalyzer::CreateMember( *pobj_c, accessibility, isConst, false, temporary, i ) 1193 ); 1168 1194 1169 1195 -
trunk/ab5.0/abdev/compiler_x86/Compile_Var.cpp
r538 r561 183 183 //////////////////////////// 184 184 185 const CMember *pMember = objClass.FindDynamicMember( VarName );185 const Member *pMember = objClass.FindDynamicMember( VarName ); 186 186 if( !pMember ) 187 187 { … … 789 789 790 790 int i = 0; 791 BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){791 BOOST_FOREACH( Member *pMember, objClass.GetDynamicMembers() ){ 792 792 if(InitBuf[i]=='\0'){ 793 793 compiler.errorMessenger.Output(41,0,cp); … … 952 952 953 953 int i = 0; 954 BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){954 BOOST_FOREACH( Member *pMember, objClass.GetDynamicMembers() ){ 955 955 if(InitBuf[i]=='\0'){ 956 956 compiler.errorMessenger.Output(41,0,cp);
Note:
See TracChangeset
for help on using the changeset viewer.