Pristine Ack-5.5
[Ack-5.5.git] / util / LLgen / lib / incl
1 /* $Id: incl,v 2.13 1997/02/21 15:44:09 ceriel Exp $ */
2 #ifdef LL_DEBUG
3 #include <assert.h>
4 #include <stdio.h>
5 #define LL_assert(x)    assert(x)
6 #else
7 #define LL_assert(x)    /* nothing */
8 #endif
9
10 extern int LLsymb;
11
12 #define LL_SAFE(x)      /* Nothing */
13 #define LL_SSCANDONE(x) if (LLsymb != x) LLsafeerror(x)
14 #define LL_SCANDONE(x)  if (LLsymb != x) LLerror(x)
15 #define LL_NOSCANDONE(x) LLscan(x)
16 #ifdef LL_FASTER
17 #define LLscan(x)       if ((LLsymb = LL_LEXI()) != x) LLerror(x)
18 #endif
19
20 extern unsigned int LLscnt[];
21 extern unsigned int LLtcnt[];
22 extern int LLcsymb;
23
24 #if LL_NON_CORR
25 extern int LLstartsymb;
26 #endif
27
28 #define LLsdecr(d)      {LL_assert(LLscnt[d] > 0); LLscnt[d]--;}
29 #define LLtdecr(d)      {LL_assert(LLtcnt[d] > 0); LLtcnt[d]--;}
30 #define LLsincr(d)      LLscnt[d]++
31 #define LLtincr(d)      LLtcnt[d]++
32
33 #if LL_ANSI_C
34 extern int LL_LEXI(void);
35 extern void LLread(void);
36 extern int LLskip(void);
37 extern int LLnext(int);
38 extern void LLerror(int);
39 extern void LLsafeerror(int);
40 extern void LLnewlevel(unsigned int *);
41 extern void LLoldlevel(unsigned int *);
42 #ifndef LL_FASTER
43 extern void LLscan(int);
44 #endif
45 #ifndef LLNOFIRSTS
46 extern int LLfirst(int, int);
47 #endif
48 #if LL_NON_CORR
49 extern void LLnc_recover(void);
50 #endif
51 #else /* not LL_ANSI_C */
52 extern LLread();
53 extern int LLskip();
54 extern int LLnext();
55 extern LLerror();
56 extern LLsafeerror();
57 extern LLnewlevel();
58 extern LLoldlevel();
59 #ifndef LL_FASTER
60 extern LLscan();
61 #endif
62 #ifndef LLNOFIRSTS
63 extern int LLfirst();
64 #endif
65 #if LL_NON_CORR
66 extern LLnc_recover();
67 #endif
68 #endif /* not LL_ANSI_C */