Changeset 814 in dev for branches/egtra/ab5.0/abdev/BasicCompiler_Common/src/LexicalAnalyzer.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.cpp
r625 r814 3 3 using namespace ActiveBasic::Compiler; 4 4 5 bool LexicalAnalyzer::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection ) 5 using boost::numeric_cast; 6 7 bool LexicalAnalyzer::CollectNamespaces(char const* source, NamespaceScopesCollection &namespaceScopesCollection) 6 8 { 7 int i, i2;8 char temporary[1024];9 10 9 bool isSuccessful = true; 11 10 … … 13 12 NamespaceScopes namespaceScopes; 14 13 15 for(i=0;;i++){ 14 for (int i = 0; ; i++) 15 { 16 16 if(source[i]=='\0') break; 17 17 18 18 if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){ 19 for(i+=2,i2=0;;i2++,i++){ 20 if( IsCommandDelimitation( source[i] ) ){ 21 temporary[i2]=0; 22 break; 23 } 24 temporary[i2]=source[i]; 19 i+=2; 20 char const* p = &source[i]; 21 while (!IsCommandDelimitation(source[i])) 22 { 23 ++i; 25 24 } 26 namespaceScopes.push_back( temporary);25 namespaceScopes.push_back(std::string(p, &source[i])); 27 26 28 27 if( !namespaceScopesCollection.IsExist( namespaceScopes ) ){ … … 46 45 } 47 46 48 if( namespaceScopes.size() > 0){47 if( !namespaceScopes.empty() ){ 49 48 compiler.errorMessenger.Output( 63, NULL, cp ); 50 49 isSuccessful = false;
Note:
See TracChangeset
for help on using the changeset viewer.