Pegasus::Generators::Api::PegasusOptionParser(C, I)
Inherits Reference / Object
High-level class for constructing parser generators that are configurable from the command line.
This class uses Input to read a value of
type I, then uses the registered FileGenerator instances
to produce output via an OutputMode. All of these
listed classes are registered with Crystal's native OptionParser,
which serves to provide a user with configuration options.
The #output_file_names and #input_file_names hashes store
the names of target output files and input files, respectively.
These are updated by the Input and FileGenerators, as well
as through user-supplied command-line options.
Constructors
Create a new PegasusOptionParser with the given input method and context.
Instance methods
The context class (which must implement the add_option method)
is included with the generator to store and retrieve
parser-specific options. FileGenerator#context is used within
a generator to access this value.
The input gathered from the Input class. This starts
uninitialized, but is set partway through #run.
Hash that stores the configured file names of the various
FileGenerator instances, associated with their internal names.
The file names are kept outside their generators so that
two generators that depend on one another (like a source file
including a header file) can know each other's names.