I am working on creating a psi tree from binary data. The binary files in question are of known format, and contain any number of "records". The goal is to read in the bytes of the file, creating the psi elements/tree as we go, and then be able to provide support for something like say, the Structure tool window.
For example, perhaps the psi tree for one of these files would simply have a root file element, and 10 child record elements.
I understand the process of creating a plugin which supports a new language, for a new file type, and defining the lexer and parser for that language. However, I am hoping to be able to accomplish this task without a lexer or parser (I am just reading bytes), going straight from the binary data to psi.
Any suggestions on how best to implement this within the IntelliJ framework? I am particularly struggling with where in the process the reading of the binary data from the file (and psi creation) should occur, because it seems like I am trying to accomplish something manually that is all handled "automatically" when you have a lexer and parser for a language and file with ascii text.
Should this be done in the IFileElementType.parseContents? Any help is appreciated.