Thanks to Jon's suggestions a week ago, I have gotten a camlp4 3.10
extension mostly working. What I would like to do next is
automatically, have a bunch of declarations defined at the top level
at the top of the file I am processing. This differs from much
tutorial material on camlp4 in that tutorials deal mainly with 1-1
transformations of existing code rather than mixing in spontaneous
bits of extra code.
Does anyone have suggestions or know of samples I can peek at? I've
actually gotten this very thing working in Camlp5, but it was painful
to figure out without tips ;)
Thanks,
Andy
On Sunday 16 March 2008 19:30:09 andrew_schein wrote:
> Hi -
>
> I'd like to start playing around with the 3.10 version of Camlp4.
> Getting started is difficult because the amount of
> information/examples out there is still in its infancy.
>
> In the 3.09 version of Camlp4 I like to visualize the grammar and
> figure out which point to extend by typing in:
>
> Grammar.Entry.print Pcaml.expr;;
>
> Is there something similar I can do with Camlp4 3.10? Otherwise, what
> methods are people using to figure out the structure of the original
> OCaml grammar?
According to the article about camlp4 3.10 in the OCaml Journal, you do:
# Gram.Entry.print Format.std_formatter Syntax.expr;;
According to the article about camlp4 3.10 in the OCaml Journal, you do:
# Gram.Entry.print Format.std_formatter Syntax.expr;;
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
.