예제 #1
0
파일: prntutil.c 프로젝트: DrItanium/maya
void FactRetractedErrorMessage(
  Environment *theEnv,
  Fact *theFact)
  {
   char tempBuffer[20];
   
   PrintErrorID(theEnv,"PRNTUTIL",11,false);
   WriteString(theEnv,STDERR,"The fact ");
   gensprintf(tempBuffer,"f-%lld",theFact->factIndex);
   WriteString(theEnv,STDERR,tempBuffer);
   WriteString(theEnv,STDERR," has been retracted.\n");
  }
예제 #2
0
파일: prntutil.c 프로젝트: DrItanium/maya
void SalienceRangeError(
  Environment *theEnv,
  int min,
  int max)
  {
   PrintErrorID(theEnv,"PRNTUTIL",9,true);
   WriteString(theEnv,STDERR,"Salience value out of range ");
   WriteInteger(theEnv,STDERR,min);
   WriteString(theEnv,STDERR," to ");
   WriteInteger(theEnv,STDERR,max);
   WriteString(theEnv,STDERR,".\n");
  }
예제 #3
0
globle void SalienceRangeError(
  void *theEnv,
  int min,
  int max)
  {
   PrintErrorID(theEnv,"PRNTUTIL",9,TRUE);
   EnvPrintRouter(theEnv,WERROR,"Salience value out of range ");
   PrintLongInteger(theEnv,WERROR,(long int) min);
   EnvPrintRouter(theEnv,WERROR," to ");
   PrintLongInteger(theEnv,WERROR,(long int) max);
   EnvPrintRouter(theEnv,WERROR,".\n");
  }
예제 #4
0
파일: argacces.c 프로젝트: DrItanium/maya
void OpenErrorMessage(
  Environment *theEnv,
  const char *functionName,
  const char *fileName)
  {
   PrintErrorID(theEnv,"ARGACCES",3,false);
   WriteString(theEnv,STDERR,"Function '");
   WriteString(theEnv,STDERR,functionName);
   WriteString(theEnv,STDERR,"' was unable to open file '");
   WriteString(theEnv,STDERR,fileName);
   WriteString(theEnv,STDERR,"'.\n");
  }
예제 #5
0
globle int EnvBatchStar(
  void *theEnv,
  char *fileName)
  {
#if (MAC_MCW || IBM_MCW) && RUN_TIME
#pragma unused(fileName)
#endif

   PrintErrorID(theEnv,"FILECOM",1,FALSE);
   EnvPrintRouter(theEnv,WERROR,"Function batch* does not work in run time modules.\n");
   return(FALSE);
  }
예제 #6
0
파일: prntutil.c 프로젝트: DrItanium/maya
void CantDeleteItemErrorMessage(
  Environment *theEnv,
  const char *itemType,
  const char *itemName)
  {
   PrintErrorID(theEnv,"PRNTUTIL",4,false);
   WriteString(theEnv,STDERR,"Unable to delete ");
   WriteString(theEnv,STDERR,itemType);
   WriteString(theEnv,STDERR," '");
   WriteString(theEnv,STDERR,itemName);
   WriteString(theEnv,STDERR,"'.\n");
  }
예제 #7
0
파일: argacces.c 프로젝트: DrItanium/maya
void ExpectedTypeError0(
  Environment *theEnv,
  const char *functionName,
  unsigned int whichArg)
  {
   PrintErrorID(theEnv,"ARGACCES",2,false);
   WriteString(theEnv,STDERR,"Function '");
   WriteString(theEnv,STDERR,functionName);
   WriteString(theEnv,STDERR,"' expected argument #");
   WriteInteger(theEnv,STDERR,whichArg);
   WriteString(theEnv,STDERR," to be of type ");
  }
예제 #8
0
static void ConstraintConflictMessage(
  void *theEnv,
  struct symbolHashNode *variableName,
  int thePattern,
  int theField,
  struct symbolHashNode *theSlot)
  {
   /*=========================*/
   /* Print the error header. */
   /*=========================*/

   PrintErrorID(theEnv,"RULECSTR",1,TRUE);

   /*======================================================*/
   /* Print the variable name (if available) and CE number */
   /* for which the constraint violation occurred.         */
   /*======================================================*/

   if (variableName != NULL)
     {
      EnvPrintRouter(theEnv,WERROR,"Variable ?");
      EnvPrintRouter(theEnv,WERROR,ValueToString(variableName));
      EnvPrintRouter(theEnv,WERROR," in CE #");
      PrintLongInteger(theEnv,WERROR,(long int) thePattern);
     }
   else
     {
      EnvPrintRouter(theEnv,WERROR,"Pattern #");
      PrintLongInteger(theEnv,WERROR,(long int) thePattern);
     }

   /*=======================================*/
   /* Print the slot name or field position */
   /* in which the violation occurred.      */
   /*=======================================*/

   if (theSlot == NULL)
     {
      EnvPrintRouter(theEnv,WERROR," field #");
      PrintLongInteger(theEnv,WERROR,(long int) theField);
     }
   else
     {
      EnvPrintRouter(theEnv,WERROR," slot ");
      EnvPrintRouter(theEnv,WERROR,ValueToString(theSlot));
     }

   /*======================================*/
   /* Print the rest of the error message. */
   /*======================================*/

   EnvPrintRouter(theEnv,WERROR,"\nhas constraint conflicts which make the pattern unmatchable.\n");
  }
예제 #9
0
globle void CantDeleteItemErrorMessage(
  void *theEnv,
  const char *itemType,
  const char *itemName)
  {
   PrintErrorID(theEnv,"PRNTUTIL",4,FALSE);
   EnvPrintRouter(theEnv,WERROR,"Unable to delete ");
   EnvPrintRouter(theEnv,WERROR,itemType);
   EnvPrintRouter(theEnv,WERROR," ");
   EnvPrintRouter(theEnv,WERROR,itemName);
   EnvPrintRouter(theEnv,WERROR,".\n");
  }
예제 #10
0
globle void OpenErrorMessage(
  void *theEnv,
  char *functionName,
  char *fileName)
  {
   PrintErrorID(theEnv,"ARGACCES",2,FALSE);
   EnvPrintRouter(theEnv,WERROR,"Function ");
   EnvPrintRouter(theEnv,WERROR,functionName);
   EnvPrintRouter(theEnv,WERROR," was unable to open file ");
   EnvPrintRouter(theEnv,WERROR,fileName);
   EnvPrintRouter(theEnv,WERROR,".\n");
  }
예제 #11
0
globle int CheckSyntax(
  void *theEnv,
  const char *theString,
  DATA_OBJECT_PTR returnValue)
  {

   PrintErrorID(theEnv,"PARSEFUN",1,FALSE);
   EnvPrintRouter(theEnv,WERROR,"Function check-syntax does not work in run time modules.\n");
   SetpType(returnValue,SYMBOL);
   SetpValue(returnValue,EnvTrueSymbol(theEnv));
   return(TRUE);
  }
예제 #12
0
/***************************************************************
  NAME         : ClassExistError
  DESCRIPTION  : Prints out error message for non-existent class
  INPUTS       : 1) Name of function having the error
                 2) The name of the non-existent class
  RETURNS      : Nothing useful
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************************/
globle void ClassExistError(
  char *func,
  char *cname)
  {
   PrintErrorID("CLASSFUN",1,FALSE);
   PrintRouter(WERROR,"Unable to find class ");
   PrintRouter(WERROR,cname);
   PrintRouter(WERROR," in function ");
   PrintRouter(WERROR,func);
   PrintRouter(WERROR,".\n");
   SetEvaluationError(TRUE);
  }
예제 #13
0
globle int DefaultOutOfMemoryFunction(
  void *theEnv,
  unsigned long size)
  {
#if MAC_MCW || IBM_MCW || MAC_XCD
#pragma unused(size)
#endif

   PrintErrorID(theEnv,"MEMORY",1,TRUE);
   EnvPrintRouter(theEnv,WERROR,"Out of memory.\n");
   EnvExitRouter(theEnv,EXIT_FAILURE);
   return(TRUE);
  }
예제 #14
0
파일: pattern.c 프로젝트: DrItanium/maya
void ReservedPatternSymbolErrorMsg(
  Environment *theEnv,
  const char *theSymbol,
  const char *usedFor)
  {
   PrintErrorID(theEnv,"PATTERN",1,true);
   WriteString(theEnv,STDERR,"The symbol '");
   WriteString(theEnv,STDERR,theSymbol);
   WriteString(theEnv,STDERR,"' has special meaning ");
   WriteString(theEnv,STDERR,"and may not be used as ");
   WriteString(theEnv,STDERR,usedFor);
   WriteString(theEnv,STDERR,".\n");
  }
예제 #15
0
void InvalidDeftemplateSlotMessage(
  void *theEnv,
  const char *slotName,
  const char *deftemplateName,
  bool printCR)
  {
   PrintErrorID(theEnv,"TMPLTDEF",1,printCR);
   EnvPrintRouter(theEnv,WERROR,"Invalid slot ");
   EnvPrintRouter(theEnv,WERROR,slotName);
   EnvPrintRouter(theEnv,WERROR," not defined in corresponding deftemplate ");
   EnvPrintRouter(theEnv,WERROR,deftemplateName);
   EnvPrintRouter(theEnv,WERROR,".\n");
  }
예제 #16
0
파일: tmpltutl.c 프로젝트: DrItanium/maya
void InvalidDeftemplateSlotMessage(
  Environment *theEnv,
  const char *slotName,
  const char *deftemplateName,
  bool printCR)
  {
   PrintErrorID(theEnv,"TMPLTDEF",1,printCR);
   WriteString(theEnv,STDERR,"Invalid slot '");
   WriteString(theEnv,STDERR,slotName);
   WriteString(theEnv,STDERR,"' not defined in corresponding deftemplate '");
   WriteString(theEnv,STDERR,deftemplateName);
   WriteString(theEnv,STDERR,"'.\n");
  }
예제 #17
0
/*****************************************************************
  NAME         : IsParameterSlotReference
  DESCRIPTION  : Determines if a message-handler parameter is of
                 the form ?self:<name>, which is not allowed since
                 this is slot reference syntax
  INPUTS       : The paramter name
  RETURNS      : TRUE if the parameter is a slot reference,
                 FALSE otherwise
  SIDE EFFECTS : None
  NOTES        : None
 *****************************************************************/
static CLIPS_BOOLEAN IsParameterSlotReference(
  void *theEnv,
  char *pname)
  {
   if ((strncmp(pname,SELF_STRING,SELF_LEN) == 0) ?
                  (pname[SELF_LEN] == SELF_SLOT_REF) : FALSE)
     {
      PrintErrorID(theEnv,"MSGPSR",4,FALSE);
      EnvPrintRouter(theEnv,WERROR,"Illegal slot reference in parameter list.\n");
      return(TRUE);
     }
   return(FALSE);
  }
예제 #18
0
파일: prntutil.c 프로젝트: DrItanium/maya
void SlotExistError(
  Environment *theEnv,
  const char *sname,
  const char *func)
  {
   PrintErrorID(theEnv,"INSFUN",3,false);
   WriteString(theEnv,STDERR,"No such slot '");
   WriteString(theEnv,STDERR,sname);
   WriteString(theEnv,STDERR,"' in function '");
   WriteString(theEnv,STDERR,func);
   WriteString(theEnv,STDERR,"'.\n");
   SetEvaluationError(theEnv,true);
  }
예제 #19
0
파일: prntutil.c 프로젝트: DrItanium/maya
void InstanceVarSlotErrorMessage2(
  Environment *theEnv,
  Instance *theInstance,
  const char *varSlot)
  {
   PrintErrorID(theEnv,"PRNTUTIL",16,false);
   
   WriteString(theEnv,STDERR,"The variable/slot reference ?");
   WriteString(theEnv,STDERR,varSlot);
   WriteString(theEnv,STDERR," is invalid because the referenced instance [");
   WriteString(theEnv,STDERR,theInstance->name->contents);
   WriteString(theEnv,STDERR,"] does not contain the specified slot.\n");
  }
예제 #20
0
파일: prntutil.c 프로젝트: DrItanium/maya
void InstanceVarSlotErrorMessage1(
  Environment *theEnv,
  Instance *theInstance,
  const char *varSlot)
  {
   PrintErrorID(theEnv,"PRNTUTIL",15,false);
   
   WriteString(theEnv,STDERR,"The variable/slot reference ?");
   WriteString(theEnv,STDERR,varSlot);
   WriteString(theEnv,STDERR," cannot be resolved because the referenced instance [");
   WriteString(theEnv,STDERR,theInstance->name->contents);
   WriteString(theEnv,STDERR,"] has been deleted.\n");
  }
예제 #21
0
static void NoConjunctiveUseError(
  void *theEnv,
  char *attribute1,
  char *attribute2)
  {
   PrintErrorID(theEnv,"CSTRNPSR",3,TRUE);
   EnvPrintRouter(theEnv,WERROR,"The ");
   EnvPrintRouter(theEnv,WERROR,attribute1);
   EnvPrintRouter(theEnv,WERROR," attribute cannot be used\n");
   EnvPrintRouter(theEnv,WERROR,"in conjunction with the ");
   EnvPrintRouter(theEnv,WERROR,attribute2);
   EnvPrintRouter(theEnv,WERROR," attribute.\n");
  }
예제 #22
0
void ReservedPatternSymbolErrorMsg(
  void *theEnv,
  char *theSymbol,
  char *usedFor)
  {
   PrintErrorID(theEnv,"PATTERN",1,TRUE);
   EnvPrintRouter(theEnv,WERROR,"The symbol ");
   EnvPrintRouter(theEnv,WERROR,theSymbol);
   EnvPrintRouter(theEnv,WERROR," has special meaning\n");
   EnvPrintRouter(theEnv,WERROR,"and may not be used as ");
   EnvPrintRouter(theEnv,WERROR,usedFor);
   EnvPrintRouter(theEnv,WERROR,".\n");
  }
예제 #23
0
void FactRetractedErrorMessage(
  void *theEnv,
  void *theVFact)
  {
   char tempBuffer[20];
   struct fact *theFact = (struct fact *) theVFact;
   
   PrintErrorID(theEnv,"PRNTUTIL",11,FALSE);
   EnvPrintRouter(theEnv,WERROR,"The fact ");
   gensprintf(tempBuffer,"f-%lld",theFact->factIndex);
   EnvPrintRouter(theEnv,WERROR,tempBuffer);
   EnvPrintRouter(theEnv,WERROR," has been retracted.\n");
  }
예제 #24
0
파일: prntutil.c 프로젝트: noxdafox/clips
globle void SlotExistError(
  void *theEnv,
  const char *sname,
  const char *func)
  {
   PrintErrorID(theEnv,"INSFUN",3,FALSE);
   EnvPrintRouter(theEnv,WERROR,"No such slot ");
   EnvPrintRouter(theEnv,WERROR,sname);
   EnvPrintRouter(theEnv,WERROR," in function ");
   EnvPrintRouter(theEnv,WERROR,func);
   EnvPrintRouter(theEnv,WERROR,".\n");
   EnvSetEvaluationError(theEnv,TRUE);
  }
예제 #25
0
/***************************************************************
  NAME         : ClassExistError
  DESCRIPTION  : Prints out error message for non-existent class
  INPUTS       : 1) Name of function having the error
                 2) The name of the non-existent class
  RETURNS      : Nothing useful
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************************/
globle void ClassExistError(
  void *theEnv,
  const char *func,
  const char *cname)
  {
   PrintErrorID(theEnv,"CLASSFUN",1,FALSE);
   EnvPrintRouter(theEnv,WERROR,"Unable to find class ");
   EnvPrintRouter(theEnv,WERROR,cname);
   EnvPrintRouter(theEnv,WERROR," in function ");
   EnvPrintRouter(theEnv,WERROR,func);
   EnvPrintRouter(theEnv,WERROR,".\n");
   SetEvaluationError(theEnv,TRUE);
  }
예제 #26
0
globle int DefaultOutOfMemoryFunction(
  void *theEnv,
  size_t size)
  {
#if MAC_MCW || WIN_MCW || MAC_XCD
#pragma unused(size)
#endif

   PrintErrorID(theEnv,(char*)"MEMORY",1,TRUE);
   EnvPrintRouter(theEnv,WERROR,(char*)"Out of memory.\n");
   EnvExitRouter(theEnv,EXIT_FAILURE);
   return(TRUE);
  }
예제 #27
0
/*************************************************************
  NAME         : ParseQueryTestExpression
  DESCRIPTION  : Parses the test-expression for a query
  INPUTS       : 1) The top node of the query expression
                 2) The logical name of the input
  RETURNS      : TRUE if all OK, FALSE otherwise
  SIDE EFFECTS : Entire query-expression deleted on errors
                 Nodes allocated for new expression
                 Test shoved in front of class-restrictions on
                    query argument list
  NOTES        : Expects top != NULL
 *************************************************************/
static int ParseQueryTestExpression(
  void *theEnv,
  EXPRESSION *top,
  const char *readSource)
  {
   EXPRESSION *qtest;
   int error;
   struct BindInfo *oldBindList;

   error = FALSE;
   oldBindList = GetParsedBindNames(theEnv);
   SetParsedBindNames(theEnv,NULL);
   
   qtest = ArgumentParse(theEnv,readSource,&error);
   
   if (error == TRUE)
     {
      ClearParsedBindNames(theEnv);
      SetParsedBindNames(theEnv,oldBindList);
      ReturnExpression(theEnv,top);
      return(FALSE);
     }
   
   if (qtest == NULL)
     {
      ClearParsedBindNames(theEnv);
      SetParsedBindNames(theEnv,oldBindList);
      SyntaxErrorMessage(theEnv,"fact-set query function");
      ReturnExpression(theEnv,top);
      return(FALSE);
     }
   
   qtest->nextArg = top->argList;
   top->argList = qtest;
   
   if (ParsedBindNamesEmpty(theEnv) == FALSE)
     {
      ClearParsedBindNames(theEnv);
      SetParsedBindNames(theEnv,oldBindList);
      PrintErrorID(theEnv,"FACTQPSR",2,FALSE);
      EnvPrintRouter(theEnv,WERROR,"Binds are not allowed in fact-set query in function ");
      EnvPrintRouter(theEnv,WERROR,ValueToString(ExpressionFunctionCallName(top)));
      EnvPrintRouter(theEnv,WERROR,".\n");
      ReturnExpression(theEnv,top);
      return(FALSE);
     }
     
   SetParsedBindNames(theEnv,oldBindList);
   
   return(TRUE);
  }
예제 #28
0
globle void SyntaxErrorMessage(
  char *location)
  {
   PrintErrorID("PRNTUTIL",2,TRUE);
   PrintRouter(WERROR,"Syntax Error");
   if (location != NULL)
     {
      PrintRouter(WERROR,":  Check appropriate syntax for ");
      PrintRouter(WERROR,location);
     }

   PrintRouter(WERROR,".\n");
   SetEvaluationError(TRUE);
  }
예제 #29
0
static void JoinNetErrorMessage(
  struct joinNode *joinPtr)
  {
   char buffer[60];

   PrintErrorID("DRIVE",1,TRUE);
   PrintRouter(WERROR,"This error occurred in the join network\n");

   sprintf(buffer,"   Problem resides in join #%d in rule(s):\n",joinPtr->depth);
   PrintRouter(WERROR,buffer);

   TraceErrorToRule(joinPtr,"      ");
   PrintRouter(WERROR,"\n");
  }
예제 #30
0
파일: msgfun.c 프로젝트: atrniv/CLIPS
/***************************************************
  NAME         : SlotVisibilityViolationError
  DESCRIPTION  : Prints out an error message when
                 attempt is made to access a
                 private slot improperly
  INPUTS       : 1) The slot descriptor
                 2) A pointer to the source class
  RETURNS      : Nothing useful
  SIDE EFFECTS : Error message printed
  NOTES        : None
 ***************************************************/
globle void SlotVisibilityViolationError(
  void *theEnv,
  EXEC_STATUS,
  SLOT_DESC *sd,
  DEFCLASS *theDefclass)
  {
   PrintErrorID(theEnv,execStatus,"MSGFUN",6,FALSE);
   EnvPrintRouter(theEnv,execStatus,WERROR,"Private slot ");
   EnvPrintRouter(theEnv,execStatus,WERROR,ValueToString(sd->slotName->name));
   EnvPrintRouter(theEnv,execStatus,WERROR," of class ");
   PrintClassName(theEnv,execStatus,WERROR,sd->cls,FALSE);
   EnvPrintRouter(theEnv,execStatus,WERROR," cannot be accessed directly\n   by handlers attached to class ");
   PrintClassName(theEnv,execStatus,WERROR,theDefclass,TRUE);
  }