private String getPackage(List<String> arguments) {
        int index = (arguments != null) ? arguments.indexOf("-package") : -1;

        return (index > -1)
            ? (arguments.get(index + 1).replace('.', File.separatorChar) +
                File.separatorChar)
            : null;
    }
Determines the package to use.

@param   arguments  the tool arguments.

@return  the package. Returns {@code null} to indicate that no package should be
         used.
antlr4-maven-plugin/src/main/java/org/antlr/mojo/antlr4/GrammarDependencies.java