[wg-camlp4] Matching on concrete syntax (was: Re: Camlp4 uses)

Xavier Clerc xavier.clerc at inria.fr
Tue Jan 29 16:30:44 GMT 2013



----- Mail original -----
> On 01/29/2013 04:37 PM, Xavier Clerc wrote:
> > However, during development,
> > it was a time-saver to be able to easily express and experiment new
> > ideas by manipulating "bits of the actual language". Camlp4 was
> > kind
> > enough to translate them for me into AST code which I had to check.
> 
> What about having a tool (either stand-alone or part of the
> compilers)
> which dumps the Parsetree representation of some code fragment in as
> textual OCaml values (probably without locations)?
> 
> So you can type your "model" as source code and obtain quickly the
> Parsetree representation, copy/paste it into a nice pattern and
> replace
> some parts with variables.

Yes, such a tool would do the trick.

I juste realized that it would probably not be very different
from the "-dsource" option you added to compilers...


Regards,

Xavier


More information about the wg-camlp4 mailing list