144230Sbostic #define INTERDATA 2 244230Sbostic #define GCOS 3 344230Sbostic #define PDP11 4 444230Sbostic #define IBM 5 544230Sbostic #define CMACH 6 644230Sbostic #define VAX 7 744230Sbostic 844230Sbostic #define DMR 2 944230Sbostic #define PCC 3 1044230Sbostic 1144230Sbostic #ifndef FAMILY 1244230Sbostic FAMILY NOT DEFINED !!! 1344230Sbostic Family = FAMILY 1444230Sbostic #endif 1544230Sbostic 1644230Sbostic #ifndef HERE 1744230Sbostic HERE NOT DEFINED !!!! 1844230Sbostic Here = HERE 1944230Sbostic #endif 2044230Sbostic 2144230Sbostic #define M(x) (1<<x) 2244230Sbostic #define ALLOC(x) (struct x *) ckalloc(sizeof(struct x)) 2344230Sbostic #define ALLOCN(n,x) (struct x *) ckalloc(n*sizeof(struct x)) 2444230Sbostic #define ALLEXPR (expptr) ckalloc( sizeof(union Expression) ) 2544230Sbostic typedef int *ptr; 2644230Sbostic typedef char *charptr; 2744230Sbostic typedef FILE *FILEP; 2844230Sbostic typedef short flag; 2944230Sbostic typedef char field; /* actually need only 4 bits */ 3044230Sbostic typedef long int ftnint; 3144230Sbostic #define LOCAL static 3244230Sbostic 3344230Sbostic #define NO 0 3444230Sbostic #define YES 1 3544230Sbostic 3644230Sbostic #define CNULL (char *) 0 3744230Sbostic #define PNULL (ptr) 0 3844230Sbostic #define CHNULL (chainp) 0 3944230Sbostic #define ENULL (expptr) 0 4044230Sbostic 4144230Sbostic 4244230Sbostic 4344230Sbostic /* block tag values */ 4444230Sbostic 4544230Sbostic #define TNAME 1 4644230Sbostic #define TCONST 2 4744230Sbostic #define TEXPR 3 4844230Sbostic #define TADDR 4 4944230Sbostic #define TTEMP 5 5044230Sbostic #define TPRIM 6 5144230Sbostic #define TLIST 7 5244230Sbostic #define TIMPLDO 8 5344230Sbostic #define TERROR 9 5444230Sbostic 5544230Sbostic 5644230Sbostic /* parser states */ 5744230Sbostic 5844230Sbostic #define OUTSIDE 0 5944230Sbostic #define INSIDE 1 6044230Sbostic #define INDCL 2 6144230Sbostic #define INDATA 3 6244230Sbostic #define INEXEC 4 6344230Sbostic 6444230Sbostic /* procedure classes */ 6544230Sbostic 6644230Sbostic #define PROCMAIN 1 6744230Sbostic #define PROCBLOCK 2 6844230Sbostic #define PROCSUBR 3 6944230Sbostic #define PROCFUNCT 4 7044230Sbostic 7144230Sbostic 7244230Sbostic /* storage classes -- vstg values */ 7344230Sbostic 7444230Sbostic #define STGUNKNOWN 0 7544230Sbostic #define STGARG 1 7644230Sbostic #define STGAUTO 2 7744230Sbostic #define STGBSS 3 7844230Sbostic #define STGINIT 4 7944230Sbostic #define STGCONST 5 8044230Sbostic #define STGEXT 6 8144230Sbostic #define STGINTR 7 8244230Sbostic #define STGSTFUNCT 8 8344230Sbostic #define STGCOMMON 9 8444230Sbostic #define STGEQUIV 10 8544230Sbostic #define STGREG 11 8644230Sbostic #define STGLENG 12 8744230Sbostic #define STGNULL 13 8844230Sbostic #define STGPREG 14 8944230Sbostic 9044230Sbostic /* name classes -- vclass values */ 9144230Sbostic 9244230Sbostic #define CLUNKNOWN 0 9344230Sbostic #define CLPARAM 1 9444230Sbostic #define CLVAR 2 9544230Sbostic #define CLENTRY 3 9644230Sbostic #define CLMAIN 4 9744230Sbostic #define CLBLOCK 5 9844230Sbostic #define CLPROC 6 9944230Sbostic #define CLNAMELIST 7 10044230Sbostic 10144230Sbostic 10244230Sbostic /* vprocclass values */ 10344230Sbostic 10444230Sbostic #define PUNKNOWN 0 10544230Sbostic #define PEXTERNAL 1 10644230Sbostic #define PINTRINSIC 2 10744230Sbostic #define PSTFUNCT 3 10844230Sbostic #define PTHISPROC 4 10944230Sbostic 11044230Sbostic /* control stack codes */ 11144230Sbostic 11244230Sbostic #define CTLDO 1 11344230Sbostic #define CTLIF 2 11444230Sbostic #define CTLELSE 3 11544230Sbostic 11644230Sbostic 11744230Sbostic /* operators -- see also arrays 'ops' and 'ops2' in put.c */ 11844230Sbostic 11944230Sbostic #define OPPLUS 1 12044230Sbostic #define OPMINUS 2 12144230Sbostic #define OPSTAR 3 12244230Sbostic #define OPSLASH 4 12344230Sbostic #define OPPOWER 5 12444230Sbostic #define OPNEG 6 12544230Sbostic #define OPOR 7 12644230Sbostic #define OPAND 8 12744230Sbostic #define OPEQV 9 12844230Sbostic #define OPNEQV 10 12944230Sbostic #define OPNOT 11 13044230Sbostic #define OPCONCAT 12 13144230Sbostic #define OPLT 13 13244230Sbostic #define OPEQ 14 13344230Sbostic #define OPGT 15 13444230Sbostic #define OPLE 16 13544230Sbostic #define OPNE 17 13644230Sbostic #define OPGE 18 13744230Sbostic #define OPCALL 19 13844230Sbostic #define OPCCALL 20 13944230Sbostic #define OPASSIGN 21 14044230Sbostic #define OPPLUSEQ 22 14144230Sbostic #define OPSTAREQ 23 14244230Sbostic #define OPCONV 24 14344230Sbostic #define OPLSHIFT 25 14444230Sbostic #define OPMOD 26 14544230Sbostic #define OPCOMMA 27 14644230Sbostic #define OPQUEST 28 14744230Sbostic #define OPCOLON 29 14844230Sbostic #define OPABS 30 14944230Sbostic #define OPMIN 31 15044230Sbostic #define OPMAX 32 15144230Sbostic #define OPADDR 33 15244230Sbostic #define OPINDIRECT 34 15344230Sbostic #define OPBITOR 35 15444230Sbostic #define OPBITAND 36 15544230Sbostic #define OPBITXOR 37 15644230Sbostic #define OPBITNOT 38 15744230Sbostic #define OPRSHIFT 39 15844230Sbostic #define OPPAREN 40 15944230Sbostic #define OPUNARYPLUS 41 16044230Sbostic 16144230Sbostic 16244230Sbostic /* label type codes */ 16344230Sbostic 16444230Sbostic #define LABUNKNOWN 0 16544230Sbostic #define LABEXEC 1 16644230Sbostic #define LABFORMAT 2 16744230Sbostic #define LABOTHER 3 16844230Sbostic 16944230Sbostic 17044230Sbostic /* INTRINSIC function codes*/ 17144230Sbostic 17244230Sbostic #define INTREND 0 17344230Sbostic #define INTRCONV 1 17444230Sbostic #define INTRMIN 2 17544230Sbostic #define INTRMAX 3 17644230Sbostic #define INTRGEN 4 17744230Sbostic #define INTRSPEC 5 17844230Sbostic #define INTRBOOL 6 17944230Sbostic #define INTRCNST 7 18044230Sbostic 18144230Sbostic 18244230Sbostic /* I/O statement codes */ 18344230Sbostic 18444230Sbostic #define IOSTDIN ICON(5) 18544230Sbostic #define IOSTDOUT ICON(6) 18644230Sbostic #define IOSTDERR ICON(0) 18744230Sbostic 18844230Sbostic #define IOSBAD (-1) 18944230Sbostic #define IOSPOSITIONAL 0 19044230Sbostic #define IOSUNIT 1 19144230Sbostic #define IOSFMT 2 19244230Sbostic 19344230Sbostic #define IOINQUIRE 1 19444230Sbostic #define IOOPEN 2 19544230Sbostic #define IOCLOSE 3 19644230Sbostic #define IOREWIND 4 19744230Sbostic #define IOBACKSPACE 5 19844230Sbostic #define IOENDFILE 6 19944230Sbostic #define IOREAD 7 20044230Sbostic #define IOWRITE 8 20144230Sbostic 20244230Sbostic 20344230Sbostic /* type masks */ 20444230Sbostic 20544230Sbostic #define MSKLOGICAL M(TYLOGICAL) 20644230Sbostic #define MSKADDR M(TYADDR) 20744230Sbostic #define MSKCHAR M(TYCHAR) 20844230Sbostic #define MSKINT M(TYSHORT)|M(TYLONG) 20944230Sbostic #define MSKREAL M(TYREAL)|M(TYDREAL) 21044230Sbostic #define MSKCOMPLEX M(TYCOMPLEX)|M(TYDCOMPLEX) 21144230Sbostic #define MSKSTATIC (M(STGINIT)|M(STGBSS)|M(STGCOMMON)|M(STGEQUIV)|M(STGCONST)) 21244230Sbostic 21344230Sbostic /* miscellaneous macros */ 21444230Sbostic 21544230Sbostic #define ONEOF(x,y) (M(x) & (y)) 21644230Sbostic #define ISCOMPLEX(z) ONEOF(z, MSKCOMPLEX) 21744230Sbostic #define ISREAL(z) ONEOF(z, MSKREAL) 21844230Sbostic #define ISNUMERIC(z) ONEOF(z, MSKINT|MSKREAL|MSKCOMPLEX) 21944230Sbostic #define ISICON(z) (z->tag==TCONST && ISINT(z->constblock.vtype)) 22044230Sbostic #define ISCHAR(z) (z->headblock.vtype==TYCHAR) 22144230Sbostic #define ISINT(z) ONEOF(z, MSKINT) 22244230Sbostic #define ISCONST(z) (z->tag==TCONST) 22344230Sbostic #define ISERROR(z) (z->tag==TERROR) 22444230Sbostic #define ISPLUSOP(z) (z->tag==TEXPR && z->exprblock.opcode==OPPLUS) 22544230Sbostic #define ISSTAROP(z) (z->tag==TEXPR && z->exprblock.opcode==OPSTAR) 226*47714Sbostic #define ISONE(z) (ISICON(z) && z->constblock.constant.ci==1) 22744230Sbostic #define INT(z) ONEOF(z, MSKINT|MSKCHAR) 22844230Sbostic #define ICON(z) mkintcon( (ftnint)(z) ) 22944230Sbostic 23044230Sbostic #define NO66(s) if(no66flag) err66(s) 23144230Sbostic #define NOEXT(s) if(noextflag) errext(s) 23244230Sbostic 23344230Sbostic /* round a up to a multiple of b */ 23444230Sbostic #define roundup(a,b) ( b * ( (a+b-1)/b) ) 23544230Sbostic 23644230Sbostic 23744230Sbostic /* optimization buffer slot types */ 23844230Sbostic 23944230Sbostic #define SKNULL 0 24044230Sbostic #define SKIFN 1 24144230Sbostic #define SKGOTO 2 24244230Sbostic #define SKLABEL 3 24344230Sbostic #define SKEQ 4 24444230Sbostic #define SKCALL 5 24544230Sbostic #define SKCMGOTO 6 24644230Sbostic #define SKSTOP 7 24744230Sbostic #define SKDOHEAD 8 24844230Sbostic #define SKENDDO 9 24944230Sbostic #define SKARIF 10 25044230Sbostic #define SKRETURN 11 25144230Sbostic #define SKASGOTO 12 25244230Sbostic #define SKPAUSE 13 25344230Sbostic #define SKASSIGN 14 25444230Sbostic #define SKIOIFN 15 25544230Sbostic #define SKFRTEMP 16 256