[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing error messages.
From: |
Akim Demaille |
Subject: |
Re: Changing error messages. |
Date: |
04 Apr 2002 18:50:42 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp) |
>>>>> "Phil" == Phil Spiby <address@hidden> writes:
Phil> Folks, I have been using Bison now for about 8 years and find it
Phil> an invaluable tool.
You probably have not used many others then ;)
Phil> However, one issue I have got with it is the default error
Phil> messages, and the lack of ability to change these.
I agree.
Phil> My solution (which worked until the recent releases of Bison)
Phil> was to use a script (actually a flex program) to change the code
Phil> between #ifdef YYERROR_VERBOSE and #endif /* YYERROR_VERBOSE */.
Phil> Thinking about it a little more, I think a general solution
Phil> would be more appropriate, such as using #define's to define the
Phil> text or functions used to put information into the verbose error
Phil> messages. For example the default could be: #ifndef YYERRORMSG
Phil> #define YYERRORMSG "Parse error" #endif I would then use:
Phil> #define YYERRORMSG (filepass == syntax_check ? "SYNTAX:" :
Phil> "REFERENCE:")
I'm not sure I understand your suggestion, but personally, I would
like to have a function invoked with an array of the possibilities,
instead of the string ready to be used. At least for C++, that's
where we are heading to.
Once we have some feedback there, we'll look for means to include such
features in the C output, while preserving some backward
compatibility.
Unfortunately, now, there are already many many open work in Bison,
and we are not looking for additional changes, rather, we need
additional workers :)
Anyway, what actually prevents you from hacking the message string
given by Bison to YYERROR?