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




_______________________________________________
[email protected] http://lists.gnu.org/mailman/listinfo/help-bison

Reply via email to