[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing the lookahead token
From: |
Hans Aberg |
Subject: |
Re: Changing the lookahead token |
Date: |
Mon, 17 Sep 2012 10:22:59 +0200 |
Hi David!
On 16 Sep 2012, at 10:51, David Kastrup wrote:
> But that's just guessing. Are there any hard or soft criteria about
> when it may or may not be allowed to pull the lookahead token out from
> under Bison and put something else there?
You might look at the push parser, which allows one to call it whenever a token
is available. Then LALR(1) compacts the states so that additional reductions
may be called before an error is issued; possibly something similar may happen
in your case. One way around it is to try to rewrite the grammar, so that the
tokens are not needed. Another might be to use LR(1) which makes sure actions
are applied as dictated by the tokens.
Hans