[antlr-interest] Troubles with TokenString

Terence Parr parrt at cs.usfca.edu
Thu Jan 8 10:19:40 PST 2004


Hi. :)

Thanks for trying out the rewrite engine!  Wow. Must be some weird  
infinite loop in my toString().  I'm swamped at the moment, but could  
you try stepping through with a debugger in toString()?  It should be  
looping endlessly there.  Or, let it hang and then see if you can stop  
it to see where it's at.

Regards,
Ter

On Thursday, January 8, 2004, at 04:46  AM, lookee wrote:

> I'm an Italian studend and I'm working for a code restructuring tool  
> wich
> parallelize loops in java sources.
>
> I'm using antlr with TokenStringRewriteEngine to: cut, paste, modify  
> and
> replace chunk of code.
>
> I'm using TokenStringRewriteEngine (I know that it isn't full tested  
> tool) as
> showed in:
> "Syntax Directed TokenStream Rewriting"
> http://www.antlr.org/article/rewrite.engine/index.tml
>
> To reproduce my trouble on TokenStringRewriteEngine.toString(int, int)  
> method,
> I can use the code reported in the article:
>
> GenHdr.java
> tinyc.g
> input.c
> TokenStreamRewriteEngine.java
> TokenWithIndex.java
>
> The problem
> I'll modify ONLY one line to reproduce my problem in GenHdr.java
>
> if I change this line:
>
> System.out.print(rewriteEngine.toString());
>
> with:
>
> System.out.print(rewriteEngine.toString(0,rewriteEngine.getTokenStreamS 
> ize()));
>
> all works perfectly :-)
>
> but if put:
>
> System.out.print(rewriteEngine.toString(x,y));
> where x,y are two valid int index in  
> [0,rewriteEngine.getTokenStreamSize]
>
> system hang and output does not work properly :-(
>
> Can someone help me?
>
> -- 
> lookee
>
>
>
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
>  http://groups.yahoo.com/group/antlr-interest/
>
> To unsubscribe from this group, send an email to:
>  antlr-interest-unsubscribe at yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
>  http://docs.yahoo.com/info/terms/
>
>
>
--
Professor Comp. Sci., University of San Francisco
Creator, ANTLR Parser Generator, http://www.antlr.org
Co-founder, http://www.jguru.com
Co-founder, http://www.knowspam.net enjoy email again!
Co-founder, http://www.peerscope.com link sharing, pure-n-simple




 

Yahoo! Groups Links

To visit your group on the web, go to:
 http://groups.yahoo.com/group/antlr-interest/

To unsubscribe from this group, send an email to:
 antlr-interest-unsubscribe at yahoogroups.com

Your use of Yahoo! Groups is subject to:
 http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list