|
Groovy 2.2.0 | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object groovy.inspect.swingui.AstNodeToScriptAdapter
class AstNodeToScriptAdapter
This class takes Groovy source code, compiles it to a specific compile phase, and then decompiles it back to the groovy source. It is used by GroovyConsole's AST Browser, but can also be invoked from the command line.
Method Summary | |
---|---|
String
|
compileToScript(String script, int compilePhase, ClassLoader classLoader = null, boolean showScriptFreeForm = true, boolean showScriptClass = true)
This method takes source code, compiles it, then reverses it back to source. |
static void
|
main(def args)
Run this class as a script to compile a groovy file and print out the resulting source. |
Methods inherited from class Object | |
---|---|
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Method Detail |
---|
String compileToScript(String script, int compilePhase, ClassLoader classLoader = null, boolean showScriptFreeForm = true, boolean showScriptClass = true)
script
- the source code to be compiled. If invalid, a compile error occurscompilePhase
- the CompilePhase. Must be an int mapped inclassLoader
- (optional) the classloader to use. If missing/null then the current is used.
This parameter enables things like ASTBrowser to invoke this with the correct classpathshowScriptFreeForm
- Whether or not to show the script portion of the source codeshowScriptClass
- Whether or not to show the Script class from the source code
static void main(def args)
args
- a filename to compile and a CompilePhase to run to
Copyright © 2003-2013 The Codehaus. All rights reserved.