Re: Parsing a language with optional spaces

"John P. Hartmann" <[email protected]>
Newsgroups gmane.comp.parsers.bison.general
Message-ID <[email protected]>
On 7/26/20 10:56, Akim Demaille wrote:
> The most frequent cited good reasons to write parsers by hand is:
> 
> 3. tailored error messages
>    Instead of some dummy "unexpected foo, expected bar or baz", writing
>    something really helping.

All you have to do is write a rule for the incorrect construct and issue 
your own tailored message.  I do that all the time, e.g.,

                |  orexpression S_EOD
                   {
                      #if G
* |  orexpression S_EOD
                      piperm 1082,exit
                      #endif
                   }
                ;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.