[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-dev
Subject:    Re: [groovy-dev] Re: Access to comments in sourcecode after parsing
From:       Guillaume Laforge <glaforge () codehaus ! org>
Date:       2012-07-10 18:10:41
Message-ID: CAJ2HCd8JhDt43KSyKJAdTaio46hamKC-vjM11=Sr3Ug1EiENTw () mail ! gmail ! com
[Download RAW message or body]

Out of curiosity, why are you building a Groovy code formatter?
It might be handy as a reusable project, for an Ant task, a Gradle plugin,
etc.

The Groovy AST indeed doesn't keep comments.
Perhaps you should look at the flow of tokens from Antlr, at the CST level
instead.

It also depends on how far you want to go with formatting.
Is it really just for, well, formatting, or do you also plan to have some
syntax highlighting for example with semantic coloring as well?
Do you want as far as supporting tons of formatting options? (like aligning
variable declarations and assignments and what not)

Guillaume

On Tue, Jul 10, 2012 at 7:09 PM, miho <info@michaelhoffer.de> wrote:

> I am trying to write an IDE independent Groovy code formatter based on
> Groovys AST API. Therefore, I looked at AstNodeToScriptVisitor in
> groovy-core. I have realized that comments cannot be handled that way. Is
> there a common code base somewhere in groovy core that I can use? Or is
> that
> all reinvented for each IDE plugin? If so, could you give me some hints?
>
> --
> Dipl.-Math. Michael Hoffer
>
> Goethe-Zentrum für Wissenschaftliches Rechnen (G-CSC)
> Goethe-Universität
> Kettenhofweg 139
> 60325 Frankfurt am Main
> Tel.: +49 69 798 25254
> michael.hoffer@gcsc.uni-frankfurt.de
>
> --
> View this message in context:
> http://groovy.329449.n5.nabble.com/Access-to-comments-in-sourcecode-after-parsing-tp385996p5710600.html
> Sent from the groovy - dev mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>


-- 
Guillaume Laforge
Groovy Project Manager
Head of Groovy Development at SpringSource
http://www.springsource.com/g2one

[Attachment #3 (text/html)]

Out of curiosity, why are you building a Groovy code formatter?<div>It might be handy \
as a reusable project, for an Ant task, a Gradle plugin, \
etc.</div><div><br></div><div>The Groovy AST indeed doesn&#39;t keep comments.</div> \
<div>Perhaps you should look at the flow of tokens from Antlr, at the CST level \
instead.</div><div><br></div><div>It also depends on how far you want to go with \
formatting.</div><div>Is it really just for, well, formatting, or do you also plan to \
have some syntax highlighting for example with semantic coloring as well?</div> \
<div>Do you want as far as supporting tons of formatting options? (like aligning \
variable declarations and assignments and what \
not)</div><div><br></div><div>Guillaume<br><br><div class="gmail_quote">On Tue, Jul \
10, 2012 at 7:09 PM, miho <span dir="ltr">&lt;<a href="mailto:info@michaelhoffer.de" \
target="_blank">info@michaelhoffer.de</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">I am trying to write an IDE independent Groovy code formatter \
based on<br> Groovys AST API. Therefore, I looked at AstNodeToScriptVisitor in<br>
groovy-core. I have realized that comments cannot be handled that way. Is<br>
there a common code base somewhere in groovy core that I can use? Or is that<br>
all reinvented for each IDE plugin? If so, could you give me some hints?<br>
<br>
--<br>
Dipl.-Math. Michael Hoffer<br>
<br>
Goethe-Zentrum für Wissenschaftliches Rechnen (G-CSC)<br>
Goethe-Universität<br>
Kettenhofweg 139<br>
60325 Frankfurt am Main<br>
Tel.: <a href="tel:%2B49%2069%20798%2025254" value="+496979825254">+49 69 798 \
25254</a><br> <a href="mailto:michael.hoffer@gcsc.uni-frankfurt.de">michael.hoffer@gcsc.uni-frankfurt.de</a><br>
 <br>
--<br>
View this message in context: <a \
href="http://groovy.329449.n5.nabble.com/Access-to-comments-in-sourcecode-after-parsing-tp385996p5710600.html" \
target="_blank">http://groovy.329449.n5.nabble.com/Access-to-comments-in-sourcecode-after-parsing-tp385996p5710600.html</a><br>


Sent from the groovy - dev mailing list archive at Nabble.com.<br>
<div class="HOEnZb"><div class="h5"><br>
---------------------------------------------------------------------<br>
To unsubscribe from this list, please visit:<br>
<br>
    <a href="http://xircles.codehaus.org/manage_email" \
target="_blank">http://xircles.codehaus.org/manage_email</a><br> <br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Guillaume \
Laforge<br>Groovy Project Manager<br>Head of Groovy Development at SpringSource<br><a \
href="http://www.springsource.com/g2one" \
target="_blank">http://www.springsource.com/g2one</a><br>

</div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic