Version française
Home     About     Download     Resources     Contact us    
Browse thread
Right recursion with ocamlyacc
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Radu Grigore <radugrigore@g...>
Subject: Re: [Caml-list] Right recursion with ocamlyacc
On Wed, 16 Feb 2005 04:35:23 +0000, Jon Harrop <jon@jdh30.plus.com> wrote:

> Yes, left recursion is definitely the way to go in general. But has anyone
> ever had a problem with right-recursion when using ocamlyacc? Is there a
> theoretical reason why this is not a problem with ocamlyacc?

In parsing.ml you will find a function approprately named growstacks.
For very big lists you will get an exception from Array.make. In my
experiment this happened after about 3x10^6 elements. OTOH bison/flex
use AFAIK a fixed stack and fails (as you said) on smaller lists.

-- 
regards,
 radu
http://rgrig.idilis.ro/