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 WAA17674; Wed, 28 May 2003 22:48:38 +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 WAA17665 for ; Wed, 28 May 2003 22:48:37 +0200 (MET DST) Received: from epexch01.qlogic.org ([63.170.40.3]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h4SKmaH21557 for ; Wed, 28 May 2003 22:48:36 +0200 (MET DST) Received: from epmailtmp.qlogic.org ([10.20.33.254]) by epexch01.qlogic.org with Microsoft SMTPSVC(5.0.2195.5329); Wed, 28 May 2003 15:46:27 -0500 Received: from [10.20.33.146] ([10.20.33.146]) by epmailtmp.qlogic.org with Microsoft SMTPSVC(5.0.2195.4905); Wed, 28 May 2003 15:46:27 -0500 Date: Wed, 28 May 2003 16:03:49 -0500 (CDT) From: Brian Hurt X-X-Sender: Reply-To: Brian Hurt To: Ocaml Mailing List Subject: [Caml-list] Ocamllex/Ocamlyacc feature request Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 28 May 2003 20:46:27.0273 (UTC) FILETIME=[3594BB90:01C3255A] X-Spam: no; 0.00; qlogic:01 bison:01 debugging:01 stdout:01 recognized:99 stderr:01 buffer:01 nonzero:01 shifted:01 debug:01 token:01 parser:02 stack:02 parsers:03 usefull:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Flex and Bison have an option to automatically output debugging information to stdout in the generated code. For flex, the option is -d, and documented thusly: > -d makes the generated scanner run in debug mode. > Whenever a pattern is recognized and the global > yy_flex_debug is non-zero (which is the default), > the scanner will write to stderr a line of the > form: > > --accepting rule at line 53 ("the matched text") > > The line number refers to the location of the rule > in the file defining the scanner (i.e., the file > that was fed to flex). Messages are also generated > when the scanner backs up, accepts the default > rule, reaches the end of its input buffer (or > encounters a NUL; at this point, the two look the > same as far as the scanner's concerned), or reaches > an end-of-file. The Bison option is -t, and documented thusly: > Each step taken by the parser when `yydebug' is nonzero produces a > line or two of trace information, written on `stderr'. The trace > messages tell you these things: > > * Each time the parser calls `yylex', what kind of token was read. > > * Each time a token is shifted, the depth and complete contents of > the state stack (*note Parser States::.). > > * Each time a rule is reduced, which rule it is, and the complete > contents of the state stack afterward. These are incredibly usefull for debugging your parsers. Brian ------------------- 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