Version française
Home     About     Download     Resources     Contact us    
Browse thread
parsing problem.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Jambon <martin.jambon@e...>
Subject: Re: using camlp4 api [WAS: Re: [Caml-list] parsing problem.]
On Thu, 25 Jan 2007, Pietro Abate wrote:

> where in the first part there is a grammar definition and in the second part
> the grammar is used to parse the argument of the match statement.
>
> my question: Is it possible to do something similar with camlp4 ?
>
> In the library documentation I can see that this might be possible, but I don't
> quite understand where to start. The first step should be to write a small
> parser to interpret the language definition and then to generate, by using the
> Grammar (extensible grammars) module, other production that extend the current
> grammar to parse the rest of the file. The trick part is that I cannot write (I
> think) and EXTEND statement on the fly (as it should be parsed itself), but I
> have to use the quotation library directly, and this is very verbose...
>
> Did anybody do anything similar ? One small example ?

No :-)

Take pa_extend.ml and unquote the quotations?
(and solve the type problems which might not be so bad)


Martin

--
Martin Jambon
http://martin.jambon.free.fr