help-bison
[Top][All Lists]
Advanced

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

Re: bison 1.35: end of file?


From: Torsten Müller
Subject: Re: bison 1.35: end of file?
Date: 24 May 2002 14:04:11 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

After a lot of experiments with this obscure problem I detected a
dependency of the error-symbol. My rules are as follows:

rule    : T1 T2 T3 T4
        | T1 T2 T3 error
          {
          }
        | T1 T2 error
          {
                // ...
          }
        | T1 error
          {
          }
        | error
          {
          }
        ;

Every error-symbol has an action. If yylex() returns T1, T2 and then 0
(or EOF) the action I marked with the comment is not executed at all.
The parser calls yyerror(), but I want to handle the error myself. In
my case I want to tell the user "'}' or ';' expected" instead of a
simple "unexpected end of file" message and i must do some cleanup.

Torsten




reply via email to

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