help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing a language with optional spaces


From: John P. Hartmann
Subject: Re: Parsing a language with optional spaces
Date: Sun, 26 Jul 2020 11:22:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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
                  }
               ;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]