Changeset 7d4ba03 in tol


Ignore:
Timestamp:
Feb 29, 2012, 3:46:47 PM (15 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
27ccb470
Parents:
e259ad9
Message:

Refs #1430
Handling stop signal in all cycles

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@4223 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/set_type/setgra.cpp

    re259ad9 r7d4ba03  
    720720    BInt n, N = (BInt)Real(Arg(1));
    721721    BSyntaxObject* obj = Arg(2);
    722     for(n=1; n<=N; n++) { lst = Cons(obj->CopyContens(), lst); }
     722    for(n=1; n<=N; n++)
     723    {
     724      lst = Cons(obj->CopyContens(), lst);
     725      if(BGrammar::StopFlag()) { break; }
     726    }
    723727    contens_.RobElement(lst);
    724728}
    … …  
    753757      totCard += set.Card();
    754758    }
     759    if(BGrammar::StopFlag()) { return; }
    755760  }
    756761  contens_.PrepareStore(totCard);
    … …  
    763768      {
    764769        contens_.AddElement(set[k]);
     770        if(BGrammar::StopFlag()) { return; }
    765771      }
    766772    }
     773    if(BGrammar::StopFlag()) { return; }
    767774  }
    768775}
    … …  
    908915  {
    909916    module[n] = module[n+1] * Set(setOfSets[n+1]).Card();
     917    if(BGrammar::StopFlag()) { return; }
    910918  }
    911919  contens_.PrepareStore(module[0]);
    … …  
    918926      BInt m = 1 + ((k-1) / module[n]) % Set(setOfSets[n]).Card();
    919927      set.AddElement(Set(setOfSets[n])[m]);
     928      if(BGrammar::StopFlag()) { return; }
    920929    }
    921930    contens_.AddElement(new BSetTuple("", set));
     931    if(BGrammar::StopFlag()) { return; }
    922932  }
    923933}
    … …  
    942952{
    943953    BList* lst = NIL;
    944     for(BInt n=0; n<Dat(Arg(2)); n++) { lst = Cons(Arg(1), lst); }
     954    for(BInt n=0; n<Dat(Arg(2)); n++)
     955    {
     956      lst = Cons(Arg(1), lst);
     957      if(BGrammar::StopFlag()) { return; }
     958    }
    945959    BSetCartesianProduct set(lst);
    946960    contens_ = set.Contens();
    … …  
    10081022    x = 1.0 + (from + step*k) -1.0;
    10091023    LstFastAppend(result, aux, new BContensDat("",x));
     1024    if(BGrammar::StopFlag()) { break; }
    10101025  }
    10111026  contens_.RobElement(result);
    … …  
    16311646      //Std(Out()+"\nObject "+ n + " = " +sorted[n]->Dump());
    16321647        LstFastAppend(classLst, classAux, sorted[n]);
     1648        if(BGrammar::StopFlag()) { break; }
    16331649      }
    16341650      LstFastAppend(result, aux, NewSet("",BText("Class ")+m,classLst,
    … …  
    16661682        }
    16671683        contens_.AddElement(cl);
     1684        if(BGrammar::StopFlag()) { break; }
    16681685      }
    16691686    }
    … …  
    17551772                LstFastAppend(result, aux, set[m]);
    17561773            }
     1774      if(BGrammar::StopFlag()) { break; }
    17571775        }
    17581776    }
    … …  
    17911809    }
    17921810    for(n=1; n<=n1; n++)
    1793     { LstFastAppend(result,aux,new BSetTuple("",Set(set1[n])<<Set(set2[n]))); }
     1811    {
     1812      LstFastAppend(result,aux,new BSetTuple("",Set(set1[n])<<Set(set2[n])));
     1813      if(BGrammar::StopFlag()) { break; }
     1814    }
    17941815    contens_.RobElement(result);
    17951816}
    … …  
    18361857        for(m=1; m<=col; m++) {
    18371858            LstFastAppend(resCol, auxCol, Set(set[m])[n]);
     1859      if(BGrammar::StopFlag()) { break; }
    18381860        }
    18391861        LstFastAppend(result, aux, NewSet("","",resCol,NIL,BSet::Generic));
     1862      if(BGrammar::StopFlag()) { break; }
    18401863    }
    18411864    contens_.RobStruct(result,NIL,BSet::Table);
    … …  
    18951918          Error(I2(en ,es));
    18961919        }
     1920        if(BGrammar::StopFlag()) { break; }
    18971921      }
    18981922    }
    … …  
    19471971            LstFastAppend(result, aux, objCode);
    19481972            n++;
     1973      if(BGrammar::StopFlag()) { break; }
    19491974          }
    19501975          while(n<=set.Card());
    … …  
    20212046      LstFastAppend(result, aux3, objCode);
    20222047      k++;
     2048      if(BGrammar::StopFlag()) { break; }
    20232049    }
    20242050    while(k<=K);
    … …  
    20732099      LstFastAppend(result, aux, objCode);
    20742100    }
     2101    if(BGrammar::StopFlag()) { break; }
    20752102  }
    20762103  contens_.RobElement(result);
    … …  
    21332160    DESTROY(objCode);
    21342161    if(valid) { LstFastAppend(result, aux, set[n]); }
     2162    if(BGrammar::StopFlag()) { break; }
    21352163  }
    21362164  contens_.RobElement(result);
    … …  
    21912219      dte.PutHash(hash[k]);
    21922220      LstFastAppend(result, aux, new BContensDate("",dte,""));
     2221      if(BGrammar::StopFlag()) { break; }
    21932222    }
    21942223  }
    … …  
    22592288//--------------------------------------------------------------------
    22602289{
    2261     BMat        mat    = Mat (Arg(1));
    2262     BList*      result = NIL;
    2263     BList*      aux    = NIL;
    2264     BInt        i,j;
    2265     for(i = 0; i < mat.Rows(); i++)
    2266     {
    2267         BList* lsta       = NIL;
    2268         BList* auxa       = NIL;
    2269         for(j = 0; j < mat.Columns(); j++)
    2270         { LstFastAppend(lsta, auxa, new BContensDat("",mat(i,j),""));  }
    2271         LstFastAppend(result, aux,  NewSet("","",lsta,NIL,BSet::Generic));
    2272     }
    2273     contens_.RobStruct(result,NIL,BSet::Table);
     2290  BMat  mat    = Mat (Arg(1));
     2291  BList*        result = NIL;
     2292  BList*        aux    = NIL;
     2293  BInt  i,j;
     2294  for(i = 0; i < mat.Rows(); i++)
     2295  {
     2296    BList* lsta   = NIL;
     2297    BList* auxa   = NIL;
     2298    for(j = 0; j < mat.Columns(); j++)
     2299    {
     2300      LstFastAppend(lsta, auxa, new BContensDat("",mat(i,j),"")); 
     2301      if(BGrammar::StopFlag()) { break; }
     2302    }
     2303    LstFastAppend(result, aux,  NewSet("","",lsta,NIL,BSet::Generic));
     2304    if(BGrammar::StopFlag()) { break; }
     2305  }
     2306  contens_.RobStruct(result,NIL,BSet::Table);
    22742307}
    22752308
    … …  
    23032336    serie->PutName(BText("S")+(i+1));
    23042337    LstFastAppend(result, aux, serie);
     2338    if(BGrammar::StopFlag()) { break; }
    23052339  }
    23062340  contens_.RobStruct(result,NIL,BSet::Table);
    … …  
    23382372      BText f = dir.FileName(i);
    23392373      files.AddElement(new BContensText("",f,f));
     2374      if(BGrammar::StopFlag()) { break; }
    23402375          }
    23412376          for(i = 0; i < dir.NumDirs(); i++)
    … …  
    23432378      BText d = dir.DirName(i);
    23442379            dirs.AddElement(new BContensText("",d,d));
     2380      if(BGrammar::StopFlag()) { break; }
    23452381          }
    23462382          contens_.AddElement(new BContensSet("",files,"Files"));
    … …  
    25702606//          ABranch   = TreBranch((BList*)ATree,BranchIdx);
    25712607            ABranch = Tree::treBranch((List*)ATree, BranchIdx);
     2608    if(BGrammar::StopFlag()) { break; }
    25722609        } // end while
    25732610       
    … …  
    28712908    //Std(BText(""\nBOisCreator::Write BMemberOwner parent ")+fn);
    28722909      contens_.AddElement(new BContensText("",fn,""));
     2910      if(BGrammar::StopFlag()) { break; }
    28732911    }
    28742912  }
Note: See TracChangeset for help on using the changeset viewer.