#define M(x) (1<<x)
#define ALLOC(x) (struct x *) ckalloc(sizeof(struct x))
#define ALLOCN(n,x) (struct x *) ckalloc(n*sizeof(struct x))
+#define ALLEXPR (expptr) ckalloc( sizeof(union Expression) )
typedef int *ptr;
+typedef char *charptr;
typedef FILE *FILEP;
typedef short flag;
+typedef char field; /* actually need only 4 bits */
typedef long int ftnint;
#define LOCAL static
#define NO 0
#define YES 1
+#define CNULL (char *) 0
+#define PNULL (ptr) 0
+#define CHNULL (chainp) 0
+#define ENULL (expptr) 0
+
/* block tag values */
#define PROCFUNCT 4
-/* storage classes */
+/* storage classes -- vstg values */
#define STGUNKNOWN 0
#define STGARG 1
#define STGEQUIV 10
#define STGREG 11
#define STGLENG 12
+#define STGNULL 13
-/* name classes */
+/* name classes -- vclass values */
#define CLUNKNOWN 0
#define CLPARAM 1
#define CLMAIN 4
#define CLBLOCK 5
#define CLPROC 6
+#define CLNAMELIST 7
-/* vproclass values */
+/* vprocclass values */
#define PUNKNOWN 0
#define PEXTERNAL 1
#define OPRSHIFT 39
-/* memory regions */
-
-#define REGARG 1
-#define REGAUTO 2
-#define REGBSS 3
-#define REGINIT 4
-#define REGCONST 5
-#define REGEXT 6
-#define REGPROG 7
-
/* label type codes */
#define LABUNKNOWN 0
#define IOSTDIN ICON(5)
#define IOSTDOUT ICON(6)
+#define IOSTDERR ICON(0)
#define IOSBAD (-1)
#define IOSPOSITIONAL 0
#define MSKINT M(TYSHORT)|M(TYLONG)
#define MSKREAL M(TYREAL)|M(TYDREAL)
#define MSKCOMPLEX M(TYCOMPLEX)|M(TYDCOMPLEX)
+#define MSKSTATIC (M(STGINIT)|M(STGBSS)|M(STGCOMMON)|M(STGEQUIV)|M(STGCONST))
/* miscellaneous macros */
#define ISCOMPLEX(z) ONEOF(z, MSKCOMPLEX)
#define ISREAL(z) ONEOF(z, MSKREAL)
#define ISNUMERIC(z) ONEOF(z, MSKINT|MSKREAL|MSKCOMPLEX)
-#define ISICON(z) (z->headblock.tag==TCONST && ISINT(z->headblock.vtype))
+#define ISICON(z) (z->tag==TCONST && ISINT(z->constblock.vtype))
#define ISCHAR(z) (z->headblock.vtype==TYCHAR)
#define ISINT(z) ONEOF(z, MSKINT)
-#define ISCONST(z) (z->headblock.tag==TCONST)
-#define ISERROR(z) (z->headblock.tag==TERROR)
-#define ISPLUSOP(z) (z->headblock.tag==TEXPR && z->exprblock.opcode==OPPLUS)
-#define ISSTAROP(z) (z->headblock.tag==TEXPR && z->exprblock.opcode==OPSTAR)
+#define ISCONST(z) (z->tag==TCONST)
+#define ISERROR(z) (z->tag==TERROR)
+#define ISPLUSOP(z) (z->tag==TEXPR && z->exprblock.opcode==OPPLUS)
+#define ISSTAROP(z) (z->tag==TEXPR && z->exprblock.opcode==OPSTAR)
#define ISONE(z) (ISICON(z) && z->constblock.const.ci==1)
#define INT(z) ONEOF(z, MSKINT|MSKCHAR)
#define ICON(z) mkintcon( (ftnint)(z) )
-#define CHCON(z) mkstrcon(strlen(z), z)
-
-#if HERE == PDP11
- /* not enough space in compiler for checks */
-# define NO66(s)
-# define NOEXT(s)
-#else
-# define NO66(s) if(no66flag) err66(s)
-# define NOEXT(s) if(noextflag) errext(s)
-#endif
+
+#define NO66(s) if(no66flag) err66(s)
+#define NOEXT(s) if(noextflag) errext(s)
/* round a up to a multiple of b */
#define roundup(a,b) ( b * ( (a+b-1)/b) )