Building PSI tree without Grammarkit


Is there documentation somewhere on how to build a PSI tree *without* using GrammarKit? I am trying to build a plugin for a language based on the tokenizing/AST information I get from an external tool. That is, I would like to build the PSI tree with information I already have instead of having Grammar-Kit generate a parser.


You can totally implement Lexer and Parser without GrammarKit, but there is no general documentation on how to implement this “manually”.

There are some hand-written parsers in IntelliJ Community sources, e.g. in Java plugin see package.