>
> Antlr and JavaCC both have full java grammars as part of the
> distribution, and both create an AST with which you can do almost
> anything you want. Either create a self walking AST, or use Visitors
> to do various tasks. I highly recommend using a parser generator. And
> the ones for java are already done.
>
Exactly what I'm doing ;o) though the java.g that comes with Antlr seems to
handle some things a bit weirdly e.g. package org.apache.alexandria; parses
into
<package>
<dot>
<dot>
<dot>
<ident>org</ident>
</dot>
<ident>apache</ident>
</dot>
<ident>alexandria</ident>
</dot>
</package>
rather than:
<package>
<ident>org</ident><dot/>
<ident>apache</ident><dot/>
<ident>alexandria</ident>
</package>
but I've sorted that one now I just need to get it to not ignore white space
and comments. Also at the moment I'm using the parser tree generated by
Antlr to generate SAX events from which is something I was trying to get
away from which is why I'm using SAX rather than DOM. But at the moment it's
really just a proof of concept.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]