Changeset 103 in dev for BasicCompiler_Common/Intermediate_Step2.cpp
- Timestamp:
- May 2, 2007, 4:08:58 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Intermediate_Step2.cpp
r100 r103 165 165 } 166 166 } 167 void AddConstEnum( char *buffer){167 void AddConstEnum( const NamespaceScopes &namespaceScopes, char *buffer){ 168 168 extern int cp; 169 169 int i=0,i2; … … 235 235 236 236 //定数を追加 237 CDBConst::obj.AddConst( temporary, NextValue);237 CDBConst::obj.AddConst( namespaceScopes, temporary, NextValue); 238 238 } 239 239 } … … 243 243 //////////////////////////////////////////// 244 244 245 int i ,i2;245 int i2; 246 246 char temporary[1024]; 247 248 // 名前空間管理 249 NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes; 250 namespaceScopes.clear(); 247 251 248 252 //定数に関する情報 … … 251 255 252 256 extern char *basbuf; 253 for(i =0;;i++){257 for(int i=0;;i++){ 254 258 if( basbuf[i] == '\0' ) break; 259 260 if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){ 261 for(i+=2,i2=0;;i2++,i++){ 262 if( IsCommandDelimitation( basbuf[i] ) ){ 263 temporary[i2]=0; 264 break; 265 } 266 temporary[i2]=basbuf[i]; 267 } 268 namespaceScopes.push_back( temporary ); 269 270 continue; 271 } 272 else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){ 273 if( namespaceScopes.size() <= 0 ){ 274 SetError(12, "End Namespace", i ); 275 } 276 else{ 277 namespaceScopes.pop_back(); 278 } 279 280 i += 2; 281 continue; 282 } 283 255 284 if( basbuf[i] == 1 ){ 256 285 if(basbuf[i]==1&&basbuf[i+1]==ESC_CONST){ … … 262 291 263 292 if(basbuf[i]==1&&basbuf[i+1]==ESC_ENUM){ 264 AddConstEnum( basbuf+i);293 AddConstEnum( namespaceScopes, basbuf+i); 265 294 continue; 266 295 } … … 281 310 temporary[i2]=basbuf[i]; 282 311 } 283 CDBConst::obj.Add( temporary);312 CDBConst::obj.Add( namespaceScopes, temporary); 284 313 if(basbuf[i]=='\0') break; 285 314 }
Note:
See TracChangeset
for help on using the changeset viewer.