At 23:13 3/09/2008, Kausch, Robert wrote:
>You can ignore tokens by sending them on a different channel.
The
>following grammar ignores everything that is not 'okko' and
works
>for me:
>
>grammar test;
>
>start: (T1)*;
>
>T1: 'okko';
>T2: ~(T1) { $channel = HIDDEN; } ;
T1 is a sequence. ~ is intended to operate on sets (alternatives
of single characters/tokens). Odd things happen if you try to use
~ on a sequence. (It does actually compile, but it doesn't run
properly.)
Using "T2: .;" ought to work, though. Or just making it a
filtering lexer.
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/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
-~----------~----~----~----~------~----~------~--~---