Coloring all rule occurrences [message #840823] |
Tue, 10 April 2012 14:55 |
Mikko Korpela Messages: 9 Registered: April 2012 |
Junior Member |
|
|
Hi,
I've used the example in 2.1.0 documentation (semantic higlight) [would have link to documentation here but I've not yet posted 25 times..] to highlight different parts of my dsl.
The code I've made is ugly. I have different kinds of crossreferences and I would like to have different colorings based on the rule they match to.
For example:
INode n = ..
if (n.getGrammarElement() instanceof CrossReference) {
if(((RuleCall) ((CrossReference) n.getGrammarElement()).getTerminal()).getRule().getName().equals("MacroName")) {
do the coloring for MacroName rule..
... More bad code
Could someone show how to do the thing in a nice way (a link to an example code would be nice) ? I'm hoping for something declarative that I can just say that whenever I have some MacroName use the specified color for MacroName.
Kind Regards,
Mikko Korpela
|
|
|
Powered by
FUDForum. Page generated in 0.03099 seconds