Re: Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-28 Thread Hans Åberg
> On 28 Apr 2016, at 00:04, Simon Sobisch wrote: > > Searching a translatable string likely isn't a good idea… It looks like the tokens aren’t translated, only the text, so it should not be a problem. Unless the translation produces a token. > An own skeleton file (as part of the source tarba

Re: Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-27 Thread Simon Sobisch
Searching a translatable string likely isn't a good idea... An own skeleton file (as part of the source tarball) looks like a big cannon, therefore we may go with tweaking the parser sources via makefile (the good part: people "normally" get the parser sources via this makefile and if they don't th

Re: Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-27 Thread Hans Åberg
> On 27 Apr 2016, at 23:15, Simon Sobisch wrote: > > this could work if we pass the current token, using > > %parse-param (char * yytext) > > tehn use a wrapper for the current yyerror function. > If we get this specific error we we can do the checks on the passed yytext. > > The proble

Re: Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-27 Thread Simon Sobisch
Hi Matthias. > Hi Simon, > > depending on your grammar, you might treat the keyword as an identifier and > just throw a warning in the lexer: > > > > "banana" { > if (!SUPPORTS_KEYWORD(yyextra->config.std)) { > > fprintf(stderr, "warning: `banana' keyword not availabl

Re: Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-27 Thread Simon Sobisch
Hello Hans, this could work if we pass the current token, using %parse-param (char * yytext) tehn use a wrapper for the current yyerror function. If we get this specific error we we can do the checks on the passed yytext. The problem here: How do we know that the error message "Unexpecte

Re: Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-27 Thread Matthias Simon
Hi Simon, depending on your grammar, you might treat the keyword as an identifier and just throw a warning in the lexer: "banana" { if (!SUPPORTS_KEYWORD(yyextra->config.std)) { fprintf(stderr, "warning: `banana' keyword not available\n");

Re: Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-26 Thread Hans Åberg
> On 26 Apr 2016, at 21:39, Simon Sobisch wrote: > If the unexpected %s is not in the reserved words list currently active > because of the compiler configuration but is in the global one we add > another line to the warning, something like "%s not supported with std %s". > > How can this be ac

Re: Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-26 Thread Hans Åberg
> On 26 Apr 2016, at 21:39, Simon Sobisch wrote: > If the unexpected %s is not in the reserved words list currently active > because of the compiler configuration but is in the global one we add > another line to the warning, something like "%s not supported with std %s". > > How can this be ac

Is there an option to change the message produced by YYERROR_VERBOSE?

2016-04-26 Thread Simon Sobisch
We use bison in cobc (the GnuCOBOL compiler) and would like to check the content of the unexpected part in YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax e