This plugin is for ANTLR v4 grammars and includes ANTLR 4.5.1. It works with Intellij 13.x-15. It should work in other Jetbrains IDEs. I have tested in PyCharm 4.5 and CLion 1.2.
- syntax highlighting
- syntax error checking
- semantic error checking
- navigation window
- find usages
- rename tokens
- rename rules
- comment grammar rule lines with meta-/ (1.7)
- grammar/comment folding (1.7)
- generates parser code; shortcut (ctrl-shift-G / meta-shift-G) but it's in Tools menu and popups.
- code completion for tokens, rule names;
- finds tokenVocab option for code gen if there is a tokenVocab option, don't warn about implicit tokens.
- handles separate parsers and lectures like TParser.g4 and TLexer.g4 (1.7)
- Parse tree nodes show the alternative number the parser chose to match that node. (1.7)
- has live grammar interpreter for grammar preview. Right click on rule and say "Test ANTLR Rule".
- view parse trees in hierarchy (sideways tree) view. (1.8)
- can view parse trees for input matched in more than one way (ambiguities) (1.7)
- can view lookahead trees to show how input directed ANTLR to match a particular alternative (1.7)
- changes to grammar seen in parse tree upon save of grammar.
- works with all Jetbrains IDEs (1.8)
- refactoring: extract rule, inline rule (1.8)
Generates code in /gen/package/YourGrammarRecognizer.java unless you override in the configuration dialog. Shortcut to generate parsers is ctrl-shift-G / meta-shift-G but it's in Tools menu, popups. Code completion for tokens, rule names. finds tokenVocab option for code gen if there is a tokenVocab option, don't warn about implicit tokens. shortcut conflicted with grammar-kit plugin. Has live grammar interpreter for grammar preview. Right click on rule and say "Test ANTLR Rule". Changes to grammar seen in parse tree upon save of grammar.
You can configure the ANTLR tool options per grammar file; right-click in a grammar or on a grammar element within the structured view. When you change and save a grammar, it automatically builds with ANTLR in the background according to the preferences you have set. ANTLR tool errors appear in a console you can opened by clicking on a button in the bottom tab.
You can use the ctrl-key while moving the mouse and it will show you token information in the preview editor box via tooltips.
Errors within the preview editor are now highlighted with tooltips and underlining just like a regular editor window. The difference is that this window's grammar is specified in your grammar file.
See README.md for more details.
For really big files and slow grammars, there is an appreciable delay when displaying the parse tree or profiling information.