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 HAA32190; Tue, 30 Sep 2003 07:46:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA29993 for ; Tue, 30 Sep 2003 07:46:04 +0200 (MET DST) Received: from localhost (adsl-64-162-212-212.dsl.snfc21.pacbell.net [64.162.212.212]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h8U5k2515331 for ; Tue, 30 Sep 2003 07:46:03 +0200 (MET DST) Received: by localhost (Postfix, from userid 1000) id E9D826A4D53; Mon, 29 Sep 2003 22:45:58 -0700 (PDT) Date: Mon, 29 Sep 2003 22:45:58 -0700 From: Kenneth Knowles To: "Rafael 'Dido' Sevilla" Cc: caml-list@inria.fr Subject: Re: [Caml-list] debugging ocamlyacc grammars Message-ID: <20030930054558.GA2808@tallman.kefka.frap.net> References: <20030929045320.GD11211@imperium.ph> <20030930044514.GA13863@imperium.ph> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030930044514.GA13863@imperium.ph> User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; knowles:99 caml-list:01 debugging:01 run-time:01 pushdown:01 shifted:01 rafael:01 'dido':01 foo:01 bison:01 bug:01 faq:01 faq:01 beginner's:01 beginners:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>From the manual: "At run-time, the ocamlyacc-generated parser can be debugged by setting the p option in the OCAMLRUNPARAM environment variable (see section 10.2). This causes the pushdown automaton executing the parser to print a trace of its action (tokens shifted, rules reduced, etc). The trace mentions rule numbers and state numbers that can be interpreted by looking at the file grammar.output generated by ocamlyacc -v." -Kenn On Tue, Sep 30, 2003 at 12:45:14PM +0800, Rafael 'Dido' Sevilla wrote: > On Mon, Sep 29, 2003 at 03:27:24PM +0200, James Leifer wrote: > > Do you mean the parser.output file produced when you use the -v > > option? > > > > ocamlyacc -v foo.mly > > > > No. I mean that once the parser is *already running*, you get a > complete trace of the entire action of the parser for some particular > input. What states it enters as it reads particular input tokens, the > contents of its stack as it enters and leaves states, and so on. This > is possible with Bison and Yacc, and I've used it before to debug > grammars written with those tools. I read nothing in Ocamlyacc's (very > meager) documentation that indicates how one should do this or if it is > even possible at all. > > ------------------- > 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 ------------------- 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