I'm working on CSS editor and I need to highlight selectors.
This is parser rule in ANTLR
selectors
: selector (COMMA selector)*
;
selector
: simple_selector_sequence (combinator? simple_selector_sequence)*
;
and so on... As you can see selectors rule contains antother rules so I cannot simply colorize one type of token.
I belive the best way is to set one type to every token in selectors rule. And then colorize only tokens with this type. But i don't know how to do this.