Changeset 11 for cpp


Ignore:
Timestamp:
06/22/09 22:42:54 (15 years ago)
Author:
mwajcht
Message:

Added some checking against NULLs

Location:
cpp/f8-to-f1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/f8-to-f1/conv_f8tof1.cpp

    r9 r11  
    696696        cout << "&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&" << endl;
    697697#endif
     698        //final check
     699        for (map<string, Production*>::iterator prodIter = lsys->productions.begin();
     700                 prodIter != lsys->productions.end(); prodIter++) {
     701                for (vector<SubProduction>::iterator subProdIter = prodIter->second->subproductions.begin();
     702                         subProdIter != prodIter->second->subproductions.end(); subProdIter++) {
     703                        SubProduction subProduction = *subProdIter;
     704                        for (vector<ActionStrP>::iterator actionIter = subProduction.actions.begin();
     705                                 actionIter != subProduction.actions.end(); actionIter++) {
     706                                if ((*actionIter).action == NULL) {
     707                                        subProduction.actions.erase(actionIter);
     708                                }
     709                        }
     710                }
     711        }
    698712#if CONV_DEBUG > 0
    699713        cout << "createLsystem() end" << endl;
  • cpp/f8-to-f1/geno_f8.cpp

    r10 r11  
    11381138                        for (vector<ActionStrP>::iterator actionIter = (*subprodIter).actions.begin();
    11391139                                 actionIter != (*subprodIter).actions.end(); actionIter++) {
     1140                                if ((*actionIter).action == NULL) {
     1141                                        continue;
     1142                                }
    11401143                                SString &actionName = (*actionIter).action->name;
    11411144                                if (actionName[0] == 'n') {
Note: See TracChangeset for help on using the changeset viewer.