| 1 |
# Frequently-Asked Questions (FAQ) |
| 2 |
|
| 3 |
This is the main landing page for the ANTLR 4 FAQ. The links below will take you to the appropriate file containing all answers for that subcategory. |
| 4 |
|
| 5 |
*To add to or improve this FAQ, [fork](https://help.github.com/articles/fork-a-repo/) the [antlr/antlr4 repo](https://github.com/antlr/antlr4) then update this `doc/faq/index.md` or file(s) in that directory. Submit a [pull request](https://help.github.com/articles/creating-a-pull-request/) to get your changes incorporated into the main repository. Do not mix code and FAQ updates in the sample pull request.* **You must sign the contributors.txt certificate of origin with your pull request if you've not done so before.** |
| 6 |
|
| 7 |
## Getting Started |
| 8 |
|
| 9 |
* [How to I install and run a simple grammar?](getting-started.md) |
| 10 |
* [Why does my parser test program hang?](getting-started.md) |
| 11 |
|
| 12 |
## Installation |
| 13 |
|
| 14 |
* [Why can't ANTLR (grun) find my lexer or parser?](installation.md) |
| 15 |
* [Why can't I run the ANTLR tool?](installation.md) |
| 16 |
* [Why doesn't my parser compile?](installation.md) |
| 17 |
|
| 18 |
## General |
| 19 |
|
| 20 |
* [Why do we need ANTLR v4?](general.md) |
| 21 |
* [What is the difference between ANTLR 3 and 4?](general.md) |
| 22 |
* [Why is my expression parser slow?](general.md) |
| 23 |
|
| 24 |
## Grammar syntax |
| 25 |
|
| 26 |
## Lexical analysis |
| 27 |
|
| 28 |
* [How can I parse non-ASCII text and use characters in token rules?](lexical.md) |
| 29 |
* [How do I replace escape characters in string tokens?](lexical.md) |
| 30 |
* [Why are my keywords treated as identifiers?](lexical.md) |
| 31 |
* [Why are there no whitespace tokens in the token stream?](lexical.md) |
| 32 |
|
| 33 |
## Parse Trees |
| 34 |
|
| 35 |
* [How do I get the input text for a parse-tree subtree?](parse-trees.md) |
| 36 |
* [What if I need ASTs not parse trees for a compiler, for example?](parse-trees.md) |
| 37 |
* [When do I use listener/visitor vs XPath vs Tree pattern matching?](parse-trees.md) |
| 38 |
|
| 39 |
## Translation |
| 40 |
|
| 41 |
* [ASTs vs parse trees](translation.md) |
| 42 |
* [Decoupling input walking from output generation](translation.md) |
| 43 |
|
| 44 |
## Actions and semantic predicates |
| 45 |
|
| 46 |
* [How do I test if an optional rule was matched?](actions-preds.md) |
| 47 |
|
| 48 |
## Error handling |
| 49 |
|
| 50 |
* [How do I perform semantic checking with ANTLR?](error-handling.md) |