reduce/reduce error confusing declaration with subscription

2008-12-26 Thread Tom Lieber
x27;]' from the declarator and direct_declarator rules to the declaration_specifiers rule, like this: declaration_specifiers: storage_class_specifier type_specifier | type_specifier | declaration_specifiers '*' | declaration_specifiers '[' ']' | dec

Re: reduce/reduce error confusing declaration with subscription

2008-12-28 Thread Tom Lieber
On Sat, Dec 27, 2008 at 9:02 AM, Luca wrote: > Tom Lieber ha scritto: >> I'm creating a parser for a C-like language, basing it on this ANSI C >> grammar: >> >> http://www.lysator.liu.se/c/ANSI-C-grammar-y.html >> >> I would like to change the syntax f

Re: reduce/reduce error confusing declaration with subscription

2008-12-29 Thread Tom Lieber
read in the "red dragon", it is better to use %left, %prec and > similar keyword rather than grammar rules, because in the latter way the > parser has many states. Ahh, that book has been on my wish list. I think I should finally get it. -- Tom Lieber http://AllTom.com/ ___ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Misunderstanding %prec?

2009-01-24 Thread Tom Lieber
LPAREN shift 9 SEMICOLON reduce 4 RPAREN reduce 4 -- Tom Lieber http://AllTom.com/ ___ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison

Re: Misunderstanding %prec?

2009-01-25 Thread Tom Lieber
about splitting up the rule as in the ANSI C grammar. I found on another mailing list that a third fix is to set a precedence for LPAREN, which has side-effects in other part of the grammar I'm sure, but seems to solve the -a(b) and -a[b] problems gracefully at least. I'm going to do this one for now (path of least resistance...) and if problems turn up, I'll turn to splitting up the rules. -- Tom Lieber http://AllTom.com/ ___ help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison