Class Antlr4Operation

java.lang.Object
rife.bld.operations.AbstractOperation<Antlr4Operation>
rife.bld.extension.Antlr4Operation

public class Antlr4Operation extends rife.bld.operations.AbstractOperation<Antlr4Operation>
Generates Java sources from ANTLR grammars.
Since:
1.0
  • Constructor Details

    • Antlr4Operation

      public Antlr4Operation()
  • Method Details

    • execute

      public void execute() throws Exception
      Performs the antlr operation.
      Specified by:
      execute in class rife.bld.operations.AbstractOperation<Antlr4Operation>
      Throws:
      Exception
      Since:
      1.0
    • arguments

      public Antlr4Operation arguments(String... arguments)
      Provides additional arguments for the antlr operation.

      The following additional arguments are supported:

      -atngenerate rule augmented transition network diagrams
      -D<option>=valueset/override a grammar-level option
      -Werrortreat warnings as errors"
      -XdbgSTlaunch StringTemplate visualizer on generated code
      -XdbgSTWaitwait for STViz to close before continuing
      -Xforce-atnuse the ATN simulator for all predictions
      -Xlogdump lots of logging info to antlr-timestamp.log
      -Xexact-output-dirall output goes into -o dir regardless of paths/package
      Parameters:
      arguments - the additional arguments
      Returns:
      this operation instance
      Since:
      1.0
    • arguments

      public Antlr4Operation arguments(List<String> arguments)
      Provides additional arguments for the antlr operation.

      See arguments(String...) for details.

      Parameters:
      arguments - the additional arguments
      Returns:
      this operation instance
      Since:
      1.0
    • sourceDirectories

      public Antlr4Operation sourceDirectories(File... directories)
      Provides the source directories that will be used for the antlr operation.
      Parameters:
      directories - the source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceDirectories

      public Antlr4Operation sourceDirectories(Path... directories)
      Provides the source directories that will be used for the antlr operation.
      Parameters:
      directories - the source directories
      Returns:
      this operation instance
      Since:
      1.4
      See Also:
    • sourceDirectories

      public Antlr4Operation sourceDirectories(String... directories)
      Provides the source directories that will be used for the antlr operation.
      Parameters:
      directories - the source directories
      Returns:
      this operation instance
      Since:
      1.4
      See Also:
    • sourceDirectories

      public Antlr4Operation sourceDirectories(List<File> directories)
      Provides the source directories that will be used for the antlr operation.
      Parameters:
      directories - the source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceDirectoriesPaths

      public Antlr4Operation sourceDirectoriesPaths(List<Path> directories)
      Provides the source directories that will be used for the antlr operation.
      Parameters:
      directories - the source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceDirectoriesStrings

      public Antlr4Operation sourceDirectoriesStrings(List<String> directories)
      Provides the source directories that will be used for the antlr operation.
      Parameters:
      directories - the source directories
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceFiles

      public Antlr4Operation sourceFiles(File... files)
      Provides the source files that will be used for the antlr operation.
      Parameters:
      files - the source files
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceFiles

      public Antlr4Operation sourceFiles(Path... files)
      Provides the source files that will be used for the antlr operation.
      Parameters:
      files - the source files
      Returns:
      this operation instance
      Since:
      1.4
      See Also:
    • sourceFiles

      public Antlr4Operation sourceFiles(String... files)
      Provides the source files that will be used for the antlr operation.
      Parameters:
      files - the source files
      Returns:
      this operation instance
      Since:
      1.4
      See Also:
    • sourceFiles

      public Antlr4Operation sourceFiles(List<File> files)
      Provides the source files that will be used for the antlr operation.
      Parameters:
      files - the source files
      Returns:
      this operation instance
      Since:
      1.0
      See Also:
    • sourceFilesPaths

      public Antlr4Operation sourceFilesPaths(List<Path> files)
      Provides the source files that will be used for the antlr operation.
      Parameters:
      files - the source files
      Returns:
      this operation instance
      Since:
      1.4
      See Also:
    • sourceFilesStrings

      public Antlr4Operation sourceFilesStrings(List<String> files)
      Provides the source files that will be used for the antlr operation.
      Parameters:
      files - the source files
      Returns:
      this operation instance
      Since:
      1.4
      See Also:
    • outputDirectory

      public Antlr4Operation outputDirectory(File directory)
      Provides the output directory where all output is generated.
      Parameters:
      directory - the output directory
      Returns:
      this operation instance
      Since:
      1.0
    • outputDirectory

      public Antlr4Operation outputDirectory(Path directory)
      Provides the output directory where all output is generated.
      Parameters:
      directory - the output directory
      Returns:
      this operation instance
      Since:
      1.4
    • outputDirectory

      public Antlr4Operation outputDirectory(String directory)
      Provides the output directory where all output is generated.
      Parameters:
      directory - the output directory
      Returns:
      this operation instance
      Since:
      1.4
    • libDirectory

      public Antlr4Operation libDirectory(File directory)
      Provides the location of grammars and tokens files.
      Parameters:
      directory - the lib directory
      Returns:
      this operation instance
      Since:
      1.0
    • libDirectory

      public Antlr4Operation libDirectory(Path directory)
      Provides the location of grammars and tokens files.
      Parameters:
      directory - the lib directory
      Returns:
      this operation instance
      Since:
      1.4
    • libDirectory

      public Antlr4Operation libDirectory(String directory)
      Provides the location of grammars and tokens files.
      Parameters:
      directory - the lib directory
      Returns:
      this operation instance
      Since:
      1.4
    • grammarEncoding

      public Antlr4Operation grammarEncoding(String encoding)
      Provides grammar file encoding; e.g., euc-jp.
      Parameters:
      encoding - the encoding
      Returns:
      this operation instance
      Since:
      1.0
    • msgFormat

      public Antlr4Operation msgFormat(String format)
      Specify output style for messages in antlr, gnu, vs2005.
      Parameters:
      format - the output styke
      Returns:
      this operation instance
      Since:
      1.0
    • longMessages

      public Antlr4Operation longMessages()
      Show exception details when available for errors and warnings.
      Returns:
      this operation instance
      Since:
      1.0
    • listener

      public Antlr4Operation listener()
      Generate parse tree listener (default).
      Returns:
      this operation instance
      Since:
      1.0
    • noListener

      public Antlr4Operation noListener()
      Don't generate parse tree listener.
      Returns:
      this operation instance
      Since:
      1.0
    • visitor

      public Antlr4Operation visitor()
      Generate parse tree visitor.
      Returns:
      this operation instance
      Since:
      1.0
    • noVisitor

      public Antlr4Operation noVisitor()
      Don't generate parse tree visitor (default).
      Returns:
      this operation instance
      Since:
      1.0
    • pkg

      public Antlr4Operation pkg(String pkg)
      Specify a package/namespace for the generated code
      Parameters:
      pkg - the package name
      Returns:
      this operation instance
      Since:
      1.0
    • depend

      public Antlr4Operation depend()
      Generate file dependencies.
      Returns:
      this operation instance
      Since:
      1.0
    • arguments

      public List<String> arguments()
      Retrieves the list of arguments that will be used for the antlr operation.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the arguments
      Since:
      1.0
    • sourceDirectories

      public List<File> sourceDirectories()
      Retrieves the list of source directories that will be used for the antlr operation.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the source directories
      Since:
      1.0
    • sourceFiles

      public List<File> sourceFiles()
      Retrieves the list of source files that will be used for the antlr operation.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the source files
      Since:
      1.0
    • outputDirectory

      public File outputDirectory()
      Retrieves the output directory where all output is generated.
      Returns:
      the output directory; or * null if the directory wasn't specified
      Since:
      1.0
    • libDirectory

      public File libDirectory()
      Retrieves the location of grammars and tokens files.
      Returns:
      the lib directory; or null if the directory wasn't specified
      Since:
      1.0