Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I remove ANTLR dependencies from generated code?

Tags:

java

antlr

antlr3

ANTLR generates java source from the grammar file. Generated source has dependency to ANTLR classes.

Can I generate 'clean' java sources using ANTLR, that do not have any antlr - dependecy?

If not, can someone recommend some java parser that excels with performances and can produce clean java code?

like image 862
igr Avatar asked Nov 21 '11 14:11

igr


1 Answers

It really isn't practical to remove runtime dependencies on ANTLR. You need to distribute the ANTLR runtime library with your recognizers.

If I remember correctly, JavaCC creates a copy of the necessary runtime classes (the JavaCC "boilerplate") as part of the "generated" code, so that you don't need to include an additional JAR.

What is the root of your concern about the ANTLR dependencies?

like image 56
erickson Avatar answered Sep 25 '22 06:09

erickson