[gcjx] Generalise visitor
Ranjit Mathew
rmathew@gmail.com
Thu Oct 6 18:17:00 GMT 2005
-----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-----
More information about the Java-patches
mailing list