mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
Lemon update 2010-07-18 11:35:53 on branch trunk
- Add the -p option to lemon to cause conflicts resolved by precedence rules to appear in the parse.out file. (user: drh)
This commit is contained in:
parent
54ff482d8f
commit
e20dc913b7
1 changed files with 17 additions and 0 deletions
|
@ -44,6 +44,7 @@ extern int access(char *path, int mode);
|
||||||
#define MAXRHS 1000
|
#define MAXRHS 1000
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int showPrecedenceConflict = 0;
|
||||||
static void *msort(void *list, void *next, int (*cmp)());
|
static void *msort(void *list, void *next, int (*cmp)());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1419,6 +1420,8 @@ int main(int argc, char **argv)
|
||||||
{OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."},
|
{OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."},
|
||||||
{OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."},
|
{OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."},
|
||||||
{OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."},
|
{OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."},
|
||||||
|
{OPT_FLAG, "p", (char*)&showPrecedenceConflict,
|
||||||
|
"Show conflicts resolved by precedence rules"},
|
||||||
{OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
|
{OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."},
|
||||||
{OPT_FLAG, "s", (char*)&statistics,
|
{OPT_FLAG, "s", (char*)&statistics,
|
||||||
"Print parser stats to standard output."},
|
"Print parser stats to standard output."},
|
||||||
|
@ -2896,7 +2899,21 @@ int PrintAction(struct action *ap, FILE *fp, int indent){
|
||||||
indent,ap->sp->name,ap->x.stp->statenum);
|
indent,ap->sp->name,ap->x.stp->statenum);
|
||||||
break;
|
break;
|
||||||
case SH_RESOLVED:
|
case SH_RESOLVED:
|
||||||
|
if( showPrecedenceConflict ){
|
||||||
|
fprintf(fp,"%*s shift %d -- dropped by precedence",
|
||||||
|
indent,ap->sp->name,ap->x.stp->statenum);
|
||||||
|
}else{
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case RD_RESOLVED:
|
case RD_RESOLVED:
|
||||||
|
if( showPrecedenceConflict ){
|
||||||
|
fprintf(fp,"%*s reduce %d -- dropped by precedence",
|
||||||
|
indent,ap->sp->name,ap->x.rp->index);
|
||||||
|
}else{
|
||||||
|
result = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case NOT_USED:
|
case NOT_USED:
|
||||||
result = 0;
|
result = 0;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue