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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美xxxxxxxxx| 色婷婷亚洲一区二区三区| 欧美日韩国产另类不卡| 婷婷夜色潮精品综合在线| 国产亚洲欧美激情| 日韩免费观看高清完整版| 日韩一区二区三区视频在线观看| 亚洲综合区在线| 日韩欧美在线观看一区二区三区| 91麻豆.com| 欧美国产精品久久| 免费成人av资源网| 精品视频在线免费看| 91麻豆精品国产91久久久久久| 欧美videos中文字幕| 精品久久一区二区| 欧美猛男男办公室激情| 国产精品美女久久久久久久久久久 | 国产精品自拍av| 九九国产精品视频| 国产精品一二一区| 欧美大白屁股肥臀xxxxxx| 久久久不卡网国产精品一区| 欧美日本乱大交xxxxx| 1024成人网| 亚洲综合免费观看高清在线观看| 成人精品高清在线| 91色乱码一区二区三区| 国产精品久久久久久久久免费桃花| 亚洲一区二区三区国产| 日韩精品色哟哟| 亚洲图片欧美综合| 美女www一区二区| 日韩vs国产vs欧美| 国内国产精品久久| 奇米一区二区三区| 日韩激情中文字幕| 欧美aaaaaa午夜精品| 精品捆绑美女sm三区| 亚洲国产综合人成综合网站| 一区二区不卡在线播放| 日本成人在线一区| 国产婷婷色一区二区三区四区| 2020国产精品久久精品美国| 日韩久久精品一区| 免费看精品久久片| 国产精品久久久久久久久快鸭| 久久九九久久九九| 亚洲精品乱码久久久久久久久 | 国产精品美女视频| 日本韩国精品在线| 日韩和欧美一区二区三区| 国产午夜精品理论片a级大结局| 色天天综合久久久久综合片| 亚洲精品免费看| 成人性生交大片| 婷婷综合在线观看| av中文字幕不卡| 国内精品在线播放| 中文字幕av一区二区三区免费看 | 亚洲超碰97人人做人人爱| 欧美日韩一二三| 日韩欧美成人激情| 亚洲福利电影网| 在线欧美小视频| 欧美午夜不卡在线观看免费| 一区二区三区日韩精品视频| 久久精品人人做人人爽97 | 一区二区三区四区中文字幕| 亚洲天堂免费看| 国产精品99久久久久久宅男| 欧美一卡二卡在线| 精品国产乱子伦一区| 亚洲精品在线电影| 国内精品视频666| 久久九九全国免费| 北条麻妃国产九九精品视频| 欧美色图天堂网| 91丨porny丨在线| 国产91丝袜在线播放0| 樱桃视频在线观看一区| 久草这里只有精品视频| 成人免费高清视频在线观看| 青娱乐精品视频| 粉嫩aⅴ一区二区三区四区五区| 色网综合在线观看| 国产精品久久久一本精品| 欧美猛男超大videosgay| 精品一区二区三区久久久| 色婷婷精品大视频在线蜜桃视频| 韩国一区二区三区| 免费人成精品欧美精品 | 亚洲理论在线观看| 韩国成人福利片在线播放| 一区二区成人在线| 国产精品区一区二区三区| 欧美成人精品高清在线播放| 日韩欧美你懂的| 亚洲天堂a在线| 久久久久久久久久久电影| 麻豆视频观看网址久久| 91麻豆精品国产91久久久久久 | 国产一区二区三区日韩| 成人理论电影网| 欧美久久一区二区| 91在线免费看| 中文字幕电影一区| 日韩亚洲欧美成人一区| 国产精品无圣光一区二区| 亚洲成人午夜电影| 久久久噜噜噜久久中文字幕色伊伊 | 日韩精品中文字幕一区二区三区| 亚洲青青青在线视频| 高清国产一区二区三区| 经典三级在线一区| 国产亚洲欧美一区在线观看| 精品国产亚洲一区二区三区在线观看| 色www精品视频在线观看| 免费看精品久久片| 亚洲国产精品自拍| 国产成人一区在线| 色94色欧美sute亚洲13| 欧美日本韩国一区二区三区视频| 午夜伊人狠狠久久| 一区二区在线观看视频 | 国内精品久久久久影院色 | 色婷婷久久一区二区三区麻豆| 色www精品视频在线观看| 7777精品久久久大香线蕉| 日韩欧美久久一区| 国产精品区一区二区三区| 色先锋资源久久综合| 欧美日韩免费一区二区三区| 欧美大片拔萝卜| 国产日韩欧美激情| 91精品国产aⅴ一区二区| 亚洲超丰满肉感bbw| 亚洲日本成人在线观看| 99久久国产综合色|国产精品| 亚洲色图制服诱惑 | 91精品国产综合久久久蜜臀图片| 欧美日本不卡视频| a在线欧美一区| 国产精品一区二区三区四区 | 老司机免费视频一区二区三区| 日韩精品乱码免费| 亚洲欧美国产77777| 欧美国产日韩精品免费观看| 国产精品系列在线播放| 蜜桃一区二区三区在线观看| 午夜视频在线观看一区二区| 亚洲一区二区在线免费看| 欧美日韩一级片在线观看| 在线精品视频免费播放| 色狠狠综合天天综合综合| aa级大片欧美| 92精品国产成人观看免费| av不卡在线观看| 不卡的av网站| 三级在线观看一区二区| 日本欧美加勒比视频| 日韩高清在线不卡| 免费黄网站欧美| 久久不见久久见免费视频7| 国产一区二区调教| 国产高清成人在线| 石原莉奈一区二区三区在线观看 | 久久久综合视频| 中文字幕一区二区三区乱码在线 | 久久男人中文字幕资源站| 国产成人鲁色资源国产91色综| 亚洲黄网站在线观看| 欧美成人a视频| 国产欧美日韩中文久久| 一区在线观看免费| 亚洲成在线观看| 国产中文字幕精品| 99这里只有精品| 制服丝袜激情欧洲亚洲| 久久综合九色综合欧美98 | 欧美午夜不卡视频| 日韩免费视频线观看| 欧洲在线/亚洲| av爱爱亚洲一区| 国产精品18久久久久久久久久久久 | 国产成人精品www牛牛影视| 日日夜夜免费精品| 亚洲bdsm女犯bdsm网站| 中文字幕在线不卡国产视频| 亚洲国产精品视频| 国内精品写真在线观看| 久久91精品久久久久久秒播| 99re热视频精品| 精品国产一区二区三区忘忧草| 日韩一区二区在线播放| 亚洲特级片在线| 老司机免费视频一区二区三区| 国内欧美视频一区二区| 欧美日韩亚洲综合在线| 国产精品久久久久久久久动漫 |