Next: Grammar, Up: User manual [Contents][Index]
Usage:
pacc [OPTION]... FILE
pacc
must be invoked with the name of a grammar file, which
conventionally has a .pacc extension. pacc
will write an
output file with the same name but a .c extension.
Option summary:
Operation modes -h, --help display this help and exit -v, --version report version number and exit -D, --dump-ast=WHEN dump the parse tree at various points Parser: -n, --name=NAME name the grammar (default: pacc) -f, --feed=FILE write extra feed parser to FILE Output: -d, --defines[=FILE] also produce a header file -o, --output=FILE write output to FILE
Some options control the output of pacc.
With the option ‘-oFILE’ or ‘--output=FILE’, pacc will write its output to the named FILE. Since pacc’s output is C source code, you should specify a FILE that has a .c extension.
With the option ‘-d’ or ‘--defines’, pacc will additionally write a header file, containing external definitions. If no FILE is specified, the defines file will have the same name as the output file but with a .h extension.
Some options control the parser (or parsers) that pacc generates.
The parser created by pacc is interfaced to your C program through a number of functions with names such as ‘pacc_new()’ (see Interfaces). When the ‘-nNAME’ or ‘--name=NAME’ option is specified, the functions are instead named ‘NAME_new()’.
With the option ‘-fFILE’ or ‘--feed=file’, pacc writes an extra feed parser to the named FILE. This can be used for parsing command line input where some lines are correct but incomplete (see Feeding). If the main parser returns an error, but the feed parser recognises the input, the controlling program should solicit more input from the user, and feed it to the parser.
The usual help options are supported.
If the ‘-h’ or ‘--help’ option is specified, pacc writes a short description of its command line usage and options to standard output, then exits.
If the ‘-v’ or ‘--version’ option is specified, pacc writes version information and its copyright statement to standard output, then exits.
Some options can help with debugging pacc itself.
If the ‘-DWHEN’ or ‘--dump-ast=WHEN’ option is specified, pacc will write a dump of the Abstract Syntax Tree representation. The WHEN string specifies various points at which the AST will be dumped: if it contains the character ‘0’ the tree will be dumped as soon as the input grammar has been parsed; ‘1’ dumps the tree after desugaring; ‘2’ dumps the tree after cooking (preparing the grammar for feeding with the ‘-f’ flag). Multiple dumps can be specified, e.g. ‘-D02’.
Next: Grammar, Up: User manual [Contents][Index]
Last updated: 2016-08-03 21:39:50 UTC
One thing pacc needs is more users. And, perhaps, one way to get more users is to reduce the friction in getting started with pacc. An obvious lubricant is packaging. Read More...
Looking at _pacc_coords(), I noticed that it seemed to have the same realloc() bug that I'd just fixed in _pacc_result(). However, the "list of arrays" trick really wasn't going to work here. Read More...