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 BD060BC0A for ; Mon, 16 Apr 2007 10:39:21 +0200 (CEST) Received: from smtp5-g19.free.fr (smtp5-g19.free.fr [212.27.42.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3G8dLw6022842 for ; Mon, 16 Apr 2007 10:39:21 +0200 Received: from imp3-g19.free.fr (imp3-g19.free.fr [212.27.42.3]) by smtp5-g19.free.fr (Postfix) with ESMTP id 5341943411 for ; Mon, 16 Apr 2007 10:39:21 +0200 (CEST) Received: by imp3-g19.free.fr (Postfix, from userid 33) id 410EF124E0; Mon, 16 Apr 2007 10:39:21 +0200 (CEST) Received: from ulysse.matra-transport.fr (ulysse.matra-transport.fr [194.117.219.2]) by imp.free.fr (IMP) with HTTP for ; Mon, 16 Apr 2007 10:39:21 +0200 Message-ID: <1176712761.462336392b320@imp.free.fr> Date: Mon, 16 Apr 2007 10:39:21 +0200 From: Emmanuel To: caml-list@inria.fr Subject: -dparsetree option parsing MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.5 X-Originating-IP: 194.117.219.2 X-Miltered: at concorde with ID 46233639.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; parsing:01 ocamlc:01 printast:01 ptyp:01 ptyp:01 printast:01 ocamlc:01 patched:01 compilation:01 constructors:01 camlp:01 constructor:01 constructor:01 functions:01 grammar:01 Hi everyone, I'm currently working on the AST printed by the -dparsetree ocamlc option. I'm using javacc to parse this AST and I'm currently confronted to an ambiguous grammar. Let's take the core_type example (3.09.3 version). The module printast.ml says the Ptyp_class constructor of core_type can end with a list of core_type and a list of strings. Let c1 be a Ptyp_class value. If the last element of the list of core_type of c1 is a Ptyp_class (called c2), there are two consecutive list of strings: one ending c2 and one ending c1. These two lists cannot be dissociated. This kind of ambiguity appears several times (javacc reports 16 warnings). So, one solution could be: modify the function "list" (and eventually other list printing functions) of the printast.ml module to start a list with e.g. "" and to end a list with e.g. "". Is it possible to include this kind of modification for the future release of ocamlc ? If this modification of the printast.ml module is done, is it enough to produce a patched ocamlc with a compilation from the sources ? I also noticed that some values of the AST are not printed by the -dparsetree option. For example, the class_type_field has a constructor Pctf_virt. When it's printed the third component "ct" is omitted. This choice is encountered several times for other constructors in the printast.ml module. Is it for camlp4 purposes ? Thanks, Manu