[antlr-interest] Does the C runtime support token rewrite?

Andy Grove andy.grove at codefutures.com
Sun Apr 12 09:59:26 PDT 2009


My grammar defines whitespace as:

Whitespace : ( '\t' | ' ' | '\r' | '\n' )+ 	{ $channel = HIDDEN; }
	;

Do you know how I can access tokens on the hidden channel in C? I also  
generate Java parser from the same grammer and the whitespace tokens  
are available there.

Thanks,

Andy.

On Apr 12, 2009, at 10:45 AM, Kay Röpke wrote:

>
> On Apr 12, 2009, at 5:13 PM, Andy Grove wrote:
>
>> Could you give me some pointers on how to get a version of the token
>> stream including whitespace?
>
> are you by any chance discarding the whitespace tokens (and not only  
> placing them on a different channel)?
> iirc the vector you get by calling getTokens() is the internal one.
>
> i distinctly remember seeing "hidden" tokens in there just a few  
> hours ago.
>
> cheers,
> -k



More information about the antlr-interest mailing list