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 88FC17FADB for ; Thu, 6 Nov 2014 18:11:43 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.176 as permitted sender) identity=mailfrom; client-ip=209.85.214.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f176.google.com) identity=helo; client-ip=209.85.214.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ob0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjABAD6rW1TRVdawm2dsb2JhbABbg2JZBIMCt2GOVYFph04CgRgHFgEBAQEBEQEBAQEBBgsLCRQuhAMBAQQSER0BGxILAQMMBgUEBxoIFQICIgERAQUBChIGEwgKEIgJAQMSDa0ZPTGLM4FuBYMSiToKGScDCmiFSQEBAQEBAQEDAQEBAQEBAQEUAQUOkH8EBwqCbYFUBYUdBY4Og0WHH4Fvkm4YKYM7HoFbPC+CSwEBAQ X-IPAS-Result: AjABAD6rW1TRVdawm2dsb2JhbABbg2JZBIMCt2GOVYFph04CgRgHFgEBAQEBEQEBAQEBBgsLCRQuhAMBAQQSER0BGxILAQMMBgUEBxoIFQICIgERAQUBChIGEwgKEIgJAQMSDa0ZPTGLM4FuBYMSiToKGScDCmiFSQEBAQEBAQEDAQEBAQEBAQEUAQUOkH8EBwqCbYFUBYUdBY4Og0WHH4Fvkm4YKYM7HoFbPC+CSwEBAQ X-IronPort-AV: E=Sophos;i="5.07,327,1413237600"; d="scan'208";a="86736427" Received: from mail-ob0-f176.google.com ([209.85.214.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 06 Nov 2014 18:11:42 +0100 Received: by mail-ob0-f176.google.com with SMTP id va2so1169642obc.35 for ; Thu, 06 Nov 2014 09:11:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=QO34NZrw6tgStAH+9bRiWc/KTOq2OBS7DiVUE5C3x6Y=; b=rnzXe1SUt9qHHXEPzPOurWq1vaLJdxzXmp71ZvG7Roi83zbjX5M0N7xP+caYW/Qogv COyY3/q+sh48Rlbv/PnDNFyKqZ2TT7DnrJh0SmlpV6ZI2ImmLddHTieDoQVGUCdCCPQm pFIRwQHbrvRzKJRV7zecKQQHJSz9GwHJE+L5ceAC4IazmtF9TBLHuLRI5R8mfEEJ6DVm AobPBqsjKe/dzO/PEd09dpIFOzdtzBjntnKsr+6j58LBCLSaEOOhi6ygQ01Dl1PqXvoL FQjjs38d/Mq7alsmVLwf+VHGtUP9gcb7zNkkgxyoFkNwRmARvznk3Gz5bwMaNIgy8hwe nFtw== X-Received: by 10.60.102.211 with SMTP id fq19mr4898373oeb.2.1415293901255; Thu, 06 Nov 2014 09:11:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.90.197 with HTTP; Thu, 6 Nov 2014 09:11:01 -0800 (PST) In-Reply-To: <545BAA3D.5070606@tu-berlin.de> References: <545BAA3D.5070606@tu-berlin.de> From: Gabriel Scherer Date: Thu, 6 Nov 2014 18:11:01 +0100 Message-ID: To: =?UTF-8?Q?Christoph_H=C3=B6ger?= Cc: caml users Content-Type: multipart/alternative; boundary=089e01160a2e3cb9f2050733ca61 Subject: Re: [Caml-list] Parsetree comparison --089e01160a2e3cb9f2050733ca61 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The Ast_mapper module contributed by Alain Frisch to recent versions of the OCaml distribution allows you to perform arbitrary transformations from AST to AST in a convenient way. In particular, you could implement a erase-all-locations pass by simply overloading the "location" method (it uses object-oriented style for open recursion) to always return a dummy value. On Thu, Nov 6, 2014 at 6:05 PM, Christoph H=C3=B6ger < christoph.hoeger@tu-berlin.de> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Dear all, > > is there a way to compare two abstract syntax trees for equality > without taking into account locations? Or rather a way to stratify the > location information inside a parsetree? I want to unit-test a parser > that invokes the OCaml parser itself. > > regards, > > Christoph > - -- > Christoph H=C3=B6ger > > Technische Universit=C3=A4t Berlin > Fakult=C3=A4t IV - Elektrotechnik und Informatik > =C3=9Cbersetzerbau und Programmiersprachen > > Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin > > Tel.: +49 (30) 314-24890 > E-Mail: christoph.hoeger@tu-berlin.de > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > > iEYEARECAAYFAlRbqj0ACgkQhMBO4cVSGS/rZgCfTspQtv/TYKjf8ZgeuF8XbyUE > 6UYAn0HNDMobnLCQOSRpyjdAPyoRPRGf > =3DeXX/ > -----END PGP SIGNATURE----- > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --089e01160a2e3cb9f2050733ca61 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The Ast_mapper module contributed by Alain Frisch to recen= t versions of the OCaml distribution allows you to perform arbitrary transf= ormations from AST to AST in a convenient way. In particular, you could imp= lement a erase-all-locations pass by simply overloading the "location&= quot; method (it uses object-oriented style for open recursion) to always r= eturn a dummy value.

On Thu, Nov 6, 2014 at 6:05 PM, Christoph H=C3=B6ger <christoph.hoeger@tu-berlin.de> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear all,

is there a way to compare two abstract syntax trees for equality
without taking into account locations? Or rather a way to stratify the
location information inside a parsetree? I want to unit-test a parser
that invokes the OCaml parser itself.

regards,

Christoph
- --
Christoph H=C3=B6ger

Technische Universit=C3=A4t Berlin
Fakult=C3=A4t IV - Elektrotechnik und Informatik
=C3=9Cbersetzerbau und Programmiersprachen

Sekr. TEL12-2, Ernst-Reuter-Platz 7, 10587 Berlin

Tel.: = +49 (30) 314-24890
E-Mail: christoph.hoeger@t= u-berlin.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlRbqj0ACgkQhMBO4cVSGS/rZgCfTspQtv/TYKjf8ZgeuF8XbyUE
6UYAn0HNDMobnLCQOSRpyjdAPyoRPRGf
=3DeXX/
-----END PGP SIGNATURE-----

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
ht= tps://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--089e01160a2e3cb9f2050733ca61--