From: Markus Mottl <markus@oefai.at>
To: Will Benton <willb@cs.wisc.edu>
Cc: caml-list@pauillac.inria.fr
Subject: Re: [Caml-list] debugging ocamllex/ocamlyacc specifications?
Date: Fri, 28 Dec 2001 12:05:58 +0100 [thread overview]
Message-ID: <20011228120558.A4288@mail4.ai.univie.ac.at> (raw)
In-Reply-To: <Pine.LNX.4.21.0112280027530.14207-100000@cilantro.cs.wisc.edu>; from willb@cs.wisc.edu on Fri, Dec 28, 2001 at 00:40:44 -0600
On Fri, 28 Dec 2001, Will Benton wrote:
> Hello, all. I am writing a simple interpreter for fun but am having
> trouble with ocamllex and ocamlyacc. To test my lexer and parser, I am
> using the test program from the desk calculator example in the manual, but
> I when I type in an expression and press EOL, it does nothing (my "main"
> rule in the parser is "exp EOL"); I know it's doing something because
> if I type in a garbage expression, it gives me a parse error
> exception.
Maybe you only need to flush the output channel after printing results?
> When I type in an expression and press EOF, on the other hand,
> it gives me a Failure("lexing: empty token") exception.
I don't know what your parser looks like, but you might have to add an
appropriate rule for "EOF" so that it isn't considered as a parse error
anymore and quits the program instead.
Regards,
Markus Mottl
--
Markus Mottl markus@oefai.at
Austrian Research Institute
for Artificial Intelligence http://www.oefai.at/~markus
-------------------
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:[~2002-01-07 8:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-28 6:40 Will Benton
2001-12-28 11:05 ` Markus Mottl [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=20011228120558.A4288@mail4.ai.univie.ac.at \
--to=markus@oefai.at \
--cc=caml-list@pauillac.inria.fr \
--cc=willb@cs.wisc.edu \
/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