* @(#)dextern 4.2 (Berkeley) %G%
/* MANIFEST CONSTANT DEFINITIONS */
/* base of nonterminal internal numbers */
/* internal codes for error and accept actions */
# define TBITSET ((32+NTERMS)/32)
/* bit packing macros (may be machine dependent) */
# define BIT(a,i) ((a)[(i)>>5] & (1<<((i)&037)))
# define SETBIT(a,i) ((a)[(i)>>5] |= (1<<((i)&037)))
/* number of words needed to hold n+1 bits */
# define NWORDS(n) (((n)+32)/32)
# define TBITSET ((16+NTERMS)/16)
/* bit packing macros (may be machine dependent) */
# define BIT(a,i) ((a)[(i)>>4] & (1<<((i)&017)))
# define SETBIT(a,i) ((a)[(i)>>4] |= (1<<((i)&017)))
/* number of words needed to hold n+1 bits */
# define NWORDS(n) (((n)+16)/16)
/* relationships which must hold:
TBITSET ints must hold NTERMS+1 bits...
TEMPSIZE >= NTERMS + NNONTERMs + 1
# define NOASC 0 /* no assoc. */
# define LASC 1 /* left assoc. */
# define RASC 2 /* right assoc. */
# define BASC 3 /* binary assoc. */
/* flags for state generation */
/* flags for a rule having an action, and being reduced */
/* output parser flags */
/* macros for getting associativity and precedence levels */
# define ASSOC(i) ((i)&03)
# define PLEVEL(i) (((i)>>4)&077)
# define TYPE(i) ((i>>10)&077)
/* macros for setting associativity and precedence levels */
# define SETASC(i,j) i|=j
# define SETPLEV(i,j) i |= (j<<4)
# define SETTYPE(i,j) i |= (j<<10)
# define TLOOP(i) for(i=1;i<=ntokens;++i)
# define NTLOOP(i) for(i=0;i<=nnonter;++i)
# define PLOOP(s,i) for(i=s;i<nprod;++i)
# define SLOOP(i) for(i=0;i<nstate;++i)
# define WSLOOP(s,j) for(j=s;j<cwp;++j)
# define ITMLOOP(i,p,q) q=pstate[i+1];for(p=pstate[i];p<q;++p)
# define SETLOOP(i) for(i=0;i<tbitset;++i)
extern FILE * finput; /* input file */
extern FILE * faction; /* file for saving actions */
extern FILE *fdefine; /* file for # defines */
extern FILE * ftable; /* y.tab.c file */
extern FILE * ftemp; /* tempfile to pass 2 */
extern FILE * foutput; /* y.output file */
/* structure declarations */
extern int ntokens ; /* number of tokens */
extern struct toksymb tokset[];
extern int toklev[]; /* vector with the precedence of the terminals */
/* nonterminal information */
extern int nnonter ; /* the number of nonterminals */
extern struct ntsymb nontrst[];
/* grammar rule information */
extern int nprod ; /* number of productions */
extern int *prdptr[]; /* pointers to descriptions of productions */
extern int levprd[] ; /* contains production levels to break conflicts */
extern int nstate ; /* number of states */
extern struct item *pstate[]; /* pointers to the descriptions of the states */
extern int tystate[]; /* contains type information about the states */
extern int defact[]; /* the default action of the state */
extern int tstates[]; /* the states deriving each token */
extern int ntstates[]; /* the states deriving each nonterminal */
extern int mstates[]; /* the continuation of the chains begun in tstates and ntstates */
/* lookahead set information */
extern struct looksets lkst[];
extern int nolook; /* flag to turn off lookahead computations */
/* working set information */
extern struct wset wsets[];
/* storage for productions */
/* storage for action table */
extern int amem[]; /* action table storage */
extern int *memp ; /* next free action table position */
extern int indgo[]; /* index to the stored goto table */
/* temporary vector, indexable by states, terms, or ntokens */
extern int lineno; /* current line number */
/* statistics collection variables */
/* define functions with strange types... */
extern struct looksets *flset();
/* default settings for a number of macros */
/* name of yacc tempfiles */
# define TEMPNAME "yacc.tmp"
# define ACTNAME "yacc.acts"
/* user output file name */
# define FILEU "y.output"
/* output file for # defines */
/* command to clobber tempfiles after use */
# define ZAPFILE(x) unlink(x)