Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Documenting CamlP4 syntax extensions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-03-02 (10:58)
From: Mitya Lomov <dsl@t...>
Subject: [Caml-list] Documenting CamlP4 syntax extensions

As I am heading to the release of Dynamic Caml 0.2,
it occurred to me that syntax extensions included there
grew quite complex, and will certainly require some
good deal of documenting to be released to the public.

It will be nice to be able to document camlp4 syntax
extensions in the same way as one documents his .mli

The first step to that will be, I guess, some kind of
tool that is able to extract plain grammar definitions
(like BNF) from CamlP4 sources (just rules, without

I see two ways to write such a tool: either reimplement extensions so that they will output grammar
entries in readable form instead of adding them into CamlP4
internals, or some kind of "dummy syntax extension" module
which will dump internal CamlP4 grammar entries
in readable form.

The latter way is, to some extent, more clean - one does not
reimplement parsing (and do not need to reinvent
internal representation for grammars...). However, it is
possible that the first way is more extensible (say, if one
wants to add some fancy comments to syntax extensions, so
that the whole documentation is generated from source, then
it is easier to do that while parsing).

Any opinions? Probably such a beast already exists?


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: