Grammar-Kit

Compatible with IntelliJ IDEA
22.05.2017
36 012
BNF Grammars and JFlex lexers editor. Readable parser/PSI code generator.

Download plugin

Recent change notes

  • Generator: disable first-check in presence of external predicates
  • Generator: support mixed AST-PSI trees (psi.impl.source.tree.CompositePsiElement inheritors)
  • Generator: add generate=[psi-classes-map="yes" option
  • Generator: alert of missing psi implementation methods #155
  • Generator: merge multiple list-valued attributes, e.g. "implements", "methods"
Full change log...

General usage instructions

1. Create grammar *.bnf file, see grammars/Grammar.bnf in the plugin code

2. Tune the grammar using Live Preview + Structure view (ctrl-alt-P / meta-alt-P)

3. Generate parser/ElementTypes/PSI classes (ctrl-shift-G / meta-shift-G)

4. Generate lexer *.flex file and then run JFlex generator (both via context menu)

5. Implement ParserDefinition and add the corresponding registrations to the plugin.xml

6. Mix-in resolve and other non-trivial functionality to PSI