Grammar-Kit

Compatible with  IntelliJ IDEA
20.07.2016
26 489
BNF Grammars and JFlex lexers editor. Readable parser/PSI code generator.

Download plugin

Version

Update date

Recent change notes

1.4.2

  • JFlex: more color options & better AST
  • Generator: meta rule parameter as 'recoverWhile' predicate
  • Generator: support 'extends' with 'upper' and 'external' modifiers
  • Generator/PSI: fix for fake rules PSI accessors calculation
  • Generator/PSi: improved methods/classes names generation logic
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
01.07.2015
Could you extend it EBNF grammar?
23.11.2013
Thanks for this great plugin! It makes development of custom language parsers so much easier!
20.08.2013
Very helpful.
16.12.2011
Thank you. Left-recursion detection is added to 1.0.1 version.
15.12.2011
Thanks for the plugin, it's a very helpful plugin to simplify the development of custom parsers.
The generator accepts left-recursive rules, which do not make sense in PEG parsers (afaik). Is it possible to highlight this type of rules in the .bnf editor?
Please  sign in  to leave a comment.