From edae1fc950b8fe2aab31d57afa8d3aa134ac3517 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 26 Jan 1987 16:14:39 +0000 Subject: [PATCH] Added a check that a tokenset in a stackpattern contains tokens that all have the same size. --- util/ncgg/cgg.y | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/ncgg/cgg.y b/util/ncgg/cgg.y index 1edca6219..8c1974e94 100644 --- a/util/ncgg/cgg.y +++ b/util/ncgg/cgg.y @@ -20,6 +20,7 @@ int startline; int npatterns; int att_type; int patindex[MAXPATTERNS]; +extern set_t l_sets[]; int emhere=0; /* lexical analyzer flag */ int optexact=0; /* Inside "with exact" rule */ @@ -742,6 +743,9 @@ setlist { NEXT(tokpatlen,TOKPATMAX,"Stack pattern"); tokpatset[tokpatlen-1] = $2; checkunstacking($2); + if (l_sets[$2].set_size == 0) { + error("Tokenset is empty or has elements with different sizes"); + } } ; kills