[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: YYMAXDEPTH and stack usage
From: |
Anand Akhare |
Subject: |
Re: YYMAXDEPTH and stack usage |
Date: |
Thu, 20 Sep 2018 08:38:15 +0530 |
While left recursion is preferable to avoid high stack consumption, is it
theoretically possible to convert every right recursive grammar to left
recursive including mutually right recursive?
Sent from my iPhone
> On 08-Sep-2018, at 5:42 PM, Akim Demaille <address@hidden> wrote:
>
>
>
>> Le 8 sept. 2018 à 09:14, Akim Demaille <address@hidden> a écrit :
>>
>>
>>
>>> Le 7 sept. 2018 à 08:13, Anand Akhare <address@hidden> a écrit :
>>>
>>> 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)?
>>
>> Nope, that’s the LR stack, and the LR stack is composed of both tokens
>> _and_ non terminal symbols. That’s really the set of symbols
>> (terminal or not) that have been shifted, and waiting to be part
>
> (I shouldn’t have said ’shifted’ here, I should have written ‘pushed’)
>
>> of a reduction.
>> _______________________________________________
>> address@hidden https://lists.gnu.org/mailman/listinfo/help-bison
>