help-bison
[Top][All Lists]
Advanced

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

Re: How to add "error"


From: Hans Aberg
Subject: Re: How to add "error"
Date: Wed, 11 Apr 2007 10:54:33 +0200

On 11 Apr 2007, at 00:17, Tamas Nagy wrote:

I cannot understand something:
how to add error when "empty" is allowed

Nodes:  Apple
      | Pear
      |  /* empty */

Then how to add 'error' to the above rule?

 Nodes:  Apple
      | Pear
      |  /* empty */
      |  error     { printf("Error") }   ?????

I think you will have to experiment, to see what seems to give good results. Error reporting and recovery is somewhat unpredictable due to the nature of the LALR(1) parsing generation algorithm that Bison uses.

  Hans Aberg






reply via email to

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