|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.util.compiler.Compiler
This class defines the common behaviour of all KOPI compilers.
| Field Summary | |
private PrintWriter |
err
The output stream for diagnostic messages |
private ModifierUtility |
modUtil
|
private PrintWriter |
out
The output stream for normal messages |
static int |
PRINT_TO_ERR
Indicates that the user wants to print to diagnostic output. |
static int |
PRINT_TO_OUT
Indicates that the user wants to print to normal output. |
private long |
timestamp
Each compilation session is identified by a timestamp |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
protected |
Compiler(ModifierUtility modUtil)
Creates a new compiler instance. |
| Method Summary | |
abstract void |
catchUp(File filename)
Compiles the named file (using the options of the current compilation session) up to the same compilation pass as the files named when the compilation session was initiated. |
long |
getTimestamp()
Returns the timestamp of the compilation session, identifying it uniquely. |
void |
inform(String message)
Write a message to the diagnostic output. |
void |
inform(String message,
int printDestination)
Write text to the output stream if printDestination is PRINT_TO_OUT and write text to the diagnostic stream if printDestination is PRINT_TO_ERR. |
void |
inform(Throwable trouble)
Write a message to the diagnostic output. |
void |
inform(FormattedException trouble)
Write a message to the diagnostic output. |
void |
inform(Message message)
Write a message to the diagnostic output. |
void |
inform(MessageDescription description)
Write a message to the diagnostic output. |
void |
inform(MessageDescription description,
Object parameter)
Write a message to the diagnostic output. |
void |
inform(MessageDescription description,
Object parameter1,
Object parameter2)
Write a message to the diagnostic output. |
void |
inform(MessageDescription description,
Object[] parameters)
Write a message to the diagnostic output. |
ModifierUtility |
modUtil()
|
abstract boolean |
parseComments()
Returns true iff comments should be parsed (false if to be skipped). |
private void |
readList(ArrayList accum,
String name)
Parses the file referenced by name, extracting the
list of files that it contains. |
abstract void |
reportTrouble(Exception trouble)
Reports a trouble (error or warning). |
boolean |
run(PrintWriter err,
String[] args)
Runs a compilation session |
abstract boolean |
run(String[] args)
Runs a compilation session |
void |
setOutputStream(OutputStream os)
Sets the output stream for inform to err |
abstract boolean |
verboseMode()
Returns true iff compilation runs in verbose mode. |
ArrayList |
verifyFiles(String[] names)
Takes an array of file names and checks that each exists. |
ArrayList |
verifyFiles(ArrayList names)
Takes a list of file names and checks that each exists. |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PRINT_TO_OUT
public static final int PRINT_TO_ERR
private final long timestamp
private PrintWriter out
private PrintWriter err
private final ModifierUtility modUtil
| Constructor Detail |
protected Compiler(ModifierUtility modUtil)
| Method Detail |
public final long getTimestamp()
public ArrayList verifyFiles(ArrayList names)
throws UnpositionedError
names - a list of names
UnpositionedError - at least one file does not exist
public ArrayList verifyFiles(String[] names)
throws UnpositionedError
names - an array of names
UnpositionedError - at least one file does not exist
private void readList(ArrayList accum,
String name)
throws IOException
name, extracting the
list of files that it contains. The files are added to
accum
accum - a list in which to accumulate the resultsname - a string of the form "@file" where "file" is the
name of a file containing a list of file names
IOException
public boolean run(PrintWriter err,
String[] args)
err - the diagnostic output streamargs - the arguments to the compiler
public void setOutputStream(OutputStream os)
err
os - the output stream to use for error and warning output
requires os != null;
public abstract boolean run(String[] args)
args - the arguments to the compiler
public abstract void catchUp(File filename)
filename - the file descriptor of the file to be compiled
requires filename != null && filename.canRead();
public abstract void reportTrouble(Exception trouble)
reportTrouble in interface TroubleReportertrouble - a description of the trouble to report.public abstract boolean parseComments()
public abstract boolean verboseMode()
public final void inform(Throwable trouble)
trouble - the error caughtpublic final void inform(FormattedException trouble)
trouble - the error caughtpublic final void inform(Message message)
message - the formatted message
public final void inform(MessageDescription description,
Object[] parameters)
description - the message descriptionparameters - the array of parameters
public final void inform(MessageDescription description,
Object parameter1,
Object parameter2)
description - the message descriptionparameter1 - the first parameterparameter2 - the second parameter
public final void inform(MessageDescription description,
Object parameter)
description - the message descriptionparameter - the parameterpublic final void inform(MessageDescription description)
description - the message descriptionpublic void inform(String message)
message - the message text
public void inform(String message,
int printDestination)
message - the message textprintDestination - the output stream that this message goes tosetOutputStream(OutputStream)public final ModifierUtility modUtil()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||