jflex:generate

Generates lexical scanners from one or more JFlex grammer files.

Mojo Attributes :

  • Requires a Maven 2.0 project to execute.
  • Automatically executes within the lifecycle phase: generate-sources

Optional Parameters

Name Type Description
backup boolean A flag whether to enable the generation of a backup copy if the generated source file already exists. Default value is true.
dot boolean Whether to produce graphviz .dot files for the generated automata. This feature is EXPERIMENTAL. Default value is false.
generationMethod String The generation method to use for the scanner. Valid values are switch, table and pack. Please see the JFlex manual for more details about the various methods. Default value is pack.
jlex boolean Strict JLex compatibility. Default value is false.
lexDefinitions File[] List of grammar definitions to run the JFlex parser generator on. Each path may either specify a single grammar file or a directory. Directories will be recursively scanned for files with one of the following extensions: ".jflex", ".flex", ".jlex" or ".lex". By default, all files in src/main/jflex will be processed.
minimize boolean A flag whether to perform the DFA minimization step during scanner generation. Default value is true.
outputDirectory File Name of the directory into which JFlex should generate the parser.
skeleton File Use external skeleton file.
staleMillis int The granularity in milliseconds of the last modification date for testing whether a source needs regeneration. Default value is 0.
verbose boolean Whether source code generation should be verbose. Default value is false.

Parameter Details

backup

A flag whether to enable the generation of a backup copy if the generated source file already exists.

  • Type : boolean
  • Required : No
  • Default : true

dot

Whether to produce graphviz .dot files for the generated automata. This feature is EXPERIMENTAL.

  • Type : boolean
  • Required : No
  • Default : false

generationMethod

The generation method to use for the scanner. Valid values are switch, table and pack. Please see the JFlex manual for more details about the various methods.

  • Type : java.lang.String
  • Required : No
  • Default : pack

jlex

Strict JLex compatibility.

  • Type : boolean
  • Required : No
  • Default : false

lexDefinitions

List of grammar definitions to run the JFlex parser generator on. Each path may either specify a single grammar file or a directory. Directories will be recursively scanned for files with one of the following extensions: ".jflex", ".flex", ".jlex" or ".lex". By default, all files in src/main/jflex will be processed.

  • Type : java.io.File[]
  • Required : No

minimize

A flag whether to perform the DFA minimization step during scanner generation.

  • Type : boolean
  • Required : No
  • Default : true

outputDirectory

Name of the directory into which JFlex should generate the parser.

  • Type : java.io.File
  • Required : No
  • Expression : ${project.build.directory}/generated-sources/jflex

skeleton

Use external skeleton file.

  • Type : java.io.File
  • Required : No

staleMillis

The granularity in milliseconds of the last modification date for testing whether a source needs regeneration.

  • Type : int
  • Required : No
  • Expression : ${lastModGranularityMs}
  • Default : 0

verbose

Whether source code generation should be verbose.

  • Type : boolean
  • Required : No
  • Default : false