Re: Groovy code generation from AST

Daniel Sun <[email protected]>
Newsgroups gmane.comp.lang.groovy.user
Message-ID <pony-75e4f59cc9cff943cff05cda6dad5634c634bf06-0e13989cd2f0ff6da2a6fe97bb9c23c120b16148@users.groovy.apache.org>
FYI.

https://github.com/apache/groovy/blob/master/subprojects/groovy-console/src/main/groovy/groovy/console/ui/AstNodeToScriptAdapter.groovy

https://github.com/apache/groovy/blob/master/subprojects/groovy-console/src/test/groovy/groovy/console/ui/AstNodeToScriptAdapterTest.groovy


Cheers,
Daniel Sun

On 2021/10/22 15:02:16, Max Lynch <[email protected]> wrote: 
> I'm building a tool for making modifications against Groovy/Gradle files.
> I've successfully built an AST using AstBuilder, but I'm not sure how to
> generate Groovy code from the modified AST I have.
> 
> I found the AstNodeToScriptAdapter.groovy which seems like what I'm after
> but it seems specialized and I'm wondering how accurate it is.
> 
> Is there any other class I'm missing for serializing an AST back to source?
> 
> Thanks,
> Max
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.