AstStringCompiler (Groovy 4.0.15)
Description: declaration: package: org.codehaus.groovy.ast.builder, class: AstStringCompiler

Package org.codehaus.groovy.ast.builder

# Class AstStringCompiler

java.lang.Object
org.codehaus.groovy.ast.builder.AstStringCompiler

public class AstStringCompiler extends Object
This class handles converting Strings to ASTNode lists.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AstStringCompiler()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<ASTNode>`
  `compile(String script)`
  Compiles the specified source code and returns its statement block and any declared types.
  `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.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AstStringCompiler

    public AstStringCompiler()

- ## Method Details

  - ### compile

    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

  - ### compile

    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