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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 4DA55BC0A for ; Wed, 13 Jun 2007 15:19:54 +0200 (CEST) Received: from bdmail1.accesst.com (pop.bulldoghome.com [83.245.1.230]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5DDJrWU021449 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Wed, 13 Jun 2007 15:19:54 +0200 Received: from host-84-9-232-186.bulldogdsl.com ([84.9.232.186] helo=[192.168.123.191]) by bdmail1.accesst.com with esmtpa (Exim 4.50) id 1HySgN-0004hX-Bi for caml-list@inria.fr; Wed, 13 Jun 2007 14:14:43 +0100 Message-ID: <466FED3B.3030405@ed.ac.uk> Date: Wed, 13 Jun 2007 14:12:27 +0100 From: Jeremy Yallop User-Agent: Mozilla-Thunderbird 2.0.0.0 (X11/20070601) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] building executables with camlp4 References: <466FCB46.1070304@ed.ac.uk> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 466FEEF9.003 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 syntax:01 prerr:01 endline:01 ocamlc:01 -pp:01 usr:01 ocaml:01 lib:01 ocaml:01 cmo:01 ocamlc:01 -linkall:01 usr:01 Thanks for the help, Nicolas. I think I'm getting somewhere. I no longer get Not_found, but now my grammar extension doesn't seem to be activated. Here's a fairly minimal example: File minimal.ml: open Camlp4.PreCast.Syntax DELETE_RULE Gram str_item: "type"; type_declaration END EXTEND Gram str_item: [[ "type"; types = type_declaration -> <:str_item< type $types$ >> | "type"; types = type_declaration; "premiums" ; "(" ; "squigglier" ; ")" -> prerr_endline "squigglier!"; <:str_item< type $types$ >> ]]; END File input.ml: type x = int premiums ( squigglier ) This works: $ ocamlc -c -pp camlp4of \ -I /usr/local/ocaml/lib/ocaml/camlp4 minimal.ml $ camlp4o minimal.cmo input.ml squigglier! type x = int But this doesn't: $ ocamlc -g -linkall -I /usr/local/ocaml/lib/ocaml/camlp4 \ -o minimal \ camlp4lib.cma \ unix.cma \ Camlp4Parsers/Camlp4OCamlRevisedParser.cmo \ Camlp4Parsers/Camlp4OCamlParser.cmo \ Camlp4Printers/Camlp4OCamlPrinter.cmo \ Camlp4Bin.cmo \ minimal.cmo $ ./minimal input.ml File "input.ml", line 1, characters 35-36: Parse error: ident_of_ctyp: this type is not an identifier What should my linking command be for this to work? Jeremy.