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.9 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 2216DBC69 for ; Tue, 23 Oct 2007 07:54:35 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABwpHUfAXQImh2dsb2JhbACOVgIBCAop X-IronPort-AV: E=Sophos;i="4.21,315,1188770400"; d="scan'208";a="3517547" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 Oct 2007 07:54:34 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9N5sY2p016213 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 23 Oct 2007 07:54:34 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAFcpHUdA6ba4mGdsb2JhbACOVgIBAQcCBis X-IronPort-AV: E=Sophos;i="4.21,315,1188770400"; d="scan'208";a="18496121" Received: from nf-out-0910.google.com ([64.233.182.184]) by mail4-smtp-sop.national.inria.fr with ESMTP; 23 Oct 2007 07:54:32 +0200 Received: by nf-out-0910.google.com with SMTP id g13so1057302nfb for ; Mon, 22 Oct 2007 22:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; bh=y9vYW7RNdbpNkeIAhyA6owP7lj1NhhfueDASE+bPjZ0=; b=CgXmDt2P9dMx4EdQ5d0jyfP8P3aWZwSIEfsi7fN3Nx11bmJwJ5TGgD9d0ug8tHbJis5nPaZGwvgEFPPmzlbFK2KIsWdCnjP4DI+WcArwi76Z3u9gBzoa/os654npjKa1Hr9as+ZHxP91Qb/qknBOjwi0yDO4ZJutxHhgtNhTJ2I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding:sender; b=spn0jw4Tskxuf/1m/msppvMas4m24QAQtxBuzBYc/zJ4l6wzQMqectpSGW/fIK40AHL/QLpVykb6o0jYaMluEEyUs39qktN/ciHpqITnx2PQV5bX6Q67DmJZdvEHu9IL38L23xmnDq5U5dhDbzI9oTs5NEyTtnLyM02OEBUiozA= Received: by 10.86.4.2 with SMTP id 2mr4461665fgd.1193118873317; Mon, 22 Oct 2007 22:54:33 -0700 (PDT) Received: from ?192.168.0.1? ( [82.246.197.195]) by mx.google.com with ESMTPS id y6sm14349407mug.2007.10.22.22.54.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 22 Oct 2007 22:54:31 -0700 (PDT) Subject: Camlp4 as a universal pre-processor ? From: David Teller To: OCaml Content-Type: text/plain Date: Tue, 23 Oct 2007 07:54:33 +0200 Message-Id: <1193118873.7228.10.camel@Blefuscu> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit Sender: David Teller X-Miltered: at discorde with ID 471D8C9A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 univ-orleans:01 camlp:01 syntax:01 ocpp:01 non-ocaml:01 parser:01 cpp:01 trivial:01 syntax:01 ocaml:01 dependencies:01 ocaml's:01 univ-orleans:01 lifo:01 Hello list, I'm currently playing with camlp4 3.10. I've succeeded in making a syntax extension to help me generate annotated trees, which is a good start. Now, I understand that, by invoking ocpp, camlp4 may be used as a pre-processor for non-OCaml language, which sounds interesting, for I have need of pre-processing some parser generator input (at the moment, menhir, but there are good chances I'll switch to Dypgen to get around some limitations) to maintain consistency between the implementation and the specifications. There are very good chances that I could do that with cpp, as it's essentially trivial pre-processing, but I'd rather use camlp4, if only to learn more about it. So, my question is: how do I write a pre-processor that doesn't depend on the syntax of OCaml ? I'm hoping I can get away with one or two quotations and one anti-quotation, but I have no clue how to register these without adding dependencies to either OCaml's Original or Revised syntax. Does anyone have any examples handy ? Thanks, David -- David Teller ------------------------------------------ Security of Distributed Systems ----------------------- Project JStify: Static Analysis for JavaScript 2 ----- -- http://www.univ-orleans.fr/lifo/Members/David.Teller ----- Laboratoire d'Informatique Fondamentale d'Orleans