version 1.9, 2000/03/05 00:28:56 |
version 1.10, 2000/03/14 14:58:27 |
|
|
.\" $OpenBSD$ |
.\" $OpenBSD$ |
|
.\" |
.\" Copyright (c) 1989, 1990 The Regents of the University of California. |
.\" Copyright (c) 1989, 1990 The Regents of the University of California. |
.\" All rights reserved. |
.\" All rights reserved. |
.\" |
.\" |
|
|
.Op Fl p Ar symbol_prefix |
.Op Fl p Ar symbol_prefix |
.Ar filename |
.Ar filename |
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm yacc |
.Nm |
reads the grammar specification in the file |
reads the grammar specification in the file |
.Ar filename |
.Ar filename |
and generates an |
and generates an |
|
|
.Tn LALR(1) |
.Tn LALR(1) |
parsing tables and a driver routine |
parsing tables and a driver routine |
written in the C programming language. |
written in the C programming language. |
.Nm yacc |
.Nm |
normally writes the parse tables and the driver routine to the file |
normally writes the parse tables and the driver routine to the file |
.Pa y.tab.c . |
.Pa y.tab.c . |
.Pp |
.Pp |
|
|
If the |
If the |
.Fl l |
.Fl l |
option is not specified, |
option is not specified, |
.Nm yacc |
.Nm |
will insert #line directives in the generated code. |
will insert #line directives in the generated code. |
The #line directives let the C compiler relate errors in the |
The #line directives let the C compiler relate errors in the |
generated code to the user's original code. |
generated code to the user's original code. |
If the |
If the |
.Fl l |
.Fl l |
option is specified, |
option is specified, |
.Nm yacc |
.Nm |
will not insert the #line directives. |
will not insert the #line directives. |
#line directives specified by the user will be retained. |
#line directives specified by the user will be retained. |
.It Fl o Ar output_file |
.It Fl o Ar output_file |
|
|
The |
The |
.Fl r |
.Fl r |
option causes |
option causes |
.Nm yacc |
.Nm |
to produce separate files for code and tables. |
to produce separate files for code and tables. |
The code file is named |
The code file is named |
.Pa y.code.c , |
.Pa y.code.c , |
|
|
The |
The |
.Fl t |
.Fl t |
option changes the preprocessor directives generated by |
option changes the preprocessor directives generated by |
.Nm yacc |
.Nm |
so that debugging statements will be incorporated in the compiled code. |
so that debugging statements will be incorporated in the compiled code. |
.It Fl v |
.It Fl v |
The |
The |
|
|
be written to the file |
be written to the file |
.Pa y.output . |
.Pa y.output . |
.Sh ENVIRONMENT |
.Sh ENVIRONMENT |
The following environment variable is referenced by |
The following environment variables affect the execution of |
.Nm yacc : |
.Nm yacc : |
.Bl -tag -width TMPDIR |
.Bl -tag -width TMPDIR |
.It Ev TMPDIR |
.It Ev TMPDIR |
If the environment variable |
Name of directory where temporary files are to be created. |
.Ev TMPDIR |
|
is set, the string denoted by |
|
.Ev TMPDIR |
|
will be used as the name of the directory where the temporary |
|
files are created. |
|
.El |
.El |
.Sh TABLES |
.Sh TABLES |
The names of the tables generated by this version of |
The names of the tables generated by this version of |
.Nm yacc |
.Nm |
are |
are |
.Dq yylhs , |
.Dq yylhs , |
.Dq yylen , |
.Dq yylen , |
|
|
are created if |
are created if |
.Dv YYDEBUG |
.Dv YYDEBUG |
is defined and non-zero. |
is defined and non-zero. |
|
.Sh DIAGNOSTICS |
|
If there are rules that are never reduced, the number of such rules is |
|
written to the standard error. |
|
If there are any |
|
.Tn LALR(1) |
|
conflicts, the number of conflicts is also written |
|
to the standard error. |
.Sh FILES |
.Sh FILES |
.Bl -tag -width /tmp/yacc.uXXXXXXXXXX -compact |
.Bl -tag -width /tmp/yacc.uXXXXXXXXXX -compact |
.It Pa y.code.c |
.It Pa y.code.c |
|
|
.It Pa /tmp/yacc.tXXXXXXXXXX |
.It Pa /tmp/yacc.tXXXXXXXXXX |
.It Pa /tmp/yacc.uXXXXXXXXXX |
.It Pa /tmp/yacc.uXXXXXXXXXX |
.El |
.El |
.Sh DIAGNOSTICS |
|
If there are rules that are never reduced, the number of such rules is |
|
written to the standard error. |
|
If there are any |
|
.Tn LALR(1) |
|
conflicts, the number of conflicts is also written |
|
to the standard error. |
|
.Sh SEE ALSO |
.Sh SEE ALSO |
.Xr yyfix 1 |
.Xr yyfix 1 |
.Sh STANDARDS |
.Sh STANDARDS |
The |
The |
.Nm yacc |
.Nm |
utility conforms to |
utility conforms to |
.St -p1003.2 . |
.St -p1003.2 . |