From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p04Hhe0Q015888 for ; Tue, 4 Jan 2011 18:43:45 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqwAADnrIk3RVdhCjWdsb2JhbACcIQGIEggVAQEBAQkJCgkPBiCkZol3ghiFGi6GFQEBAwWFRQSLB4YS X-IronPort-AV: E=Sophos;i="4.60,273,1291590000"; d="scan'208";a="85340984" Received: from mail-qw0-f66.google.com ([209.85.216.66]) by mail2-smtp-roc.national.inria.fr with ESMTP; 04 Jan 2011 18:43:44 +0100 Received: by qwk3 with SMTP id 3so4845200qwk.9 for ; Tue, 04 Jan 2011 09:43:44 -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; bh=SSIqBE0snwFrDCHWB2zIH3UytFrCNmnBl8VTiIzkekI=; b=FdqctqOVynF7XhcZFDOIy9hdthXO1jthpm0DM+rMkkE6jhRT1B8wwmg4c7oEkfPgc/ 1m7djzf0Wq8plLeZUu4whPHIEN+hG7hGW16LrHvp5FSQyXSwrVPvuQ+Bsoq2Nt0bPNE3 sMpuvgwu6eQHnyBdWdPKd0MN0rEp5p8z3nuSE= 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; b=DWit5Os4ZI+MGT6LH4F0GVD3ygsg8wK34nrrgDHVmgvZdWRPxFTFjj85wLfx4WZHPc uuys7JJsNXubHU1X1AaogDrVhhGgHzIWKDVJhTsNvHfKdJKfOjo6LpViGsarhjfe0KxO B50z3AKgJJeu6OGkbp06LmNR2AYR3hnU2XNLs= Received: by 10.229.183.135 with SMTP id cg7mr13533349qcb.38.1294163022847; Tue, 04 Jan 2011 09:43:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.98.203 with HTTP; Tue, 4 Jan 2011 09:43:22 -0800 (PST) In-Reply-To: References: <4D23353C.8020803@gmail.com> From: Jean Krivine Date: Tue, 4 Jan 2011 18:43:22 +0100 Message-ID: To: bluestorm Cc: =?ISO-8859-1?Q?T=F6r=F6k_Edwin?= , caml-list@inria.fr Content-Type: multipart/alternative; boundary=0016364d2c914220d3049908cff0 Subject: Re: [Caml-list] Array.make exception and parser --0016364d2c914220d3049908cff0 Content-Type: text/plain; charset=ISO-8859-1 I just tried menhir. Looks great ! Problem is it generates an invalid myParser.ml file: it contains a integer _menhir_shifted = 4611686018427387903; which way beyond int32 integers. I guess it comes from my grammar file which is certainly very bad, but in any case I should receive some insult from menhir first no ? I guess this error is linked to the Array.make exception that I get when I use ocamlyacc! J On Tue, Jan 4, 2011 at 4:38 PM, bluestorm wrote: > Indeed, Ocaml arrays are limited in length, and the parser generator may > use arrays internally that would run into the limit for specific grammars (I > don't think the memory used is linear in the size of the input in the common > use cases). > > You may be interested in trying to use menhir [1] as a Parser generator > instead of ocamlyacc. Menhir is mostly compatible with ocamlyacc, but > doesn't use the Parsing module. While I don't think it as done anything > specific to support larger input files, the issue may go away (or don't > appear on the input sizes you need) using the different menhir > implementation. > > [1] http://gallium.inria.fr/~fpottier/menhir/ > > Of course, patching ocamlyacc (or any other generator) to fix this issue > would be the best way to handle this. But still, switching to a different > but 90% compatible software may be a least-effort solution for you -- > provided it doesn't have the same issue. > --0016364d2c914220d3049908cff0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I just tried menhir. Looks great ! Problem is it generates an invalid myPar= ser.ml file:
it contains a integer

_menhir_shifted =3D 46116860= 18427387903;

which way beyond int32 integers. I guess it comes from = my grammar file which is certainly very bad, but in any case I should recei= ve some insult from menhir first no ?
I guess this error is linked to the Array.make exception that I get when I = use ocamlyacc!

J

On Tue, Jan 4, 20= 11 at 4:38 PM, bluestorm <bluestorm.dylc@gmail.com> wrote:
Indeed, Ocam= l arrays are limited in length, and the parser generator may use arrays int= ernally that would run into the limit for specific grammars (I don't th= ink the memory used is linear in the size of the input in the common use ca= ses).

You may be interested in trying to use menhir [1] as a Parse= r generator instead of ocamlyacc. Menhir is mostly compatible with ocamlyac= c, but doesn't use the Parsing module. While I don't think it as do= ne anything specific to support larger input files, the issue may go away (= or don't appear on the input sizes you need) using the different menhir= implementation.

=A0[1]=A0http://gallium.inria.fr/~fpottier/menhir/

Of course, patching ocamlyacc (or any other generat= or) to fix this issue would be the best way to handle this. But still, swit= ching to a different but 90% compatible software may be a least-effort solu= tion for you -- provided it doesn't have the same issue.

--0016364d2c914220d3049908cff0--