English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] Right way to determine used syntax ( camlp4 )
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-11-04 (10:45)
From: Artem Prisyznuk <tema@s...>
Subject: [Caml-list] Right way to determine used syntax ( camlp4 )

I write small extension for ocaml. But I have next question.

Grammar entry differ for pa_o.cmo and pa_r.cmo. So in my pa_ module
I want auto determinate which syntax used and apply differ EXTEND
branches for normal syntax and revised syntax. Now I determine which 
used with next code:

let normal_extend () =
  	GLOBAL: expr;
	expr: LEVEL "expr1"
	  [[ ..... ]]

let revised_extend () =
  	GLOBAL: expr;
	expr: LEVEL "top"
	  [[ ..... ]]

let _ =
   try ignore(Grammar.Entry.find Pcaml.expr "expr1"); normal_extend ()
   with Not_found -> revised_extend ();;

It work, but I don't assurance what it's right way.

Any suggestions?

Artem Prysyznuk

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