Interface Compiler
-
- All Known Implementing Classes:
AbstractCompiler,Javac,Jikes
public interface CompilerThis interface defines a compiler's functionality for all (Java-based) compiled languages- Since:
- 2.0
- Author:
- Davanum Srinivas, Stefano Mazzocchi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFile(java.lang.String file)Set the name of the file containing the source programbooleancompile()Compile a source file yielding a loadable program file.java.util.ListgetErrors()Return the list of errors generated by this compilationvoidsetClasspath(java.lang.String classpath)Set the classpath to be used for this compilationvoidsetDestination(java.lang.String destDir)Set the name of the directory to contain the resulting object program filevoidsetEncoding(java.lang.String encoding)Set the encoding of the input source file ornullto use the platform's default encodingvoidsetSource(java.lang.String srcDir)Set the name of the directory containing the source program file
-
-
-
Method Detail
-
addFile
void addFile(java.lang.String file)
Set the name of the file containing the source program- Parameters:
file- The name of the file containing the source program
-
setSource
void setSource(java.lang.String srcDir)
Set the name of the directory containing the source program file- Parameters:
srcDir- The name of the directory containing the source program file
-
setDestination
void setDestination(java.lang.String destDir)
Set the name of the directory to contain the resulting object program file- Parameters:
destDir- The name of the directory to contain the resulting object program file
-
setClasspath
void setClasspath(java.lang.String classpath)
Set the classpath to be used for this compilation- Parameters:
classpath- The classpath to be used for this compilation
-
setEncoding
void setEncoding(java.lang.String encoding)
Set the encoding of the input source file ornullto use the platform's default encoding- Parameters:
encoding- The encoding of the input source file ornullto use the platform's default encoding
-
compile
boolean compile() throws java.io.IOExceptionCompile a source file yielding a loadable program file.- Parameters:
filename- The object program base file namebaseDirectory- The directory containing the object program fileencoding- The encoding expected in the source file ornullif it is the platform's default encoding- Throws:
LanguageException- If an error occurs during compilationjava.io.IOException
-
getErrors
java.util.List getErrors() throws java.io.IOExceptionReturn the list of errors generated by this compilation- Returns:
- The list of errors generated by this compilation
- Throws:
java.io.IOException- If an error occurs during message collection
-
-