开发者

See statements as Groovy scripts executes

Is it possible to s开发者_如何学编程ee the statements of Groovy script as it executes, like the output of running bash with -v or -ex? What would it take to do this programmatically?


Is it possible to see the statements of Groovy script as it executes, like the output of running bash with -v or -ex?

I suppose it's possible, but I'm not aware of any tool that does this.


This could be done relatively easily using a global AST transformation whose public void visit(ASTNode[] astNodes, SourceUnit sourceUnit) method adds println Statements after or before each Statement visted in a class.

See http://groovy.codehaus.org/Global+AST+Transformations for more details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜