00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _H_expressn
00026
00027 #define _H_expressn
00028
00029 struct expr;
00030 struct exprHashNode;
00031
00032 #ifndef _H_exprnops
00033 #include "exprnops.h"
00034 #endif
00035
00036
00037
00038
00039
00040 struct expr
00041 {
00042 unsigned short type;
00043 void *value;
00044 struct expr *argList;
00045 struct expr *nextArg;
00046 };
00047
00048 #define arg_list argList
00049 #define next_arg nextArg
00050
00051 typedef struct expr EXPRESSION;
00052
00053 typedef struct exprHashNode
00054 {
00055 unsigned hashval;
00056 unsigned count;
00057 struct expr *exp;
00058 struct exprHashNode *next;
00059 long bsaveID;
00060 } EXPRESSION_HN;
00061
00062 #define EXPRESSION_HASH_SIZE 503
00063
00064
00065
00066
00067
00068 #define GetType(target) ((target).type)
00069 #define GetpType(target) ((target)->type)
00070 #define SetType(target,val) ((target).type = (unsigned short) (val))
00071 #define SetpType(target,val) ((target)->type = (unsigned short) (val))
00072 #define GetValue(target) ((target).value)
00073 #define GetpValue(target) ((target)->value)
00074 #define SetValue(target,val) ((target).value = (void *) (val))
00075 #define SetpValue(target,val) ((target)->value = (void *) (val))
00076
00077 #define EnvGetType(theEnv,target) ((target).type)
00078 #define EnvGetpType(theEnv,target) ((target)->type)
00079 #define EnvSetType(theEnv,target,val) ((target).type = (unsigned short) (val))
00080 #define EnvSetpType(theEnv,target,val) ((target)->type = (unsigned short) (val))
00081 #define EnvGetValue(theEnv,target) ((target).value)
00082 #define EnvGetpValue(theEnv,target) ((target)->value)
00083 #define EnvSetValue(theEnv,target,val) ((target).value = (void *) (val))
00084 #define EnvSetpValue(theEnv,target,val) ((target)->value = (void *) (val))
00085
00086
00087
00088
00089
00090 #ifndef _H_exprnpsr
00091 #include "exprnpsr.h"
00092 #endif
00093
00094 #define EXPRESSION_DATA 45
00095
00096 struct expressionData
00097 {
00098 void *PTR_AND;
00099 void *PTR_OR;
00100 void *PTR_EQ;
00101 void *PTR_NEQ;
00102 void *PTR_NOT;
00103 EXPRESSION_HN **ExpressionHashTable;
00104 #if (BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE)
00105 long NumberOfExpressions;
00106 struct expr *ExpressionArray;
00107 long int ExpressionCount;
00108 #endif
00109 #if (! RUN_TIME)
00110 SAVED_CONTEXTS *svContexts;
00111 int ReturnContext;
00112 int BreakContext;
00113 #endif
00114 intBool SequenceOpMode;
00115 };
00116
00117 #define ExpressionData(theEnv) ((struct expressionData *) GetEnvironmentData(theEnv,EXPRESSION_DATA))
00118
00119
00120
00121
00122
00123 #ifdef LOCALE
00124 #undef LOCALE
00125 #endif
00126
00127 #ifdef _EXPRESSN_SOURCE_
00128 #define LOCALE
00129 #else
00130 #define LOCALE extern
00131 #endif
00132
00133 LOCALE void ReturnExpression(void *,struct expr *);
00134 LOCALE void ExpressionInstall(void *,struct expr *);
00135 LOCALE void ExpressionDeinstall(void *,struct expr *);
00136 LOCALE struct expr *PackExpression(void *,struct expr *);
00137 LOCALE void ReturnPackedExpression(void *,struct expr *);
00138 LOCALE void InitExpressionData(void *);
00139 LOCALE void InitExpressionPointers(void *);
00140 #if (! BLOAD_ONLY) && (! RUN_TIME)
00141 LOCALE EXPRESSION *AddHashedExpression(void *,EXPRESSION *);
00142 #endif
00143 #if (! RUN_TIME)
00144 LOCALE void RemoveHashedExpression(void *,EXPRESSION *);
00145 #endif
00146 #if BLOAD_AND_BSAVE || BLOAD_ONLY || BLOAD || CONSTRUCT_COMPILER
00147 LOCALE long HashedExpressionIndex(void *,EXPRESSION *);
00148 #endif
00149
00150 #endif
00151
00152
00153
00154