Hi Nathanael,Unfortunately the project is quite big but I want to make a 
minimal reproducible example for it. Before doing so though, I'd like to 
understand if it makes sense at all to use YYRECOVERING() in yylex. I have a 
rule for each token a validating action which triggers YYERROR if the token is 
invalid. The issue I noticed is that e.g. for the input A B C where token B is 
invalid, YYERROR is triggered after which yylex is called by bison. Thus yylex 
processes the input and returns the next token (C). Then the action set up for 
error recovery takes place which checks if it's already the end of input. The 
end of input check returns true since token C has been returned by yylex in 
which case I raise YYABORT. That's why I thought, if I could check in yylex 
that YYRECOVERING() is 1 then it could return the previous token not the next. 
However, as I reported, I get a compile time error since YYRECOVERING() may 
have been designed to be used only in actions. I hope I could sum up clearly 
what I'm doing. Nevertheless, I'll try to make a minimal example.Best 
regards,r0ller-------- Eredeti levél --------Feladó: Nathanael Bracy 
<njbrac...@gmail.com>Dátum: 2025 március 12 16:41:07Tárgy: Re: YYRECOVERING() 
in yylex functionCímzett: r0ller <r0l...@freemail.hu>Hi r0llerxCould I see your 
code somewhere? Perhaps you're forgetting to include a header or your linker 
isn't linking against the right objects.On Wed, Mar 12, 2025 at 5:27 AM r0ller 
<r0l...@freemail.hu> wrote:Hi All,I tried to use the YYRECOVERING() macro in my 
implementation of yylex but I get the following error: "error: use of 
undeclared identifier 'yyerrstatus_'"I don't know if it's the intended 
behaviour just wanted to ask (as I think I can work it around to detect 
recovering status).Best regards,r0ller

Reply via email to