help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

yyerror strlen question


From: tys lefering
Subject: yyerror strlen question
Date: Sun, 17 Jan 2010 22:12:43 +0100
User-agent: SquirrelMail/1.4.18

Hi,
using YYERROR_VERBOSE in a bison grammar to get a verbose
error message at yyerror() it is not mentioned how large
the error message string may be in the manual or source
http://www.gnu.org/software/bison/manual/bison.html#Error-Reporting
reading in the generated yacc y.tab.c the string looks to be
generated with:
static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int
yystate, int yytoken)
which has a limit om max. 5 args with enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
and resulting longest string is like this:
YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or
%s"));
is this correct ?
then the longest yyerror string depends on the token names lenght ?
passing the yyerror string in a gui program to a window and
need to estimate how long the yyerror string may be.
Thanks,
Tys lefering






reply via email to

[Prev in Thread] Current Thread [Next in Thread]