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: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] camlp4 and quotations for c#: Two parsers needed?
Excerpts from jon's message of Mon Jan 28 11:58:19 +0100 2008:
> 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.

There is nothing wrong with the Camlp4's *lexer*, it's simple generic and reusable.
However I confess that parsers can be a lot more complex.

-- 
Nicolas Pouillard aka Ertai