This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: [gcjx] Generalise visitor
- From: Ranjit Mathew <rmathew at gmail dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 06 Oct 2005 23:39:53 +0530
- Subject: Re: [gcjx] Generalise visitor
- Openpgp: url=http://ranjitmathew.hostingzero.com/aa_6C114B8F.txt
- References: <di3nru$91s$1@sea.gmane.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ranjit Mathew wrote:
> Hi,
>
> I wanted to implement an equivalent of debug_tree() for GCJX, but
> found that the current visitor does not accept all model element
> tree nodes. The attached patche make model_element provide a
> visit() method and extends visitor to accept a few more classes.
Ugh! I meant "The attached patch makes...".
"dump.cc" provides a single "dump_method()" method and a helper
class that implements the visitor interface over the model
elements. However, it is inconvenient to fetch a model_method *
every time you want to examine a portion of the AST and the
output would be unwieldy in some cases too.
My plan is to replace dump_method() with a more general
dump_tree(), but that means model_element being able to accept
a visitor and the visitor interface providing for a method
for a model_element, etc. Hence the need for this patch
before I can implement dump_tree().
Ranjit.
- --
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.hostingzero.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDRWhxYb1hx2wRS48RAiM5AJ4+ZohANtUg7ELwA4YkjjHO3CIBFQCdFpvO
Sk/N0D2qWEOOVelWCt/m0NM=
=A611
-----END PGP SIGNATURE-----