From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 0015DBC6B for ; Wed, 7 Mar 2007 12:15:58 +0100 (CET) Received: from orion.metastack.com (no-dns-yet.demon.co.uk [80.177.38.218] (may be forged)) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l27BFwkx015165 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 7 Mar 2007 12:15:58 +0100 Received: from treble (cpc2-cmbg6-0-0-cust535.cmbg.cable.ntl.com [81.107.34.24]) (authenticated bits=0) by orion.metastack.com (8.13.4/8.13.3) with ESMTP id l27ARKGR010610 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 7 Mar 2007 10:27:20 GMT From: "David Allsopp" To: References: <20070306110003.AE491BC70@yquem.inria.fr> Subject: Re: [Caml-list] Catching a double semicolon Date: Wed, 7 Mar 2007 11:15:56 -0000 Organization: MetaStack Solutions Ltd. Message-ID: <004a01c760a9$faaeaec0$6a7ba8c0@treble> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: Acdf1/Byvqn7x8xpRDyG99HjDgTQuwA0ROHQ In-Reply-To: <20070306110003.AE491BC70@yquem.inria.fr> X-Miltered: at concorde with ID 45EE9EEE.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; semicolon:01 debugging:01 parsing:01 parser:01 parser:01 semicolons:01 debugging:01 ocamlyacc:01 unset:01 ocamlc:01 compilation:01 ocamlyacc:01 exception:01 caml-list:01 exceptions:01 > I wish there was a way to get debugging output when a > Parsing.Parser_error exception is triggered as I can't figure out > what rule the parser is chocking on when I try an expression with two > semicolons at the end. Set the CAMLRUNPARAM environment variable to "p" and you will get debugging output of the automata including error recovery attempts that lead to Parse_error exceptions (see 10.2 in the manual). Be careful when you set it though: it debugs *all* automata generated with ocamlyacc so remember to unset it when running ocamlc or compilation will take some time! While it's a pretty primitive debugging aid, in combination with ocamlyacc -v I find it sufficient to diagnose most grammar errors... David