From: Alain Frisch <alain@frisch.fr>
To: Arnaud Spiwack <Arnaud.Spiwack@lix.polytechnique.fr>,
Caml mailing list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] OCamlduce + camlp4
Date: Mon, 24 Dec 2007 17:03:33 +0100 [thread overview]
Message-ID: <476FD855.9010800@frisch.fr> (raw)
In-Reply-To: <476FBA62.9080600@lix.polytechnique.fr>
Arnaud Spiwack wrote:
> There I discovered that I couldn't find a camlp4 syntax file for
> OCamlduce (to be able to extend OCamlduce's syntax). In my case, I'd
> like an equivalent to camlp4orf (original syntax, but revised-syntax
> quotations) that handles OCamlduce syntax (though, original-syntax
> quotation would require little to change, thus would be all right).
>
> Does anybody know whether it already exists ? (maybe Alain or Nicolas ;) ).
>
> If it does not, I shall consider making one myself, but I will have to
> know better of the insides of OCamlduce.
I'm not aware of a Camlp4 parser for OCamlduce (which probably means
that such a thing does not exist). It should not be difficult (only
quite boring) to write one. Of course, before writing the grammar,
you'll have to extend Camlp4's OCaml syntax tree with new constructions
and its translation to the real OCaml AST (Parsetree).
The OCamlDuce parser uses different lexers for the OCaml and CDuce
parts. This is done by switching lexing mode on a few tokens ( {{, {:,
:}, }}). It is possible to reproduce that with Camlp4 (you can plug an
arbitrary lexer).
Let me know if you need more assistance on the OCamlDuce side...
Good luck!
-- Alain
next prev parent reply other threads:[~2007-12-24 16:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-24 13:55 Arnaud Spiwack
2007-12-24 16:03 ` Alain Frisch [this message]
2007-12-24 19:36 ` [Caml-list] " Nicolas Pouillard
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=476FD855.9010800@frisch.fr \
--to=alain@frisch.fr \
--cc=Arnaud.Spiwack@lix.polytechnique.fr \
--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