help-bison
[Top][All Lists]
Advanced

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

Query about error recovery in bison


From: Ranjeeta
Subject: Query about error recovery in bison
Date: Tue, 24 Aug 2004 15:05:46 +0530

Hi All,
        I have a query about the way error recovery should be done in
bison. Here is the description:

        I am writing a parser for an assembler. In assembler we need to
consider 1 line at a time. No information is required in parser for the
previous lines. As soon as parser gets an error it will be terminated
and invoked again for the rest of the file.

        I want that I should specify the production rules for the inputs
which are valid to the assembler. The other inputs should be
automatically treated as invalid and parser should call yyerror. But
this is not happening. Sometimes parser terminates without calling
yyerror. This usually happens when the illegal input is the 1st input or
it is preceded by some other invalid input line. Can any one suggest me
why?

        Also according to bison PDF in error recovery chapter (Please
refer The YACC-compatible Parser Generator 25 February 2002, Bison
Version 1.35) I read "To prevent an outpouring of error messages, the
parser will output no error message for another syntax error that
happens shortly after the first; only after three consecutive input
tokens have been successfully shifted will error messages resume.".
        Is it the reason that the parser is not behaving correctly for
simultaneous invalid inputs? If so I want to control this specification
as per my requirement. Please suggest me for this too.

        I am using 1.24 version of Bison. Please let me know if any
other information is required.

Waiting for the reply.
Thanx in advance.

Ranjeeta Sharma.








reply via email to

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