Interface Compiler
- All Known Implementing Classes:
AbstractCompiler
,Javac
,Jikes
public interface Compiler
This interface defines a compiler's functionality for all
(Java-based) compiled languages
- Since:
- 2.0
- Author:
- Davanum Srinivas, Stefano Mazzocchi
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Set the name of the file containing the source programboolean
compile()
Compile a source file yielding a loadable program file.Return the list of errors generated by this compilationvoid
setClasspath
(String classpath) Set the classpath to be used for this compilationvoid
setDestination
(String destDir) Set the name of the directory to contain the resulting object program filevoid
setEncoding
(String encoding) Set the encoding of the input source file ornull
to use the platform's default encodingvoid
Set the name of the directory containing the source program file
-
Method Details
-
addFile
Set the name of the file containing the source program- Parameters:
file
- The name of the file containing the source program
-
setSource
Set the name of the directory containing the source program file- Parameters:
srcDir
- The name of the directory containing the source program file
-
setDestination
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
Set the classpath to be used for this compilation- Parameters:
classpath
- The classpath to be used for this compilation
-
setEncoding
Set the encoding of the input source file ornull
to use the platform's default encoding- Parameters:
encoding
- The encoding of the input source file ornull
to use the platform's default encoding
-
compile
Compile 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 ornull
if it is the platform's default encoding- Throws:
LanguageException
- If an error occurs during compilationIOException
-
getErrors
Return the list of errors generated by this compilation- Returns:
- The list of errors generated by this compilation
- Throws:
IOException
- If an error occurs during message collection
-