From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 6FE1CBC75 for ; Wed, 16 Feb 2005 10:18:22 +0100 (CET) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.202]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1G9ILYM019852 for ; Wed, 16 Feb 2005 10:18:22 +0100 Received: by rproxy.gmail.com with SMTP id a36so114413rnf for ; Wed, 16 Feb 2005 01:18:21 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=RDesuWNWUecDW9d+YVIPlGWfCQlzmqkrCBy5q4iplnR+dadpqR9BLqIBQzWfvpk0ZD9/WXd2YP027YrHktyi9ET5YtfhMmqPeceSujAN61Vv3eZDc1o76clkqjvlnjWTb53FRMW8JQ0ZEa6gcf4XX7dqsnJHtd1Fm5AOv6s34uw= Received: by 10.39.2.45 with SMTP id e45mr19519rni; Wed, 16 Feb 2005 01:18:21 -0800 (PST) Received: by 10.38.65.58 with HTTP; Wed, 16 Feb 2005 01:18:21 -0800 (PST) Message-ID: <7f8e92aa0502160118388588b4@mail.gmail.com> Date: Wed, 16 Feb 2005 11:18:21 +0200 From: Radu Grigore Reply-To: Radu Grigore To: Jon Harrop Subject: Re: [Caml-list] Right recursion with ocamlyacc Cc: caml-list@yquem.inria.fr In-Reply-To: <200502160435.23574.jon@jdh30.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <200502160210.46048.jon@jdh30.plus.com> <20050216035811.GA17612@mobile> <200502160435.23574.jon@jdh30.plus.com> X-Miltered: at nez-perce with ID 42130FDD.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 recursion:01 ocamlyacc:01 wrote:01 recursion:01 ocamlyacc:01 parsing:01 afaik:01 stack:01 exception:01 otoh:02 theoretical:03 problem:05 problem:05 radu:05 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, 16 Feb 2005 04:35:23 +0000, Jon Harrop 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/