[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Query regarding Parser stack
From: |
Rachna Khanna |
Subject: |
RE: Query regarding Parser stack |
Date: |
Sat, 30 Oct 2004 14:50:45 +0530 |
> -----Original Message-----
> From: Hans Aberg [mailto:address@hidden
> Sent: Friday, October 29, 2004 11:44 PM
> To: address@hidden
> Cc: address@hidden; address@hidden; address@hidden
> Subject: Re: Query regarding Parser stack
>
>
> The Bison C parser already creates a dynamically reallocating stack:
> YYINITDEPTH creates an initial array in the parser function, used as a
> static stack. When that becomes too small, it switches to a dynamic
> allocation, where YYMAXDEPTH is the upper limit. The file yacc.c says:
> /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
> if the built-in stack extension method is used).
>
> Do not make this value too large; the results are undefined if
> SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
> evaluated with infinite-precision integer arithmetic. */
>
> So, apart from making sure you get the left/right recursion correct
(as
> suggested in another letter), you already get your dynamic stack
(thanks
> to
> Paul Eggert, who wrote it). When setting YYMAXDEPTH, follow the
> instructions
> in the comment above.
>
"(as suggested in another letter)", here are you referring to some
previous mail in which you have mentioned about left/right recursion. I
am sorry, but I have not received this mail. Can you please forward me
the mail again.
Rachna.