|
|
1.1 ! root 1: /* ! 2: * macros and global declarations for basic ! 3: * ! 4: * ! 5: * ! 6: * stack frame types: ! 7: * ! 8: * NOTE: the EXPR types must be distinguishable from all others ! 9: * by the presence of the single bit defined by EXPR ! 10: * Also note that INT, FLOAT and STRING are used as indices ! 11: * into the 'chains' array (cf. sym.c) and that the value ! 12: * of MAXTYPES must be at least 1 greater than that of the ! 13: * highest-numbered basic type. ! 14: */ ! 15: ! 16: #define ANYTYPE 0 ! 17: #define INT 1 ! 18: #define FLOAT 2 ! 19: #define STRING 3 ! 20: #define STK_DEF 5 ! 21: #define STK_FOR 6 ! 22: #define STK_GOSUB 7 ! 23: #define INTEXPR INT+EXPR ! 24: #define FLOATEXPR FLOAT+EXPR ! 25: #define STRINGEXPR STRING+EXPR ! 26: #define EXPR 010 ! 27: ! 28: #define MAXTYPES 4 ! 29: ! 30: ! 31: /* ! 32: * macros and abbreviations: ! 33: */ ! 34: ! 35: #define ALL_LINES(p) (p=(Linep)lines;isline(p);p=nextline(p)) ! 36: #define endchk() if(!endtest()) badsyn() ! 37: #define endtest() (*inptr==0||*inptr==COLON||*inptr==ELSE) ! 38: #define expectc(c) if(*inptr!=c) badsyn(); else ++inptr ! 39: #define fexpr() (expr(),popfloat()) ! 40: #define isexpr(s) ((s)->k_type&EXPR) ! 41: #define isline(p) ((p)->l_len) ! 42: #define isstring(s) ((s)>=strspace&&(s)<endstring) ! 43: #define istoken(c) ((c)<0) ! 44: #ifdef NULL ! 45: #undef NULL ! 46: #endif ! 47: #define NULL (char *)0 ! 48: #define pushint(i) pushfloat((double)(i)) ! 49: #define skipbl() while(*inptr==' '||*inptr=='\t')++inptr ! 50: #define SINGLE (typelens[FLOAT]==4) ! 51: #define UNTOKEN(c) (-1-(c)) ! 52: ! 53: #define endstring strspace+MAXSTRSPACE ! 54: #define line immed.l_line ! 55: #define stkbase stkspace ! 56: #define stktop stkspace+MAXSTACK ! 57: ! 58: ! 59: /* ! 60: * sizes and limits: ! 61: */ ! 62: ! 63: #define DEFSIZE 10 /* default number of array elements */ ! 64: #define EXPANDLINES 4096 /* expansion size */ ! 65: #define EXPANDSYM 4096 /* symbol table expansion increment */ ! 66: #define LEN_FUZZ 6 /* close enough to not move */ ! 67: #define MAXFILENAME 32 ! 68: #define MAXLINELEN 255 /* maximum length of an input line */ ! 69: #define MAXLINES 4096 /* initial size of line buffer */ ! 70: #define MAXSTACK 2048 /* size of expression stack */ ! 71: #define MAXSTRING 255 /* max string len. (must fit in a char) */ ! 72: #define MAXSTRSPACE 2048 /* size of string table */ ! 73: #define MAXSUBS 3 /* max number of array dimensions */ ! 74: #define MAXSYMSPACE 4096 /* initial size of symbol table */ ! 75: #define TOKEN 0177600 ! 76: #define TOKENMASK 0177 ! 77: ! 78: #define FLOATSIZE (sizeof(double)) ! 79: #define INTSIZE (sizeof(int)) ! 80: #define STRINGSIZE (sizeof(String)) ! 81: ! 82: #define MINLNR 0 ! 83: #define MAXLNR (unsigned)65535 ! 84: #define MAXINT 32767 ! 85: ! 86: ! 87: /* ! 88: * status and action symbols: ! 89: */ ! 90: ! 91: #define LISTLNRS 1 /* getlnrs: expect lnrs in input */ ! 92: #define DEFAULTLNRS 0 /* getlnrs: use defaults if no lnrs found */ ! 93: #define EXACTLNR 1 /* findline: error if line not found */ ! 94: #define NEXTLNR 0 /* findline: return next higher line */ ! 95: #define YES 1 ! 96: #define NO 0
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.