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 HAA21285; Tue, 23 Oct 2001 07:42:58 +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 HAA21388 for ; Tue, 23 Oct 2001 07:42:57 +0200 (MET DST) Received: from mailf.telia.com (mailf.telia.com [194.22.194.25]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9N5guD06835 for ; Tue, 23 Oct 2001 07:42:56 +0200 (MET DST) Received: from d1o849.telia.com (d1o849.telia.com [213.66.248.241]) by mailf.telia.com (8.11.6/8.11.6) with ESMTP id f9N5gq526385; Tue, 23 Oct 2001 07:42:52 +0200 (CEST) Received: from gateway (h40n2fls34o849.telia.com [217.208.235.40]) by d1o849.telia.com (8.10.2/8.10.1) with SMTP id f9N5gqa09746; Tue, 23 Oct 2001 07:42:52 +0200 (CEST) From: "Mattias Waldau" To: "Rafael 'Dido' Sevilla" , "Caml List" Subject: RE: [Caml-list] debugging an ocamlyacc parser Date: Tue, 23 Oct 2001 07:42:51 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <20011023101442.B17138@team.ph.inter.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Importance: Normal Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I normally test the lexer and the parser separately. The lexer is easy to test using a function like: let lexbuf = Lexing.from_channel file_channel in let result = ref [] in try while true do let next_token = Dtd_lexer.token lexbuf in result := next_token :: !result; if debug_lexer then Dtd_types.print next_token; if next_token = Dtd_types.EOF then raise Not_found done; List.rev (!result) with Not_found -> List.rev (!result) For debugging the parser I set the -v flag to ocamlyacc and look at the .parser file /mattias > -----Original Message----- > From: owner-caml-list@pauillac.inria.fr > [mailto:owner-caml-list@pauillac.inria.fr]On Behalf Of Rafael 'Dido' > Sevilla > Sent: Tuesday, October 23, 2001 4:15 AM > To: Caml List > Subject: [Caml-list] debugging an ocamlyacc parser > > > 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). > > -- > Rafael R. Sevilla +63(2) 8177746 > ext. 8311 > Programmer, Inter.Net Philippines +63(917) 4458925 > http://dido.engr.internet.org.ph/ OpenPGP Key ID: > 0x5CDA17D8 > ------------------- > 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 ------------------- 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