AST: inserting comments and blank lines [message #242876] |
Fri, 13 April 2007 20:20 |
Eclipse User |
|
|
|
Originally posted by: myawn.ebay.com
I've been reading through some earlier posts and bugzilla discussions
regarding comment handling, and just wanted to see if there was anything
new I might have missed. Because what I've read so far doesn't give me
much hope that I can do this via AST (and the whole point of using AST
is I don't really want to start manipulating my source file as just a
big character stream).
Is there a way to:
- Insert comments into the AST tree. This would most likely be a line
comment style, inserted just before insertion of a block of
FieldDeclarations or VariableStatementDeclarations.
- Insert blank lines into the AST tree, to visually separate the blocks
of declarations
So what I'm trying to accomplish is to be able to emit:
// notes about the following declarations go here
MyType fielda = . . .
MyType fieldb = . . .
MyOtherType fieldc = . . .
// Now another comment about more fields
YourType fieldd = . . .
code continues . . .
It seems the answer is "it doesn't work that way", but I've been wrong
before, and I'm hoping this is another one of those times :-)
Mike
|
|
|
Powered by
FUDForum. Page generated in 0.02401 seconds