From: Xavier Leroy <xleroy@pauillac.inria.fr>
To: "Rafael 'Dido' Sevilla" <sevillar@team.ph.inter.net>
Cc: Caml List <caml-list@pauillac.inria.fr>
Subject: Re: [Caml-list] debugging an ocamlyacc parser
Date: Wed, 24 Oct 2001 16:53:32 +0200 [thread overview]
Message-ID: <20011024165332.A20982@pauillac.inria.fr> (raw)
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
> 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
prev parent reply other threads:[~2001-10-24 16:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-23 2:14 Rafael 'Dido' Sevilla
2001-10-23 5:42 ` Mattias Waldau
2001-10-23 7:51 ` Hendrik Tews
2001-10-24 14:53 ` Xavier Leroy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20011024165332.A20982@pauillac.inria.fr \
--to=xleroy@pauillac.inria.fr \
--cc=caml-list@pauillac.inria.fr \
--cc=sevillar@team.ph.inter.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox