将Scala AST转换为源代码 [英] Convert Scala AST to source code
本文介绍了将Scala AST转换为源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
鉴于Scala AST,有没有一种生成Scala源代码的方法?
Given a Scala AST, is there a way to generate Scala source code?
我正在研究通过解析/分析其他Scala源自动生成Scala源的方法。
I'm looking into ways to autogenerate Scala source by parsing/analyzing other Scala source. Any tips would be appreciated!
推荐答案
对于合成构建的AST,它强烈依赖于现有的树DSL 。
For synthetically constructing ASTs, it relies strongly on the existing Tree DSL of Scala's NSC.
尽管代码有些混乱,但是您可以在我的项目中找到示例用法 ScalaCollider-UGens 。
Although the code is a bit messy, you can find an example usage in my project ScalaCollider-UGens.
我还通过约翰内斯·鲁道夫。
这篇关于将Scala AST转换为源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文