Package: org.codehaus.groovy.control

## [Java] Interface ParserPlugin

-     public interface ParserPlugin

  A simple extension point to allow us to switch between the classic Groovy parser and the new Antlr based parser(s).

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public ModuleNode` | `buildAST(SourceUnit sourceUnit, ClassLoader classLoader, Reduction cst)` Builds the AST from a previously parsed CST.
    `` | `public static ModuleNode` | `buildAST(CharSequence sourceText, CompilerConfiguration config, GroovyClassLoader loader, ErrorCollector errors)` Parses and converts the supplied source text into a module AST.
    `` | `public Reduction` | `parseCST(SourceUnit sourceUnit, Reader reader)` Parses source text into a concrete syntax tree.

- - ### Method Detail

    - #### public ModuleNode buildAST(SourceUnit sourceUnit, ClassLoader classLoader, Reduction cst)

      Builds the AST from a previously parsed CST.

      throws:
        ParserException if AST construction fails
      Parameters:
        `sourceUnit` - the source being compiled
        `classLoader` - the class loader to use during AST creation
        `cst` - the parsed CST
      Returns:
        the resulting module node

    - #### public static ModuleNode buildAST(CharSequence sourceText, CompilerConfiguration config, GroovyClassLoader loader, ErrorCollector errors)

      Parses and converts the supplied source text into a module AST.

      throws:
        CompilationFailedException if parsing or conversion fails
      Parameters:
        `sourceText` - the source text to compile
        `config` - the compiler configuration to use
        `loader` - the class loader used during compilation
        `errors` - the collector that receives compilation errors
      Returns:
        the compiled module AST

    - #### public Reduction parseCST(SourceUnit sourceUnit, Reader reader)

      Parses source text into a concrete syntax tree.

      throws:
        CompilationFailedException if parsing fails
      Parameters:
        `sourceUnit` - the source being parsed
        `reader` - the source reader
      Returns:
        the parsed CST