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

Andy Grove andy.grove at codefutures.com
Sun Apr 12 08:13:20 PDT 2009


Jim,

Thanks. I went ahead and wrote my own TokenRewriteStream (happy to  
contribute if you want it, it is very simple) and it is working fine  
other than the fact that I am not getting whitespace tokens from the  
original token stream. I am iterating over the 'tokens' vector in  
pANTLR3_COMMON_TOKEN_STREAM).

Could you give me some pointers on how to get a version of the token  
stream including whitespace?

Thanks,

Andy.

On Apr 1, 2009, at 12:45 PM, Jim Idle wrote:

> Andy Grove wrote:
>> I am using a subset of the token rewrite in Java actions called from
>> the generated parser and I need to get the same functionality working
>> in C. The Java code is using the following methods from the
>> TokenRewriteStream class:
>>
>> public void insertAfter(int i, java.lang.Object o)
>> public void replace(int i, java.lang.Object o)
>> public void delete(org.antlr.runtime.Token token) {
>>
>> Is there equivalent functionality in the C runtime? I couldn't see it
>> there. If not, how can I go about achieving this in C?
>>
> The token rewrite stream is not yet implemented in C. Ter is  
> eventually
> going to change some of the algorithms I think and so far nobody has
> asked for it.
>
> Jim
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address



More information about the antlr-interest mailing list