Implement your own next token method. There are two functions, this one
and nextToken - copy them and make the change then install your pointer
before calling the lexer.

Jim

> -----Original Message-----
> From: [email protected] [mailto:antlr-interest-
> [email protected]] On Behalf Of A Z
> Sent: Thursday, April 14, 2011 8:03 AM
> To: [email protected]
> Subject: [antlr-interest] C target - Disabling lexer output for groups
> of tokens
>
> Is there way to persistantly switch the lexer output on or off? Channel
> assignments only last for one token. I know I can use skip() but then I
> have to add the same code to every lexer rule(I have hundreds) where it
> checks a boolean and then executes skip(). I also looked at changing
> the default channel but I don't how that can be done as the following
> isn't a function pointer that can be reassigned:
>
> ANTLR3_INLINE static pANTLR3_COMMON_TOKEN
> nextTokenStr        (pANTLR3_TOKEN_SOURCE toksource)
> {
> ...
>             lexer->rec->state->channel                        =
> ANTLR3_TOKEN_DEFAULT_CHANNEL;
> ...
> }
>
> Is there another way of doing this?
>
> Thanks
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-
> email-address

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to