|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.tools.Compiler
Controls the compilation process, from source to class generation.
Constructor Summary | |
Compiler()
Initializes the compiler. |
Method Summary | |
protected ModuleNode |
buildAST(CSTNode cst,
java.lang.String descriptor)
Creates an Abstract Syntax Tree (AST) from the CST. |
GroovyClass[] |
compile(CharStream source)
Compiles a single source. |
GroovyClass[] |
compile(CharStream[] sources)
Compiles a set of sources. |
protected java.util.ArrayList |
generateClasses(GeneratorContext context,
ClassNode classNode,
java.lang.String descriptor)
Generates a class from an AST. |
protected CompilerClassLoader |
getClassLoader()
Returns the compiler's class loader. |
CompilerConfig |
getConfig()
|
protected CSTNode |
parseSource(CharStream charStream,
java.lang.String descriptor)
Parses a CharStream source, producing a Concrete
Syntax Tree (CST). |
void |
setClasspath(java.lang.String classpath)
Adds additional paths to the class loader's search path. |
void |
setConfig(CompilerConfig config)
|
void |
setDebug(boolean debug)
Controls the presence of debugging output. |
void |
setVerbose(boolean verbose)
Controls the output verbosity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Compiler()
Method Detail |
protected CompilerClassLoader getClassLoader()
public void setVerbose(boolean verbose)
public void setDebug(boolean debug)
public void setClasspath(java.lang.String classpath) throws java.lang.Exception
java.lang.Exception
public CompilerConfig getConfig()
public void setConfig(CompilerConfig config)
public GroovyClass[] compile(CharStream source) throws CompilationFailuresException, CompilerBugException
CompilationFailuresException
on error. Other
exceptions are bugs that need to be caught and encapsulated.
CompilationFailuresException
CompilerBugException
public GroovyClass[] compile(CharStream[] sources) throws CompilationFailuresException, CompilerBugException
CharStream
sources. Collects exceptions
during processing and throws a CompilationFailuresException
on error. Other exceptions are bugs that need to be caught and encapsulated.
CompilationFailuresException
CompilerBugException
protected CSTNode parseSource(CharStream charStream, java.lang.String descriptor) throws ExceptionCollector, java.lang.Exception
CharStream
source, producing a Concrete
Syntax Tree (CST). Lexing and parsing errors will be collected in
an ExceptionCollector
.
ExceptionCollector
java.lang.Exception
protected ModuleNode buildAST(CSTNode cst, java.lang.String descriptor) throws java.lang.Exception
java.lang.Exception
protected java.util.ArrayList generateClasses(GeneratorContext context, ClassNode classNode, java.lang.String descriptor) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |