JFlex
Class Out

java.lang.Object
  extended byJFlex.Out
All Implemented Interfaces:
ErrorMessages

public final class Out
extends java.lang.Object
implements ErrorMessages

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.


Field Summary
static boolean DEBUG
          If DEBUG is true, additional verbose debug information is produced
static boolean DOT
          If DOT is true, jflex will write graphviz .dot files for generated automata
static boolean DUMP
          If DUMP is true, you will be flooded with information (e.g.
static int errors
          count total errors
static java.lang.String NL
          platform dependent newline sequence
static boolean TIME
          If TIME is true, jflex will print time statistics about the generation process
static boolean VERBOSE
          If VERBOSE is false, no progress output will be generated
static int warnings
          count total warnings
 
Fields inherited from interface JFlex.ErrorMessages
CHARCLASS_MACRO, CHARSET_2_SMALL, CS2SMALL_CHAR, CS2SMALL_STRING, CUPSYM_AFTER_CUP, EOF_IN_ACTION, EOF_IN_COMMENT, EOF_IN_MACROS, EOF_IN_REGEXP, EOF_IN_STATES, EOF_IN_STRING, EOF_SINGLERULE, EOF_WO_ACTION, EOL_IN_CHARCLASS, FILE_CYCLE, FILE_WRITE, LEXSTATE_UNDECL, LOOKAHEAD_ERROR, MACRO_UNDECL, messages, NEVER_MATCH, NO_BUFFER_SIZE, NO_DIRECTORY, NO_LAST_ACTION, NO_LEX_SPEC, NO_MATCHING_BR, NO_SKEL_FILE, NOT_AT_BOL, NOT_READABLE, OUT_OF_MEMORY, QUIL_CUPSYM, QUIL_EOFTHROW, QUIL_INITTHROW, QUIL_SCANERROR, QUIL_THROW, QUIL_YYLEXTHROW, REGEXP_EXPECTED, REPEAT_GREATER, REPEAT_ZERO, STATE_IDENT_EXP, SYNTAX_ERROR, UNEXPECTED_CHAR, UNEXPECTED_EOF, UNEXPECTED_NL, UNKNOWN_OPTION, UNKNOWN_SYNTAX, UNTERMINATED_STR, WRONG_SKELETON, ZERO_STATES
 
Constructor Summary
Out()
           
 
Method Summary
static void checkErrors()
          throws a GeneratorException if there are any errors recorded
static void debug(java.lang.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).
static void dump(java.lang.String message)
          All parts of JFlex, that want to provide dump information should use this method for their output.
static void error(java.io.File file, int message, int line, int column)
          print error message with location information
static void error(int message)
          print error message (code)
static void error(int message, java.io.File file)
          IO error message for a file (displays file name in parentheses).
static void error(java.lang.String message)
          print error message (string)
static void print(java.lang.String message)
          All parts of JFlex, that want to report generation progress should use this method for their output.
static void println(java.lang.String message)
          All parts of JFlex, that want to report generation progress should use this method for their output.
static void printSystemInfo()
          Print system information (e.g.
static void requestBugReport(java.lang.Error e)
          Request a bug report for an unexpected Exception/Error.
static void resetCounters()
          reset error and warning counters
static void setGUIMode(java.awt.TextArea text)
          Switches to GUI mode if text is not null
static void showPosition(java.io.File file, int line)
          print a line of a file
static void showPosition(java.io.File file, int line, int column)
          prints a line of a file with marked position.
static void statistics()
          print error and warning statistics
static void time(java.lang.String message)
          All parts of JFlex, that want to report something about time statistic should use this method for their output.
static void warning(java.io.File file, int message, int line, int column)
          print warning message with location information
static void warning(int message, int line)
          print a warning with line information
static void warning(java.lang.String message)
          print a warning without position information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NL

public static final java.lang.String NL
platform dependent newline sequence


VERBOSE

public static boolean VERBOSE
If VERBOSE is false, no progress output will be generated


TIME

public static boolean TIME
If TIME is true, jflex will print time statistics about the generation process


DUMP

public static boolean DUMP
If DUMP is true, you will be flooded with information (e.g. dfa tables).


DOT

public static boolean DOT
If DOT is true, jflex will write graphviz .dot files for generated automata


DEBUG

public static final boolean DEBUG
If DEBUG is true, additional verbose debug information is produced

See Also:
Constant Field Values

warnings

public static int warnings
count total warnings


errors

public static int errors
count total errors

Constructor Detail

Out

public Out()
Method Detail

setGUIMode

public static void setGUIMode(java.awt.TextArea text)
Switches to GUI mode if text is not null

Parameters:
text - the message TextArea of the JFlex GUI

time

public static void time(java.lang.String message)
All parts of JFlex, that want to report something about time statistic should use this method for their output.

Parameters:
message - the message to be printed

println

public static void println(java.lang.String message)
All parts of JFlex, that want to report generation progress should use this method for their output.

Parameters:
message - the message to be printed

print

public static void print(java.lang.String message)
All parts of JFlex, that want to report generation progress should use this method for their output.

Parameters:
message - the message to be printed

debug

public static void debug(java.lang.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(java.lang.String message)
All parts of JFlex, that want to provide dump information 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

public static void warning(java.lang.String message)
print a warning without position information

Parameters:
message - the warning message

warning

public static void warning(int message,
                           int line)
print a warning with line information

Parameters:
message - code of the warning message
line - the line information
See Also:
ErrorMessages

warning

public static void warning(java.io.File file,
                           int message,
                           int line,
                           int column)
print warning message with location information

Parameters:
file - the file the warning is issued for
message - the code of the message to print
line - the line number of the position
column - the column of the position

error

public static void error(java.lang.String message)
print error message (string)

Parameters:
message - the message to print

error

public static void error(int message)
print error message (code)

Parameters:
message - the code of the error message
See Also:
ErrorMessages

error

public static void error(int message,
                         java.io.File file)
IO error message for a file (displays file name in parentheses).

Parameters:
message - the code of the error message
file - the file it occurred for

error

public static void error(java.io.File file,
                         int message,
                         int line,
                         int column)
print error message with location information

Parameters:
file - the file the error occurred for
message - the code of the error message to print
line - the line number of error position
column - the column of error position

showPosition

public static void showPosition(java.io.File file,
                                int line,
                                int column)
prints a line of a file with marked position.

Parameters:
file - the file of which to show the line
line - the line to show
column - the column in which to show the marker

showPosition

public static void showPosition(java.io.File file,
                                int line)
print a line of a file

Parameters:
file - the file to show
line - the line number

printSystemInfo

public static void printSystemInfo()
Print system information (e.g. in case of unexpected exceptions)


requestBugReport

public static void requestBugReport(java.lang.Error e)
Request a bug report for an unexpected Exception/Error.