jflex:generate

Generates lexical scanners from one or more JFlex grammar 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.
dump boolean Whether to dump full debug information. Default value is false.
generationMethod String The generation method to use for the scanner. The only valid value is pack. Default value is pack.
inputStreamCtor boolean If true, the generated scanner will include a constructor taking an InputStream. Default value is false.
jlex boolean Strict JLex compatibility. Default value is false.
legacyDot boolean If true, the dot (.) metachar matches [^\n] instead of [^\n\r\u000B\u000C\u0085\u2028\u2029]. 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.
unusedWarning boolean Whether a warning will be logged when there are unused macros. Default value is true.
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

dump

Whether to dump full debug information.

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

generationMethod

The generation method to use for the scanner. The only valid value is pack.

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

inputStreamCtor

If true, the generated scanner will include a constructor taking an InputStream.

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

jlex

Strict JLex compatibility.

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

legacyDot

If true, the dot (.) metachar matches [^\n] instead of [^\n\r\u000B\u000C\u0085\u2028\u2029].

  • 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

unusedWarning

Whether a warning will be logged when there are unused macros.

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

verbose

Whether source code generation should be verbose.

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