Currently my hand built lexer batch processes a file in one go and outputs the tokens. For highlighting I understand we want incremental relexing of the input buffer. Regarding this I had two questions:
1. Will my lexer get startoffset or endoffset which is in the middle of a token or a line, and hence should be able to deal with invalid input i.e. mark it as invalid or something similar? What problems can occur if I just reinitialize the lexer and start indexing the modified code snippet as a new code snippet?
2. Can I plugin a lexer to Intellij IDEA anywhere else apart from the standard Lexer interface to enable highlighting, PSI building etc?
I am using Intellij Idea 9.0.3