version 1.1, 1995/10/18 08:47:05 |
version 1.2, 1996/02/04 08:37:01 |
|
|
|
|
action **parser; |
action **parser; |
int SRtotal; |
int SRtotal; |
|
int SRexpect = 0; |
int RRtotal; |
int RRtotal; |
short *SRconflicts; |
short *SRconflicts; |
short *RRconflicts; |
short *RRconflicts; |
|
|
|
|
total_conflicts() |
total_conflicts() |
{ |
{ |
fprintf(stderr, "%s: ", myname); |
/* Warn if s/r != expect or if any r/r */ |
if (SRtotal == 1) |
if ((SRtotal != SRexpect) || RRtotal) |
fprintf(stderr, "1 shift/reduce conflict"); |
{ |
else if (SRtotal > 1) |
if (SRtotal == 1) |
fprintf(stderr, "%d shift/reduce conflicts", SRtotal); |
fprintf(stderr, "%s: 1 shift/reduce conflict\n", myname); |
|
else if (SRtotal > 1) |
|
fprintf(stderr, "%s: %d shift/reduce conflicts\n", myname, |
|
SRtotal); |
|
} |
|
|
if (SRtotal && RRtotal) |
|
fprintf(stderr, ", "); |
|
|
|
if (RRtotal == 1) |
if (RRtotal == 1) |
fprintf(stderr, "1 reduce/reduce conflict"); |
fprintf(stderr, "%s: 1 reduce/reduce conflict\n", myname); |
else if (RRtotal > 1) |
else if (RRtotal > 1) |
fprintf(stderr, "%d reduce/reduce conflicts", RRtotal); |
fprintf(stderr, "%s: %d reduce/reduce conflicts\n", myname, |
|
RRtotal); |
fprintf(stderr, ".\n"); |
|
} |
} |
|
|
|
|