I'm working on a Java application that uses ANTLR for lexing, parsing, and code generation. I recently started investigating RSyntaxTextArea to support editing my domain-specific languages.
I did not relish the prospect of learning JFlex and maintaining two versions of my grammars, and it also seemed that JFlex was a bit clumsy because of the required manual editing of the output. Because I already had a significant investment in ANTLR grammars, I tried defining my RSTA TokenMaker by wrapping the lexer produced by ANTLR. It was simpler than I expected. My custom token maker needed about 25 lines of code to implement getTokenList(), plus a few more lines in a method to map ANTLR token type codes (which are chosen by the lexer, not by the user) to RSTA token type codes.
I believe that ANTLR creates a recursive descent lexer, while JFlex creates a deterministic finite state machine lexer. I don't have enough information at this time to determine if that would have a significant performance impact.
If there is interest among the forum readers, I can put together a cleaned up and tested example to illustrate this approach. (My current version is still crude and not thoroughly tested; I may have overlooked some error conditions that should be caught.)
