Categories


Authors:
parrt

ANTLR v4 grammar plugin

Products: IntelliJ IDEA, RubyMine, WebStorm, PhpStorm, PyCharm, AppCode, Android Studio, 0xDBE, CLion, Rider

Vendor: ANTLR Project

Email:

Source code: https://github.com/antlr/intellij-plugin-v4

License: https://github.com/antlr...n-v4/blob/master/LICENSE

Bugtracker page

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
  • goto-declaration
  • 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.

Github source

Downloads: 63845
Rating:
Participated in rating: 4
Version Compatible builds Date
1.8 133 + 09.11.2015 Download
1.6 123.72 + 12.01.2015 Download
11 updates are hidden show all updates
Screenshot #14519
Screenshot #14512
Screenshot #14350
Screenshot #14614
Screenshot #14507
Screenshot #14506
Screenshot #14351
Screenshot #14352

Recent change notes

1.8 release; extract / inline rules refactorings; hierarchy parse tree view. Works with all jetbrains platforms, 13.x-15.x Intellij.

Comments:

Anonymous
Rated:
2015-12-26 00:44:50
This is my tool of choice when fiddling with antlr grammars, love it!
.
Anonymous
Rated:
2015-02-14 13:29:44
Pretty nifty alternative to ANTLRWorks if you are an IDEA user. Very helpful for visualizing grammars! Thanks!
.
Anonymous
Rated:
2014-10-26 19:55:05
.
bkiers
Rated:
2014-03-22 02:14:47
Great plugin! I love the fact you can dynamically test the generated parser by typing some input source that should be parsed and immediately see the parse tree. Really cool!
.
parrt
2014-02-25 00:56:34
.