This is the first post in a series of blog posts describing the process of creating an IntelliJ IDEA plugin for Garmin Connect IQ.
Setting up IntelliJ IDEA for plugin development is quite well documented in the IntelliJ Platform SDK DevGuide. Only things that I would add is installing plugins Grammar-Kit and PsiViewer, which are both available in the official plugins repository.
Grammar-Kit enables us to write the language grammar in a variant of BNF (Backus-Naur Form) and then generate java classes for parsers, element types and PSI (Program Structure Interface). It also allows us to generate JFlex-compatible lexer definition file (*.flex) from the grammar. JFlex is a lexical analyzer generator (also known as scanner generator) for Java. JFlex lexer is based on deterministic finite automaton. After the .flex file generation you use the JFlex generator (also bundled with the Grammar-Kit plugin). The plugin also features live preview where we can type in our language and see the parsing result immediately.read on