From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p05DbmgS014475 for ; Wed, 5 Jan 2011 14:37:48 +0100 X-IronPort-AV: E=Sophos;i="4.60,278,1291590000"; d="scan'208";a="94236323" Received: from estephe.inria.fr (HELO [128.93.11.95]) ([128.93.11.95]) by mail1-relais-roc.national.inria.fr with ESMTP; 05 Jan 2011 14:37:43 +0100 Message-ID: <4D247425.9070400@inria.fr> Date: Wed, 05 Jan 2011 14:37:41 +0100 From: Xavier Leroy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101027 Thunderbird/3.0.10 MIME-Version: 1.0 To: caml-list@inria.fr References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Caml-list] Array.make exception and parser On 01/04/2011 02:41 PM, Jean Krivine wrote: > I am encountering a weird problem, I am trying to parse a very large > file (around 1.2 GB) according to a grammar defined in ocamlyacc. > During the parsing I get the exception > Invalid_argument "Array.make". > This is strange because I am not using any array. As others said, you're just overflowing the stack of the parse engine. As no one else said already, watch out for left recusion vs. right recursion in your grammar, esp. the rules matching long sequences. For more details, see e.g. http://tldp.org/HOWTO/Lex-YACC-HOWTO-6.html section 6.2, or many compiler textbooks. - Xavier Leroy