Version française
Home     About     Download     Resources     Contact us    
Browse thread
camlp4 and quotations for c#: Two parsers needed?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] camlp4 and quotations for c#: Two parsers needed?
On Monday 28 January 2008 10:59:15 Joel Reymont wrote:
> I would like to introduce statements in C# into my OCaml code and have
> camlp4 convert them to my C# AST at compile time. I would also like to
> reuse the same parser used by camlp4 to parser regular C# files.
>
> Is it possible to share a parser this way or do I need a special
> parser for quotations and another parser to read C# files?

Camlp4's lexer is undocumented so its utility here is limited. I suspect it 
would be easier overall to simply forget all of that and manipulate ML-style 
raw ASTs.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e