Pristine Ack-5.5
[Ack-5.5.git] / util / LLgen / src / sets.h
1 /* Copyright (c) 1991 by the Vrije Universiteit, Amsterdam, the Netherlands.
2  * For full copyright and restrictions on use see the file COPYING in the top
3  * level of the LLgen tree.
4  */
5
6 /*
7  *  L L G E N
8  *
9  *  An Extended LL(1) Parser Generator
10  *
11  *  Author : Ceriel J.H. Jacobs
12  */
13
14 /*
15  * $Id: sets.h,v 2.6 1995/07/31 09:17:07 ceriel Exp $
16  * Some macros that deal with bitsets and their size
17  */
18
19 # define BITS           (8 * sizeof (int))
20 # define IN(a,i)        ((a)[(i)/BITS] & (1<<((i) % BITS)))
21 # define NTIN(a,i)      ((a)[(i)/BITS+tsetsize]&(1<<((i)%BITS)))
22 # define PUTIN(a,i)     ((a)[(i)/BITS] |=(1<<((i) % BITS)))
23 # define NTPUTIN(a,i)   ((a)[(i)/BITS+tsetsize]|=(1<<((i)%BITS)))
24 # define NBYTES(n)      (((n) + 7) / 8)
25 /*
26  * The next two macros operate on byte counts!
27  */
28 # define NINTS(n)       (((n) + (int) (sizeof(int) - 1)) / (int) sizeof(int))
29 # define ALIGN(n)       (NINTS(n) * (int) sizeof (int))
30
31 extern int      tsetsize;
32 extern p_set    *setptr, *maxptr;
33 extern int      nbytes;