On 26 Aug 2010, at 23:08, Christoph Lechner wrote:
Mike Aubury wrote:
I'm thinking your grammar is probably wrong - there shouldn't be any
problem with having lots of packets like that - so long and they are
not very recursive (packet within packet within packet .....)
What does your grammar look like ?
@Mike: Sorry for sending my first reply to you and not to the list. So
here is my mail to the list.
Hi,
thank you for your fast reply. I think I found the mistake now -- I
guess it's the 'stream' rule.
The beginning of my grammar is like:
stream: /* empty line */
| stmt stream
| error stream
;
Make sure to use left recursion (see the Bison manual), as in the
reply by Mike, with the recursion variable to the left, in order to
avoid the parser stack building up. Like this:
expseq1:
exp
| expseq1 ’,’ exp /* To the left here */
;
Your grammar may be written for LL, but Bison uses LALR(1).
_______________________________________________
help-bison@gnu.org http://lists.gnu.org/mailman/listinfo/help-bison