亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pattern.c

?? clips源代碼
?? C
?? 第 1 頁 / 共 3 頁
字號:
   /*******************************************************/   /*      "C" Language Integrated Production System      */   /*                                                     */   /*             CLIPS Version 6.30  10/19/06            */   /*                                                     */   /*                 RULE PATTERN MODULE                 */   /*******************************************************//*************************************************************//* Purpose: Provides the mechanism for recognizing and       *//*   parsing the various types of patterns that can be used  *//*   in the LHS of a rule. In version 6.0, the only pattern  *//*   types provided are for deftemplate and instance         *//*   patterns.                                               *//*                                                           *//* Principal Programmer(s):                                  *//*      Gary D. Riley                                        *//*                                                           *//* Contributing Programmer(s):                               *//*                                                           *//* Revision History:                                         *//*                                                           *//*      6.24: Renamed BOOLEAN macro type to intBool.         *//*                                                           *//*      6.30: Added support for hashed alpha memories.       *//*                                                           *//*************************************************************/#define _PATTERN_SOURCE_#include "setup.h"#include <stdio.h>#define _STDIO_INCLUDED_#include <stdlib.h>#if DEFRULE_CONSTRUCT#include "constant.h"#include "constrnt.h"#include "cstrnchk.h"#include "cstrnutl.h"#include "envrnmnt.h"#include "exprnpsr.h"#include "match.h"#include "memalloc.h"#include "reteutil.h"#include "router.h"#include "rulecmp.h"#include "pattern.h"/***************************************//* LOCAL INTERNAL FUNCTION DEFINITIONS *//***************************************/#if (! RUN_TIME) && (! BLOAD_ONLY)   static struct lhsParseNode            *ConjuctiveRestrictionParse(void *,char *,struct token *,int *);   static struct lhsParseNode            *LiteralRestrictionParse(void *,char *,struct token *,int *);   static int                             CheckForVariableMixing(void *,struct lhsParseNode *);   static void                            TallyFieldTypes(struct lhsParseNode *);#endif   static void                            DeallocatePatternData(void *);   static struct patternNodeHashEntry   **CreatePatternHashTable(void *,unsigned long);   /*****************************************************************************//* InitializePatterns: Initializes the global data associated with patterns. *//*****************************************************************************/globle void InitializePatterns(  void *theEnv)  {      AllocateEnvironmentData(theEnv,PATTERN_DATA,sizeof(struct patternData),DeallocatePatternData);   PatternData(theEnv)->NextPosition = 1;   PatternData(theEnv)->PatternHashTable = CreatePatternHashTable(theEnv,SIZE_PATTERN_HASH);   PatternData(theEnv)->PatternHashTableSize = SIZE_PATTERN_HASH;  }/*******************************************************************//* CreatePatternHashTable: Creates and initializes a fact hash table. *//*******************************************************************/static struct patternNodeHashEntry **CreatePatternHashTable(   void *theEnv,   unsigned long tableSize)   {    unsigned long i;    struct patternNodeHashEntry **theTable;    theTable = (struct patternNodeHashEntry **)               gm3(theEnv,sizeof (struct patternNodeHashEntry *) * tableSize);    if (theTable == NULL) EnvExitRouter(theEnv,EXIT_FAILURE);        for (i = 0; i < tableSize; i++) theTable[i] = NULL;        return(theTable);   }       /**************************************************//* DeallocatePatternData: Deallocates environment *//*    data for rule pattern registration.         *//**************************************************/static void DeallocatePatternData(  void *theEnv)  {   struct reservedSymbol *tmpRSPtr, *nextRSPtr;   struct patternParser *tmpPPPtr, *nextPPPtr;   struct patternNodeHashEntry *tmpPNEPtr, *nextPNEPtr;   unsigned long i;   tmpRSPtr = PatternData(theEnv)->ListOfReservedPatternSymbols;   while (tmpRSPtr != NULL)     {      nextRSPtr = tmpRSPtr->next;      rtn_struct(theEnv,reservedSymbol,tmpRSPtr);      tmpRSPtr = nextRSPtr;     }        tmpPPPtr = PatternData(theEnv)->ListOfPatternParsers;   while (tmpPPPtr != NULL)     {      nextPPPtr = tmpPPPtr->next;      rtn_struct(theEnv,patternParser,tmpPPPtr);      tmpPPPtr = nextPPPtr;     }      for (i = 0; i < PatternData(theEnv)->PatternHashTableSize; i++)      {      tmpPNEPtr = PatternData(theEnv)->PatternHashTable[i];            while (tmpPNEPtr != NULL)        {         nextPNEPtr = tmpPNEPtr->next;         rtn_struct(theEnv,patternNodeHashEntry,tmpPNEPtr);         tmpPNEPtr = nextPNEPtr;        }     }     rm3(theEnv,PatternData(theEnv)->PatternHashTable,       sizeof(struct patternNodeHashEntry *) * PatternData(theEnv)->PatternHashTableSize);  }/******************************************************************************//* AddHashedPatternNode: Adds a pattern node entry to the pattern hash table. *//******************************************************************************/globle void AddHashedPatternNode(  void *theEnv,  void *parent,  void *child,  unsigned short keyType,  void *keyValue)  {   unsigned long hashValue;   struct patternNodeHashEntry *newhash, *temp;   hashValue = GetAtomicHashValue(keyType,keyValue,1) + GetAtomicHashValue(EXTERNAL_ADDRESS,parent,1);   newhash = get_struct(theEnv,patternNodeHashEntry);   newhash->parent = parent;   newhash->child = child;   newhash->type = keyType;   newhash->value = keyValue;   hashValue = (hashValue % PatternData(theEnv)->PatternHashTableSize);      temp = PatternData(theEnv)->PatternHashTable[hashValue];   PatternData(theEnv)->PatternHashTable[hashValue] = newhash;   newhash->next = temp;  }/***************************************************//* RemoveHashedPatternNode: Removes a pattern node *//*   entry from the pattern node hash table.       *//***************************************************/globle intBool RemoveHashedPatternNode(  void *theEnv,  void *parent,  void *child,  unsigned short keyType,  void *keyValue)  {   unsigned long hashValue;   struct patternNodeHashEntry *hptr, *prev;   hashValue = GetAtomicHashValue(keyType,keyValue,1) + GetAtomicHashValue(EXTERNAL_ADDRESS,parent,1);   hashValue = (hashValue % PatternData(theEnv)->PatternHashTableSize);   for (hptr = PatternData(theEnv)->PatternHashTable[hashValue], prev = NULL;        hptr != NULL;        hptr = hptr->next)     {      if (hptr->child == child)        {         if (prev == NULL)           {            PatternData(theEnv)->PatternHashTable[hashValue] = hptr->next;            rtn_struct(theEnv,patternNodeHashEntry,hptr);            return(1);           }         else           {            prev->next = hptr->next;            rtn_struct(theEnv,patternNodeHashEntry,hptr);            return(1);           }        }      prev = hptr;     }   return(0);  }/***********************************************//* FindHashedPatternNode: Finds a pattern node *//*   entry in the pattern node hash table.     *//***********************************************/globle void *FindHashedPatternNode(  void *theEnv,  void *parent,  unsigned short keyType,  void *keyValue)  {   unsigned long hashValue;   struct patternNodeHashEntry *hptr;   hashValue = GetAtomicHashValue(keyType,keyValue,1) + GetAtomicHashValue(EXTERNAL_ADDRESS,parent,1);   hashValue = (hashValue % PatternData(theEnv)->PatternHashTableSize);   for (hptr = PatternData(theEnv)->PatternHashTable[hashValue];        hptr != NULL;        hptr = hptr->next)     {      if ((hptr->parent == parent) &&          (keyType == hptr->type) &&          (keyValue == hptr->value))        { return(hptr->child); }     }   return(NULL);  }  /******************************************************************//* AddReservedPatternSymbol: Adds a symbol to the list of symbols *//*  that are restricted for use in patterns. For example, the     *//*  deftemplate construct cannot use the symbol "object", since   *//*  this needs to be reserved for object patterns. Some symbols,  *//*  such as "exists" are completely reserved and can not be used  *//*  to start any type of pattern CE.                              *//******************************************************************/void AddReservedPatternSymbol(  void *theEnv,  char *theSymbol,  char *reservedBy)  {   struct reservedSymbol *newSymbol;   newSymbol = get_struct(theEnv,reservedSymbol);   newSymbol->theSymbol = theSymbol;   newSymbol->reservedBy = reservedBy;   newSymbol->next = PatternData(theEnv)->ListOfReservedPatternSymbols;   PatternData(theEnv)->ListOfReservedPatternSymbols = newSymbol;  }/******************************************************************//* ReservedPatternSymbol: Returns TRUE if the specified symbol is *//*   a reserved pattern symbol, otherwise FALSE is returned. If   *//*   the construct which is trying to use the symbol is the same  *//*   construct that reserved the symbol, then FALSE is returned.  *//******************************************************************/intBool ReservedPatternSymbol(  void *theEnv,  char *theSymbol,  char *checkedBy)  {   struct reservedSymbol *currentSymbol;   for (currentSymbol = PatternData(theEnv)->ListOfReservedPatternSymbols;        currentSymbol != NULL;        currentSymbol = currentSymbol->next)     {      if (strcmp(theSymbol,currentSymbol->theSymbol) == 0)        {         if ((currentSymbol->reservedBy == NULL) || (checkedBy ==  NULL))           { return(TRUE); }         if (strcmp(checkedBy,currentSymbol->reservedBy) == 0) return(FALSE);         return(TRUE);        }     }   return(FALSE);  }/********************************************************//* ReservedPatternSymbolErrorMsg: Generic error message *//*   for attempting to use a reserved pattern symbol.   *//********************************************************/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");  }/************************************************************//* GetNextEntity: Utility routine for accessing all of the  *//*   data entities that can match patterns. Currently facts *//*   and instances are the only data entities available.    *//************************************************************/globle void GetNextPatternEntity(  void *theEnv,  struct patternParser **theParser,  struct patternEntity **theEntity)  {   /*=============================================================*/   /* If the current parser is NULL, then we want to retrieve the */   /* very first data entity. The traversal of entities is done   */   /* by entity type (e.g. all facts are traversed followed by    */   /* all instances). To get the first entity type to traverse,   */   /* the current parser is set to the first parser on the list   */   /* of pattern parsers.                                         */   /*=============================================================*/   if (*theParser == NULL)     {      *theParser = PatternData(theEnv)->ListOfPatternParsers;      *theEntity = NULL;     }   /*================================================================*/   /* Otherwise try to retrieve the next entity following the entity */   /* returned by the last call to GetNextEntity. If that entity was */   /* the last of its data type, then move on to the next pattern    */   /* parser, otherwise return that entity as the next one.          */   /*================================================================*/   else if (theEntity != NULL)     {      *theEntity = (struct patternEntity *)                   (*(*theParser)->entityType->base.getNextFunction)(theEnv,*theEntity);      if ((*theEntity) != NULL) return;      *theParser = (*theParser)->next;     }   /*===============================================================*/   /* Otherwise, we encountered a situation which should not occur. */   /* Once a NULL entity is returned from GetNextEntity, it should  */   /* not be passed back to GetNextEntity.                          */   /*===============================================================*/   else     {      SystemError(theEnv,"PATTERN",1);      EnvExitRouter(theEnv,EXIT_FAILURE);     }   /*================================================*/   /* Keep looping through the lists of entities and */   /* pattern parsers until an entity is found.      */   /*================================================*/   while ((*theEntity == NULL) && (*theParser != NULL))     {      *theEntity = (struct patternEntity *)                   (*(*theParser)->entityType->base.getNextFunction)(theEnv,*theEntity);      if (*theEntity != NULL) return;      *theParser = (*theParser)->next;     }   return;  }/**************************************************************//* DetachPattern: Detaches a pattern from the pattern network *//*   by calling the appropriate function for the data type    *//*   associated with the pattern.                             *//**************************************************************/void DetachPattern(  void *theEnv,  int rhsType,  struct patternNodeHeader *theHeader)  {   if (rhsType == 0) return;      if (PatternData(theEnv)->PatternParserArray[rhsType-1] != NULL)     {      FlushAlphaMemory(theEnv,theHeader);      (*PatternData(theEnv)->PatternParserArray[rhsType-1]->removePatternFunction)(theEnv,theHeader);     }  }/**************************************************//* AddPatternParser: Adds a pattern type to the   *//*   list of pattern parsers used to detect valid *//*   patterns in the LHS of a rule.               *//**************************************************/globle intBool AddPatternParser(  void *theEnv,  struct patternParser *newPtr)  {   struct patternParser *currentPtr, *lastPtr = NULL;   /*============================================*/   /* Check to see that the limit for the number */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
1024精品合集| 久久久欧美精品sm网站| 欧美日韩高清在线播放| 欧美亚洲国产怡红院影院| 精品国产免费人成在线观看| 一区二区在线看| 国产色综合一区| 蜜桃av噜噜一区| 一区二区三区在线视频免费观看 | 欧美精品一区视频| aaa国产一区| 久久精品亚洲乱码伦伦中文 | 日韩欧美国产综合| 亚洲三级小视频| 国产在线播放一区| 精品视频免费在线| 成人深夜在线观看| 欧美一级精品在线| 久久精品国产在热久久| 日韩一区二区在线看| 99精品视频在线观看| 欧美日韩国产综合久久| 天天综合天天综合色| 91麻豆高清视频| 5858s免费视频成人| 日韩黄色在线观看| 欧美性视频一区二区三区| 国产精品一区三区| 久久青草欧美一区二区三区| 在线观看一区二区精品视频| 一区二区欧美国产| 日韩一区中文字幕| 国产一区二区毛片| 蜜桃视频一区二区三区在线观看| 一区二区国产盗摄色噜噜| 国产精品久久久久久久岛一牛影视| 日韩高清不卡一区二区| 欧美r级在线观看| 国产午夜亚洲精品不卡| 欧美精品少妇一区二区三区| 久久久久久久久伊人| 宅男噜噜噜66一区二区66| 亚洲视频在线一区观看| 中文一区二区在线观看| 国产一区二区三区美女| 麻豆精品一区二区av白丝在线| 亚洲一区二区av电影| 亚洲va欧美va天堂v国产综合| 欧美美女网站色| 欧美午夜宅男影院| 欧美影视一区在线| 欧美日韩一区二区三区在线| 中文字幕日韩一区| 亚洲欧洲av在线| 亚洲乱码中文字幕| 91亚洲精品乱码久久久久久蜜桃| 成人永久看片免费视频天堂| 国产精品99久久久久久久女警| 国产一区 二区 三区一级| xvideos.蜜桃一区二区| 石原莉奈在线亚洲三区| 亚洲国产欧美在线| 久久中文娱乐网| 国产亚洲成年网址在线观看| 丁香桃色午夜亚洲一区二区三区| 中文字幕永久在线不卡| 国产日韩av一区| 播五月开心婷婷综合| 日本欧美在线观看| 久久国产视频网| 久久精品亚洲乱码伦伦中文| 国产精品理论片| 亚洲综合免费观看高清在线观看| 亚洲成人动漫在线免费观看| 免费不卡在线观看| 亚洲免费观看在线视频| 麻豆91精品视频| 久久91精品国产91久久小草| 亚洲综合色视频| 蜜臀av性久久久久蜜臀aⅴ| 黑人精品欧美一区二区蜜桃| 在线观看亚洲一区| 日韩欧美亚洲一区二区| 日韩欧美成人激情| 中文字幕一区二区三区不卡| 亚洲.国产.中文慕字在线| 精品一区免费av| 色婷婷亚洲婷婷| 国产成人综合在线播放| 依依成人综合视频| 日韩成人一级片| 东方aⅴ免费观看久久av| 欧美三级电影一区| 国产电影一区二区三区| 在线亚洲+欧美+日本专区| 日韩精品一区二区三区在线播放| 亚洲国产精品精华液ab| 天天色天天爱天天射综合| 国产精品18久久久久久久网站| 在线观看欧美日本| 亚洲一区电影777| 国产成人亚洲精品青草天美| 欧美撒尿777hd撒尿| 国产亚洲精品aa午夜观看| 偷窥国产亚洲免费视频| 国产aⅴ精品一区二区三区色成熟| 欧美在线小视频| 欧美高清在线精品一区| 日本午夜精品一区二区三区电影| 成人一区二区三区视频在线观看| 亚洲成av人片一区二区梦乃| 国产一区二区三区免费| 欧美日本乱大交xxxxx| 国产精品久久久久久久久图文区| 日韩中文字幕麻豆| 91国产成人在线| 欧美无砖专区一中文字| 久久久国产一区二区三区四区小说 | 成人免费视频免费观看| 欧美日韩精品一区二区三区四区| 国产欧美精品一区| 91精品在线麻豆| 一本色道久久综合亚洲91| 欧美精品一区二区三区在线| 午夜视频一区二区| 色综合久久综合网| 国产精品欧美极品| 欧日韩精品视频| 亚洲国产精品久久久久婷婷884| 北条麻妃一区二区三区| 久久精品亚洲一区二区三区浴池| 久久不见久久见中文字幕免费| 欧美三级日本三级少妇99| 日韩理论片在线| 国产suv一区二区三区88区| 欧美日韩高清一区二区三区| 亚洲欧美综合色| 成人丝袜视频网| 免费在线观看不卡| 欧美日韩免费观看一区三区| 亚洲柠檬福利资源导航| 色综合久久久久| 伊人开心综合网| 欧洲av一区二区嗯嗯嗯啊| 亚洲人123区| 成人国产精品视频| 国产麻豆视频一区| 欧美精品亚洲一区二区在线播放| 亚洲一卡二卡三卡四卡| 欧美性xxxxx极品少妇| 一区二区三区在线观看动漫| 色噜噜久久综合| 亚洲一区二区视频在线| 宅男噜噜噜66一区二区66| 色狠狠一区二区三区香蕉| 亚洲品质自拍视频网站| jizz一区二区| 综合久久给合久久狠狠狠97色| 91色九色蝌蚪| 亚洲综合区在线| 91麻豆精品国产91| 奇米精品一区二区三区在线观看| 日韩精品中文字幕在线不卡尤物 | 欧美另类高清zo欧美| 午夜精品一区二区三区电影天堂| 7799精品视频| 国产一区久久久| 国产精品久久久久久久久免费桃花| 懂色av一区二区三区蜜臀| 国产精品久久久久影院| 欧美中文一区二区三区| 欧美色图免费看| 免费成人结看片| 国产欧美日韩激情| 一本高清dvd不卡在线观看| 秋霞影院一区二区| 中文成人av在线| 欧美在线不卡视频| 免费在线观看日韩欧美| 国产盗摄精品一区二区三区在线| 国产蜜臀av在线一区二区三区| 成人不卡免费av| 亚洲大尺度视频在线观看| 日韩无一区二区| 成人高清视频在线观看| 一区二区高清在线| 一区二区三区免费网站| 91精品一区二区三区久久久久久 | 亚洲特黄一级片| 欧美日韩国产小视频在线观看| 国产一区二区三区高清播放| 亚洲日本一区二区三区| 亚洲国产婷婷综合在线精品| 日韩精品一区二区三区在线播放| a级精品国产片在线观看| 蜜桃久久久久久久| 亚洲日穴在线视频| www国产精品av| 91麻豆精品在线观看| 久久国产生活片100|