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 SAA24526; Wed, 24 Oct 2001 18:41:06 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA24097 for caml-list@pauillac.inria.fr; Wed, 24 Oct 2001 18:40:56 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA21788; Wed, 24 Oct 2001 16:53:32 +0200 (MET DST) Date: Wed, 24 Oct 2001 16:53:32 +0200 From: Xavier Leroy To: "Rafael 'Dido' Sevilla" Cc: Caml List Subject: Re: [Caml-list] debugging an ocamlyacc parser Message-ID: <20011024165332.A20982@pauillac.inria.fr> References: <20011023101442.B17138@team.ph.inter.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20011023101442.B17138@team.ph.inter.net>; from sevillar@team.ph.inter.net on Tue, Oct 23, 2001 at 10:14:42AM +0800 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Well, while my current ocamlyacc parser seems to be working pretty well, > I'm just wondering if there's a debug mode available for > ocamlyacc-generated parsers, like the debugging mode that Bison uses > when you do a #define YYDEBUG, printing out all the states the parser > goes through as it receives tokens from the lexer, so along with the > generated y.output file I can see how it's working (or not working as > the case may be). There is such a debugging mode in the pushdown automaton used to execute ocamlyacc parsers, but it is not easily accessible. You need to build the "debug" version of the bytecode interpreter (cd runtime ; make ocamlrund), then run your bytecode executable with "ocamlrund -P myprog". You then get a trace of shift and reduce actions; tokens read are also printed, but in such a low-level format that it's nearly useless... I agree this tracing facility should be made better at some point, although printing tokens correctly is difficult in general. - Xavier Leroy ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr