Let's say I have two rules like the below:
printable_characters : '\u0020' .. '\uFFEF' ;
newline_characters : '\n' | '\r' ;
Now let's say that I want to make a new rule called printable_no_newlines
. I would like to do this by subtracting newline_characters
from printable_characters
like so:
printable_no_newlines : printable_characters - newline_characters ;
That syntax doesn't work in ANTLR3 but does anyone know what the best way would be to emulate this without re-typing the entire rule?