help-bison
[Top][All Lists]
Advanced

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

Re: Query regarding Parser stack


From: Vincent Zweije
Subject: Re: Query regarding Parser stack
Date: Tue, 12 Oct 2004 14:34:51 +0200
User-agent: Mutt/1.4.1i

On Tue, Oct 12, 2004 at 02:26:56PM +0200, Laurence Finston
wrote:

||  There is no necessary correllation between the size of the
||  input files and a minimum size of the parser stack to
||  prevent overflow.  The stack will overflow if too many
||  objects representing states are pushed onto it.  I strongly
||  suspect that the default size of the stack is large enough
||  for most purposes.  I think a more promising approach would
||  be to examine your grammar and try to get it to shift
||  states less often and reduce them more often.

In particular, make sure your closures associate to the
left.  That is, do:

    exprlist : exprlist comma expr.

not:

    exprlist : expr comma exprlist.

The former uses constant stack space; the latter uses stack
space linear in the length of the expression list.

Ciao.                                              Vincent.
-- 
Answer: no.
Question: should I reply before the quote?





reply via email to

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