Package org.antlr.mojo.antlr4
Class MojoUtils
java.lang.Object
org.antlr.mojo.antlr4.MojoUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
Creates the MD5 checksum for the given file.static String
findSourceSubdir
(File sourceDirectory, File grammarFile) Given the source directory File object and the full PATH to a grammar, produce the path to the named grammar file in relative terms to thesourceDirectory
.
-
Constructor Details
-
MojoUtils
MojoUtils()
-
-
Method Details
-
checksum
Creates the MD5 checksum for the given file.- Parameters:
file
- the file.- Returns:
- the checksum.
- Throws:
IOException
-
findSourceSubdir
Given the source directory File object and the full PATH to a grammar, produce the path to the named grammar file in relative terms to thesourceDirectory
. This will then allow ANTLR to produce output relative to the base of the output directory and reflect the input organization of the grammar files.- Parameters:
sourceDirectory
- The source directoryFile
objectgrammarFile
- The full path to the input grammar file- Returns:
- The path to the grammar file relative to the source directory
-