AstStringCompiler (Groovy 5.0.0)

Package: org.codehaus.groovy.ast.builder

## [Java] Class AstStringCompiler

- org.codehaus.groovy.ast.builder.AstStringCompiler

-     public class AstStringCompiler
      extends Object

  This class handles converting Strings to ASTNode lists.

- - ### Methods Summary

    Methods
    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.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public List<ASTNode> compile(String script)

      Compiles the specified source code and returns its statement block and any declared types.

      Parameters:
        `script` - a Groovy script in String form
      Since:
        3.0.0

    - #### 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.

      Parameters:
        `script` - a Groovy script in String form
        `compilePhase` - the last compilation phase to complete
        `statementsOnly` - if `true`, exclude the script class from the result
      Since:
        1.7.0