Changeset 561 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src/Class.cpp
- Timestamp:
- May 5, 2008, 1:09:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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() )
Note:
See TracChangeset
for help on using the changeset viewer.