Package jflex
Class Out
java.lang.Object
jflex.Out
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 parameters.
Redirects output to a TextArea in GUI mode.
Counts error and warning messages.
- Version:
- JFlex 1.7.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
throws a GeneratorException if there are any errors recordedstatic void
Dump debug information to System.outstatic void
All parts of JFlex, that want to provide dump information should use this method for their output.private static void
All parts of JFlex, that want to report error messages should use this method for their output.static void
error
(File file, ErrorMessages message, int line, int column) print error message with location informationstatic void
print error message (string)static void
error
(ErrorMessages message) print error message (code)static void
error
(ErrorMessages message, File file) IO error message for a file (displays file name in parentheses).static void
error
(ErrorMessages message, String data) print error message with dataprivate static String
get one line from a filestatic void
Report generation progress.static void
Report generation progress.static void
println
(ErrorMessages message, int data) Report generation progress.static void
println
(ErrorMessages message, String data) Report generation progress.static void
Print system information (e.g.static void
Request a bug report for an unexpected Exception/Error.static void
reset error and warning countersstatic void
setGUIMode
(TextArea text) Switches to GUI mode iftext
is notnull
static void
setOutputStream
(OutputStream stream) Sets a new output stream and switches to non-gui mode.static void
showPosition
(File file, int line) print a line of a filestatic void
showPosition
(File file, int line, int column) prints a line of a file with marked position.static void
print error and warning statisticsstatic void
Report time statistic data.static void
time
(ErrorMessages message, Timer time) Report time statistic data.static void
warning
(File file, ErrorMessages message, int line, int column) print warning message with location informationstatic void
print a warning without position informationstatic void
warning
(ErrorMessages message) print a warning message without line informationstatic void
warning
(ErrorMessages message, int line) print a warning with line information
-
Field Details
-
NL
platform dependent newline sequence -
warnings
private static int warningscount total warnings -
errors
private static int errorscount total errors -
out
output device
-
-
Constructor Details
-
Out
public Out()
-
-
Method Details
-
setGUIMode
Switches to GUI mode iftext
is notnull
- Parameters:
text
- the message TextArea of the JFlex GUI
-
setOutputStream
Sets a new output stream and switches to non-gui mode.- Parameters:
stream
- the new output stream
-
time
Report time statistic data.- Parameters:
message
- the message to be printedtime
- elapsed time
-
time
Report time statistic data.- Parameters:
message
- the message to be printed
-
println
Report generation progress.- Parameters:
message
- the message to be printed
-
println
Report generation progress.- Parameters:
message
- the message to be printeddata
- data to be inserted into the message
-
println
Report generation progress.- Parameters:
message
- the message to be printeddata
- data to be inserted into the message
-
print
Report generation progress.- Parameters:
message
- the message to be printed
-
debug
Dump debug information to System.outUse like this
if (Out.DEBUG) Out.debug(message)
to save performance during normal operation (when DEBUG is turned off).- Parameters:
message
- aString
object.
-
dump
All parts of JFlex, that want to provide dump information should use this method for their output.- Parameters:
message
- aString
object.
-
err
All parts of JFlex, that want to report error messages should use this method for their output. -
checkErrors
public static void checkErrors()throws a GeneratorException if there are any errors recorded -
statistics
public static void statistics()print error and warning statistics -
resetCounters
public static void resetCounters()reset error and warning counters -
warning
print a warning without position information- Parameters:
message
- the warning message
-
warning
print a warning message without line information- Parameters:
message
- code of the warning message- See Also:
-
warning
print a warning with line information- Parameters:
message
- code of the warning messageline
- the line information- See Also:
-
warning
print warning message with location information- Parameters:
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
-
error
print error message (string)- Parameters:
message
- the message to print
-
error
print error message (code)- Parameters:
message
- the code of the error message- See Also:
-
error
print error message with data- Parameters:
data
- data to insert into the messagemessage
- the code of the error message- See Also:
-
error
IO error message for a file (displays file name in parentheses).- Parameters:
message
- the code of the error messagefile
- the file it occurred for
-
error
print error message with location information- Parameters:
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
-
showPosition
prints a line of a file with marked position.- Parameters:
file
- the file of which to show the lineline
- the line to showcolumn
- the column in which to show the marker
-
showPosition
print a line of a file- Parameters:
file
- the file to showline
- the line number
-
getLine
get one line from a file- Parameters:
file
- the file to readline
- the line number to get- Throws:
IOException
-
printSystemInfo
public static void printSystemInfo()Print system information (e.g. in case of unexpected exceptions) -
requestBugReport
Request a bug report for an unexpected Exception/Error.- Parameters:
e
- aError
object.
-