This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gcjx] RFC/RFA: A Simple Pretty-Printer for the AST (WIP)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Tromey wrote:
> 
> Ranjit>   I am attaching a work-in-progress implementation of a simple
> Ranjit> pretty-printer for the AST. 
> Ranjit> Comments? OK to apply?
> 
> I think it is fine.  Thanks for doing this.
> Feel free to check in future dumper changes with just an 'fyi' note.

Thanks. I've checked in this initial implementation.


> Ranjit> +    modifier_t mods = field->get_modifiers ();
> Ranjit> +    if ((mods & ACC_PUBLIC) != 0)
> Ranjit> +      out << " PUBLIC";
> 
> Maybe a helper function to print this stuff?

Of course! I added that.


> You may also want to \-quote "weird" characters in string literals.
> Kind of a pain though.

I am procrastinating on this one for the moment.

I forgot to mention an oddity here - if you notice, there are
lots of:

  if (ref_foo_object)
    descend (ref_foo_object.get ());

here and ref_foo.get() is not supposed to be kosher. However,
I had first implemented a descend( const ref_element &bar) which
was working fine till I encountered an owner<model_foo> where
the VALUE was a NULL pointer. In this case, the assert_cast
to convert an owner<model_foo> to owner<model_element> fails
and aborts the program.

I do not know if having an owner<model_foo> with a NULL VALUE
is a genuine bug or a "feature", but this was the reason I had
to drop this variant of the descend() method.

Thanks,
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

iD8DBQFDSHiuYb1hx2wRS48RAl1jAJwOxN8Im8dzjk1u9Hl4IwDNle3XLQCdEnAq
nSSP0lOk3DaXl7vcreg9j/s=
=QIN5
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]