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 7136FBC8E for ; Wed, 16 Feb 2005 04:58:16 +0100 (CET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.204]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j1G3wFNE019975 for ; Wed, 16 Feb 2005 04:58:16 +0100 Received: by wproxy.gmail.com with SMTP id 71so65434wra for ; Tue, 15 Feb 2005 19:58:15 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=dTlcS+oWz7jGF3Mn/tnkA9gb0cQi29j88TBRkE5/wPM7L0t9hUip58HaqjAq8j52hnUapJu5v1z3PlMinPiNxQG22TfiqzbDjscYVIIzmUbP7eUK2PK1ysPebSuKm47NfIt1Nz72KHLYibqg0U+d6BAXaR+EmVdHPkzrrTKpdsM= Received: by 10.54.32.23 with SMTP id f23mr100488wrf; Tue, 15 Feb 2005 19:58:13 -0800 (PST) Received: from localhost ([70.21.171.118]) by smtp.gmail.com with ESMTP id 66sm47367wra.2005.02.15.19.58.12; Tue, 15 Feb 2005 19:58:13 -0800 (PST) Date: Tue, 15 Feb 2005 22:58:11 -0500 From: Markus Mottl To: Jon Harrop Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Right recursion with ocamlyacc Message-ID: <20050216035811.GA17612@mobile> Mail-Followup-To: Jon Harrop , caml-list@yquem.inria.fr References: <200502160210.46048.jon@jdh30.plus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200502160210.46048.jon@jdh30.plus.com> User-Agent: Mutt/1.5.6+20040907i X-Miltered: at nez-perce with ID 4212C4D7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; markus:01 mottl:01 markus:01 mottl:01 caml-list:01 recursion:01 ocamlyacc:01 wrote:01 ocaml:01 recursion:01 ocamlyacc:01 recursive:01 grammar:01 stack:01 ocaml:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.5 required=5.0 tests=INFO_TLD,RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, 16 Feb 2005, Jon Harrop wrote: > I've just been converting a new Computer Language Shootout submission from > OCaml to C++ and found that bison falls over very easily with right recursion > (failing to load a 10^4-element list) but ocamlyacc had no problems (even on > a 10^5-element list). Why use right recursive productions in the grammar? Left recursion runs in constant stack space so this would be the way to go... Regards, Markus -- Markus Mottl markus.mottl@gmail.com http://www.ocaml.info