caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pietro Abate <Pietro.Abate@anu.edu.au>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] combining camlp4 extensions
Date: Sun, 17 Sep 2006 17:41:20 +1000	[thread overview]
Message-ID: <20060917074120.GA27422@pulp.rsise.anu.edu.au> (raw)
In-Reply-To: <20060917072242.GA26895@pulp.rsise.anu.edu.au>

There's something magic about this list... as soon as I post something I
come up with a solution... must be the ocaml-guru karma reaching my
office... anyway...

This example now works as expected... 

Is this the best way of solving this problem ?

------------ ext_repeat.ml
open Pcaml
open Repeat (* <--------- I need to refer to the grammar entity declared
               in the common part to be able to extend it !!!!!! *)

let extend () =
    EXTEND
    GLOBAL: reexpr;
      reexpr: [[ e = expr -> e ]];
    END
;;
-----------

-----------repeat.ml
open Pcaml
let reexpr = Grammar.Entry.create Pcaml.gram "reexpr";;
let extend () =
    EXTEND
    GLOBAL: reexpr expr ;
      expr: LEVEL "expr1"
        [[ "repeat"; e1 = reexpr; "until"; e2 = expr ->
              <:expr< do { $e1$; while not $e2$ do { $e1$; } } >> ]];

      reexpr: [[]];
    END
;;
--------------

-- 
++ Blog: http://blog.rsise.anu.edu.au/?q=pietro
++ 
++ "All great truths begin as blasphemies." -George Bernard Shaw
++ Please avoid sending me Word or PowerPoint attachments.
   See http://www.fsf.org/philosophy/no-word-attachments.html


      reply	other threads:[~2006-09-17  7:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-17  7:22 Pietro Abate
2006-09-17  7:41 ` Pietro Abate [this message]

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=20060917074120.GA27422@pulp.rsise.anu.edu.au \
    --to=pietro.abate@anu.edu.au \
    --cc=caml-list@yquem.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).