HJW
HJW

Reputation: 23443

New to ANTLR: What is the difference between ANTLR and JavaParser

I am looking for a Java source code parser and came across JavaParser, however i noticed that there is a lack of documentation such that i can't really explore all the options of the library.

At the same time, i have come across another such library - ANTLR, may i know if anyone has experience working with ANTLR, whether ANTLR == JavaParser?

JavaParser ANTLR

Upvotes: 1

Views: 1113

Answers (2)

bn.
bn.

Reputation: 7949

I would recommend reading Terence Parr's book: Language Implementation Patterns.

I won't rehash the book and his/ANTLR's website content here, but my understanding, or "take away" if you like, is that JavaParser, built on JavaCC is considered a great tool, but is not as robust, nor does it have the user community and tooling (ANTLRWorks) that ANTLR does. ANTLR is also a very powerful tool allowing you to create parser generators, specifically LL(*) recursive decent parsers and others as well.

Also ANTLR is also licensed under BSD, while JavaParser falls under the GNU Lesser GPL license.

My preference would be ANTLR.

Upvotes: 3

sarnold
sarnold

Reputation: 104080

ANTLR grew from the old PCCTS project, and has been under constant growth since 1988 or so. Java was a "recent" addition in the scale of ANTLR's lifetime.

JavaParser grew from JavaCC, which has always lived its life in Java-land.

Upvotes: 2

Related Questions