From: Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Obj.t : Illegal instruction (and camlp4)
Date: Wed, 7 Feb 2007 03:29:31 +0100 [thread overview]
Message-ID: <20070207022931.GA24805@yquem.inria.fr> (raw)
In-Reply-To: <20070207014717.GA17319@pulp.rsise.anu.edu.au>
Hi,
On Wed, Feb 07, 2007 at 12:47:17PM +1100, Pietro Abate wrote:
> let make_entry rt (token_list,action) =
> let _loc = Token.dummy_loc in
> let el = List.map (make_token rt) token_list in
> let a = (fun _ _ -> <:expr< "dummy_action" >>) in
> (el,Gramext.action (Obj.repr a))
> ;;
Replace:
let a = (fun _ _ -> <:expr< "dummy_action" >>) in
by:
let a =
List.fold_left (fun a _ -> Obj.magic (fun _ a))
(Obj.magic (fun _loc -> <:expr< "dummy_action" >>)) token_list
in
The semantic action must have as many parameters as the length of the
symbols list plus one (the last one being the location of the rule).
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/
next prev parent reply other threads:[~2007-02-07 2:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-07 1:47 Pietro Abate
2007-02-07 2:29 ` Daniel de Rauglaudre [this message]
2007-02-07 2:42 ` [Caml-list] " Daniel de Rauglaudre
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=20070207022931.GA24805@yquem.inria.fr \
--to=daniel.de_rauglaudre@inria.fr \
--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;
as well as URLs for NNTP newsgroup(s).