Changeset 828 in dev for trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Delegate.cpp
- Timestamp:
- Mar 19, 2012, 1:59:48 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to
/branches/egtra merged eligible
-
Property svn:mergeinfo
set to
-
trunk/ab5.0/abdev
-
Property svn:ignore
set to
*.opensdf
*.sdf
*.suo
*.user
int
ipch
out
-
Property svn:ignore
set to
-
trunk/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Delegate.cpp
r750 r828 5 5 void LexicalAnalyzer::CollectDelegates( const char *source, Delegates &delegates ) 6 6 { 7 int i2;8 char temporary[VN_SIZE];9 10 7 // 名前空間管理 11 8 NamespaceScopes &namespaceScopes = compiler.GetNamespaceSupporter().GetLivingNamespaceScopes(); … … 15 12 compiler.GetNamespaceSupporter().ClearImportedNamespaces(); 16 13 17 int length = lstrlen( source ); 18 for( int i=0; i<length; i++ ) 14 for (int i=0; source[i] != '\0'; i++) 19 15 { 20 16 if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){ 21 for(i+=2,i2=0;;i2++,i++){ 22 if( IsCommandDelimitation( source[i] ) ){ 23 temporary[i2]=0; 24 break; 25 } 26 temporary[i2]=source[i]; 27 } 28 namespaceScopes.push_back( temporary ); 17 i+=2; 18 char const* p = &source[i]; 19 while (!IsCommandDelimitation(source[i])) 20 { 21 ++i; 22 } 23 namespaceScopes.push_back(std::string(p, &source[i])); 29 24 30 25 continue; … … 42 37 } 43 38 else if( source[i] == 1 && source[i+1] == ESC_IMPORTS ){ 44 for(i+=2,i2=0;;i2++,i++){45 if( IsCommandDelimitation( source[i] ) ){46 temporary[i2]=0;47 break;48 }49 temporary[i2]=source[i];50 }51 if ( !compiler.GetNamespaceSupporter().ImportsNamespace( temporary ))52 { 53 compiler.errorMessenger.Output(64, temporary,i);39 i+=2; 40 char const* p = &source[i]; 41 while (!IsCommandDelimitation(source[i])) 42 { 43 ++i; 44 } 45 std::string s(p, &source[i]); 46 if (!compiler.GetNamespaceSupporter().ImportsNamespace(s)) 47 { 48 compiler.errorMessenger.Output(64, s.c_str(), i); 54 49 } 55 50 … … 112 107 { 113 108 compiler.errorMessenger.Output(-104,name,nowLine); 114 lstrcpy( returnTypeName, "Double" );109 strcpy( returnTypeName, "Double" ); 115 110 } 116 111 } … … 127 122 Jenga::Common::SourceTemplate sourceTemplate( ActiveBasic::Common::Environment::GetAbdevSystemDirPath() + "\\templates\\delegate_class.tab" ); 128 123 129 delegates.Iterator_Reset(); 130 while( delegates.Iterator_HasNext() ) 131 { 132 const Delegate &dg = *delegates.Iterator_GetNext(); 124 foreach (auto pDelegate, delegates) 125 { 126 const Delegate &dg = *pDelegate; 133 127 134 128 if( dg.IsExternal() ) … … 263 257 void LexicalAnalyzer::RefleshDelegatesParameterAndReturnType( Delegates &delegates ) 264 258 { 265 delegates.Iterator_Reset(); 266 while( delegates.Iterator_HasNext() ) 267 { 268 Delegate &dg = *delegates.Iterator_GetNext(); 269 RefleshDelegateParameterAndReturnType( dg ); 270 } 271 } 259 foreach (auto *pDelegate, delegates) 260 { 261 RefleshDelegateParameterAndReturnType(*pDelegate); 262 } 263 }
Note:
See TracChangeset
for help on using the changeset viewer.