Browse thread
-dparsetree option parsing
- Emmanuel
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2007-04-16 (08:39) |
From: | Emmanuel <emmanuel.dieul@f...> |
Subject: | -dparsetree option parsing |
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. "<list>" and to end a list with e.g. "</list>". 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