From: "Denis Bueno" <dbueno@gmail.com>
To: "Joel Reymont" <joelr1@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Testing lexers and parsers
Date: Tue, 27 Feb 2007 10:42:21 -0500 [thread overview]
Message-ID: <6dbd4d000702270742s39afbac6yfa46881c7069909c@mail.gmail.com> (raw)
In-Reply-To: <7175FEA6-5CA0-4379-9BBC-CF43504CE733@gmail.com>
On 2/27/07, Joel Reymont <joelr1@gmail.com> wrote:
> Is there a better way to accomplish this while still using structural
> comparison of ASTs?
>
> Should I try to read my target AST into OCaml, for example? Should I
> create a bunch of "target AST" modules with functions that return my
> target AST?
I recently had to deal with this problem. I ended up testing the
parsing/printing by parsing a file, printing it out, and parsing the
print-out, and then making sure the ASTs built up are structurally
identical (modulo any position fields you might have lurking in your
ASTs).
I have to say, ever since I did this testing, I have had no problems
with my parser.
-Denis
next prev parent reply other threads:[~2007-02-27 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-27 15:29 Joel Reymont
2007-02-27 15:42 ` Denis Bueno [this message]
2007-02-27 15:46 ` [Caml-list] " Joel Reymont
[not found] ` <6dbd4d000702270810h16ea3308k49dfcf7e5a479ecb@mail.gmail.com>
2007-02-27 16:11 ` Denis Bueno
2007-02-27 16:20 ` konrad
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=6dbd4d000702270742s39afbac6yfa46881c7069909c@mail.gmail.com \
--to=dbueno@gmail.com \
--cc=caml-list@inria.fr \
--cc=joelr1@gmail.com \
/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