From: Emmanuel <emmanuel.dieul@free.fr>
To: caml-list@inria.fr
Subject: -dparsetree option parsing
Date: Mon, 16 Apr 2007 10:39:21 +0200 [thread overview]
Message-ID: <1176712761.462336392b320@imp.free.fr> (raw)
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
reply other threads:[~2007-04-16 8:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1176712761.462336392b320@imp.free.fr \
--to=emmanuel.dieul@free.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox