Class LexSimpleAnalyzerUtils
java.lang.Object
jflex.maven.plugin.jflex.LexSimpleAnalyzerUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringguessClass(String line) private static StringguessIncluded(String line) guessIncludes(File file) Processes a file for%includedirectives.private static StringguessPackage(String line) (package private) static SpecInfoguessSpecInfo(File lexFile) Guesses package and class name, and%includefiles, based on this grammar definition.(package private) static SpecInfoguessSpecInfo(Reader lexFileReader, File lexFile) Guesses package and class name, and%includefiles, based on this grammar definition.Resolves path names relative to parent.nestedIncludes(Set<File> seen, File file) Recursively processes a file for%includedirectives.parseIncludes(Reader fileReader) Parses input for%includedirectives.
-
Field Details
-
DEFAULT_NAME
- See Also:
-
INCLUDE_DIRECTIVE_MATCHER
-
INCLUDE_DIRECTIVE_ARG_OFFSET
private static final int INCLUDE_DIRECTIVE_ARG_OFFSET- See Also:
-
-
Constructor Details
-
LexSimpleAnalyzerUtils
private LexSimpleAnalyzerUtils()
-
-
Method Details
-
guessSpecInfo
Guesses package and class name, and%includefiles, based on this grammar definition.- Parameters:
lexFile- the lex spec to process- Returns:
- collected info about this lex spec.
- Throws:
FileNotFoundException- if the lex file does not existIOException- when an IO exception occurred while reading a file.
-
guessSpecInfo
Guesses package and class name, and%includefiles, based on this grammar definition.- Parameters:
lexFileReader- reader for lex spec to processlexFile- the lex spec to process, used for relative path name resolution of%incudes.- Returns:
- collected info about this lex spec.
- Throws:
IOException- when an IO exception occurred while processing the reader. Ignores IO errors for%incudefiles.
-
guessIncludes
-
nestedIncludes
Recursively processes a file for%includedirectives.- Parameters:
seen- the set of files seen so far, to avoid following cycles.file- the file to process; itself assumed to be an%includeor lex file. Path names in the file are relative to the file location.- Returns:
- the set of files (recursively) mentioned in
%includes.
-
mapFiles
-
parseIncludes
Parses input for%includedirectives.- Parameters:
fileReader- the input- Returns:
- the set of path names mentioned after
%includedirectives in the input. - Throws:
IOException
-
guessClass
-
guessPackage
-
guessIncluded
-