caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe Raffalli <raffalli@univ-savoie.fr>
To: caml-list@inria.fr
Subject: question about camlp4 and lexer
Date: Fri, 18 Aug 2006 19:32:10 +0200	[thread overview]
Message-ID: <44E5F99A.7000009@univ-savoie.fr> (raw)


Hello,

For a camlp4 extension, I want to add some delimiters:
  (^  ^)  [^ ^] {^ ^} [|^ ^|].

It does not break anything and it works quite well ... my problem is
that I find it a bit hard to compile the camlp4 extension.
Here is a part of my Makefile:

# compilation of the lexer
mylexer.cmo: mylexer.ml
    $(CAMLC) -pp "camlp4r -loc _loc"  -I +camlp4 -c mylexer.ml

# recompilation of pa_o.ml (unmodified and directly copied from the
source of ocaml)
pa_o.cmo: pa_o.ml mylexer.cmo
    $(CAMLC) -pp "camlp4r pa_extend.cmo q_MLast.cmo -loc _loc"  -I
+camlp4 -c pa_o.ml

# my syntax extension
pa_bindlib.cmo: bindlib.cmi pa_bindlib.ml pa_o.cmo
    $(CAMLC) -pp "camlp4 ./mylexer.cmo ./pa_o.cmo pa_extend.cmo
q_MLast.cmo pr_dump.cmo -loc _loc"  -I +camlp4 -c pa_bindlib.ml

# linking of a camlp4 preprocessor
camlp4bo: pa_bindlib.cmo
    $(CAMLC) -linkall -I +camlp4 odyl.cma camlp4.cma ./mylexer.cmo
./pa_o.cmo pa_bindlib.cmo pr_dump.cmo odyl.cmo -o camlp4bo


I do not understand why I need to recompile pa_o.ml and cannot use
pa_o.cmo in "ocaml/camlp4" (I tried but it uses the original lexer and
not mine) ...
This is a bit annoying and I am probably doing something wrong ...

Thanks in advance for you help,
Christophe Raffalli


By the way, I think the default lexer should consider (xxx xxx) [xxx
xxx] {xxx xxx} as delimiters whenever xxx is an infix keyword ... so
camlp4 user would have a big choice of delimiters ...


                 reply	other threads:[~2006-08-18 17:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=44E5F99A.7000009@univ-savoie.fr \
    --to=raffalli@univ-savoie.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).