From: "Loup Vaillant" <loup.vaillant@gmail.com>
To: "Caml mailing list" <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] How can I generate an AST?
Date: Mon, 20 Aug 2007 10:22:17 +0200 [thread overview]
Message-ID: <6f9f8f4a0708200122k710b2f3dnd723a7244140575e@mail.gmail.com> (raw)
In-Reply-To: <20070819181634.GA797@yquem.inria.fr>
2007/8/19, Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>:
> Hi,
>
> On Sun, Aug 19, 2007 at 07:39:50PM +0200, Loup Vaillant wrote:
>
> > I would like to write a preprocessor of my own (to make a lisp
> > syntax). In the process, I am slowly catching up with the Ocaml AST.
>
> If you just need a Lisp syntax, you can use Camlp5 which proposes a
> Lisp syntax among its parsing kits:
> http://pauillac.inria.fr/~ddr/camlp5/doc/html/scheme.html
>
> Perhaps (probably) incomplete, but you can complete or fix it if you
> want.
Looks great, but unfortunately, I think it is unsuitable for what I
want to do : a macro system based on a lisp-like syntax. I want reader
macros as well as regular ones. (By the way, have I overlooked a
"defmacro" in your syntax?)
> If you are interested on the fact of *programming* yourself a new
> syntax, use Camlp5: make your parser generating Camlp5 AST and the
> rest (dumping syntax tree) is already done by Camlp5. See the doc
> or ask who knows for hints (me or other).
This may be a better approach. However, I am not eager to use camlp*,
for it will introduce a additional dependency. I may choose this
however, if the camlp* AST is simpler than the Ocaml AST. Where can I
find it?
Thank you,
Loup
next prev parent reply other threads:[~2007-08-20 8:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-19 17:39 Loup Vaillant
2007-08-19 18:16 ` [Caml-list] " Daniel de Rauglaudre
2007-08-20 8:22 ` Loup Vaillant [this message]
2007-08-20 11:13 ` Daniel de Rauglaudre
2007-08-20 13:24 ` Loup Vaillant
2007-08-20 13:29 ` Massimiliano Brocchini
2007-08-20 15:45 ` Daniel de Rauglaudre
[not found] ` <6f9f8f4a0708220222q5ea56138u8b4c85dd4c35c56e@mail.gmail.com>
[not found] ` <20070822103226.GA12907@yquem.inria.fr>
2007-08-22 13:47 ` Loup Vaillant
2007-08-19 21:37 ` Alain Frisch
2007-08-20 8:29 ` Loup Vaillant
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=6f9f8f4a0708200122k710b2f3dnd723a7244140575e@mail.gmail.com \
--to=loup.vaillant@gmail.com \
--cc=caml-list@yquem.inria.fr \
/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