From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 24971BC6C for ; Mon, 28 Jan 2008 12:03:52 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj0KADJFnUfUnw7WeGdsb2JhbACCNo1lDQEKBAYIBxqaBg X-IronPort-AV: E=Sophos;i="4.25,259,1199660400"; d="scan'208";a="21879495" Received: from ptb-relay03.plus.net ([212.159.14.214]) by mail4-smtp-sop.national.inria.fr with ESMTP; 28 Jan 2008 12:03:51 +0100 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay03.plus.net with esmtp (Exim) id 1JJRmI-0007FW-Ji for caml-list@yquem.inria.fr; Mon, 28 Jan 2008 11:03:50 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] camlp4 and quotations for c#: Two parsers needed? Date: Mon, 28 Jan 2008 10:58:19 +0000 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801281058.19602.jon@ffconsultancy.com> X-Plusnet-Relay: f5dd586293c46a70f6a766e11f85af4c X-Spam: no; 0.00; camlp:01 parsers:01 ocaml:01 camlp:01 parser:01 parser:01 lexer:01 frog:98 wrote:01 compile:01 caml-list:01 reuse:01 ast:02 quotations:03 quotations:03 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