Package minitex
Class InsAnalyzer
java.lang.Object
minitex.InsAnalyzer
This class contains a parser to analyse
.ins (installer) files as
used by the CTAN/LaTeX packaging tools.
An .ins file is a small TeX-like script which, among other things,
declares which files a package generates or ships. This parser does not
attempt to interpret the full TeX macro language; instead it recognizes a
small, fixed set of macros (\file and \generateFile) that
name output files, skips TeX comments introduced by %, and silently
ignores everything else (including grouping braces { and
}, and unrecognized macros).
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newInsParserand registers the built-in macros\fileand\generateFile. -
Method Summary
-
Constructor Details
-
InsAnalyzer
public InsAnalyzer()Creates a newInsParserand registers the built-in macros\fileand\generateFile. Both macros expect a single braced argument, e.g.\file{name.sty}, and recorddirconcatenated with the braced content as a file name in the resulting list; they are treated identically since, for the purposes of this parser, both simply declare a produced file.
-
-
Method Details
-
parse
Parses the contents of an.insfile, collecting the names of all files declared via the\fileand\generateFilemacros.The given
readeris read to its end (or until an error occurs) and is closed by this method before returning, even if an exception is thrown while parsing.- Parameters:
dir- the directory to prepend to each declared file name; use the empty string to obtain file names exactly as they appear in the inputreader- the reader providing the contents of the.insfile; it is closed by this method- Returns:
- the list of file names declared in the input, in the order in which they were encountered
- Throws:
IOException- in case of an I/O error, or if the input is malformed (e.g. an unterminated macro argument)
-