caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: "Christoph Höger" <christoph.hoeger@tu-berlin.de>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Parsetree comparison
Date: Thu, 6 Nov 2014 18:11:01 +0100	[thread overview]
Message-ID: <CAPFanBEm0KNX50U79QhkBhousG2H5D_ztv3eHNdUw6p78ocKbw@mail.gmail.com> (raw)
In-Reply-To: <545BAA3D.5070606@tu-berlin.de>

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

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öger <
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öger
>
> Technische Universität Berlin
> Fakultät IV - Elektrotechnik und Informatik
> Übersetzerbau 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
> =eXX/
> -----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
>

[-- Attachment #2: Type: text/html, Size: 2336 bytes --]

  reply	other threads:[~2014-11-06 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 17:05 Christoph Höger
2014-11-06 17:11 ` Gabriel Scherer [this message]
2014-11-06 17:21 ` Rodolphe Lepigre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPFanBEm0KNX50U79QhkBhousG2H5D_ztv3eHNdUw6p78ocKbw@mail.gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=christoph.hoeger@tu-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).