Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] debugging ocamlyacc grammars
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-09-30 (05:46)
From: Kenneth Knowles <kknowles@u...>
Subject: Re: [Caml-list] debugging ocamlyacc grammars

>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."


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 Archives:
> Bug reports: FAQ:
> Beginner's list:

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: