Automate class generation on build


I'm writting a custom language plugin.

For generating lexer classes and psi classes, I use to

- right click on the .bnf file -> generate parser code
- right click on the .flex file -> run jflex generator

Is there a way to add these 2 tasks to the build process ?

1 comment
Comment actions Permalink


There's no automation at the moment. The reason behind that is:

The generated JFlex file is really a stub and not a production-grade lexer definition.
Just one state for all keywords and puntuation symbols.
Real world languages require multiple-state lexers with more complex lexer rules than that.

The proposed workflow is to generate JFlex file just once and re-run JFlex generator only when the lexing structure needs to be updated.


Please sign in to leave a comment.