[antlr-interest] Not able to preserve formatting while saving the file
Monty Zukowski
monty at codetransform.com
Tue Jun 1 11:00:20 PDT 2004
This is not the easiest thing to do. Ter's answer using the
TokenStreamRewriteEngine assumes no trees, just a parser pass. There
is another article on preserving whitespace on antlr.org using hidden
token streams and attaching to the tokens.
In the C grammar I think I recorded the column and line info and would
add in the indentation and lines as needed when I was emitting a token
that wasn't at the current position.
Monty
On Jun 1, 2004, at 3:33 AM, swift_turtle_male wrote:
> Guys,
> Basically I have made a program, which will analyze the java code and
> suggest optimizations using the antlr tree structure. Now I wanted to
> expand the capabilities of automatically optimizing the existing java
> code, by changing the tree structure. Now Im able to make the
> modifications and save the file, but then I have got a major issue,
> wherein Im not able to preserve the original formatting of the java
> code. Can anyone help me with that ?
>
> Regards,
> Chunduru Anil Kumar
>
Monty Zukowski
ANTLR & Java Consultant -- http://www.codetransform.com
ANSI C/GCC transformation toolkit --
http://www.codetransform.com/gcc.html
Embrace the Decay -- http://www.codetransform.com/EmbraceDecay.html
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