Changeset a21b01d in tol


Ignore:
Timestamp:
Nov 11, 2008, 2:36:25 PM (18 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
be00874
Parents:
2476be7
Message:

New method ShowCallStack

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/btol/bgrammar/opr.cpp

    r2476be7 ra21b01d  
    876876BUserFunction* BUserFunction::ActiveFunction()
    877877{
    878     if(activeFunctions_.size()>0)
    879          return activeFunctions_.back();
    880     else return NIL;
     878  if(activeFunctions_.size()>0)
     879          return activeFunctions_.back();
     880  else return NIL;
    881881}
    882882
    … …  
    889889void BUserFunction::AddActiveFunction(BUserFunction* uFunction)
    890890{
    891     activeFunctions_.push_back(uFunction);
     891  if(uFunction->Name()=="generate")
     892    printf(""); 
     893  activeFunctions_.push_back(uFunction);
     894}
     895
     896
     897//- static member ----------------------------------------------------
     898/* Shows
     899 */
     900//--------------------------------------------------------------------
     901void BUserFunction::ShowCallStack()
     902{
     903  if(activeFunctions_.size())
     904  {
     905    int i;
     906    Std("\n[Call stack]\n");
     907    for(i=activeFunctions_.size()-1; i>=0; i--)
     908    {
     909      BUserFunction* usf = activeFunctions_[i];
     910      if(usf->Name()=="generate")
     911        printf(""); 
     912      Std(BText("  [")+(i+1)+"] "+
     913        usf->Grammar()->Name()+" "+
     914        usf->FullName()+" "+
     915        usf->Arguments()+"\n");
     916    }
     917  }
    892918}
    893919
    … …  
    910936    inFile_ = inFile;
    911937}
     938
Note: See TracChangeset for help on using the changeset viewer.