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-09-16 (10:11)
From: Mitya Lomov <dsl@t...>
Subject: Re: [Caml-list] Documenting CamlP4 syntax extensions
Daniel de Rauglaudre wrote:
> Hi,
> On Sat, Mar 02, 2002 at 01:59:37PM +0400, Mitya Lomov wrote:
> > 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
> > semantics).
> The function Grammar.Entry.print prints the rules of a grammar
> entry. For example, the code:
>     Grammar.Entry.print Pcaml.expr
> prints the rules for expressions.

This function is great for development purposes.
But for documenting syntax extensions its output is not 
quite acceptable, and coverting its output to more readable
form essentialy involves parsing camlp4 grammar definitions
(a la pa_extend.cmo). 
Moreover, one have to build a transitive closure of all grammar
entries referenced from an entry to get a complete doc...

> Perhaps a complete program displaying all entries (by scanning the
> main grammar entries "interf" and "implem") could be useful. It is
> possible to scan entries using the (undocumented) module Gramext.

> --
> Daniel de RAUGLAUDRE
> -------------------
> To unsubscribe, mail Archives:
> Bug reports: FAQ:
> Beginner's list:
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: