Re: yyerror strlen question

2010-01-17 Thread Joel E. Denny
On Mon, 18 Jan 2010, tys lefering wrote: > > As I posted earlier today, we have plans to provide an alternative to > > yyerror. One feature we've discussed is the ability to iterate the > > expected tokens and construct the error message yourself. That would > > allow you to place whatever limit

Re: yyerror strlen question

2010-01-17 Thread tys lefering
On Sun, January 17, 2010 22:37, Joel E. Denny wrote: >> 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 ? > > For now, but 5 is an arbitrary limit, and I know of no guarantee that > Bison won't evolv

Re: yyerror() location tracking

2010-01-17 Thread Tom Stellard
On Sun, Jan 17, 2010 at 02:14:14PM -0500, Joel E. Denny wrote: > On Sun, 17 Jan 2010, Joel E. Denny wrote: > > > The section of the manual you want is: > > > > > > http://www.gnu.org/software/bison/manual/html_node/Error-Reporting.html#Error-Reporting > > > > As you'll read there, to convince

Re: yyerror strlen question

2010-01-17 Thread Joel E. Denny
On Sun, 17 Jan 2010, tys lefering wrote: > 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 As far as

yyerror strlen question

2010-01-17 Thread tys lefering
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 t

Re: yyerror() location tracking

2010-01-17 Thread Joel E. Denny
On Sun, 17 Jan 2010, Joel E. Denny wrote: > The section of the manual you want is: > > > http://www.gnu.org/software/bison/manual/html_node/Error-Reporting.html#Error-Reporting > > As you'll read there, to convince the deterministic parser in C to pass a > location to yyerror, you need to sp

Re: yyerror() location tracking

2010-01-17 Thread Joel E. Denny
On Sat, 16 Jan 2010, Tom Stellard wrote: > I am trying to add line numbers to my parser's error messages. I have > included the options, %locations and %define api.pure in my bison > definition file, but it seems to be generating yyerror with this signature: > yyerror(const char *msg); > instead

Re: yyerror() location tracking

2010-01-17 Thread Luca
Il 17/01/2010 7.18, Tom Stellard ha scritto: Hi, I am trying to add line numbers to my parser's error messages. I have included the options, %locations and %define api.pure in my bison definition file, but it seems to be generating yyerror with this signature: yyerror(const char *msg); instead