[BACK]Return to yacc.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / yacc

Annotation of src/usr.bin/yacc/yacc.1, Revision 1.14

1.14    ! aaron       1: .\"    $OpenBSD: yacc.1,v 1.13 2000/11/09 17:52:50 aaron Exp $
1.10      aaron       2: .\"
1.1       deraadt     3: .\" Copyright (c) 1989, 1990 The Regents of the University of California.
                      4: .\" All rights reserved.
                      5: .\"
                      6: .\" This code is derived from software contributed to Berkeley by
                      7: .\" Robert Paul Corbett.
                      8: .\"
                      9: .\" Redistribution and use in source and binary forms, with or without
                     10: .\" modification, are permitted provided that the following conditions
                     11: .\" are met:
                     12: .\" 1. Redistributions of source code must retain the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer.
                     14: .\" 2. Redistributions in binary form must reproduce the above copyright
                     15: .\"    notice, this list of conditions and the following disclaimer in the
                     16: .\"    documentation and/or other materials provided with the distribution.
                     17: .\" 3. All advertising materials mentioning features or use of this software
                     18: .\"    must display the following acknowledgement:
                     19: .\"    This product includes software developed by the University of
                     20: .\"    California, Berkeley and its contributors.
                     21: .\" 4. Neither the name of the University nor the names of its contributors
                     22: .\"    may be used to endorse or promote products derived from this software
                     23: .\"    without specific prior written permission.
                     24: .\"
                     25: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     26: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     27: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     28: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     29: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     30: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     31: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     32: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     33: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     34: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     35: .\" SUCH DAMAGE.
                     36: .\"
                     37: .\"    from: @(#)yacc.1        5.7 (Berkeley) 7/30/91
                     38: .\"
                     39: .Dd July 30, 1991
                     40: .Dt YACC 1
                     41: .Os
                     42: .Sh NAME
                     43: .Nm yacc
                     44: .Nd an
                     45: .Tn LALR(1)
                     46: parser generator
                     47: .Sh SYNOPSIS
                     48: .Nm yacc
                     49: .Op Fl dlrtv
                     50: .Op Fl b Ar prefix
1.5       aaron      51: .Op Fl o Ar output_file
1.2       deraadt    52: .Op Fl p Ar symbol_prefix
1.1       deraadt    53: .Ar filename
                     54: .Sh DESCRIPTION
1.10      aaron      55: .Nm
1.1       deraadt    56: reads the grammar specification in the file
                     57: .Ar filename
                     58: and generates an
                     59: .Tn LR(1)
                     60: parser for it.
                     61: The parsers consist of a set of
                     62: .Tn LALR(1)
                     63: parsing tables and a driver routine
                     64: written in the C programming language.
1.10      aaron      65: .Nm
1.1       deraadt    66: normally writes the parse tables and the driver routine to the file
                     67: .Pa y.tab.c .
                     68: .Pp
1.9       aaron      69: The options are as follows:
1.13      aaron      70: .Bl -tag -width Ds
1.1       deraadt    71: .It Fl b Ar prefix
                     72: The
                     73: .Fl b
                     74: option changes the prefix prepended to the output file names to
                     75: the string denoted by
                     76: .Ar prefix .
                     77: The default prefix is the character
                     78: .Ar y .
                     79: .It Fl d
                     80: The
                     81: .Fl d
                     82: option causes the header file
                     83: .Pa y.tab.h
                     84: to be written.
                     85: .It Fl l
                     86: If the
                     87: .Fl l
                     88: option is not specified,
1.10      aaron      89: .Nm
1.1       deraadt    90: will insert #line directives in the generated code.
                     91: The #line directives let the C compiler relate errors in the
                     92: generated code to the user's original code.
                     93: If the
                     94: .Fl l
                     95: option is specified,
1.10      aaron      96: .Nm
1.1       deraadt    97: will not insert the #line directives.
                     98: #line directives specified by the user will be retained.
1.5       aaron      99: .It Fl o Ar output_file
                    100: The
                    101: .Fl o
1.8       aaron     102: option specifies an explicit name for the parser's output file name instead
1.11      aaron     103: of the default.
                    104: The names of the other output files are constructed from
1.8       aaron     105: .Pa output_file
                    106: as described under the
                    107: .Fl d
                    108: and
                    109: .Fl v
                    110: options.
1.2       deraadt   111: .It Fl p Ar symbol_prefix
                    112: The
                    113: .Fl p
                    114: option changes the prefix prepended to yacc-generated symbols to
                    115: the string denoted by
                    116: .Ar symbol_prefix .
                    117: The default prefix is the string
                    118: .Ar yy .
1.1       deraadt   119: .It Fl r
                    120: The
                    121: .Fl r
                    122: option causes
1.10      aaron     123: .Nm
1.1       deraadt   124: to produce separate files for code and tables.
                    125: The code file is named
                    126: .Pa y.code.c ,
                    127: and the tables file is named
                    128: .Pa y.tab.c .
                    129: .It Fl t
                    130: The
                    131: .Fl t
                    132: option changes the preprocessor directives generated by
1.10      aaron     133: .Nm
1.1       deraadt   134: so that debugging statements will be incorporated in the compiled code.
                    135: .It Fl v
                    136: The
                    137: .Fl v
                    138: option causes a human-readable description of the generated parser to
                    139: be written to the file
                    140: .Pa y.output .
1.12      aaron     141: .El
1.1       deraadt   142: .Sh ENVIRONMENT
                    143: .Bl -tag -width TMPDIR
                    144: .It Ev TMPDIR
1.10      aaron     145: Name of directory where temporary files are to be created.
1.1       deraadt   146: .El
                    147: .Sh TABLES
                    148: The names of the tables generated by this version of
1.10      aaron     149: .Nm
1.1       deraadt   150: are
                    151: .Dq yylhs ,
                    152: .Dq yylen ,
                    153: .Dq yydefred ,
                    154: .Dq yydgoto ,
                    155: .Dq yysindex ,
                    156: .Dq yyrindex ,
                    157: .Dq yygindex ,
                    158: .Dq yytable ,
                    159: and
                    160: .Dq yycheck .
                    161: Two additional tables,
                    162: .Dq yyname
                    163: and
                    164: .Dq yyrule ,
                    165: are created if
                    166: .Dv YYDEBUG
                    167: is defined and non-zero.
1.10      aaron     168: .Sh DIAGNOSTICS
                    169: If there are rules that are never reduced, the number of such rules is
                    170: written to the standard error.
                    171: If there are any
                    172: .Tn LALR(1)
                    173: conflicts, the number of conflicts is also written
                    174: to the standard error.
1.1       deraadt   175: .Sh FILES
1.7       millert   176: .Bl -tag -width /tmp/yacc.uXXXXXXXXXX -compact
1.1       deraadt   177: .It Pa y.code.c
                    178: .It Pa y.tab.c
                    179: .It Pa y.tab.h
                    180: .It Pa y.output
1.7       millert   181: .It Pa /tmp/yacc.aXXXXXXXXXX
                    182: .It Pa /tmp/yacc.tXXXXXXXXXX
                    183: .It Pa /tmp/yacc.uXXXXXXXXXX
1.1       deraadt   184: .El
1.7       millert   185: .Sh SEE ALSO
                    186: .Xr yyfix 1
1.1       deraadt   187: .Sh STANDARDS
                    188: The
1.10      aaron     189: .Nm
1.1       deraadt   190: utility conforms to
                    191: .St -p1003.2 .