/* jgmath.h Include file for JGOFS system math method. WJS 15 Apr 98 */ /* Named jgmath instead of math because there might be conflict */ /* with . Isn't on VMS... */ /* 11 Jan 99 v 1.3 WJS */ /* SGI compiler apparently doesn't like concatenation via ## */ /* [Begin 1.3] */ /* 4 May 98 v 1.2 WJS */ /* Add comma to token delims */ /* 24 Apr 98 v 1.2 WJS */ /* EQUATION_ID */ /* Redefine PCODE_LEN in terms of max equation length to try to */ /* minimize chances of pcode overflow (which is not checked for...) */ /* [Begin 1.2] */ /* 24 Apr 98 v 1.1 WJS */ /* Add PCODE_LEN, NEW_VAR_WIDTH, some comments */ /* Remove architecture constant defns */ /* [Begin 1.1] */ #include #include #include #include double strtod(); #include #define MAX_EQUATIONS 10 #define MAX_NEW_VARS 10 #define NEW_VAR_WIDTH 8 /* Minimum width, in chars, of variables we */ /* generate. 8 is value corresponding to %f */ /* format - at least 1 dig before dec pt, dec */ /* pt, 6 digs after dec pt */ #define STACK_DEPTH 20 /* Size of parsing stack. I assume this is */ /* related to how many operators, sets of */ /* parens, etc, are in expression, but maybe */ /* not... */ #include OPTIONS /* Coordinates sizes between inners & outers */ #include INNEROPTIONS /* Common sizes for all inners */ /* Number of bytes of pcode for a given equation. Used to be 255. */ /* Possible that in past, pcode was always < = equation size. Equa- */ /* tion was parsed into temporary buffer, then recopied over equa- */ /* tion. Now that I've made variable number 2 bytes instead of 1, */ /* would seem that if variables names are 1 char each, pcode could */ /* be bigger than equation. As approximation, use twice the equa- */ /* tion size... */ #define PCODE_LEN 2*INBUFSIZE #if NVAR > 0x7FFF #error "Max # variables in math is 15 bits' worth (= 16767?)" #endif #define MAXLEVELS 10 /* This belongs in some other .h file... */ #define ATTRIB_SEP ';' /* These */ #define ATTRIB_DELIMS "[]" /* too */ #define W_EXTEND '_' /* perhaps */ #define PRIORITY " $ (), = +-*/^ " /* Each 2 chars at same prio */ /* below had '##' in front of ATTRIB_DELIMS in v1.1 */ #define TOKEN_TERMINATORS "$(),=+-*/^"ATTRIB_DELIMS /* String which appears between variable (and optional attribute */ /* string) and rest of equation. Must be at least 2 chars long, or, */ /* if 1 char, must not conflict w/any chars above */ #define EQUATION_ID ":=" #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE !FALSE #endif