help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: parser stack overflow


From: Hans Aberg
Subject: Re: parser stack overflow
Date: Thu, 27 Nov 2003 18:55:33 +0100

At 11:37 +0000 2003/11/27, Nosnos wrote:
>frame : FRAME other frame
>      | FRAME other
>      ;
>
>other : [...]
>
>
>Of course, i get a stack overflow.
>
>So i want to know how to prevent this ? :

Apart from (as suggested by others) you may attempt to switch to left
recursion, the fact that you get stack overflow suggests that you are using
an old Bison version, as the later version generate parsers that can adjust
the stack dynamically.

Also note that, even though left recursion is always to prefer, it does not
work in all grammars: We hit in Help-Bison recently an example where right
recursion was necessary, as the grammar would not be LALR(1) (which Bison
uses) when left recursion was used.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]