help-bison
[Top][All Lists]
Advanced

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

Re: yyerrok is missing in C++ parser


From: Lucian Smith
Subject: Re: yyerrok is missing in C++ parser
Date: Tue, 12 Aug 2008 08:52:49 +0100
User-agent: Mutt/1.4.2.3i

If I recall correctly, in my own C++ code, I had to have an actual 
grammar line that *used* 'yyerrok' before bison would put the relevant 
code into the .tab.cpp file.  If I didn't, it would never put it in, 
and other code that tried to reference it would run into problems.

Something like:

input:          /* empty */
        |       input mycorrectparsing {do_stuff($2);}
        |       input error {cerr << "oops"; yyerrok;}

Commenting out that last line would give me problems (since I assumed 
yyerror things elsewhere in the code).

Similar things happened with yylloc, I believe.

Maybe that helps?

-Lucian




reply via email to

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