How to parse groovy code?

前端 未结 2 1910
陌清茗
陌清茗 2020-12-31 02:48

Since groovy is good at parsing nearly anything, a search on how to parse groovy code will not reveal any good results - so I hope that the SO community is able to help :-)<

2条回答
  •  灰色年华
    2020-12-31 03:02

    ASM should do most of the work for you....

    Additional classes in Groovy Code likely wrap around ASM : -

    • http://groovy-lang.org/api/org/codehaus/groovy/ast/ClassNode.html.
    • http://groovy-lang.org/api/org/codehaus/groovy/ast/GroovyClassVisitor.html

    Once you have a visitor, if there's a built-in adapter in the Groovy API, it could be "more or less" straightforward...

提交回复
热议问题