[antlr-interest] Troubles with TokenString
lookee
luca at lookee.it
Thu Jan 8 04:46:27 PST 2004
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.getTokenStreamSize()));
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/
More information about the antlr-interest
mailing list