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 RAA10829; Tue, 2 Sep 2003 17:42:17 +0200 (MET DST) 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 RAA13508 for ; Tue, 2 Sep 2003 17:42:15 +0200 (MET DST) Received: from ep09.kernel.pl (ep09.kernel.pl [212.87.11.162]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h82FgEf25505 for ; Tue, 2 Sep 2003 17:42:14 +0200 (MET DST) Received: (qmail 14326 invoked by uid 566); 2 Sep 2003 15:42:11 -0000 Date: Tue, 2 Sep 2003 17:40:21 +0200 From: Michal Moskal To: katre Cc: caml-list@inria.fr Subject: Re: [Caml-list] Calling ocamlyacc from ocamlyacc Message-ID: <20030902154021.GA5029@roke.freak> Mail-Followup-To: katre , caml-list@inria.fr References: <20030901172828.GA24208@henchmonkey.org> <20030902151922.GB4055@roke.freak> <20030902152340.GA32745@henchmonkey.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030902152340.GA32745@henchmonkey.org> User-Agent: Mutt/1.4.1i X-PGP-Fingerprint: CF89 1B14 11BE 1CC9 2CA3 7497 5E32 69B4 BC71 B4C2 X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Loop: caml-list@inria.fr X-Spam: no; 0.00; michal:01 moskal:01 malekith:01 pld-linux:01 caml-list:01 0400,:01 michal:01 moskal:01 malekith:01 kernel:01 sep:01 parser:02 gcs:03 wrote:03 wrote:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Sep 02, 2003 at 11:23:40AM -0400, katre wrote: > Michal Moskal wrote: > > > > You can define several start symbols in your grammar. Parsing functions > > are defined for each. You can also define several rule ... in your lexer > > (lexing functions are defined for each). Hope that helps, I can't help > > more, since I don't quite understand nature of your problem. > > > > Right, but is there a way, in a ocamlyacc action, to switch which lexer > rule you're using? That seems to be the main part I am missing. Or if > I could access the lexbuf directly, I could also use that. I believe you can set some flag in lexer (from parser action), to make it switch for another rule. But you have to consider lookahead. -- : Michal Moskal :: http://www.kernel.pl/~malekith : GCS {C,UL}++++$ a? !tv : When in doubt, use brute force. -- Ken Thompson : {E-,w}-- {b++,e}>+++ h ------------------- 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