public class AstStringCompiler extends Object
This class handles converting Strings to ASTNode lists.
Type Params | Return Type | Name and description |
---|---|---|
|
public List<ASTNode> |
compile(String script) Compiles the specified source code and returns its statement block and any declared types. |
|
public List<ASTNode> |
compile(String script, CompilePhase compilePhase, boolean statementsOnly) Compiles the specified source code and returns its statement block, the script class (if desired) and any declared types. |
Compiles the specified source code and returns its statement block and any declared types.
script
- a Groovy script in String formCompiles the specified source code and returns its statement block, the script class (if desired) and any declared types.
script
- a Groovy script in String formcompilePhase
- the last compilation phase to completestatementsOnly
- if true
, exclude the script class from the result