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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id E5BC0BC69 for ; Tue, 6 Mar 2007 01:55:25 +0100 (CET) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l260tP3f003433 for ; Tue, 6 Mar 2007 01:55:25 +0100 Received: by ug-out-1314.google.com with SMTP id k3so22151ugf for ; Mon, 05 Mar 2007 16:55:25 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=Pa5dvSLHZeJ01lFYKHDpfoFQLNnSv+0T7SOYZ4rHWjbLw2K6F5GnNxAv7hNgXoqnxkjHrbQbYe9NpMeeBMMkhfwq843T5JCeNNUG5NwOymNz2+5+YKy/4TgFg6q1e6TrmFRaXjMUDNqFrpyWyTgSQ4I5hM8mEvUY/KAdv6OcXDU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer; b=ofNpFMaDEx+cH4eqk8e8FgUdvJA5JuSPUngVddjprnER2RaBx6kkYqBRiMaXytkjUSaGKlZMGIyQjLfN6GNIwJSMUqyx3/NX6TKLbex2WeqhhmKfEIaRRzB/rGrUmFQEc1kzZNGhlFD2aip0VVEINKdNM29w8Acco0cHJnXQ/ss= Received: by 10.66.221.6 with SMTP id t6mr288634ugg.1173142525164; Mon, 05 Mar 2007 16:55:25 -0800 (PST) Received: from ?192.168.1.33? ( [83.53.109.173]) by mx.google.com with ESMTP id b23sm78718ugd.2007.03.05.16.55.23; Mon, 05 Mar 2007 16:55:24 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v752.3) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: caml-list@inria.fr From: Joel Reymont Subject: Catching a double semicolon Date: Tue, 6 Mar 2007 00:55:27 +0000 X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 45ECBBFD.000 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 45ECBBFD.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; semicolon:01 semicolon:01 debugging:01 parsing:01 parser:01 parser:01 semicolons:01 syntax:01 syntax:01 exception:01 grammar:01 expression:02 output:02 clause:03 catching:04 Folks, Any idea how to catch a double semicolon in the decs rule of this grammar? 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. I know it's chocking on a semicolon because when I insert a "catch all" error clause into the sections rule the error location points to it. The rules below are working fine since my tests pass. program: sections { $1 } sections: | section EOF { $1 } | sections section EOF { $1 @ $2 } | EOF { [] } section: | decs { List.rev $1 } | statements { List.rev $1 } decs: | declarations SEMI { $1 :: [] } | decs declarations SEMI { $2 :: $1 } declarations: | input_declarations { $1 } | var_declarations { $1 } | array_declarations { $1 } input_declarations: | INPUT COLON input_decs { InputDecs (List.rev $3) } | INPUT COLON input_decs error { syntax_error "Missing semicolon" 4 } | INPUT COLON error { syntax_error "Nothing after INPUT:" 3 } | INPUT error { syntax_error "Missing ':' after INPUT" 2 } Thanks, Joel -- http://wagerlabs.com/