MPE/iX Shell and Utilities Reference Manual, Vol 2

yacc(1) MPE/iX Shell and Utilities yacc(1)
NAME
yacc — parser generator language
SYNOPSIS
yacc [–dhlmqstv][–b file.prefix][–D file.h][–o file.c][–p prefix]
[–P yyparse.c][–S statesfile][–V stats] gram.y
DESCRIPTION
yacc converts a context-free LALR(1) grammar found in the input file gram.y into a set of
tables that together with additional
C code constitute a parser to recognize that grammar. If
you specify an input file named -, yacc reads the grammar from the standard input. By de-
fault, yacc places the parsing tables and associated C code into the file y.tab.c.
For detailed information on writing parsers using yacc, see the YACC Programming Guide.
Options
yacc accepts the following options:
–b file_prefix
uses file_prefix instead of y as the prefix for all output file names. For example, yacc
would name the parsing table file_prefix.tab.c rather than y.tab.c.
–D file.h
generates the file file.h which contains the constant definition statements for token
names. This lets other modules of a multi-module program access these symbolic
names.
–d generates the file y.tab.h which contains the constant definition statements for to-
ken names. This lets other modules of a multi-module program access these symbol-
ic names. This is the same as –D except that you do not specify the header file name.
–h displays a brief list of the options and quits.
–l disables the generation of #line statements in the parser output file. yacc uses
these statements to produce correct line numbers in compiler error messages from
gram.y.
–m displays memory usage, timing, and table size statistics on the standard output.
–o file.c
places the generated parser tables into file.c instead of the default y.tab.c.
–P yyparse.c
indicates that the
C parser template is found in the file yyparse.c. By default, this
parser template is found in /etc/yyparse.c.
1-710 Commands and Utilities