first doc commit

This commit is contained in:
Terence Parr 2015-10-27 17:12:01 -07:00
parent 8aac8e7157
commit 78fde76fc5
3 changed files with 55 additions and 0 deletions

BIN
doc/images/tpantlr2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

BIN
doc/images/tpdsl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

55
doc/index.md Normal file
View File

@ -0,0 +1,55 @@
# 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):
<img src=images/tpantlr2.png width=120>
<img src=images/tpdsl.png width=120>
<iframe class="youtube-player conf-macro output-block" type="text/html" style="width: 300px; height: 169px" src="//www.youtube.com/embed/OAoA3E-cyug?wmode=opaque" frameborder="0" data-hasbody="false" data-macro-name="widget">
</iframe>
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:
<object id="myFlashContent" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="169" class="conf-macro output-block" data-hasbody="false" data-macro-name="widget">
<param name="movie" value="//vimeo.com/moogaloop.swf?clip_id=59285751&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="wmode" value="opaque" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="//vimeo.com/moogaloop.swf?clip_id=59285751&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" width="300" height="169">
<param name="movie" value="//vimeo.com/moogaloop.swf?clip_id=59285751&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" />
<param name="allowFullScreen" value="true" />
<param name="allowscriptaccess" value="always" />
<param name="wmode" value="opaque" />
<!--<![endif]-->
<a href="https://get.adobe.com/flashplayer/">
<img src="https://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
## Sections
Getting Started with ANTLR v4
Grammar Lexicon
Grammar Structure
Parser Rules
Left-recursive rules
Actions and Attributes
Lexer Rules
Wildcard Operator and Nongreedy Subrules
Parse Tree Listeners
Parse Tree Matching and XPath
Semantic Predicates
Options
ANTLR Tool Command Line Options
Runtime Libraries and Code Generation Targets
Parser and lexer interpreters
Integrating ANTLR into Development Systems
You can also build ANTLR itself.