caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Artem Prisyznuk <tema@sit.kiev.ua>
To: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: [Caml-list] Right way to determine used syntax ( camlp4 )
Date: Tue, 04 Nov 2003 12:46:06 +0200	[thread overview]
Message-ID: <oprx3z640bafbmjd@uaapc442> (raw)

Hello,

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 
syntax
used with next code:

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

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


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
tema@sit.kiev.ua

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


             reply	other threads:[~2003-11-04 10:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-04 10:46 Artem Prisyznuk [this message]
2003-11-04 12:59 ` Dmitry Lomov
     [not found]   ` <oprx3918mvafbmjd@uaapc442>
2003-11-04 14:54     ` Artem Prisyznuk

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=oprx3z640bafbmjd@uaapc442 \
    --to=tema@sit.kiev.ua \
    --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).