Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion Gogland DataGrip Rider MPS Android Studio
Sep 24, 2017
37 972
BNF Grammars and JFlex lexers editor. Readable parser/PSI code generator.

Download plugin

Recent change notes

  • Plugin: switch to IntelliJ IDEA versioning scheme
  • BNF and JFlex PSI: merge AST and PSI trees (memory/performance)
  • Generator: support dash-separated and angle-quoted rules
  • Generator: "psi-factory" support for merged AST and PSI trees
  • Generator: honor explicitly set rule name
  • Generator: fix freeze on generation several grammars at once
  • Generator: fix custom consume-type not being used after a predicate
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