Yacc equivalent for Java

GNU Bison has a Java interface,

http://www.gnu.org/software/bison/manual/html_node/Java-Bison-Interface.html

You can use it go generate Java code.


There is also jacc.

Jacc is about as close to yacc as you can get, but it is implemented in pure java and generates a java parser.

It interfaces well with jFlex

http://web.cecs.pdx.edu/~mpj/jacc/


In the past, I've used ANLTR for both lexer and parser, and the JFlex homepage says it can interoperate with ANTLR. I wouldn't say that ANTLR's online documentation is that great. I ended up investing in 'The Definitive ANTLR reference', which helped considerably.


If you specifically want YACC-like behavior (table-driven), the only one I know is CUP.

In the Java world, it seems that more people lean toward recursive descent parsers like ANTLR or JavaCC.

And efficiency is seldom a reason to pick a parser generator.

Tags:

Java

Yacc