From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA07684; Tue, 4 Nov 2003 11:45:48 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA07660 for ; Tue, 4 Nov 2003 11:45:47 +0100 (MET) Received: from megs23.100mwh.com ([205.214.86.13]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hA4Ajk111081 for ; Tue, 4 Nov 2003 11:45:47 +0100 (MET) Received: from [205.214.86.158] (helo=uaapc442) by megs23.100mwh.com with asmtp (Exim 4.24) id 1AGygt-00045Z-R5 for caml-list@inria.fr; Tue, 04 Nov 2003 03:45:40 -0700 To: "caml-list@inria.fr" Subject: [Caml-list] Right way to determine used syntax ( camlp4 ) From: Artem Prisyznuk Content-Type: text/plain; format=flowed; charset=koi8-r MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Tue, 04 Nov 2003 12:46:06 +0200 Message-ID: User-Agent: Opera7.21/Win32 M2 build 3218 X-MailScanner-Information: Please contact the ISP for more information X-MailScanner: Found to be clean X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - megs23.100mwh.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sit.kiev.ua X-Loop: caml-list@inria.fr X-Spam: no; 0.00; camlp:01 artem:01 expr:01 expr:01 pcaml:01 artem:01 cmo:01 cmo:01 ocaml:01 syntax:02 syntax:02 module:03 revised:03 revised:03 let:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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