Changeset 814 in dev for branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Delegate.cpp
- Timestamp:
- Mar 19, 2011, 1:29:12 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer_Delegate.cpp
r803 r814 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 }
Note:
See TracChangeset
for help on using the changeset viewer.