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 p05DkU4x014941 for ; Wed, 5 Jan 2011 14:46:30 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwAAF8FJE3RVdi2imdsb2JhbACVY449CBUBAQEKCRMPBiCnUYl4ghiEXy6GKgEBAwWFRwSLCg X-IronPort-AV: E=Sophos;i="4.60,278,1291590000"; d="scan'208";a="94239759" Received: from mail-qy0-f182.google.com ([209.85.216.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-MD5; 05 Jan 2011 14:46:24 +0100 Received: by qyk36 with SMTP id 36so15304991qyk.6 for ; Wed, 05 Jan 2011 05:46:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=uEvJM2tYSflmy3irFeZQDo4sOraX3jPandcdym36PzA=; b=OIFdYjvhUrYuqkZY+jOanzvOSVUHzGyLgKoCFqIEMxtvetJp1Trjl37Yr9754RC2Ol vqbyudiTvqL/Xa1sOWcmT4GbtyTX8t1aJQXRWRoJNRQIEg9tnWqME2m8yNpIwnKmbaUC KCEjm480M3y/flbV+XpHb1ONk8BQImBFzKtE4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=nfCjWzuBVZbplOin9oIR50CA9+hq/Ig1FvWZYx87CIYsJKWykbyP3Kt8vObH2EFGAS u14i2Y7FYjgeiLZp+jAy0gSYxlEls89lzR+CJu2tSDQBOfvKOxSg5+vlnzoQpctvVnSJ lPcM4tXietKc7DiVp2T79vKJdzhf1jhxUWSCw= Received: by 10.229.142.6 with SMTP id o6mr2072625qcu.299.1294235183288; Wed, 05 Jan 2011 05:46:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.98.203 with HTTP; Wed, 5 Jan 2011 05:46:03 -0800 (PST) In-Reply-To: <4D247425.9070400@inria.fr> References: <4D247425.9070400@inria.fr> From: Jean Krivine Date: Wed, 5 Jan 2011 14:46:03 +0100 Message-ID: To: Xavier Leroy Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p05DkU4x014941 Subject: Re: [Caml-list] Array.make exception and parser Good point. I think the fundamental reason is my poor grammar. But I guess this should deserve a better warning that an Invalid_argument in my face :) Thanks! On Wed, Jan 5, 2011 at 2:37 PM, Xavier Leroy wrote: > 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 > > -- > Caml-list mailing list.  Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > >