3 Genparse Options
In this section we present the command line options that Genparse
accepts, along with their default values. Genparse’s command line
parsing functions were created by Genparse (talk about bootstrapping),
so you can expect Genparse to behave like any other program with
Genparse-enabled command line parsing.
-c / --cppext: C++ file extension. There are
a number of valid C++ file extensions, such as "C", "cc", "cpp",and
"cxx". This option allows the user to specify which one should be used
for the C++ files created by Genparse. The default value is "cc". If
C++ is not the output language, this option is ignored.
- -d: Debug mode. Setting this flag turns on debugging
in the form of logging to a file and
bison debug output to
stderr. The name of the debug/log file can be specified with the
-f option (see below). The default value is off. Only useful
for debugging Genparse itself.
- -f / --logfile: Name of log file. Only used
if debugging (-d option) is turned on. All debug output will
be written to this file. Currently this consists of the processing of
the Genparse file and dumping the state of the command line parameter
list class. The default value is "genparse.log". Only useful for
debugging Genparse itself.
- -g / --gnulib: Use GNU Compatibility Library
(Gnulib, see http://www.gnu.org/software/gnulib/). Only available
for C output. Allows some more types (unsigned long, intmax_t etc.) for
which Gnulib provides conversion functions.
- -h / --help: Help instructions. This option
displays the usage of Genparse with a list of all command line options,
then terminates the program. The default is off.
- -i / --internationalize:
Put internationalization macro _() around text output so that the generated
program can be internationalized using the GNU gettext command. Presently
only implemented for C output.
- -l / --language: Output language. The
programming language in which Genparse writes the output files.
Currently only C, C++ and Java are supported. The default is C.
To indicate C++, the following strings may be used: "c++", "cpp", "cc",
and "cxx". In order to generate Java code use "java" or "Java".
- -m / --longmembers: Use long options for the
members of the parser class (struct). The default is to use the short
representation except if there is only a long representation defined in
the genparse file. If this option is set then the behavior is reverted.
The long representation is used then except if there is only a short
- -o / --outfile: Output file name. Specifies
the main part of the output file name. The extension will be determined
by the output language and possibly by other options. For example, when
the output language is C, giving this option an argument of "file" will
result in output file names of "file.h", "file.c" and "file_cb.c" for
the header, parser, and callback files, respectively. Default value is
"parse_cl". Use the -D option in order to specify a directory
for the results.
- -p / --parsefunc: Name of the parsing
function/class. This option allows the user to specify the name of the
function (for C) or class (for C++ and Java) that does the actual command
line parsing. Default value is "Cmdline". In Java this value is also
used as a prefix for the names of the interface and the exception class.
Leaving the default names the interface "CmdlineInterface" and the exception
- -P / --manyprints: Output help text for every
command line parameter in a separate print command.
- -q / --quiet: Quiet mode.
- -s / --static-headers: Keep the descriptive
header on top of the generated files static. Without this option
genparse prints creation date and time, Linux kernel version, kernel
build time, computer architecture name, host name and user name.
- -v / --version: Version. If this option is
set, the version number is displayed, then the program is terminated.
The default value is off.
- -D / --directory: Directory for storing results.
The -h and -v options can be overridden
by defining them to be something else in the Genparse file. However,
they cannot be turned off completely. In other words, you can define
your own -h and -v options or let
Genparse create them with the default behavior.