* -dparsetree option parsing
@ 2007-04-16 8:39 Emmanuel
0 siblings, 0 replies; only message in thread
From: Emmanuel @ 2007-04-16 8:39 UTC (permalink / raw)
To: caml-list
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-04-16 8:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-16 8:39 -dparsetree option parsing Emmanuel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox