[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: YYMAXDEPTH and stack usage
From: |
Martin Alexander Neumann |
Subject: |
Re: YYMAXDEPTH and stack usage |
Date: |
Sat, 8 Sep 2018 07:26:22 +0200 |
Hi Anand,
right, please also have a look at the manual on YYMAXDEPTH[1].
And "you should always use left recursion, because it can parse a
sequence of any number of elements with bounded stack space."[2]
(Sure, when implementing "calculators", using right recursion may make
your life easier with right-associative operators.)
Yours,
Alex
[1]
http://www.gnu.org/software/bison/manual/html_node/Memory-Management.html
[2]
http://www.gnu.org/software/bison/manual/html_node/Recursion.html#Recursion
On 07.09.2018 08:13, Anand Akhare wrote:
> Hi help-bison,
> stack memory is allocated with size YYMAXDEPTH * sizeof(GLRStackItem)
> and YYMAXDEPTH defaults is 10000.
> Does this reflect as maximum number of tokens which means maximum
> number of tokens that can be shifted is 10000 without reducing(likely to
> happen in right recursion)?
>
> Regards,
> Anand
> _______________________________________________
> address@hidden https://lists.gnu.org/mailman/listinfo/help-bison
>