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 JAA14560; Fri, 23 Apr 2004 09:02:06 +0200 (MET DST) 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 JAA14961 for ; Fri, 23 Apr 2004 09:02:04 +0200 (MET DST) Received: from eris.rz.uni-saarland.de (eris.rz.uni-saarland.de [134.96.7.8]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i3N723YM015946 for ; Fri, 23 Apr 2004 09:02:03 +0200 Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.254.254]) by eris.rz.uni-saarland.de (8.12.10/8.12.10) with ESMTP id i3N6v1Ox29163217; Fri, 23 Apr 2004 08:57:01 +0200 (CST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.12.11/2003091100) with ESMTP id i3N6v0FR016563; Fri, 23 Apr 2004 08:57:01 +0200 (CEST) Received: from mail.st.cs.uni-sb.de (goscinny.cs.uni-sb.de [134.96.235.32]) by mail.cs.uni-sb.de (8.12.11/2004041400) with ESMTP id i3N6uxbI023982; Fri, 23 Apr 2004 08:57:00 +0200 (CEST) X-Authentication-Warning: email: Host goscinny.cs.uni-sb.de [134.96.235.32] claimed to be mail.st.cs.uni-sb.de Received: from [134.96.235.101] (jonagold.cs.uni-sb.de [134.96.235.101]) by mail.st.cs.uni-sb.de (Postfix) with ESMTP id A254C1BE19; Fri, 23 Apr 2004 08:56:59 +0200 (CEST) In-Reply-To: <4088A020.2000103@tfb.com> References: <4088A020.2000103@tfb.com> Mime-Version: 1.0 (Apple Message framework v613) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <659EACA3-94F3-11D8-A5C0-000A95DDB608@cs.uni-sb.de> Content-Transfer-Encoding: 7bit Cc: caml-list@inria.fr From: Christian Lindig Subject: Re: [Caml-list] Ocamlburg problem Date: Fri, 23 Apr 2004 08:56:51 +0200 To: rose@acm.org X-Mailer: Apple Mail (2.613) X-AntiVirus: checked by AntiVir Milter 1.0.6; AVE 6.25.0.2; VDF 6.25.0.26 X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; lindig:01 lindig:01 uni-sb:01 caml-list:01 ocamlburg:01 debugging:01 ocamlburg:01 debugging:01 inspect:01 cminusminus:01 qc--:01 uni-sb:01 int:01 int:01 width:98 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Apr 23, 2004, at 6:48 AM, Ken Rose wrote: > Does anyone have any experience debugging OCamlBurg code generators? > I'm getting an "Uncovered" exception, and I'm unable to figure out why > it's failing. Debugging tips, anyone? An Uncovered exception means, your subject tree cannot be matched with your rules - a rule is missing. In general it is quite difficult to argue that an existing set of rules in complete. For debugging our OCamlburg rules we have no magic bullet. When an Uncovered exception occurs we pretty print the subject tree and inspect it manually. Another trick is to have a set of rules in addition to the existing rules. These rules are constructed in way that they always cover the subject tree. For example, we are having rules for an "any" nonterminal to match a certain kind of expressions. any : True () {: cat [ "True" ] :} any : False () {: cat [ "False" ] :} any : Link(x, w:int) {: cat [ "Link(";x#mangled_text;",";width w;")" ] :} any : Late(string,w:int){: cat [ "Late(";string;",";width w;")" ] :} any : Bits(bits) {: cat [ "Bits(b)" ] :} any : Fetch (any, w:int){: cat [ "Fetch(";any;",";width w;")" ] :} any : Add(x:any, y:any) {: cat [ "Add(";x;", ";y;")" ] :} any : Sub(x:any, y:any) {: cat [ "Sub(";x;", ";y;")" ] :} any : Sx(any) {: cat [ "Sx(";any;")" ] :} any : Zx(any) {: cat [ "Zx(";any;")" ] :} any : Lobits(any) {: cat [ "Lobits(";any;")" ] :} These rules just follow the syntactical structure of the subject tree and thus we know it will always match. The semantic actions simply build a string of the subject tree. If you guard this set of rules with a high cost it will never match when your real rules can find a cover, but it matches otherwise and you won't get an Uncovered. You can find this code here: http://www.cminusminus.org/rsync/qc--/src/alpharec.nw -- Christian -- http://www.st.cs.uni-sb.de/~lindig/ ------------------- 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/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners