[antlr-interest] Using extra channels
Terence Parr
parrt at cs.usfca.edu
Mon Mar 23 11:35:15 PDT 2009
On Mar 23, 2009, at 11:30 AM, Sam Barnett-Cormack wrote:
> Hi all,
>
> We all (generally) use the default and hidden channels. What if I
> wanted
> there to be another channel which, usually, doesn't get used, but if I
> want to tune to it as well I won't get the actual whitespace? Say for
> tokens that you mostly won't be interested in, but may want to
> programmatically choose to be interested in.
>
> Can I literally just define a new constant, MYCHANNEL, that's an int
> not
> of the same value as HIDDEN or whatever the default one is called, and
> use it as I would either of those?
Yep. channels are just ints. Parser can tune in/out on any channel it
ways.
Ter
More information about the antlr-interest
mailing list