* Re: [Caml-list] camlp4 and quotations for c#: Two parsers needed?
2008-01-28 10:59 camlp4 and quotations for c#: Two parsers needed? Joel Reymont
@ 2008-01-28 10:58 ` Jon Harrop
2008-01-28 14:34 ` Nicolas Pouillard
2008-05-01 21:25 ` Richard Jones
1 sibling, 1 reply; 4+ messages in thread
From: Jon Harrop @ 2008-01-28 10:58 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* camlp4 and quotations for c#: Two parsers needed?
@ 2008-01-28 10:59 Joel Reymont
2008-01-28 10:58 ` [Caml-list] " Jon Harrop
2008-05-01 21:25 ` Richard Jones
0 siblings, 2 replies; 4+ messages in thread
From: Joel Reymont @ 2008-01-28 10:59 UTC (permalink / raw)
To: caml-list List
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?
Thanks, Joel
--
http://wagerlabs.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] camlp4 and quotations for c#: Two parsers needed?
2008-01-28 10:58 ` [Caml-list] " Jon Harrop
@ 2008-01-28 14:34 ` Nicolas Pouillard
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Pouillard @ 2008-01-28 14:34 UTC (permalink / raw)
To: jon; +Cc: caml-list
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Caml-list] camlp4 and quotations for c#: Two parsers needed?
2008-01-28 10:59 camlp4 and quotations for c#: Two parsers needed? Joel Reymont
2008-01-28 10:58 ` [Caml-list] " Jon Harrop
@ 2008-05-01 21:25 ` Richard Jones
1 sibling, 0 replies; 4+ messages in thread
From: Richard Jones @ 2008-05-01 21:25 UTC (permalink / raw)
To: Joel Reymont; +Cc: caml-list List
On Mon, Jan 28, 2008 at 10:59:15AM +0000, 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?
You might want to look at the implementation of PG'OCaml. It passes
SQL statements off to the database for parsing.
Rich.
--
Richard Jones
Red Hat
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-01 21:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-28 10:59 camlp4 and quotations for c#: Two parsers needed? Joel Reymont
2008-01-28 10:58 ` [Caml-list] " Jon Harrop
2008-01-28 14:34 ` Nicolas Pouillard
2008-05-01 21:25 ` Richard Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox