[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Is there an option to change the message produced by bison's YYERROR
From: |
Hans Åberg |
Subject: |
Re: Is there an option to change the message produced by bison's YYERROR_VERBOSE? |
Date: |
Mon, 7 Nov 2016 22:18:13 +0100 |
> On 7 Nov 2016, at 22:03, Simon Sobisch <address@hidden> wrote:
>> It should not be too difficult, as it now uses M4. The only problem is
> when the Bison skeleton file is updated, then you have an outdated
> skeleton file.
>
> * Where do I find the correct skeleton file?
Typically in /usr/local/share/bison/ or somewhere.
> * How do I get familiar with m4 fast?
It is fairly readable, so modify the relevant parts. I try to avoid macro
programming :-), but check its manual, available at
https://www.gnu.org/software/m4/manual/.
> * How do I apply it (both via a manual call to bison in the makefile and
> with the implicit yacc rule)?
Just include it in the grammar file, have it in the sam directory; see the
Bison manual.
>
>> But you may develop it as a feature, and then integrate it into Bison
> yourself, or suggest it. The feature might be an option adding an extra
> argument to yyerror with a reference to the error token.
>
> Sounds even much better. How to do this? If this isn't possible to be
> applied "in-tree" (via m4 or otherwise - I guess it isn't) this would
> only help people with a recent and unpublished Bison version (btw: are
> there plans for a new release soon?) - or with the generated files.
The developers seem not very active (cc'ed) right now. So try the above.