Changeset 260 in dev for trunk/abdev/BasicCompiler32/Compile_Statement.cpp
- Timestamp:
- Aug 3, 2007, 11:28:19 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abdev/BasicCompiler32/Compile_Statement.cpp
r254 r260 279 279 280 280 int GetLabelAddress(char *LabelName,int LineNum){ 281 extern int MaxLabelNum; 282 extern LABEL *pLabelNames; 283 int i; 281 extern Labels labels; 284 282 285 283 if(LabelName){ 286 for(i=0;i<MaxLabelNum;i++){ 287 if(pLabelNames[i].pName){ 288 if(lstrcmp(LabelName,pLabelNames[i].pName)==0) return pLabelNames[i].address; 284 BOOST_FOREACH( const Label &label, labels ) 285 { 286 if( label.name.size() > 0 ) 287 { 288 if( label.name == LabelName ) 289 { 290 return label.address; 291 } 289 292 } 290 293 } 291 294 } 292 295 else{ 293 for(i=0;i<MaxLabelNum;i++){ 294 if(pLabelNames[i].pName==0){ 295 if(LineNum==pLabelNames[i].line) return pLabelNames[i].address; 296 BOOST_FOREACH( const Label &label, labels ) 297 { 298 if( label.name.size() == 0 ) 299 { 300 if( label.line == LineNum ) 301 { 302 return label.address; 303 } 296 304 } 297 305 } … … 309 317 { 310 318 //jmp ...(schedule) 311 extern int obp;312 319 compiler.codeGenerator.op_jmp_goto_schedule( (const std::string)(Parameter + 1), 0, cp ); 313 320 } … … 326 333 { 327 334 //jmp ...(schedule) 328 extern int obp;329 335 compiler.codeGenerator.op_jmp_goto_schedule( "", LineNum, cp ); 330 336 }
Note:
See TracChangeset
for help on using the changeset viewer.