JFlex
Class Main

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

public class Main
extends java.lang.Object
implements ErrorMessages

This is the main class of JFlex controlling the scanner generation process. It is responsible for parsing the commandline, getting input files, starting up the GUI if necessary, etc.


Field Summary
static int gen_method
          default code generation method
static boolean no_backup
          don't write backup files if this is true
static boolean no_minimize
          don't run minimization algorithm if this is true
static int PACK
          code generation method: maximum packing
static int SWITCH
          code generation method: switch statement
static int TABLE
          code generation method: traditional
static java.lang.String version
          JFlex version
 
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
Main()
           
 
Method Summary
static void generate(java.io.File inputFile)
          Generates a scanner for the specified input file.
static void generate(java.lang.String[] argv)
           
static void main(java.lang.String[] argv)
          Starts the generation process with the files in argv or pops up a window to choose a file, when argv doesn't have any file entries.
static java.util.Vector parseOptions(java.lang.String[] argv)
           
static void printUsage()
           
static void setDir(java.lang.String dirName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
JFlex version

See Also:
Constant Field Values

PACK

public static final int PACK
code generation method: maximum packing

See Also:
Constant Field Values

TABLE

public static final int TABLE
code generation method: traditional

See Also:
Constant Field Values

SWITCH

public static final int SWITCH
code generation method: switch statement

See Also:
Constant Field Values

no_minimize

public static boolean no_minimize
don't run minimization algorithm if this is true


no_backup

public static boolean no_backup
don't write backup files if this is true


gen_method

public static int gen_method
default code generation method

Constructor Detail

Main

public Main()
Method Detail

generate

public static void generate(java.io.File inputFile)
Generates a scanner for the specified input file.

Parameters:
inputFile - a file containing a lexical specification to generate a scanner for.

setDir

public static void setDir(java.lang.String dirName)

parseOptions

public static java.util.Vector parseOptions(java.lang.String[] argv)

printUsage

public static void printUsage()

generate

public static void generate(java.lang.String[] argv)

main

public static void main(java.lang.String[] argv)
Starts the generation process with the files in argv or pops up a window to choose a file, when argv doesn't have any file entries.

Parameters:
argv - the commandline.