caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] camlp4 avec ocamlopt
@ 2002-10-16 11:59 Stalkern 2
  2002-10-16 12:09 ` Daniel de Rauglaudre
  0 siblings, 1 reply; 2+ messages in thread
From: Stalkern 2 @ 2002-10-16 11:59 UTC (permalink / raw)
  To: caml-list

Savez-vous si on peut compiler camlp4 avec ocamlopt, et comment?


j'ai essayé de compiler l'example
-----------------------
camlp4foo.ml
-----------------------
let gram = Grammar.create (Plexer.make ());;
let expr = Grammar.Entry.create gram "expr" ;;


    EXTEND
    expr :
    [ [ x = expr; "+"; y = expr -> x + y

  | x = expr; "-"; y = expr -> x - y ]
  | [ x = expr; "*"; y = expr -> x * y
  | x = expr; "/"; y = expr -> x / y ]
  | [ x = INT -> int_of_string x
  | "("; e = expr; ")" -> e ] ]

    ;
  END;;
-----------------------
avec la commande
ocamlopt -I +camlp4 gramlib.cmxa camlp4foo.ml -o camlp4foo.opt
mais j'obtiens l'erreur
File "camlp4foo.ml", line 5, characters 9-10:
Syntax error
en correspondance de ce qui suit 'expr' et je me sens un peu en panne de 
documentation (comme d'habitude...)


Merci d'avance
Ernesto

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Caml-list] camlp4 avec ocamlopt
  2002-10-16 11:59 [Caml-list] camlp4 avec ocamlopt Stalkern 2
@ 2002-10-16 12:09 ` Daniel de Rauglaudre
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel de Rauglaudre @ 2002-10-16 12:09 UTC (permalink / raw)
  To: caml-list

Bonjour,

On Wed, Oct 16, 2002 at 01:59:13PM +0200, Stalkern 2 wrote:

> avec la commande
> ocamlopt -I +camlp4 gramlib.cmxa camlp4foo.ml -o camlp4foo.opt
> mais j'obtiens l'erreur
> File "camlp4foo.ml", line 5, characters 9-10:
> Syntax error

If faut ajouter -pp "camlp4o pa_extend.cmo" dans la commande:

    ocamlopt -pp "camlp4o pa_extend.cmo" -I +camlp4 gramlib.cmxa camlp4foo.ml -o camlp4foo.opt

Sinon, c'est ocamlc qui parse, et alors il y comprend rien parce que
l'instruction EXTEND, il connait pas.

-- 
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-16 12:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-16 11:59 [Caml-list] camlp4 avec ocamlopt Stalkern 2
2002-10-16 12:09 ` Daniel de Rauglaudre

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).