I'm trying to write a plugin to add Freemarker support to IntelliJ. Now I'd like to understand how to write a lexer for syntax highlighting. My issue is that if I look at Freemarker's source, their parser is written for JavaCC, not JFlex. Knowing that I haven't written a parser in a long time, I'm trying to find the best approach.
- is there a way to convert a .jj file into a .flex one
- is it possible to implement a lexer in JavaCC instead of JFlex (and are there examples of plugins doing so)?
- should I write a Flex parser from scratch?
What do you think?