|defined YYERROR_VERBOSE, but still got only "parse error" firstname.lastname@example.org (2001-09-03)|
|Re: defined YYERROR_VERBOSE, but still got only "parse error" email@example.com (2001-09-05)|
|Re: defined YYERROR_VERBOSE, but still got only "parse error" firstname.lastname@example.org (2001-09-16)|
|From:||email@example.com (Gene Wirchenko)|
|Date:||5 Sep 2001 22:11:04 -0400|
|Organization:||Posted via Supernews, http://www.supernews.com|
|Posted-Date:||05 Sep 2001 22:11:04 EDT|
firstname.lastname@example.org (Sorin Gherman) wrote:
>This is my first time using Bison and I run into the following
>problem: I defined YYERROR_VERBOSE (and confirmed it is defined into
>the generated .c file by inserting a printf there) but I still got
>only the usual "parse error" message when an error occurs.
>I've looked into the code that actully generates the error message:
>if (count < 5)
> count = 0;
> for (x = (yyn < 0 ? -yyn : 0);
> x < (sizeof(yytname) / sizeof(char *)); x++)
> if (yycheck[x + yyn] == x)
> strcat(msg, count == 0 ? ", expecting `" : " or `");
> strcat(msg, yytname[x]);
> strcat(msg, "'");
>and found out that count == 5 from the beginning; replacing
>if (count < 5)
>resulted in an informative error message ("expected" ... "or" ...).
>What's the problem? Do I need to set up other variables as well, or
5 isn't less than 5.
If count==5, then count<5 is FALSE. You changed the semantics.
Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
Return to the
Search the comp.compilers archives again.