示例#1
0
文件: msgfun.c 项目: atrniv/CLIPS
/********************************************************
  NAME         : UnboundHandlerErr
  DESCRIPTION  : Print out a synopis of the currently
                   executing handler for unbound variable
                   errors
  INPUTS       : None
  RETURNS      : Nothing useful
  SIDE EFFECTS : Error synopsis printed to WERROR
  NOTES        : None
 ********************************************************/
globle void UnboundHandlerErr(
  void *theEnv,
  EXEC_STATUS)
  {
   EnvPrintRouter(theEnv,execStatus,WERROR,"message-handler ");
   PrintHandler(theEnv,execStatus,WERROR,MessageHandlerData(theEnv,execStatus)->CurrentCore->hnd,TRUE);
  }
 void PrintFuncDefn::print (FilePtr const & file, SectionKind skind, FuncDefnPtr const & func_defn) const
   {
     // declaration
     printLine (file, skind, getNameLoc (func_defn->getName ()), declToString (func_defn));
     // try
     TryBlockPtr const & try_block = func_defn->getTryBlock ();
     if (try_block.isSet ())
     {
       printLine (file, skind, try_block->getLoc (), "try");
     }
     // ctor init
     CtorInitPtr const & ctor_init = func_defn->getCtorInit ();
     if (ctor_init.isSet ())
     {
       printLine (file, skind, ctor_init->getLoc (), 1, ctorInitToString (ctor_init));
     }
     // body
     printEnclosedBlock (file, skind, func_defn->getBody ());
     // handler seq
     if (try_block.isSet ())
     {
       HandlerPtrVector const & handler_seq = try_block->getHandlerSeq ();
       std::for_each (handler_seq.begin (), handler_seq.end (), PrintHandler (file, skind));
     }
   }
示例#3
0
/****************************************************
  NAME         : DisplayHandlersInLinks
  DESCRIPTION  : Recursively displays all handlers
                  for an array of classes
  INPUTS       : 1) The logical name of the output
                 2) The packed class links
                 3) The index to print from the links
  RETURNS      : The number of handlers printed
  SIDE EFFECTS : None
  NOTES        : Used by DescribeClass()
 ****************************************************/
globle long DisplayHandlersInLinks(
  char *log,
  PACKED_CLASS_LINKS *plinks,
  unsigned index)
  {
   register unsigned i;
   long cnt;

   cnt = (long) plinks->classArray[index]->handlerCount;
   if (index < (plinks->classCount - 1))
     cnt += DisplayHandlersInLinks(log,plinks,index + 1);
   for (i = 0 ; i < plinks->classArray[index]->handlerCount ; i++)
     PrintHandler(log,&plinks->classArray[index]->handlers[i],TRUE);
   return(cnt);
  }
示例#4
0
文件: msgcom.c 项目: noxdafox/clips
/****************************************************
  NAME         : DisplayHandlersInLinks
  DESCRIPTION  : Recursively displays all handlers
                  for an array of classes
  INPUTS       : 1) The logical name of the output
                 2) The packed class links
                 3) The index to print from the links
  RETURNS      : The number of handlers printed
  SIDE EFFECTS : None
  NOTES        : Used by DescribeClass()
 ****************************************************/
globle long DisplayHandlersInLinks(
  void *theEnv,
  const char *logName,
  PACKED_CLASS_LINKS *plinks,
  int theIndex)
  {
   long i;
   long cnt;

   cnt = (long) plinks->classArray[theIndex]->handlerCount;
   if (((int) theIndex) < (plinks->classCount - 1))
     cnt += DisplayHandlersInLinks(theEnv,logName,plinks,theIndex + 1);
   for (i = 0 ; i < plinks->classArray[theIndex]->handlerCount ; i++)
     PrintHandler(theEnv,logName,&plinks->classArray[theIndex]->handlers[i],TRUE);
   return(cnt);
  }
示例#5
0
文件: msgfun.c 项目: atrniv/CLIPS
/***************************************************
  NAME         : PrintPreviewHandler
  DESCRIPTION  : Displays a message preview
  INPUTS       : 1) The logical name of the output
                 2) Handler-link
                 3) Number of handlers shadowed
                 4) The trace-string
  RETURNS      : Nothing useful
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
static void PrintPreviewHandler(
  void *theEnv,
  EXEC_STATUS,
  char *logicalName,
  HANDLER_LINK *cptr,
  int sdepth,
  char *tstr)
  {
   register int i;

   for (i = 0 ; i < sdepth ; i++)
     EnvPrintRouter(theEnv,execStatus,logicalName,"| ");
   EnvPrintRouter(theEnv,execStatus,logicalName,tstr);
   EnvPrintRouter(theEnv,execStatus,logicalName," ");
   PrintHandler(theEnv,execStatus,logicalName,cptr->hnd,TRUE);
  }
示例#6
0
文件: msgfun.c 项目: atrniv/CLIPS
/***********************************************************
  NAME         : WatchHandler
  DESCRIPTION  : Prints a condensed description of a
                   message-handler and its arguments
  INPUTS       : 1) The output logical name
                 2) The handler address
                 3) BEGIN_TRACE or END_TRACE string
  RETURNS      : Nothing useful
  SIDE EFFECTS : None
  NOTES        : Uses the global variables ProcParamArray
                   and CurrentMessageName
 ***********************************************************/
globle void WatchHandler(
  void *theEnv,
  EXEC_STATUS,
  char *logName,
  HANDLER_LINK *hndl,
  char *tstring)
  {
   HANDLER *hnd;
   
   EnvPrintRouter(theEnv,execStatus,logName,"HND ");
   EnvPrintRouter(theEnv,execStatus,logName,tstring);
   EnvPrintRouter(theEnv,execStatus,logName," ");
   hnd = hndl->hnd;
   PrintHandler(theEnv,execStatus,WTRACE,hnd,TRUE);
   EnvPrintRouter(theEnv,execStatus,logName,"       ED:");
   PrintLongInteger(theEnv,execStatus,logName,(long long) execStatus->CurrentEvaluationDepth);
   PrintProcParamArray(theEnv,execStatus,logName);
  }