antlr/doc/index.md

52 lines
2.2 KiB
Markdown
Raw Normal View History

2015-10-28 08:12:01 +08:00
# ANTLR 4 Documentation
Please check Frequently asked questions (FAQ) before asking questions. The main wiki page is also useful.
*Copyright © 2012, The Pragmatic Bookshelf. Pragmatic Bookshelf grants a nonexclusive, irrevocable, royalty-free, worldwide license to reproduce, distribute, prepare derivative works, and otherwise use this contribution as part of the ANTLR project and associated documentation.*
This text was copied with permission from the [The Definitive ANTLR 4 Reference](http://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference), though it is being morphed over time as the tool changes. Links in the documentation refer to various sections of the book but have been redirected to the general book page on the publisher's site. There are two excerpts on the publisher's website that might be useful to you without having to purchase the book: [Let's get Meta](http://media.pragprog.com/titles/tpantlr2/picture.pdf) and [Building a Translator with a Listener](http://media.pragprog.com/titles/tpantlr2/listener.pdf). You should also consider reading the following books (the vid describes the reference book):
2015-10-28 08:19:06 +08:00
<a href=""><img src=images/tpantlr2.png width=120></a>
<a href=""><img src=images/tpdsl.png width=120></a>
<a href="https://www.youtube.com/watch?v=OAoA3E-cyug"><img src=images/teronbook.png width=250></a>
2015-10-28 08:12:01 +08:00
This documentation is a reference and summarizes grammar syntax and the key semantics of ANTLR grammars. The source code for all examples in the book, not just this chapter, are free at the publisher's website. The following video is a general tour of ANTLR 4 and includes a description of how to use parse tree listeners to process Java files easily:
2015-10-28 08:19:06 +08:00
<a href="https://vimeo.com/59285751"><img src=images/tertalk.png width=200></a>
2015-10-28 08:12:01 +08:00
## Sections
Getting Started with ANTLR v4
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Grammar Lexicon
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Grammar Structure
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Parser Rules
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Left-recursive rules
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Actions and Attributes
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Lexer Rules
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Wildcard Operator and Nongreedy Subrules
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Parse Tree Listeners
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Parse Tree Matching and XPath
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Semantic Predicates
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Options
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
ANTLR Tool Command Line Options
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Runtime Libraries and Code Generation Targets
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Parser and lexer interpreters
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
Integrating ANTLR into Development Systems
2015-10-28 08:19:06 +08:00
2015-10-28 08:12:01 +08:00
You can also build ANTLR itself.