Module Name: src
Committed By: christos
Date: Sat Sep 14 22:13:34 UTC 2024
Modified Files:
src/external/bsd/byacc/bin: yacc.1
Log Message:
sync with current man page
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/byacc/bin/yacc.1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/byacc/bin/yacc.1
diff -u src/external/bsd/byacc/bin/yacc.1:1.9 src/external/bsd/byacc/bin/yacc.1:1.10
--- src/external/bsd/byacc/bin/yacc.1:1.9 Sun Jul 26 20:34:56 2020
+++ src/external/bsd/byacc/bin/yacc.1 Sat Sep 14 18:13:34 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: yacc.1,v 1.9 2020/07/27 00:34:56 uwe Exp $
+.\" $NetBSD: yacc.1,v 1.10 2024/09/14 22:13:34 christos Exp $
.\"
.\" Copyright (c) 1989, 1990 The Regents of the University of California.
.\" All rights reserved.
@@ -32,9 +32,9 @@
.\"
.\" from: @(#)yacc.1 5.7 (Berkeley) 7/30/91
.\" from: Id: yacc.1,v 1.24 2014/10/06 00:03:48 tom Exp
-.\" $NetBSD: yacc.1,v 1.9 2020/07/27 00:34:56 uwe Exp $
+.\" $NetBSD: yacc.1,v 1.10 2024/09/14 22:13:34 christos Exp $
.\"
-.Dd October 5, 2014
+.Dd September 14, 2024
.Dt YACC 1
.Os
.Sh NAME
@@ -44,8 +44,9 @@
parser generator
.Sh SYNOPSIS
.Nm
-.Op Fl BdgilLPrtvVy
+.Op Fl BdhgilLPrtvVy
.Op Fl b Ar file_prefix
+.Op Fl H Ar defines_file
.Op Fl o Ar output_file
.Op Fl p Ar symbol_prefix
.Ar filename
@@ -78,14 +79,26 @@ The default prefix is the character
Create a backtracking parser (compile-type configuration for
.Nm ) .
.It Fl d
-The
-.Fl d
-option causes the header file
+causes the header file
.Pa y.tab.h
to be written.
It contains
.No #define Ns 's
for the token identifiers.
+.It Fl h
+print a usage message to the standard error.
+.It Fl H Ar defines_file
+causes
+.No #define Ns 's
+for the token identifiers
+to be written to the given
+.Ar defines_file
+rather
+than the
+.Pa y.tab.h
+file used by the
+.Fl d
+option.
.It Fl g
The
.Fl g
@@ -146,21 +159,13 @@ Enable position processing, e.g.,
(compile-type configuration for
.Nm ) .
.It Fl o Ar output_file
-Specify the filename for the parser file.
+specify the filename for the parser file.
If this option is not given, the output filename is
the file prefix concatenated with the file suffix, e.g.
.Pa y.tab.c .
This overrides the
.Fl b
option.
-.It Fl P
-The
-.Fl P
-options instructs
-.Nm
-to create a reentrant parser, like
-.Ql %pure-parser
-does.
.It Fl p Ar symbol_prefix
The
.Fl p
@@ -169,6 +174,9 @@ the string denoted by
.Ar symbol_prefix .
The default prefix is the string
.Ql yy .
+.It Fl P
+create a reentrant parser, e.g.,
+.Ql %pure-parser .
.It Fl r
The
.Fl r
@@ -237,16 +245,16 @@ The
option changes the preprocessor directives generated by
.Nm
so that debugging statements will be incorporated in the compiled code.
-.It Fl V
-The
-.Fl V
-option prints the version number to the standard output.
.It Fl v
The
.Fl v
option causes a human-readable description of the generated parser to
be written to the file
.Pa y.output .
+.It Fl V
+The
+.Fl V
+print the version number to the standard output.
.It Fl y
.Nm
ignores this option,
@@ -254,23 +262,80 @@ which
.Xr bison 1
supports for ostensible POSIX compatibility.
.El
+.Pp
+The filename parameter is not optional.
+However,
+.Nm
+accepts a single
+.Dq \&-
+to read the grammar from the standard input.
+A double
+.Dq \&--
+marker denotes the end of options.
+A single filename parameter is expected after a
+.Dq \&--
+marker.
.Sh EXTENSIONS
.Nm
provides some extensions for
compatibility with
.Xr bison 1
and other implementations of yacc.
+It accepts several
+.Ql long options
+which have equivalents in
+.Nm .
The
.Ql %destructor
and
.Ql %locations
features are available only if
.Nm yacc
-has been configured and compiled to support the back-tracking functionality.
+has been configured and compiled to support the back-tracking
+.Aq ( btyacc )
+functionality.
The remaining features are always available:
-.Bl -tag -width Ic
+.Bl -tag -width Fl
+.It Ic %code Ar keyword { Ar code Ic }
+Adds the indicated source code at a given point in the output
+file.
+The optional
+.Ar keyword
+tells yacc where to insert the
+.Ar code :
+.Bl -tag -width Fl
+.It Ic top
+just after the version-definition in the generated code-file.
+.It Ic requires
+just after the declaration of public parser variables.
+If the
+.Fl d
+option is given, the code is inserted at the beginning of the
+.Ar defines_file .
+.It Ic provides
+just after the declaration of private parser variables.
+If the
+.Fl d
+option is given, the code is inserted at the end of the
+.Ar defines_file .
+.El
+.Pp
+If no
+.Ar keyword
+is given, the code is inserted at the beginning of
+the section of code copied verbatim from the source file.
+Multiple
+.Ar %code
+directives may be given;
+.Nm
+inserts those into the corresponding code- or defines_file in the order that
+they appear in the source file.
+.It Ic %debug
+This has the same effect as the
+.Fl t
+command-line option.
.It Ic %destructor { Ar code Ic } Ar symbol Ns +
-Defines code that is invoked when a symbol is automatically
+defines code that is invoked when a symbol is automatically
discarded during error recovery.
This code can be used to
reclaim dynamically allocated memory associated with the corresponding
@@ -313,24 +378,29 @@ unless that symbol has its own per-symbo
Two categories of default destructor are supported that are
invoked when discarding any grammar symbol that has no per-symbol and no
per-type destructor:
-.Pp
+.Bl -bullet
+.It
The code for
.Sq Li \*[Lt]*\*[Gt]
is used
for grammar symbols that have an explicitly declared semantic type tag
(via
.Ql %type ) ;
-.Pp
+.It
The code for
.Sq Li \*[Lt]\*[Gt]
is used for grammar symbols that have no declared semantic type tag.
+.El
+.It Ic %empty
+ignored by
+.Nm .
.It Ic %expect Ar number
-Tell
+tells
.Nm
the expected number of shift/reduce conflicts.
That makes it only report the number if it differs.
.It Ic %expect-rr Ar number
-Tell
+tell
.Nm
the expected number of reduce/reduce conflicts.
That makes it only report the number if it differs.
@@ -464,7 +534,8 @@ yacc.
For instance, there is
.Xr bison 1 .
Here are a few differences:
-.Pp
+.Bl -bullet
+.It
.Nm
accepts an equals mark preceding the left curly brace
of an action (as in the original grammar file
@@ -475,7 +546,7 @@ of an action (as in the original grammar
statcmd();
}
.Ed
-.Pp
+.It
.Nm
and
.Xr bison 1
@@ -487,7 +558,7 @@ makes forward reference to common functi
and
.Fn yyerror
without providing prototypes.
-.Pp
+.It
.Xr bison 1
support for
.Ql %expect
@@ -495,17 +566,17 @@ is broken in more than one release.
For best results using
.Xr bison 1 ,
delete that directive.
-.Pp
+.It
.Xr bison 1
has no equivalent for some of
.Nm Ns 's
command-line options, relying on directives embedded in the grammar file.
-.Pp
+.It
.Xr bison 1
.Fl y
option does not affect bison's lack of support for
features of AT\*[Am]T yacc which were deemed obsolescent.
-.Pp
+.It
.Nm
accepts multiple parameters with
.Ql %lex-param
@@ -520,7 +591,7 @@ in two forms
.Xr bison 1
accepts the latter (though undocumented), but depending on the
release may generate bad code.
-.Pp
+.It
Like
.Xr bison 1 ,
.Nm
@@ -545,6 +616,7 @@ but
for destructors.
.Nm
matches this behavior.
+.El
.Sh ENVIRONMENT
The following environment variable is referenced by
.Nm :
@@ -596,6 +668,8 @@ If there are any
conflicts, the number of conflicts is also written
to the standard error.
.\" .Sh SEE ALSO
+.Xr flex 1 ,
+.Xr lex 1
.\" .Xr yyfix 1
.Sh STANDARDS
The