From: Jeremy Yallop <jeremy.yallop@ed.ac.uk>
To: caml-list@inria.fr
Subject: Re: [Caml-list] building executables with camlp4
Date: Wed, 13 Jun 2007 14:12:27 +0100 [thread overview]
Message-ID: <466FED3B.3030405@ed.ac.uk> (raw)
In-Reply-To: <cd67f63a0706130523wa12a391m4c3a391a390a5036@mail.gmail.com>
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.
next prev parent reply other threads:[~2007-06-13 13:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-13 10:47 Jeremy Yallop
2007-06-13 12:23 ` [Caml-list] " Nicolas Pouillard
2007-06-13 13:12 ` Jeremy Yallop [this message]
2007-06-13 13:27 ` Nicolas Pouillard
2007-06-13 13:27 ` Jeremy Yallop
2007-06-13 13:45 ` Nicolas Pouillard
2007-06-13 14:07 ` Jeremy Yallop
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=466FED3B.3030405@ed.ac.uk \
--to=jeremy.yallop@ed.ac.uk \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox