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.
[フレーム]
| [画像:book cover] | recommend book⇒The Definitive ANTLR 4 Referenceto book home | |||
| 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. | ||||
| Online bookstores carrying The Definitive ANTLR 4 Reference
Australian flag
abe books anz
abe books.ca
Canadian flag
German flag
abe books.de
amazon.ca
Canadian flag
German flag
amazon.de
Chapters Indigo
Canadian flag
Spanish flag
amazon.es
Chapters Indigo eBooks
Canadian flag
Spanish flag
iberlibro.com
abe books.com
American flag
French flag
abe books.fr
amazon.com
American flag
French flag
amazon.fr
Barnes & Noble
American flag
Italian flag
abe books.it
Nook at Barnes & Noble
American flag
India flag
junglee.com
Google play
American flag
UK flag
abe books.co.uk
O’Reilly Safari
American flag
UK flag
amazon.co.uk
Powells
American flag
UN flag
other stores
| ||||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
| [画像:book cover] | recommend book⇒Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languagesto book home | |||
| 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. | ||||
| Online bookstores carrying Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages
Australian flag
abe books anz
abe books.ca
Canadian flag
German flag
abe books.de
amazon.ca
Canadian flag
German flag
amazon.de
Chapters Indigo
Canadian flag
Spanish flag
amazon.es
Chapters Indigo eBooks
Canadian flag
Spanish flag
iberlibro.com
abe books.com
American flag
French flag
abe books.fr
amazon.com
American flag
French flag
amazon.fr
Barnes & Noble
American flag
Italian flag
abe books.it
Nook at Barnes & Noble
American flag
India flag
junglee.com
Google play
American flag
UK flag
abe books.co.uk
O’Reilly Safari
American flag
UK flag
amazon.co.uk
Powells
American flag
UN flag
other stores
| ||||
| Greyed out stores probably do not have the item in stock. Try looking for it with a bookfinder. | ||||
Optional Replicator mirror
of mindprod.com
on local hard disk J: