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 JAA10016; Mon, 7 Jan 2002 09:21:10 +0100 (MET) 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 JAA10168 for caml-list@pauillac.inria.fr; Mon, 7 Jan 2002 09:21:09 +0100 (MET) 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 MAA18417 for ; Fri, 28 Dec 2001 12:06:05 +0100 (MET) Received: from fichte.ai.univie.ac.at (fichte.ai.univie.ac.at [131.130.174.156]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id fBSB64T06113 for ; Fri, 28 Dec 2001 12:06:04 +0100 (MET) Received: from chopin.ai.univie.ac.at (root@chopin.ai.univie.ac.at [131.130.174.170]) by fichte.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id MAA00474; Fri, 28 Dec 2001 12:05:58 +0100 Received: (from markus@localhost) by chopin.ai.univie.ac.at (8.9.3/8.9.3/Debian 8.9.3-21) id MAA05114; Fri, 28 Dec 2001 12:05:58 +0100 Date: Fri, 28 Dec 2001 12:05:58 +0100 From: Markus Mottl To: Will Benton Cc: caml-list@pauillac.inria.fr Subject: Re: [Caml-list] debugging ocamllex/ocamlyacc specifications? Message-ID: <20011228120558.A4288@mail4.ai.univie.ac.at> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from willb@cs.wisc.edu on Fri, Dec 28, 2001 at 00:40:44 -0600 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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