ANTLR 4 $channel = HIDDEN and options
The v4 equivalent would look like: COMMENT : ( ‘//’ ~[\r\n]* ‘\r’? ‘\n’ | ‘/*’ .*? ‘*/’ ) -> channel(HIDDEN) ; which will put all single- and multi line comment on the HIDDEN channel. However, if you’re not doing anything with these HIDDEN-tokens, you could also skip these tokens, which would look like this: COMMENT … Read more