The Java Compiler Compiler (JavaCC)
is an open source (as of June 2003) parser generator for Java applications.
Using a defined grammar, JavaCC can produce java code that recognises matches
to the grammar.
JavaCC also includes a tool called JJTree which allows a
generated parser to produce syntax trees.
Theodore Norvell at the Memorial University of Newfoundland in Canada,
maintains a FAQ for
issues related to using JavaCC.