in jflex/src/main/java/jflex/anttask/JFlexTask.java [99:131]
public void findPackageAndClass() throws IOException {
// find name of the package and class in jflex source file
packageName = null;
className = null;
Reader r = Files.newBufferedReader(inputFile.toPath(), StandardCharsets.UTF_8);
try (LineNumberReader reader = new LineNumberReader(r)) {
while (className == null || packageName == null) {
String line = reader.readLine();
if (line == null) {
break;
}
if (packageName == null) {
Matcher matcher = PACKAGE_PATTERN.matcher(line);
if (matcher.find()) {
packageName = matcher.group(1);
}
}
if (className == null) {
Matcher matcher = CLASS_PATTERN.matcher(line);
if (matcher.find()) {
className = matcher.group(1);
}
}
}
// package name may be null, but class name not
if (className == null) {
className = "Yylex";
}
}
}