Changeset 16 in dev for BasicCompiler_Common/Intermediate_Step2.cpp
- Timestamp:
- Dec 12, 2006, 4:11:11 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Intermediate_Step2.cpp
r7 r16 237 237 } 238 238 } 239 voidGetConstInfo(void){239 bool GetConstInfo(void){ 240 240 //////////////////////////////////////////// 241 241 // Const命令の情報を取得 … … 251 251 extern char *basbuf; 252 252 for(i=0;;i++){ 253 if(basbuf[i]=='\0') break; 254 else if(basbuf[i]==1&&basbuf[i+1]==ESC_CONST){ 255 i+=2; 256 257 extern int cp; 258 cp=i; //エラー用 259 260 261 if(basbuf[i]==1&&basbuf[i+1]==ESC_ENUM){ 262 AddConstEnum(basbuf+i); 263 continue; 264 } 265 266 for(i2=0;;i++,i2++){ 267 if(basbuf[i]=='\"'){ 253 if( basbuf[i] == '\0' ) break; 254 if( basbuf[i] == 1 ){ 255 if(basbuf[i]==1&&basbuf[i+1]==ESC_CONST){ 256 i+=2; 257 258 extern int cp; 259 cp=i; //エラー用 260 261 262 if(basbuf[i]==1&&basbuf[i+1]==ESC_ENUM){ 263 AddConstEnum(basbuf+i); 264 continue; 265 } 266 267 for(i2=0;;i++,i2++){ 268 if(basbuf[i]=='\"'){ 269 temporary[i2]=basbuf[i]; 270 for(i++,i2++;;i++,i2++){ 271 temporary[i2]=basbuf[i]; 272 if(basbuf[i]=='\"') break; 273 } 274 continue; 275 } 276 if(IsCommandDelimitation(basbuf[i])){ 277 temporary[i2]=0; 278 break; 279 } 268 280 temporary[i2]=basbuf[i]; 269 for(i++,i2++;;i++,i2++){ 270 temporary[i2]=basbuf[i]; 271 if(basbuf[i]=='\"') break; 272 } 273 continue; 274 } 275 if(IsCommandDelimitation(basbuf[i])){ 276 temporary[i2]=0; 277 break; 278 } 279 temporary[i2]=basbuf[i]; 280 } 281 CDBConst::obj.Add(temporary); 282 if(basbuf[i]=='\0') break; 283 } 284 } 281 } 282 CDBConst::obj.Add(temporary); 283 if(basbuf[i]=='\0') break; 284 } 285 else{ 286 int result = JumpStatement( basbuf, i ); 287 if( result == -1 ){ 288 //エラー 289 return false; 290 } 291 else if( result == 1 ){ 292 //ジャンプした場合 293 i--; 294 } 295 } 296 } 297 } 298 return true; 285 299 } 286 300
Note:
See TracChangeset
for help on using the changeset viewer.