I suppose we should produce some yacc.1, but should it be:
- a stub that says that this is bison -y, read bison(1)
- be a copy of bison.1 with the precision that this is
bison -y.
- be a copy of bison.1 (with s/bison/yacc/, which is, btw,
not done in yacc --help).
I think 1 or 2 are ok.
Another question is whether we leave bison.1 in the repository.
I left it there, so that we don't require help2man from maintainers
(it is called via missing).
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
Generate bison.1 using help2man.
* doc/common.x, doc/bison.x: New.
* doc/Makefile.am (bison.1, .x.1): New.
The code is taken from autoconf-2.61/man/Makefile.am.
* configure.ac: Look for help2man.
+2007-11-04 Akim Demaille <[EMAIL PROTECTED]>
+
Complete --help.
* src/getargs.c (usage): Document -W, make it clear that -d,
-g and -x have optional arguments.
Index: configure.ac
===================================================================
RCS file: /cvsroot/bison/bison/configure.ac,v
retrieving revision 1.81
diff -u -r1.81 configure.ac
--- configure.ac 15 Aug 2007 20:21:20 -0000 1.81
+++ configure.ac 4 Nov 2007 21:00:43 -0000
@@ -1,6 +1,6 @@
# Configure template for GNU Bison. -*-Autoconf-*-
#
-# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
@@ -39,7 +39,7 @@
yes|no) ;;
*) AC_MSG_ERROR([bad value ${enableval} for gcc-warnings option]) ;;
esac],
- [enableval=no])
+ [enableval=no])
if test "${enableval}" = yes; then
gl_WARNING_CFLAGS([-Werror])
AC_SUBST([WERROR_CFLAGS], [$WARNING_CFLAGS])
@@ -87,6 +87,7 @@
AC_MSG_ERROR([GNU M4 1.4 is required])
fi
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the GNU M4 executable name.])
+AM_MISSING_PROG([HELP2MAN], [help2man])
# Checks for header files.
AC_CHECK_HEADERS_ONCE([locale.h])
@@ -138,11 +139,11 @@
gt_JAVAEXEC
AC_CONFIG_FILES([Makefile
- build-aux/Makefile
- po/Makefile.in
- data/Makefile
- etc/Makefile
+ build-aux/Makefile
+ po/Makefile.in
+ data/Makefile
+ etc/Makefile
examples/Makefile
examples/calc++/Makefile
- lib/Makefile src/Makefile doc/Makefile])
+ lib/Makefile src/Makefile doc/Makefile])
AC_OUTPUT
Index: doc/Makefile.am
===================================================================
RCS file: /cvsroot/bison/bison/doc/Makefile.am,v
retrieving revision 1.14
diff -u -r1.14 Makefile.am
--- doc/Makefile.am 15 Aug 2007 20:21:20 -0000 1.14
+++ doc/Makefile.am 4 Nov 2007 21:00:43 -0000
@@ -1,5 +1,5 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
-## Copyright (C) 2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation,
Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,22 +16,72 @@
AM_MAKEINFOFLAGS = --no-split
info_TEXINFOS = bison.texinfo
-man_MANS = bison.1
bison_TEXINFOS = gpl-3.0.texi fdl.texi
-EXTRA_DIST = bison.1 refcard.tex
-
-CLEANFILES = refcard.dvi refcard.log refcard.ps bison.fns
+CLEANFILES = bison.fns
CLEANDIRS = *.t2d
clean-local:
rm -rf $(CLEANDIRS)
+## ---------- ##
+## Ref card. ##
+## ---------- ##
+
+EXTRA_DIST = refcard.tex
+
+CLEANFILES += refcard.dvi refcard.log refcard.ps
+
refcard.dvi: refcard.tex
tex refcard.tex
refcard.ps: refcard.dvi
+## ----------- ##
+## Man Pages. ##
+## ----------- ##
+
+dist_man_MANS = $(srcdir)/bison.1
+
+EXTRA_DIST += $(dist_man_MANS:.1=.x) common.x
+MAINTAINERCLEANFILES = $(dist_man_MANS)
+
+# Depend on configure.ac to get version number changes.
+common_dep = $(top_srcdir)/configure.ac $(srcdir)/common.x
+srcsrcdir = $(top_srcdir)/bin
+$(srcdir)/bison.1: $(common_dep) $(top_srcdir)/src/getargs.c
+
+remove_time_stamp = 's/^\(\.TH[^"]*"[^"]*"[^"]*\)"[^"]*"/\1/'
+
+MOSTLYCLEANFILES = $(srcdir)/*.t
+
+SUFFIXES = .x .1
+
+PREPATH = $(top_builddir)/src
+.x.1:
+ @program=`expr "/$*" : '.*/\(.*\)'` && \
+ save_IFS=$IFS; \
+ IFS=$(PATH_SEPARATOR); \
+ for dir in $(PREPATH); do \
+ IFS=$save_IFS; \
+ echo cd $$dir '&&' $(MAKE) $(AM_MAKEFLAGS) $$program && \
+ (cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $$program) || exit; \
+ done
+ @echo "Updating man page $@"
+ PATH="$(PREPATH)$(PATH_SEPARATOR)$$PATH"; \
+ export PATH; \
+ $(HELP2MAN) \
+ --include=$*.x \
+ --include=$(srcdir)/common.x \
+ [EMAIL PROTECTED] `echo '$*' | sed 's,.*/,,'`
+ if sed $(remove_time_stamp) $@ >[EMAIL PROTECTED] 2>/dev/null &&
\
+ sed $(remove_time_stamp) [EMAIL PROTECTED] | cmp [EMAIL PROTECTED] -
>/dev/null 2>&1; then \
+ touch $@; \
+ else \
+ mv [EMAIL PROTECTED] $@;
\
+ fi
+ rm -f [EMAIL PROTECTED]
+
## -------------- ##
## Doxygenation. ##
Index: doc/bison.1
===================================================================
RCS file: /cvsroot/bison/bison/doc/bison.1,v
retrieving revision 1.15
diff -u -r1.15 bison.1
--- doc/bison.1 12 Aug 2007 02:12:29 -0000 1.15
+++ doc/bison.1 4 Nov 2007 21:00:43 -0000
@@ -1,65 +1,10 @@
-.TH BISON 1 local
+.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36.
+.TH BISON "1" "November 2007" "bison 2.3a+" "User Commands"
.SH NAME
bison \- GNU Project parser generator (yacc replacement)
.SH SYNOPSIS
.B bison
-[
-.BI \-b " file-prefix"
-] [
-.BI \-\-file-prefix= file-prefix
-] [
-.B \-d
-] [
-.BI \-\-defines= defines-file
-] [
-.B \-g
-] [
-.BI \-\-graph= graph-file
-] [
-.B \-k
-] [
-.B \-\-token-table
-] [
-.B \-l
-] [
-.B \-\-no-lines
-] [
-.BI \-o " outfile"
-] [
-.BI \-\-output-file= outfile
-] [
-.BI \-p " prefix"
-] [
-.BI \-\-name-prefix= prefix
-] [
-.B \-t
-] [
-.B \-\-debug
-] [
-.B \-v
-] [
-.B \-\-verbose
-] [
-.B \-V
-] [
-.B \-\-version
-] [
-.B \-y
-] [
-.B \-\-yacc
-] [
-.B \-h
-] [
-.B \-\-help
-] [
-.B \-\-fixed-output-files
-]
-file
-.br
-.B yacc
-[
-.I "similar options and operands"
-]
+[\fIOPTION\fR]... \fIFILE\fR
.SH DESCRIPTION
.I Bison
is a parser generator in the style of
@@ -112,245 +57,132 @@
.BR \-\-file-prefix ,
connect the option name and the argument with
.BR = .
-.SS OPTIONS
+.PP
+Generate LALR(1) and GLR parsers.
+.PP
+Mandatory arguments to long options are mandatory for short options too.
+.SS "Operation modes:"
.TP
-.BI \-b " file-prefix"
-.br
-.ns
+\fB\-h\fR, \fB\-\-help\fR
+display this help and exit
.TP
-.BI \-\-file-prefix= file-prefix
-Specify a prefix to use for all
-.I bison
-output file names. The names are
-chosen as if the input file were named
-\fIfile-prefix\fP\fB.c\fP.
+\fB\-V\fR, \fB\-\-version\fR
+output version information and exit
.TP
-.B \-d
-.br
-.ns
-Write an extra output file containing macro definitions for the token
-type names defined in the grammar and the semantic value type
-.BR YYSTYPE ,
-as well as a few
-.B extern
-variable declarations.
-.sp
-If the parser output file is named
-.IB name .c
-then this file
-is named
-\fIname\fP\fB.h\fP.
-.sp
-This output file is essential if you wish to put the definition of
-.B yylex
-in a separate source file, because
-.B yylex
-needs to be able to refer to token type codes and the variable
-.BR yylval .
-.TP
-.BI \-\-defines= defines-file
-The behavior of
-.B \-\-defines
-is the same than
-.B \-d
-option.
-The only difference is that it has an optional argument which is
-the name of the output filename.
+\fB\-\-print\-localedir\fR
+output directory containing locale\-dependent data
.TP
-.BI \-g
-.br
-.ns
-Output a graph of the grammar automaton computed by
-Bison. If the grammar file is
-.BR foo.y
-, the output file will be
-.BR foo.dot .
-.TP
-.BI \-\-graph= graph-file
-The behavior of
-.BI \-\-graph
-is the same than
-.BI \-g
-option. The only difference is that it has an optional argument which
-is the name of the output graph filename.
+\fB\-\-print\-datadir\fR
+output directory containing skeletons and XSLT
.TP
-.B \-k
-.br
-.ns
+\fB\-y\fR, \fB\-\-yacc\fR
+emulate POSIX Yacc
.TP
-.B \-\-token-table
-This switch causes the
-.IB name .tab.c
-output to include a list of
-token names in order by their token numbers; this is defined in the array
-.IR yytname .
-Also generated
-are #defines for
-.IR YYNTOKENS ,
-.IR YYNNTS ,
-.IR YYNRULES ,
-and
-.IR YYNSTATES .
+\fB\-W\fR, \fB\-\-warnings\fR=\fI[CATEGORY]\fR
+report the warnings falling in CATEGORY
+.SS "Parser:"
.TP
-.B \-l
-.br
-.ns
+\fB\-S\fR, \fB\-\-skeleton\fR=\fIFILE\fR
+specify the skeleton to use
.TP
-.B \-\-no-lines
-Don't put any
-.B #line
-preprocessor commands in the parser file.
-Ordinarily
-.I bison
-puts them in the parser file so that the C compiler
-and debuggers will associate errors with your source file, the
-grammar file. This option causes them to associate errors with the
-parser file, treating it an independent source file in its own right.
+\fB\-t\fR, \fB\-\-debug\fR
+instrument the parser for debugging
.TP
-.BI \-o " outfile"
-.br
-.ns
+\fB\-\-locations\fR
+enable locations computation
.TP
-.BI \-\-output-file= outfile
-Specify the name
-.I outfile
-for the parser file.
-.sp
-The other output files' names are constructed from
-.I outfile
-as described under the
-.B \-v
-and
-.B \-d
-switches.
+\fB\-p\fR, \fB\-\-name\-prefix\fR=\fIPREFIX\fR
+prepend PREFIX to the external symbols
.TP
-.BI \-p " prefix"
-.br
-.ns
+\fB\-l\fR, \fB\-\-no\-lines\fR
+don't generate `#line' directives
.TP
-.BI \-\-name-prefix= prefix
-Rename the external symbols used in the parser so that they start with
-.I prefix
-instead of
-.BR yy .
-The precise list of symbols renamed is
-.BR yyparse ,
-.BR yylex ,
-.BR yyerror ,
-.BR yylval ,
-.BR yychar ,
-and
-.BR yydebug .
-.sp
-For example, if you use
-.BR "\-p c" ,
-the names become
-.BR cparse ,
-.BR clex ,
-and so on.
+\fB\-k\fR, \fB\-\-token\-table\fR
+include a table of token names
+.SS "Output:"
.TP
-.B \-t
-.br
-.ns
+\fB\-d\fR, \fB\-\-defines\fR[=\fIFILE\fR]
+also produce a header file
.TP
-.B \-\-debug
-In the parser file, define the macro
-.B YYDEBUG
-to 1 if it is not already defined,
-so that the debugging facilities are compiled.
+\fB\-r\fR, \fB\-\-report\fR=\fITHINGS\fR
+also produce details on the automaton
.TP
-.B \-v
-.br
-.ns
+\fB\-v\fR, \fB\-\-verbose\fR
+same as `\-\-report=state'
.TP
-.B \-\-verbose
-Write an extra output file containing verbose descriptions of the
-parser states and what is done for each type of lookahead token in
-that state.
-.sp
-This file also describes all the conflicts, both those resolved by
-operator precedence and the unresolved ones.
-.sp
-The file's name is made by removing
-.B .tab.c
-or
-.B .c
-from the parser output file name, and adding
-.B .output
-instead.
-.sp
-Therefore, if the input file is
-.BR foo.y ,
-then the parser file is called
-.B foo.tab.c
-by default. As a consequence, the verbose
-output file is called
-.BR foo.output .
+\fB\-b\fR, \fB\-\-file\-prefix\fR=\fIPREFIX\fR
+specify a PREFIX for output files
.TP
-.B \-V
-.br
-.ns
+\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
+leave output to FILE
.TP
-.B \-\-version
-Print the version number of
-.I bison
-and exit.
+\fB\-g\fR, \fB\-\-graph\fR[=\fIFILE\fR]
+also output a graph of the automaton
.TP
-.B \-h
-.br
-.ns
+\fB\-x\fR, \fB\-\-xml\fR[=\fIFILE\fR]
+also output an XML report of the automaton
+.SS "Warning categories include:"
.TP
-.B \-\-help
-Print a summary of the options to
-.I bison
-and exit.
+`midrule\-values'
+unset or unused midrule values
.TP
-.B \-y
-.br
-.ns
+`yacc'
+incompatibilities with POSIX YACC
.TP
-.B \-\-yacc
-.br
-.ns
+`all'
+all the warnings
.TP
-.B \-\-fixed-output-files
-Equivalent to
-.BR "\-o y.tab.c" ;
-the parser output file is called
-.BR y.tab.c ,
-and the other outputs are called
-.B y.output
-and
-.BR y.tab.h .
-The purpose of this switch is to imitate
-.IR yacc 's
-output file name conventions.
-Thus, the following shell script can substitute for
-.I yacc
-and is often installed as
-.IR yacc :
-.sp
-.RS
-.ft B
-bison \-y "$@"
-.ft R
-.sp
-.RE
-.SH SEE ALSO
-.IR yacc (1)
-.br
-The
-.IR "Bison Reference Manual" ,
-included as the file
-.B bison.texinfo
-in the
-.I bison
-source distribution.
-.SH DIAGNOSTICS
-Self explanatory.
+`no\-CATEGORY'
+turn off warnings in CATEGORY
+.TP
+`none'
+turn off all the warnings
+.TP
+`error'
+treat warnings as errors
+.SS "THINGS is a list of comma separated words that can include:"
+.TP
+`state'
+describe the states
+.TP
+`itemset'
+complete the core item sets with their closure
+.TP
+`lookahead'
+explicitly associate lookahead tokens to items
+.TP
+`solved'
+describe shift/reduce conflicts solving
+.TP
+`all'
+include all the above information
+.TP
+`none'
+disable the report
+.SH AUTHOR
+Written by Robert Corbett and Richard Stallman.
+.SH "REPORTING BUGS"
+Report bugs to <[EMAIL PROTECTED]>.
+.PP
+Id: ChangeLog,v 1.1745 2007/10/29 17:36:38 jdenny Exp
.SH COPYRIGHT
-Copyright \(co 2006 Free Software Foundation, Inc.
+Copyright \(co 2007 Free Software Foundation, Inc.
.br
-This is free software. You may redistribute copies of it under the terms of
-the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
-There is NO WARRANTY, to the extent permitted by law.
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+.SH "SEE ALSO"
+.BR lex (1),
+.BR flex (1),
+.BR yacc (1).
+.PP
+The full documentation for
+.B bison
+is maintained as a Texinfo manual. If the
+.B info
+and
+.B bison
+programs are properly installed at your site, the command
+.IP
+.B info bison
+.PP
+should give you access to the complete manual.
Index: doc/bison.x
===================================================================
RCS file: doc/bison.x
diff -N doc/bison.x
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ doc/bison.x 4 Nov 2007 21:00:43 -0000
@@ -0,0 +1,55 @@
+[name]
+bison \- GNU Project parser generator (yacc replacement)
+
+[description]
+.I Bison
+is a parser generator in the style of
+.IR yacc (1).
+It should be upwardly compatible with input files designed
+for
+.IR yacc .
+.PP
+Input files should follow the
+.I yacc
+convention of ending in
+.BR .y .
+Unlike
+.IR yacc ,
+the generated files do not have fixed names, but instead use the prefix
+of the input file.
+Moreover, if you need to put
+.I C++
+code in the input file, you can end his name by a C++-like extension
+(.ypp or .y++), then bison will follow your extension to name the
+output file (.cpp or .c++).
+For instance, a grammar description file named
+.B parse.yxx
+would produce the generated parser in a file named
+.BR parse.tab.cxx ,
+instead of
+.IR yacc 's
+.B y.tab.c
+or old
+.I Bison
+version's
+.BR parse.tab.c .
+.PP
+This description of the options that can be given to
+.I bison
+is adapted from the node
+.B Invocation
+in the
+.B bison.texinfo
+manual, which should be taken as authoritative.
+.PP
+.I Bison
+supports both traditional single-letter options and mnemonic long
+option names. Long option names are indicated with
+.B \-\-
+instead of
+.BR \- .
+Abbreviations for option names are allowed as long as they
+are unique. When a long option takes an argument, like
+.BR \-\-file-prefix ,
+connect the option name and the argument with
+.BR = .
Index: doc/common.x
===================================================================
RCS file: doc/common.x
diff -N doc/common.x
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ doc/common.x 4 Nov 2007 21:00:43 -0000
@@ -0,0 +1,4 @@
+[see also]
+.BR lex (1),
+.BR flex (1),
+.BR yacc (1).