ANTLR (Another Tool for Language Recognition) is a parser, formerly known as PCCTS (Purdue Compiler Compiler Tool Set) that generates Java source code, alternatively C++ or C#. iDoc and NetBeans use it. The current version is 4.7 Last revised/verified: 2017-03-30 Version numbers are very important in ANTLR. Code written for one version will not work on another without modification. Version 4 was a complete redesign and rewrite. ANTLR is like JavaCC with jjTree built-in. There is strict separation of grammar and actions so you can use the same grammar with several different languages and applications. The official documentation I found quite daunting. I prodded Scott Stanchfield to write a tutorial based on the one he wrote for PCCTS. Unfortunately, it stops at recognition. It does not cover how you hook in your code to do something with the resulting parse tree. Generates LL(K) parsers. Same code base as JavaCC, but code is open. There are dozens of parser generators, but ANTLR seems to be the one where the action is. It has IntelliJ Idea support.
It keeps track of the exact offset in the original source where it found each token and each higher level syntactic match. You write Vistors and Listeners to do something with the various matches.
It is open source, available at GitHub using Git.
Here is an ANTLR sample, a piece of a Java parser written in ANTLR. You can see it is basically a type of BNF (Backus-Naur Form) crossed with regex.
recommend book⇒The Definitive ANTLR 4 Reference | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
by | Terence Parr | 978-1-934356-99-9 | paperback | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
birth | 1964-08-17 age:53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
publisher | Pragmatic Bookshelf | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
published | 2013-01-22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
It teaches you how to use ANTLR to write parsers. video about the book. Available in epub (for Kobo, iPhone/iPad, Android, eReaders) mobi (for Kindle) and PDF from the publisher. Though he is an academic, Parr is funny, unpretentious and fond of homely analogies. He wants to make sure you understand the big picture, not just the details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
recommend book⇒Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
by | Terence Parr | 978-1-934356-45-6 | paperback | |||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
birth | 1964-08-17 age:53 | B00A376HGG | kindle | |||||||||||||||||||||||||||||||||||||||||||||||||||||
publisher | Pragmatic Bookshelf | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
published | 2010-01-07 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
Design Patterns for creating parsers. Available in epub (for Kobo, iPhone/iPad android, eReaders) mobi (for Kindle), and PDF from the publisher. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. |
This page is posted |
http://mindprod.com/jgloss/antlr.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\antlr.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[3.145.183.207] |
| |
Feedback |
You are visitor number | |