On Wed, Nov 26, 2008 at 03:25:42PM +0100, Hans Aberg <[EMAIL PROTECTED]> wrote:
> >state 1
> > 4 EXPRESSION: T_IDENTIFIER . '(' EXPRESSION ')'
> > 5 | T_IDENTIFIER . [$end, T_IDENTIFIER, ';', '(',
> >')', "++", "--", '+', '-', '/']
> > '(' shift, and go to state 5
> > '(' [reduce using rule 5 (EXPRESSION)]
> > $default reduce using rule 5 (EXPRESSION)
> >
> >Is there some way to tell bison to prefer shifting to reducing in this
> >case?
>
> If one should use Bison token precedence, then T_IDENTIFIER needs to
> be expanded in the grammar, so that there is a token immediately
> before the parsing "." in the shift-reduce conflict above.
Thanks for the tip- I'll try that.
> But if your identifiers have been defined and pu on a look-up table
> which the lexer can read, them change the rule above to
> EXPRESSION:
> FUNCTION '(' EXPRESSION ')'
> where the lexer returns the token FUNCTION.
Afraid look-up is not possible, as ActionScript allows forward
references. (And I'm not sure whether switching to two-pass
parsing would be a good idea. Is two-pass parsing with bison a
"typical" use case?)
Greetings
Matthias
_______________________________________________
[email protected] http://lists.gnu.org/mailman/listinfo/help-bison