expressn.h
来自「一套美国国家宇航局人工智能中心NASA的专家系统工具源代码」· C头文件 代码 · 共 145 行
H
145 行
/*******************************************************/ /* "C" Language Integrated Production System */ /* */ /* CLIPS Version 6.05 04/09/97 */ /* */ /* EXPRESSION HEADER FILE */ /*******************************************************//*************************************************************//* Purpose: Contains routines for creating, deleting, *//* compacting, installing, and hashing expressions. *//* *//* Principal Programmer(s): *//* Gary D. Riley *//* *//* Contributing Programmer(s): *//* Brian L. Donnell *//* *//* Revision History: *//* *//*************************************************************/#ifndef _H_expressn#define _H_expressnstruct expr;struct exprHashNode;#ifndef _H_exprnops#include "exprnops.h"#endif/******************************//* Expression Data Structures *//******************************/struct expr { short type; VOID *value; struct expr *argList; struct expr *nextArg; }; #define arg_list argList#define next_arg nextArgtypedef struct expr EXPRESSION;typedef struct exprHashNode { unsigned hashval; unsigned count; struct expr *exp; struct exprHashNode *nxt; long bsaveID; } EXPRESSION_HN;#define EXPRESSION_HASH_SIZE 503/*************************//* Type and Value Macros *//*************************/#define GetType(target) ((target).type) #define GetpType(target) ((target)->type) #define SetType(target,val) ((target).type = (val)) #define SetpType(target,val) ((target)->type = (val)) #define GetValue(target) ((target).value) #define GetpValue(target) ((target)->value) #define SetValue(target,val) ((target).value = (VOID *) (val)) #define SetpValue(target,val) ((target)->value = (VOID *) (val)) /********************//* Global Functions *//********************/ #ifdef LOCALE#undef LOCALE#endif#ifdef _EXPRESSN_SOURCE_#define LOCALE#else#define LOCALE extern#endif#if ANSI_COMPILER LOCALE VOID ReturnExpression(struct expr *); LOCALE VOID ExpressionInstall(struct expr *); LOCALE VOID ExpressionDeinstall(struct expr *); LOCALE struct expr *CopyExpression(struct expr *); LOCALE struct expr *PackExpression(struct expr *); LOCALE VOID ReturnPackedExpression(struct expr *); LOCALE VOID InitExpressionData(void); LOCALE VOID InitExpressionPointers(void);#if (! BLOAD_ONLY) && (! RUN_TIME) LOCALE EXPRESSION *AddHashedExpression(EXPRESSION *);#endif#if (! RUN_TIME) LOCALE VOID RemoveHashedExpression(EXPRESSION *);#endif#if BLOAD_AND_BSAVE || BLOAD_ONLY || BLOAD || CONSTRUCT_COMPILER LOCALE long HashedExpressionIndex(EXPRESSION *);#endif#else LOCALE VOID ReturnExpression(); LOCALE VOID ExpressionInstall(); LOCALE VOID ExpressionDeinstall(); LOCALE struct expr *CopyExpression(); LOCALE struct expr *PackExpression(); LOCALE VOID ReturnPackedExpression(); LOCALE VOID InitExpressionData(); LOCALE VOID InitExpressionPointers();#if (! BLOAD_ONLY) && (! RUN_TIME) LOCALE EXPRESSION *AddHashedExpression();#endif#if (! RUN_TIME) LOCALE VOID RemoveHashedExpression();#endif#if BLOAD_AND_BSAVE || BLOAD_ONLY || BLOAD || CONSTRUCT_COMPILER LOCALE long HashedExpressionIndex();#endif#endif /********************//* Global Variables *//********************/#ifndef _EXPRESSN_SOURCE_ extern VOID *PTR_AND; extern VOID *PTR_OR; extern VOID *PTR_EQ; extern VOID *PTR_NEQ; extern VOID *PTR_NOT; extern EXPRESSION_HN **ExpressionHashTable;#endif#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?