Files
oldlinux-files/Minix/2.0.0/wwwman/man1/yacc.1.html
2024-02-19 00:21:39 -05:00

122 lines
3.7 KiB
HTML

<HTML>
<HEAD>
<TITLE>yacc(1)</TITLE>
</HEAD>
<BODY>
<H1>yacc(1)</H1>
<HR>
<PRE>
</PRE>
<H2>NAME</H2><PRE>
yacc - an <STRONG><A HREF="../man1/LALR.1.html">LALR(1)</A></STRONG> parser generator
</PRE>
<H2>SYNOPSIS</H2><PRE>
<STRONG>yacc</STRONG> <STRONG>[</STRONG> <STRONG>-dlrtv</STRONG> <STRONG>]</STRONG> <STRONG>[</STRONG> <STRONG>-b</STRONG> <EM>file</EM>_<EM>prefix</EM> <STRONG>]</STRONG> <STRONG>[</STRONG> <STRONG>-p</STRONG> <EM>symbol</EM>_<EM>prefix</EM> <STRONG>]</STRONG> <EM>filename</EM>
</PRE>
<H2>DESCRIPTION</H2><PRE>
<EM>Yacc</EM> reads the grammar specification in the file <EM>filename</EM> and generates
an <STRONG><A HREF="../man1/LR.1.html">LR(1)</A></STRONG> parser for it. The parsers consist of a set of <STRONG><A HREF="../man1/LALR.1.html">LALR(1)</A></STRONG> parsing
tables and a driver routine written in the C programming language. <EM>Yacc</EM>
normally writes the parse tables and the driver routine to the file
<EM>y</EM>.<EM>tab</EM>.<EM>c</EM>.
The following options are available:
<STRONG>-b</STRONG> <EM>file</EM>_<EM>prefix</EM>
The <STRONG>-b</STRONG> option changes the prefix prepended to the output file names
to the string denoted by <EM>file</EM>_<EM>prefix</EM>. The default prefix is the
character <EM>y</EM>.
<STRONG>-d</STRONG> The <STRONG>-d</STRONG> option causes the header file <EM>y</EM>.<EM>tab</EM>.<EM>h</EM> to be written.
<STRONG>-l</STRONG> If the <STRONG>-l</STRONG> option is not specified, <EM>yacc</EM> will insert #line directives
in the generated code. The #line directives let the C compiler
relate errors in the generated code to the user's original code. If
the <STRONG>-l</STRONG> option is specified, <EM>yacc</EM> will not insert the #line
directives. #line directives specified by the user will be
retained.
<STRONG>-p</STRONG> <EM>symbol</EM>_<EM>prefix</EM>
The <STRONG>-p</STRONG> option changes the prefix prepended to yacc-generated symbols
to the string denoted by <EM>symbol</EM>_<EM>prefix</EM>. The default prefix is the
string <EM>yy</EM>.
<STRONG>-r</STRONG> The <STRONG>-r</STRONG> option causes <EM>yacc</EM> to produce separate files for code and
tables. The code file is named <EM>y</EM>.<EM>code</EM>.<EM>c</EM>, and the tables file is
named <EM>y</EM>.<EM>tab</EM>.<EM>c</EM>.
<STRONG>-t</STRONG> The <STRONG>-t</STRONG> option changes the preprocessor directives generated by <EM>yacc</EM>
so that debugging statements will be incorporated in the compiled
code.
<STRONG>-v</STRONG> The <STRONG>-v</STRONG> option causes a human-readable description of the generated
parser to be written to the file <EM>y</EM>.<EM>output</EM>.
If the environment variable TMPDIR is set, the string denoted by TMPDIR
will be used as the name of the directory where the temporary files are
created.
</PRE>
<H2>FILES</H2><PRE>
<EM>y</EM>.<EM>code</EM>.<EM>c</EM>
<EM>y</EM>.<EM>tab</EM>.<EM>c</EM>
<EM>y</EM>.<EM>tab</EM>.<EM>h</EM>
<EM>y</EM>.<EM>output</EM>
/<EM>tmp</EM>/<EM>yacc</EM>.<EM>aXXXXXX</EM>
/<EM>tmp</EM>/<EM>yacc</EM>.<EM>tXXXXXX</EM>
/<EM>tmp</EM>/<EM>yacc</EM>.<EM>uXXXXXX</EM>
</PRE>
<H2>DIAGNOSTICS</H2><PRE>
If there are rules that are never reduced, the number of such rules is
reported on standard error. If there are any <STRONG><A HREF="../man1/LALR.1.html">LALR(1)</A></STRONG> conflicts, the
number of conflicts is reported on standard error.
</PRE>
</BODY>
</HTML>