Plugin Icon if
  • Tools Integration

ANTLR v4

Обновлено:
5 месяцев назад
Версия:

1.24

Обзор
Версии

Обзор

This plugin is for ANTLR v4 grammars and includes ANTLR 4.13.2. It works with 2022.3 and above. It should work in other JetBrains IDEs.

  • 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)
  • save parse trees as svg/jpg/png; right click in parse tree view (1.9)
  • 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 lexers 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". Please noteThat actions and semantic predicates in the grammar or not executed during this preview!
  • 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), dup rule to make refs unique

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.mdfor more details.

For really big files and slow grammars, there is an appreciable delay when displaying the parse tree or profiling information.

Github source

Версии

Версия
Диапазон совместимости
Дата обновления
2024
1.24
240+
06.10.2024
Скачать
Plugin ID:
org.antlr.intellij.plugin
icon