From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 8B73DBC8E for ; Wed, 16 Feb 2005 03:28:25 +0100 (CET) Received: from ux9.sp.cs.cmu.edu (UX9.SP.CS.CMU.EDU [128.2.220.166]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id j1G2SOK6009398 for ; Wed, 16 Feb 2005 03:28:25 +0100 Received: from c-24-3-154-200.client.comcast.net ([24.3.154.200]) by ux9.sp.cs.cmu.edu id aa15174; 15 Feb 2005 21:28 EST Received: from ecc by stratocaster.home with local (Exim 4.34) id 1D1EvB-0005AM-G1 for caml-list@yquem.inria.fr; Tue, 15 Feb 2005 21:28:09 -0500 Date: Tue, 15 Feb 2005 21:28:09 -0500 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Right recursion with ocamlyacc Message-ID: <20050216022809.GA19827@localhost> Mail-Followup-To: 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 From: "Eric C. Cooper" X-Miltered: at concorde with ID 4212AFC8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 recursion:01 ocamlyacc:01 wrote:01 internals:01 stack:01 parser:01 stack:01 tokens:01 ...:98 expression:01 compile:01 defining:01 integer:01 define:01 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=none autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, Feb 16, 2005 at 02:10:45AM +0000, Jon Harrop wrote: > Now, I don't know much about yacc internals but I'm curious as to why this > would be. Does g++ simply consume much bigger stack frames as it recurses > (>10x the size?) running out much earler, or is there another reason? See section 5.9 of the Bison info file: By defining the macro `YYMAXDEPTH', you can control how deep the parser stack can become before a stack overflow occurs. Define the macro with a value that is an integer. This value is the maximum number of tokens that can be shifted (and not reduced) before overflow. It must be a constant expression whose value is known at compile time. [...] The default value of `YYMAXDEPTH', if you do not define it, is 10000. -- Eric C. Cooper e c c @ c m u . e d u