From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 92DDB7EE5B for ; Mon, 8 Apr 2013 14:30:09 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmkBAPy3YlFKN1ZKnGdsb2JhbABRgz2DKb1+gR4OAQEBAQEGDQkJFCiCIAEFI0UREAsaAiYCAkcQBhuIDASqP5IIgSONTTMHgi4yYQOcZBOMYIE3 X-IPAS-Result: AmkBAPy3YlFKN1ZKnGdsb2JhbABRgz2DKb1+gR4OAQEBAQEGDQkJFCiCIAEFI0UREAsaAiYCAkcQBhuIDASqP5IIgSONTTMHgi4yYQOcZBOMYIE3 X-IronPort-AV: E=Sophos;i="4.87,431,1363129200"; d="scan'208";a="10177129" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 08 Apr 2013 14:29:47 +0200 Received: from [172.20.10.2] (92.40.254.63.threembb.co.uk [92.40.254.63]) by smtp.webfaction.com (Postfix) with ESMTP id D494F20DD81D; Mon, 8 Apr 2013 12:29:45 +0000 (UTC) Date: Mon, 8 Apr 2013 13:29:43 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: Tom Ridge Cc: caml-list Message-ID: <9FBB950CE8A047D9990785F9ACF3608E@erratique.ch> In-Reply-To: References: <48620B658D39465385431EB23E6876C8@erratique.ch> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Caml-list] First release of P3: a combinator parser library, and parser generator Le lundi, 8 avril 2013 =C3=A0 12:33, Tom Ridge a =C3=A9crit : > Yes, I need to do something here. At the moment, there is no real handlin= g of errors, and nothing to support error correction (I'm not completely su= re what error correction is). In hand made parsers you rewind/fast forward your parser state to get it in= a state where it may parse sensible things again (e.g. a "toplevel" constr= uct, or the next element in a list-like construct), this can be done for ex= ample by closing/ignoring mismatched parentheses etc. Essentially this mean= s discarding part of the input or introducing tokens not present in the inp= ut. While this may result in wrong error reports, you always end with a complet= e (albeit broken from the user's intent) parse tree. The advantage is that = in certain cases you can report more than one syntax error during parsing (= since this tends to result in cascading errors you usually set an upper err= or reporting bound).=20=20 With the combinator approach, see for example [1,2] (I don't know if there = were further developments in that area, these were the papers I was reading= at the time). Best, Daniel [1] Swierstra, S.D. (2001).=20=20 Combinator Parsers: From Toys to Tools.=20=20 In G. Hutton (Ed.),=20=20 Electronic Notes in Theoretical Computer Science. Elsevier Science Publishe= rs.=20=20 [2] Hughes, R.J.M. & Swierstra, S.D. (2003).=20=20 Polish Parsers, Step by Step.=20=20 In Eighth ACM Sigplan International Conference on Functional Programming (pp. 239-248). New York: ACM Press.=20=20