BNF Rule Syntax Highlighting for Custom Language

I posted this question to Stack Overflow and then discovered this forum.  If you could help it would be much appreciated!

I'm trying to develop a custom language plugin for IntelliJ using the Grammar-Kit plugin. I am easily able to provide syntax highlighting for tokens defined, but I cannot figure out how to highlight at the element or token-parent level. Linked below is a simplified grammar and syntax highlighter which works for tokens (comment, variable, etc.) but does not work for rules/elements (operator, command, etc.).

Because of the ridiculous amount of code it takes to do this, I've pushed the simplified example to GitHub to give more context for the question - https://github.com/carymrobbins/intellij-plugin-example

I don't see code quoting in the menu, so I won't paste any code.  If you use the github link above, you can reference primarily these two files -

  • src/com/simpleplugin/Simple.bnf
  • src/com/simpleplugin/SimpleSyntaxHighlighter.java

If you are interested in what I am actually working on, you can find it here - https://github.com/carymrobbins/intellij-haskforce

Thanks again and best regards!

Cary
1 comment
Comment actions Permalink

You need an Annotator for that.

Here's the explanation: Syntax Highlighting and Error Highlighting

0

Please sign in to leave a comment.