[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Preceding action
From: |
Hans Åberg |
Subject: |
Re: Preceding action |
Date: |
Mon, 13 Nov 2017 20:20:46 +0100 |
On 13 Nov 2017, at 18:22, Péter <address@hidden> wrote:
> and does *not* try to resume from errors (yyerror() is fatal, it exits),
You might have a top level error recovery that reset stuff, say:
body:
%empty
| body_contents {}
| error {
/* Reset stuff. */
YYABORT;
}
;
> then for each action (call it "action0"), one can be sure that, for example,
> if the rule is
> ...
> | alfa "+" beta ";" {action0}
> ...
> ;
>
> then the preceding action was one of beta's actions (the last nonterminal),
You only know that the values have been computed and put onto the stack. As it
is LR, the derivation is the rightmost. Put in printouts in your alpha and beta
to see what happens.