In this class all output to the java console is filtered.
Use the switches verbose, time and DUMP at compile time to determine
the verbosity of JFlex output. There is no switch for
suppressing error messages. verbose and time can be overridden
by command line paramters.
Redirects output to a TextArea in GUI mode.
Counts error and warning messages.
checkErrors
public static void checkErrors()
throws a GeneratorException if there are any errors recorded
debug
public static void debug(String message)
Dump debug information to System.out
Use like this
if (Out.DEBUG) Out.debug(message)
to save performance during normal operation (when DEBUG
is turned off).
dump
public static void dump(String message)
All parts of JFlex, that want to provide dump information
should use this method for their output.
error
public static void error(File file,
ErrorMessages message,
int line,
int column)
print error message with location information
file
- the file the error occurred formessage
- the code of the error message to printline
- the line number of error positioncolumn
- the column of error position
error
public static void error(ErrorMessages message)
print error message (code)
message
- the code of the error message
error
public static void error(ErrorMessages message,
File file)
IO error message for a file (displays file
name in parentheses).
message
- the code of the error messagefile
- the file it occurred for
error
public static void error(ErrorMessages message,
String data)
print error message with data
message
- the code of the error messagedata
- data to insert into the message
error
public static void error(String message)
print error message (string)
message
- the message to print
print
public static void print(String message)
Report generation progress.
message
- the message to be printed
printSystemInfo
public static void printSystemInfo()
Print system information (e.g. in case of unexpected exceptions)
println
public static void println(ErrorMessages message,
String data)
Report generation progress.
message
- the message to be printeddata
- data to be inserted into the message
println
public static void println(ErrorMessages message,
int data)
Report generation progress.
message
- the message to be printeddata
- data to be inserted into the message
println
public static void println(String message)
Report generation progress.
message
- the message to be printed
requestBugReport
public static void requestBugReport(Error e)
Request a bug report for an unexpected Exception/Error.
resetCounters
public static void resetCounters()
reset error and warning counters
setGUIMode
public static void setGUIMode(TextArea text)
Switches to GUI mode if text
is not null
text
- the message TextArea of the JFlex GUI
setOutputStream
public static void setOutputStream(OutputStream stream)
Sets a new output stream and switches to non-gui mode.
stream
- the new output stream
showPosition
public static void showPosition(File file,
int line)
print a line of a file
file
- the file to showline
- the line number
showPosition
public static void showPosition(File file,
int line,
int column)
prints a line of a file with marked position.
file
- the file of which to show the lineline
- the line to showcolumn
- the column in which to show the marker
statistics
public static void statistics()
print error and warning statistics
time
public static void time(ErrorMessages message,
Timer time)
Report time statistic data.
message
- the message to be printedtime
- elapsed time
time
public static void time(String message)
Report time statistic data.
message
- the message to be printed
warning
public static void warning(File file,
ErrorMessages message,
int line,
int column)
print warning message with location information
file
- the file the warning is issued formessage
- the code of the message to printline
- the line number of the positioncolumn
- the column of the position
warning
public static void warning(ErrorMessages message,
int line)
print a warning with line information
message
- code of the warning messageline
- the line information
warning
public static void warning(String message)
print a warning without position information
message
- the warning message