From 8b48512de72755f006a45b453847edee4958a6c2 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 25 Nov 1985 15:50:51 +0000 Subject: [PATCH] New version, with a much faster parser. --- util/LLgen/lib/incl | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/util/LLgen/lib/incl b/util/LLgen/lib/incl index 237ee69ea..9ce5edd5f 100644 --- a/util/LLgen/lib/incl +++ b/util/LLgen/lib/incl @@ -1,12 +1,26 @@ /* $Header$ */ +#ifdef LL_DEBUG +#define LL_assert(x) if(!(x)) LL_badassertion("x",__FILE__,__LINE__) +#else +#define LL_assert(x) /* nothing */ +#endif -#define LLin(x) (LLsets[(x)+LLi]&LLb) - -extern short *LLptr; -extern char LLsets[]; -extern int LLi, LLb; extern int LLsymb; -extern int LLcsymb; -extern int LLscd; +extern char LLsets[]; + +#define LL_SAFE(x) /* Nothing */ +#define LL_SSCANDONE(x) if (LLsymb != x) LLmessage(x); else +#define LL_SCANDONE(x) if (LLsymb != x) LLerror(x); else +#define LL_T_NOSCANDONE(x) LLscan(x) # include "Lpars.h" + +extern unsigned int LLscnt[]; +extern unsigned int LLtcnt[]; +extern int LLcsymb; +extern int LL_symb; + +#define LLsdecr(d) {LL_assert(LLscnt[d] > 0); LLscnt[d]--;} +#define LLtdecr(d) {LL_assert(LLtcnt[d] > 0); LLtcnt[d]--;} +#define LLsincr(d) LLscnt[d]++ +#define LLtincr(d) LLtcnt[d]++