ANTLR

ANTLR Development Tools

There are plug-ins for Intellij, NetBeans, Eclipse, Visual Studio Code, and jEdit.

Intellij 12+ Plugin for ANTLR 4

We have a ANTLR v4 plugin for Intellij 12+. Features:

  • Syntax highlighting and syntax error checking
  • Navigation window
  • Code completion for tokens, rule names
  • Live grammar interpreter for grammar preview
  • Config per grammar, autobuild on save
  • Use the meta-key while moving the mouse and it will show you token information; click on the token that's underlined and it will show the location in the ANTLR grammar editor window of the grammar element that matched that token
  • Meta-j pops up a list of live templates, just like it does for Java programming
  • Ctrl-return, or whatever you have configured for the generate pop-up, will bring up a list of things you can generate
  • Alt-key while moving the mouse shows the region of input associated with parser rule that matched it
  • Clicking at the same time jumps the grammar to the associated rule. A pop up shows the parser call stack leading to that parse region.
  • Sophisticated profiler tab that shows ambiguities, lookahead depth, etc...

Sample usage showing Java grammar to the right.

ANTLRWorks2 and NetBeans Plugin for ANTLR 3 and 4

ANTLRWorks 2. This IDE is a sophisticated editor for ANTLR v3/v4 grammars as well as StringTemplate templates. It can run the ANTLR tool to generate recognizers and can run the TestRig (grun on command line) to test grammars. To integrate ANTLR-generated recognizers into your application, you will still need at least the runtime library.

ANTLR4 IDE Eclipse Plugin for ANTLR 4

Edgar Espina has created an Eclipse plugin for ANTLR v4. Features:

  • Advanced Syntax Highlighting
  • Automatic Code Generation (on save)
  • Manual Code Generation (through External Tools menu)
  • Code Formatter (Ctrl+Shift+F)
  • Syntax Diagrams
  • Advanced Rule Navigation between files (F3 or Ctrl+Click over a rule)
  • Quick fixes

AntlrDT Tools Suite for Eclipse

1. AntlrDT — an ANTLR v4 grammar editor and builder

  • full syntax-directed editor with outline view
  • hyperlinked navigation between rules and rule subterms
  • automatic builder with real-time problem feedback markers
  • ANTLR grammar and Java native code formatter
  • Parse Tree view – graphical visualization of generated parse trees
    • builds parse trees using full (non-interpreted) grammar builds and parsing
    • displays lexed tokens list and full parser/lexer errors list
    • supports use of custom token emitters, token factories, and error strategies
  • Paths view – graphical visualization of rule connectivity paths
    • shows all possible parse paths from the start rule to any other selected rule
    • particularly useful in the design of XVisitor grammars and ANTLR XPaths

2. XVisitorDT — an XVisitor grammar editor and builder

  • full syntax-directed editor with outline view
  • hyperlinked navigation between rules
  • automatic builder with real-time problem feedback markers
  • builder performs automatic visitor code generation
  • utilizes fully symbolic XPath-style rule path references
  • ANTLR grammar and Java native code formatter

3. StringTemplateDT — a StringTemplate v4 template editor

  • full syntax-directed editor with outline view
  • for template ('.st') and template group ('.stg') files

Update site: http://www.certiv.net/updates/

Visual Studio Code plugin for ANTLR 4

Mike Lischke created an ANTLR 4 plug-in for Visual Studio Code. Features:

  • Syntax coloring for ANTLR grammars (.g and .g4 files).
  • An own color theme, which not only includes all the recommended groups, but also some special rules for grammar elements that you don't find in other themes.
  • Parser generation on save.
  • Syntax and some semantic error checking (symbol matching)
  • Quick navigation via ctrl/cmd+click.
  • The symbol list for quick navigation (via shift+ctrl/cmd+O).
  • Hovers (tooltips) with symbol information.
  • Rule reference counts via code lens.
  • Railroad diagrams for all types of rules (parser, lexer, fragment lexer).
  • ATN graphs for all rule types. This is a visualization of the internal ATN that drives lexers + parsers. It uses D3.js for layout and interaction. Nodes can be repositioned with the mouse and you can drag and zoom the image. The transformation and position state is restored when reopening a graph.

jEdit plugin for ANTLR 4

The jEdit editor has a plugin with:

  • Syntax highlighting
  • Code navigation
  • Code generation
  • Error checking