diff -Naur yayacc.orig/Makefile.in yayacc/Makefile.in
--- yayacc.orig/Makefile.in	Sun May  6 17:05:35 2001
+++ yayacc/Makefile.in	Mon Aug 22 17:58:33 2005
@@ -27,9 +27,17 @@
 	 (cd $$i; $(MAKE) clean) ;\
 	done
 
+distclean:
+	for i in $(SUBDIRS); do \
+	 (cd $$i; $(MAKE) distclean) ;\
+	done
+	rm -rf autom4te.cache
+	rm -f docs/Makefile Makefile config.cache config.status config.log aclocal.m4
 
 reconfigure:
-	autoconf -l config
+	aclocal-1.6 -I demo/config
+	autoconf-2.59
+	autoheader-2.59
 
 distributive: 
 	(cd ..; tar -cvzf @PACKAGE@-@VERSION@.tar.gz `cat yayacc/FLIST`)
diff -Naur yayacc.orig/config/mkinstalldirs yayacc/config/mkinstalldirs
--- yayacc.orig/config/mkinstalldirs	Thu Jan  1 00:00:00 1970
+++ yayacc/config/mkinstalldirs	Mon Aug 22 17:03:02 2005
@@ -0,0 +1,99 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
+
+# process command line arguments
+while test $# -gt 0 ; do
+   case "${1}" in
+     -h | --help | --h* )			# -h for help
+	echo "${usage}" 1>&2; exit 0 ;;
+     -m )					# -m PERM arg
+	shift
+	test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
+	dirmode="${1}"
+	shift ;;
+     -- ) shift; break ;;			# stop option processing
+     -* ) echo "${usage}" 1>&2; exit 1 ;;	# unknown option
+     * )  break ;;				# first non-opt arg
+   esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+0) exit 0 ;;
+esac
+
+case $dirmode in
+'')
+  if mkdir -p -- . 2>/dev/null; then
+    echo "mkdir -p -- $*"
+    exec mkdir -p -- "$@"
+  fi ;;
+*)
+  if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+    echo "mkdir -m $dirmode -p -- $*"
+    exec mkdir -m "$dirmode" -p -- "$@"
+  fi ;;
+esac
+
+for file
+do
+   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+   shift
+
+   pathcomp=
+   for d
+   do
+     pathcomp="$pathcomp$d"
+     case "$pathcomp" in
+       -* ) pathcomp=./$pathcomp ;;
+     esac
+
+     if test ! -d "$pathcomp"; then
+	echo "mkdir $pathcomp"
+
+	mkdir "$pathcomp" || lasterr=$?
+
+	if test ! -d "$pathcomp"; then
+	  errstatus=$lasterr
+	else
+	  if test ! -z "$dirmode"; then
+	     echo "chmod $dirmode $pathcomp"
+
+	     lasterr=""
+	     chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+	     if test ! -z "$lasterr"; then
+	       errstatus=$lasterr
+	     fi
+	  fi
+	fi
+     fi
+
+     pathcomp="$pathcomp/"
+   done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 3
+# End:
+# mkinstalldirs ends here
diff -Naur yayacc.orig/configure.in yayacc/configure.in
--- yayacc.orig/configure.in	Thu Jun  7 09:49:52 2001
+++ yayacc/configure.in	Mon Aug 22 17:56:36 2005
@@ -1,11 +1,21 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_CONFIG_AUX_DIR(config)
 AC_INIT(src/closure.c)
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_HEADER(src/config.h)
 
 PACKAGE=yayacc
 AC_SUBST(PACKAGE)
 VERSION=1.0.1
 AC_SUBST(VERSION)
+pubheader="interface/GradSoft/YaYaccConfig.h"
+
+dnl YAYACC_SUBST_YESNO([NAME],[YESNO_VALUE])
+AC_DEFUN([YAYACC_SUBST_YESNO],
+[case x$2 in
+    xyes) yayacc_val=1;;
+    *) yayacc_val=0;;
+esac
+AC_SUBST([$1], [$yayacc_val])])
 
 dnl Checks for programs.
 AC_PROG_CC
@@ -15,7 +25,7 @@
 
 dnl Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS(unistd.h)
+AC_CHECK_HEADERS([unistd.h paths.h])
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -23,6 +33,20 @@
 dnl Checks for library functions.
 AC_TYPE_SIGNAL
 
-AC_OUTPUT(Makefile src/Makefile docs/Makefile \
-  interface/Makefile interface/GradSoft/Makefile)
-
+dnl check for C++ compiler switches.
+AC_CXX_NAMESPACES
+YAYACC_SUBST_YESNO([HAVE_NAMESPACES], [$ac_cv_cxx_namespaces])
+
+AC_CONFIG_COMMANDS([YaYaccConfig.h],[
+    AC_MSG_NOTICE([creating $pubheader])
+    if cmp -s "$pubheader" "$pubheader.tmp"; then
+        AC_MSG_NOTICE([$pubheader is unchanged])
+        rm "$pubheader.tmp"
+    else
+        mv "$pubheader.tmp" "$pubheader"
+    fi
+],[pubheader=$pubheader])
+
+AC_OUTPUT([Makefile src/Makefile docs/Makefile \
+  interface/Makefile interface/GradSoft/Makefile \
+  $pubheader.tmp:$pubheader.in])
diff -Naur yayacc.orig/demo/Makefile.in yayacc/demo/Makefile.in
--- yayacc.orig/demo/Makefile.in	Tue Apr 24 14:28:06 2001
+++ yayacc/demo/Makefile.in	Mon Aug 22 17:18:02 2005
@@ -8,3 +8,13 @@
 
 clean:
 	for i in $(SUBDIRS); do (cd $$i; $(MAKE) clean ); done
+
+distclean:
+	for i in $(SUBDIRS); do (cd $$i; $(MAKE) distclean ); done
+	rm -rf autom4te.cache
+	rm -f Makefile include/YaYaccDemoConfig.h config.cache config.status config.log aclocal.m4
+
+reconfigure:
+	aclocal-1.6 -I config
+	autoconf-2.59
+
diff -Naur yayacc.orig/demo/calculator/CalculatorLexer.cpp yayacc/demo/calculator/CalculatorLexer.cpp
--- yayacc.orig/demo/calculator/CalculatorLexer.cpp	Mon May  7 12:45:12 2001
+++ yayacc/demo/calculator/CalculatorLexer.cpp	Mon Aug 22 16:50:40 2005
@@ -1,12 +1,13 @@
 #ifndef __CalculatorLexer_h
 #include <CalculatorLexer.h>
 #endif
+#include <iostream>
 
 #ifndef __y_tab_h
 #include <y.tab.h>
 #endif
 
-CalculatorLexer::CalculatorLexer(istream& is)
+CalculatorLexer::CalculatorLexer(GRADSOFT_YAYACC_STD istream& is)
   :is_(is),
    state_(in_whitespace)
 {
@@ -18,7 +19,7 @@
 
 int CalculatorLexer::readToken()
 {
- int ch;
+ int ch = 0; /* initialize to suppress gcc's warning */
  for(;;) {
   switch(state_) {
     case in_whitespace: 
diff -Naur yayacc.orig/demo/calculator/CalculatorLexer.h yayacc/demo/calculator/CalculatorLexer.h
--- yayacc.orig/demo/calculator/CalculatorLexer.h	Tue Apr 24 14:28:07 2001
+++ yayacc/demo/calculator/CalculatorLexer.h	Mon Aug 22 16:49:43 2005
@@ -13,6 +13,8 @@
 #include <GradSoft/YaYacc.h>
 #endif
 
+#include <iosfwd> /* for std::istream */
+
 #ifdef HAVE_NAMESPACES
 using namespace GradSoft;
 #endif
@@ -20,7 +22,7 @@
 class CalculatorLexer: public YYLexer<Calculator>
 {
 private:
- istream& is_;
+ GRADSOFT_YAYACC_STD istream& is_;
  enum{
    in_whitespace,in_digit,in_end
  } state_;
@@ -28,7 +30,7 @@
 
 public:
 
- CalculatorLexer(istream& is);
+ CalculatorLexer(GRADSOFT_YAYACC_STD istream& is);
  ~CalculatorLexer();
 
  int readToken();
diff -Naur yayacc.orig/demo/calculator/Main.cpp yayacc/demo/calculator/Main.cpp
--- yayacc.orig/demo/calculator/Main.cpp	Mon May  7 12:34:29 2001
+++ yayacc/demo/calculator/Main.cpp	Mon Aug 22 16:52:43 2005
@@ -1,20 +1,23 @@
 #include <CalculatorLexer.h>
+#include <iostream>
+#include <iomanip>
+#define STD GRADSOFT_YAYACC_STD
 
 int main(int argc, char** argv)
 {
  
- CalculatorLexer lexer(cin);
+ CalculatorLexer lexer(STD cin);
  bool quit = false;
  YYParser<Calculator> parser(lexer,quit);
  //parser.setDebugLevel(9);
 
  for(;;) {
-  cout << ">" << flush;
+  STD cout << ">" << STD flush;
   if (parser.parse()!=0) {
-    cerr << "Parse error:" << parser.getErrorMessage() << endl; 
+    STD cerr << "Parse error:" << parser.getErrorMessage() << STD endl; 
   }
   if (quit) break;
-  cout << "result:" << parser.getValue() << endl;
+  STD cout << "result:" << parser.getValue() << STD endl;
   lexer.reset();
  }
 
diff -Naur yayacc.orig/demo/calculator/Makefile.in yayacc/demo/calculator/Makefile.in
--- yayacc.orig/demo/calculator/Makefile.in	Sun May  6 17:20:44 2001
+++ yayacc/demo/calculator/Makefile.in	Mon Aug 22 17:17:16 2005
@@ -14,13 +14,15 @@
 
 clean:
 	-rm *.o y.tab.cpp y.tab.h $(TARGET)
+distclean: clean
+	rm -f Makefile
 
 .SUFFIXES: .o .cpp .h .y
 
-y.tab.cpp: Calculator.y
+y.tab.cpp: Calculator.y $(YAYACC)
 	$(YAYACC) -n Calculator Calculator.y
 
-y.tab.h: Calculator.y
+y.tab.h: Calculator.y $(YAYACC)
 	$(YAYACC) -n Calculator Calculator.y
 
 y.tab.o: y.tab.cpp
diff -Naur yayacc.orig/demo/configure.in yayacc/demo/configure.in
--- yayacc.orig/demo/configure.in	Sun Apr  8 13:55:56 2001
+++ yayacc/demo/configure.in	Mon Aug 22 16:53:32 2005
@@ -29,10 +29,10 @@
 
 dnl Checks for library functions.
 dnl AC_CHECK_FUNCS(random)
-RSSH_ENABLE_PTHREADS
-AC_CHECK_FUNCS(pthread_rwlock_init)
-AC_CHECK_FUNCS(rwlock_init)
-AC_CHECK_HEADER(unistd.h,AC_DEFINE(HAVE_UNISTD_H,1))
+dnl RSSH_ENABLE_PTHREADS
+dnl AC_CHECK_FUNCS(pthread_rwlock_init)
+dnl AC_CHECK_FUNCS(rwlock_init)
+dnl AC_CHECK_HEADER(unistd.h,AC_DEFINE(HAVE_UNISTD_H,1))
 
 
 dnl Checks for C++ library functions.
@@ -45,12 +45,12 @@
 AC_CXX_MUTABLE
 AC_CXX_TYPENAME
 
-AC_ARG_WITH(gen,"location of GradSoft C\+\+ ToolBox",
+AC_ARG_WITH(gen,[location of GradSoft C++ ToolBox],
             gen_prefix=${with_gen}, gen_prefix=/usr/local
            )
 
 CPPFLAGS="$CPPFLAGS -I$gen_prefix/include"
-LIBS="-L$gen_prefix/lib -lThreading  $LIBS"
+LIBS="-L$gen_prefix/lib  $LIBS"
 
 dnl
 project_root=`pwd`
diff -Naur yayacc.orig/interface/GradSoft/Makefile.in yayacc/interface/GradSoft/Makefile.in
--- yayacc.orig/interface/GradSoft/Makefile.in	Sun May  6 16:34:32 2001
+++ yayacc/interface/GradSoft/Makefile.in	Mon Aug 22 18:12:37 2005
@@ -1,21 +1,27 @@
-
+top_srcdir=@top_srcdir@
 prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+includedir=@includedir@
 
 INSTALL=@INSTALL@
 INSTALL_DATA=@INSTALL_DATA@
 INSTALL_PROGRAM=@INSTALL_PROGRAM@
+MKINSTALLDIRS=$(SHELL) $(top_srcdir)/config/mkinstalldirs
 
-HEADER=YaYacc.h
+HEADERS=YaYacc.h YaYaccConfig.h
 
 default: 
 build: 
 
 install: 
-	if test ! -d $(prefix) ; then mkdir $(prefix); fi
-	if test ! -d $(prefix)/GradSoft ; then mkdir $(prefix)/GradSoft; fi
-	$(INSTALL_DATA) $(HEADER) $(prefix)/GradSoft
+	$(MKINSTALLDIRS) $(DESTDIR)$(includedir)/GradSoft
+	$(INSTALL_DATA) $(HEADERS) $(DESTDIR)$(includedir)/GradSoft
 
 uninstall:
-	-rm $(prefix)/GradSoft/$(HEADER)
+	for f in $(HEADERS); do rm -f $(DESTDIR)$(includedir)/GradSoft/$$f; done
 
 clean:
+	rm -f YaYaccConfig.h.tmp
+distclean: clean
+	rm -f Makefile YaYaccConfig.h
diff -Naur yayacc.orig/interface/GradSoft/YaYacc.h yayacc/interface/GradSoft/YaYacc.h
--- yayacc.orig/interface/GradSoft/YaYacc.h	Mon May  7 12:37:59 2001
+++ yayacc/interface/GradSoft/YaYacc.h	Mon Aug 22 16:45:15 2005
@@ -37,11 +37,17 @@
  *
  */
 
-#ifndef __GradSoft_Threading_h
-#include <GradSoft/Threading.h>
+#ifndef __GradSoft_YaYaccConfig_h
+#include <GradSoft/YaYaccConfig.h>
+#endif
+#include <cstddef> /* for NULL */
+#if GRADSOFT_YAYACC_HAVE_NAMESPACES
+# define GRADSOFT_YAYACC_STD std::
+#else
+# define GRADSOFT_YAYACC_STD
 #endif
 
-#ifdef HAVE_NAMESPACES
+#if GRADSOFT_YAYACC_HAVE_NAMESPACES
 namespace  GradSoft {
 #endif
 
@@ -154,7 +160,6 @@
 {
  int newSize, i;
  short *newss;
- YYType *newvs;
  if ((newSize = yyStackSize) == 0)
        newSize = ParserTag::initTableSize;
  else if (newSize >= ParserTag::maxTableSize)
@@ -174,14 +179,6 @@
  return 0;
 }
 
-#ifndef _STD_BAD_ALLOC
-#ifdef HAVE_NAMESPACES
-#define _STD_BAD_ALLOC std::bad_alloc
-#else
-#define _STD_BAD_ALLOC bad_alloc
-#endif
-#endif
-
 template<class ParserTag>
 typename ParserTag::YYType* YYParser<ParserTag>::reallocYYType(int newSize)
 {
@@ -200,12 +197,12 @@
     yyvs = newvs;
   }
   return yyvs;
- }catch(_STD_BAD_ALLOC){
+ }catch(GRADSOFT_YAYACC_STD bad_alloc){
   return NULL;
  }
 }
 
-#ifdef HAVE_NAMESPACES
+#if GRADSOFT_YAYACC_HAVE_NAMESPACES
 }
 #endif
 
diff -Naur yayacc.orig/interface/GradSoft/YaYaccConfig.h.in yayacc/interface/GradSoft/YaYaccConfig.h.in
--- yayacc.orig/interface/GradSoft/YaYaccConfig.h.in	Thu Jan  1 00:00:00 1970
+++ yayacc/interface/GradSoft/YaYaccConfig.h.in	Mon Aug 22 16:14:30 2005
@@ -0,0 +1,7 @@
+#ifndef __GradSoft_YaYaccConfig_h
+#define __GradSoft_YaYaccConfig_h
+
+/* 1 if the compiler supports namespaces, 0 otherwise */
+#define GRADSOFT_YAYACC_HAVE_NAMESPACES @HAVE_NAMESPACES@
+
+#endif
diff -Naur yayacc.orig/interface/Makefile.in yayacc/interface/Makefile.in
--- yayacc.orig/interface/Makefile.in	Sun May  6 16:20:40 2001
+++ yayacc/interface/Makefile.in	Mon Aug 22 17:04:43 2005
@@ -20,3 +20,12 @@
 	done
 
 clean:
+	for i in $(SUBDIRS); do \
+	 (cd $$i; $(MAKE) clean) ;\
+	done
+
+distclean:
+	for i in $(SUBDIRS); do \
+	 (cd $$i; $(MAKE) distclean) ;\
+	done
+	rm -f Makefile
diff -Naur yayacc.orig/src/Makefile.in yayacc/src/Makefile.in
--- yayacc.orig/src/Makefile.in	Sat May  5 17:46:08 2001
+++ yayacc/src/Makefile.in	Mon Aug 22 18:12:08 2005
@@ -1,7 +1,11 @@
 #	@(#)Makefile	5.3 (Berkeley) 5/12/90
 # $FreeBSD: src/usr.bin/yacc/Makefile,v 1.8 1999/08/28 01:07:58 peter Exp $
 
+top_srcdir=@top_srcdir@
 prefix=@prefix@
+exec_prefix=@exec_prefix@
+bindir=@bindir@
+includedir=@includedir@
 
 CC=@CC@
 CFLAGS=@CFLAGS@
@@ -9,6 +13,7 @@
 INSTALL=@INSTALL@
 INSTALL_DATA=@INSTALL_DATA@
 INSTALL_PROGRAM=@INSTALL_PROGRAM@
+MKINSTALLDIRS=$(SHELL) $(top_srcdir)/config/mkinstalldirs
 
 PROG=	yayacc
 SRCS=	closure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c \
@@ -26,12 +31,14 @@
 	$(CC) -o $(PROG) $(OBJS)
 
 install: $(PROG)
-	if test ! -d $(prefix) ; then mkdir $(prefix); fi
-	if test ! -d $(prefix)/bin ; then mkdir $(prefix)/bin; fi
-	$(INSTALL_PROGRAM) $(PROG) $(prefix)/bin
+	$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
+	$(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)
 
 uninstall:
-	-rm $(prefix)/bin/$(PROG)
+	rm -f $(DESTDIR)$(bindir)/$(PROG)
 
 clean:
-	-rm -f $(OBJS) yayacc
+	rm -f $(OBJS) $(PROG)
+
+distclean: clean
+	rm -f Makefile config.h
diff -Naur yayacc.orig/src/closure.c yayacc/src/closure.c
--- yayacc.orig/src/closure.c	Tue Mar 20 12:00:01 2001
+++ yayacc/src/closure.c	Mon Aug 22 12:56:28 2005
@@ -32,13 +32,18 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/usr.bin/yacc/closure.c,v 1.6 1999/08/28 01:07:58 peter Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)closure.c	5.3 (Berkeley) 5/24/93";
-#endif /* not lint */
+static char sccsid[] = "@(#)closure.c	5.3 (Berkeley) 5/24/93";
+#endif
+#endif
+
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/closure.c,v 1.12 2002/04/09 11:39:05 ru Exp $");
+#endif
 
 #include <stdlib.h>
 #include "defs.h"
@@ -47,11 +52,11 @@
 short *itemsetend;
 unsigned *ruleset;
 
-static void set_EFF __P((void));
+static void set_EFF(void);
 #ifdef DEBUG
-static void print_closure __P((int));
-static void print_EFF __P(());
-static void print_first_derives __P(());
+static void print_closure(int);
+static void print_EFF();
+static void print_first_derives();
 #endif
 
 static unsigned *first_derives;
@@ -61,12 +66,12 @@
 static void
 set_EFF()
 {
-    register unsigned *row;
-    register int symbol;
-    register short *sp;
-    register int rowsize;
-    register int i;
-    register int rule;
+    unsigned *row;
+    int symbol;
+    short *sp;
+    int rowsize;
+    int i;
+    int rule;
 
     rowsize = WORDSIZE(nvars);
     EFF = NEW2(nvars * rowsize, unsigned);
@@ -98,12 +103,12 @@
 void
 set_first_derives()
 {
-    register unsigned *rrow;
-    register unsigned *vrow;
-    register int j;
-    register unsigned k;
-    register unsigned cword = 0;
-    register short *rp;
+    unsigned *rrow;
+    unsigned *vrow;
+    int j;
+    unsigned k;
+    unsigned cword = 0;
+    short *rp;
 
     int rule;
     int i;
@@ -156,13 +161,13 @@
 short *nucleus;
 int n;
 {
-    register int ruleno;
-    register unsigned word;
-    register unsigned i;
-    register short *csp;
-    register unsigned *dsp;
-    register unsigned *rsp;
-    register int rulesetsize;
+    int ruleno;
+    unsigned word;
+    unsigned i;
+    short *csp;
+    unsigned *dsp;
+    unsigned *rsp;
+    int rulesetsize;
 
     short *csend;
     unsigned *rsend;
@@ -237,7 +242,7 @@
 print_closure(n)
 int n;
 {
-  register short *isp;
+  short *isp;
 
   printf("\n\nn = %d\n\n", n);
   for (isp = itemset; isp < itemsetend; isp++)
@@ -248,10 +253,10 @@
 static void
 print_EFF()
 {
-    register int i, j;
-    register unsigned *rowp;
-    register unsigned word;
-    register unsigned k;
+    int i, j;
+    unsigned *rowp;
+    unsigned word;
+    unsigned k;
 
     printf("\n\nEpsilon Free Firsts\n");
 
@@ -280,11 +285,11 @@
 static void
 print_first_derives()
 {
-    register int i;
-    register int j;
-    register unsigned *rp;
-    register unsigned cword;
-    register unsigned k;
+    int i;
+    int j;
+    unsigned *rp;
+    unsigned cword;
+    unsigned k;
 
     printf("\n\n\nFirst Derives\n");
 
diff -Naur yayacc.orig/src/defs.h yayacc/src/defs.h
--- yayacc.orig/src/defs.h	Fri Apr  6 13:10:03 2001
+++ yayacc/src/defs.h	Mon Aug 22 17:55:39 2005
@@ -37,13 +37,12 @@
  * SUCH DAMAGE.
  *
  *	@(#)defs.h	5.6 (Berkeley) 5/24/93
- * $FreeBSD: src/usr.bin/yacc/defs.h,v 1.8 1999/08/28 01:07:59 peter Exp $
+ * $FreeBSD: src/usr.bin/yacc/defs.h,v 1.12 2002/06/11 11:27:20 robert Exp $
  */
 
-#include <sys/cdefs.h>	/* for __P macro */
+#include "config.h"
 #include <assert.h>
 #include <ctype.h>
-#include <err.h>
 #include <stdio.h>
 
 
@@ -51,9 +50,6 @@
 /*  the following definitions are for the Tahoe		*/
 /*  they might have to be changed for other machines	*/
 
-/*  MAXCHAR is the largest unsigned character value	*/
-/*  MAXSHORT is the largest value of a C short		*/
-/*  MINSHORT is the most negative value of a C short	*/
 /*  MAXTABLE is the maximum table size			*/
 /*  BITS_PER_WORD is the number of bits in a C unsigned	*/
 /*  WORDSIZE computes the number of words needed to	*/
@@ -62,9 +58,6 @@
 /*	from r (0-indexed)				*/
 /*  SETBIT sets the n-th bit starting from r		*/
 
-#define	MAXCHAR		255
-#define	MAXSHORT	32767
-#define MINSHORT	-32768
 #define MAXTABLE	32500
 #define BITS_PER_WORD	32
 #define	WORDSIZE(n)	(((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
@@ -232,8 +225,8 @@
 extern char rflag;
 extern char tflag;
 extern char vflag;
-extern char *symbol_prefix;
-extern char *tag_name;
+extern const char *symbol_prefix;
+extern const char *tag_name;
 
 extern char *myname;
 extern char *cptr;
@@ -241,18 +234,18 @@
 extern int lineno;
 extern int outline;
 
-extern char *banner[];
-extern char *tables[];
-extern char *header[];
-extern char *body[];
-extern char *trailer[];
-extern char *open_gradsoft_namespace[];
-extern char *close_gradsoft_namespace[];
+extern const char *banner[];
+extern const char *tables[];
+extern const char *header[];
+extern const char *body[];
+extern const char *trailer[];
+extern const char *open_gradsoft_namespace[];
+extern const char *close_gradsoft_namespace[];
 
 extern char *action_file_name;
 extern char *code_file_name;
 extern char *defines_file_name;
-extern char *input_file_name;
+extern const char *input_file_name;
 extern char *output_file_name;
 extern char *text_file_name;
 extern char *union_file_name;
@@ -275,7 +268,6 @@
 extern int ntags;
 
 extern char unionized;
-extern char line_format[];
 
 extern int   start_symbol;
 extern char  **symbol_name;
@@ -323,53 +315,54 @@
 
 /* global functions */
 
-char *allocate __P((unsigned));
-void closure __P((short *, int));
-void create_symbol_table __P((void));
-void default_action_warning __P((void));
-void dollar_error __P((int, char *, char *));
-void dollar_warning __P((int, int));
-void done __P((int));
-void fatal __P((char *msg));
-void finalize_closure __P((void));
-void free_parser __P((void));
-void free_symbols __P((void));
-void free_symbol_table __P((void));
-void illegal_character __P((char *));
-void illegal_tag __P((int, char *, char *));
-void lalr __P((void));
-bucket *lookup __P((char *));
-void lr0 __P((void));
-bucket *make_bucket __P((char *));
-void make_parser __P((void));
-void no_grammar __P((void));
-void no_space __P((void));
-void open_error __P((char *));
-void output __P((void));
-void over_unionized __P((char *));
-void prec_redeclared __P((void));
-void reader __P((void));
-void reflexive_transitive_closure __P((unsigned *, int));
-void reprec_warning __P((char *));
-void restarted_warning __P((void));
-void retyped_warning __P((char *));
-void revalued_warning __P((char *));
-void set_first_derives __P((void));
-void syntax_error __P((int, char *, char *));
-void terminal_lhs __P((int));
-void terminal_start __P((char *));
-void tokenized_start __P((char *));
-void undefined_goal __P((char *));
-void undefined_symbol_warning __P((char *));
-void unexpected_EOF __P((void));
-void unknown_rhs __P((int));
-void unterminated_action __P((int, char *, char *));
-void unterminated_comment __P((int, char *, char *));
-void unterminated_string __P((int, char *, char *));
-void unterminated_text __P((int, char *, char *));
-void unterminated_union __P((int, char *, char *));
-void untyped_lhs __P((void));
-void untyped_rhs __P((int, char *));
-void used_reserved __P((char *));
-void verbose __P((void));
-void write_section __P((char **));
+char *allocate(unsigned);
+void closure(short *, int);
+void create_symbol_table(void);
+void default_action_warning(void);
+void dollar_error(int, char *, char *);
+void dollar_warning(int, int);
+void done(int);
+void fatal(const char *msg);
+void finalize_closure(void);
+void free_parser(void);
+void free_symbols(void);
+void free_symbol_table(void);
+void illegal_character(char *);
+void illegal_tag(int, char *, char *);
+void lalr(void);
+bucket *lookup(char *);
+void lr0(void);
+bucket *make_bucket(const char *);
+void make_parser(void);
+void mywarnx(const char *fmt, ...);
+void no_grammar(void);
+void no_space(void);
+void open_error(const char *);
+void output(void);
+void over_unionized(char *);
+void prec_redeclared(void);
+void reader(void);
+void reflexive_transitive_closure(unsigned *, int);
+void reprec_warning(char *);
+void restarted_warning(void);
+void retyped_warning(char *);
+void revalued_warning(char *);
+void set_first_derives(void);
+void syntax_error(int, char *, char *);
+void terminal_lhs(int);
+void terminal_start(char *);
+void tokenized_start(char *);
+void undefined_goal(char *);
+void undefined_symbol_warning(char *);
+void unexpected_EOF(void);
+void unknown_rhs(int);
+void unterminated_action(int, char *, char *);
+void unterminated_comment(int, char *, char *);
+void unterminated_string(int, char *, char *);
+void unterminated_text(int, char *, char *);
+void unterminated_union(int, char *, char *);
+void untyped_lhs(void);
+void untyped_rhs(int, char *);
+void used_reserved(char *);
+void verbose(void);
+void write_section(const char **);
diff -Naur yayacc.orig/src/error.c yayacc/src/error.c
--- yayacc.orig/src/error.c	Tue Mar 20 12:00:01 2001
+++ yayacc/src/error.c	Mon Aug 22 12:57:23 2005
@@ -34,23 +34,26 @@
  * SUCH DAMAGE.
  */
 
-#ifndef lint
 #if 0
-static char const sccsid[] = "@(#)error.c	5.3 (Berkeley) 6/1/90";
+#ifndef lint
+static char sccsid[] = "@(#)error.c	5.3 (Berkeley) 6/1/90";
+#endif
+#endif
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/error.c,v 1.15 2002/04/09 11:39:05 ru Exp $");
 #endif
-static const char rcsid[] =
-  "$FreeBSD: src/usr.bin/yacc/error.c,v 1.7 1999/08/28 01:07:59 peter Exp $";
-#endif /* not lint */
 
 /* routines for printing error messages  */
 
 #include "defs.h"
+#define warnx mywarnx
 
-static void print_pos __P((char *, char *));
+static void print_pos(char *, char *);
 
 void
 fatal(msg)
-char *msg;
+const char *msg;
 {
     warnx("f - %s", msg);
     done(2);
@@ -67,7 +70,7 @@
 
 void
 open_error(filename)
-char *filename;
+const char *filename;
 {
     warnx("f - cannot open \"%s\"", filename);
     done(2);
@@ -88,7 +91,7 @@
 char *st_line;
 char *st_cptr;
 {
-    register char *s;
+    char *s;
 
     if (st_line == 0) return;
     for (s = st_line; *s != '\n'; ++s)
diff -Naur yayacc.orig/src/lalr.c yayacc/src/lalr.c
--- yayacc.orig/src/lalr.c	Tue Mar 20 12:00:01 2001
+++ yayacc/src/lalr.c	Mon Aug 22 12:57:33 2005
@@ -32,14 +32,20 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/usr.bin/yacc/lalr.c,v 1.7 1999/08/28 01:07:59 peter Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)lalr.c	5.3 (Berkeley) 6/1/90";
-#endif /* not lint */
+static char sccsid[] = "@(#)lalr.c	5.3 (Berkeley) 6/1/90";
+#endif
+#endif
+
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/lalr.c,v 1.15 2002/06/11 11:27:20 robert Exp $");
+#endif
 
+#include <limits.h>
 #include <stdlib.h>
 #include "defs.h"
 
@@ -63,22 +69,22 @@
 short *from_state;
 short *to_state;
 
-static void add_lookback_edge __P((int, int, int));
-static void build_relations __P((void));
-static void compute_FOLLOWS __P((void));
-static void compute_lookaheads __P((void));
-static void digraph __P((short **));
-static void initialize_F __P((void));
-static void initialize_LA __P((void));
-static int map_goto __P((int, int));
-static void set_accessing_symbol __P((void));
-static void set_goto_map __P((void));
-static void set_maxrhs __P((void));
-static void set_reduction_table __P((void));
-static void set_shift_table __P((void));
-static void set_state_table __P((void));
-static short **transpose __P((short **, int));
-static void traverse __P((register int));
+static void add_lookback_edge(int, int, int);
+static void build_relations(void);
+static void compute_FOLLOWS(void);
+static void compute_lookaheads(void);
+static void digraph(short **);
+static void initialize_F(void);
+static void initialize_LA(void);
+static int map_goto(int, int);
+static void set_accessing_symbol(void);
+static void set_goto_map(void);
+static void set_maxrhs(void);
+static void set_reduction_table(void);
+static void set_shift_table(void);
+static void set_state_table(void);
+static short **transpose(short **, int);
+static void traverse(int, short **);
 
 static int infinity;
 static int maxrhs;
@@ -86,7 +92,6 @@
 static unsigned *F;
 static short **includes;
 static shorts **lookback;
-static short **R;
 static short *INDEX;
 static short *VERTICES;
 static int top;
@@ -115,7 +120,7 @@
 static void
 set_state_table()
 {
-    register core *sp;
+    core *sp;
 
     state_table = NEW2(nstates, core *);
     for (sp = first_state; sp; sp = sp->next)
@@ -127,7 +132,7 @@
 static void
 set_accessing_symbol()
 {
-    register core *sp;
+    core *sp;
 
     accessing_symbol = NEW2(nstates, short);
     for (sp = first_state; sp; sp = sp->next)
@@ -139,7 +144,7 @@
 static void
 set_shift_table()
 {
-    register shifts *sp;
+    shifts *sp;
 
     shift_table = NEW2(nstates, shifts *);
     for (sp = first_shift; sp; sp = sp->next)
@@ -151,7 +156,7 @@
 static void
 set_reduction_table()
 {
-    register reductions *rp;
+    reductions *rp;
 
     reduction_table = NEW2(nstates, reductions *);
     for (rp = first_reduction; rp; rp = rp->next)
@@ -163,10 +168,10 @@
 static void
 set_maxrhs()
 {
-  register short *itemp;
-  register short *item_end;
-  register int length;
-  register int max;
+  short *itemp;
+  short *item_end;
+  int length;
+  int max;
 
   length = 0;
   max = 0;
@@ -192,8 +197,8 @@
 static void
 initialize_LA()
 {
-  register int i, j, k;
-  register reductions *rp;
+  int i, j, k;
+  reductions *rp;
 
   lookaheads = NEW2(nstates + 1, short);
 
@@ -230,13 +235,13 @@
 static void
 set_goto_map()
 {
-  register shifts *sp;
-  register int i;
-  register int symbol;
-  register int k;
-  register short *temp_map;
-  register int state2;
-  register int state1;
+  shifts *sp;
+  int i;
+  int symbol;
+  int k;
+  short *temp_map;
+  int state2;
+  int state1;
 
   goto_map = NEW2(nvars + 1, short) - ntokens;
   temp_map = NEW2(nvars + 1, short) - ntokens;
@@ -250,7 +255,7 @@
 
 	  if (ISTOKEN(symbol)) break;
 
-	  if (ngotos == MAXSHORT)
+	  if (ngotos == SHRT_MAX)
 	    fatal("too many gotos");
 
 	  ngotos++;
@@ -302,10 +307,10 @@
 int state;
 int symbol;
 {
-    register int high;
-    register int low;
-    register int middle;
-    register int s;
+    int high;
+    int low;
+    int middle;
+    int s;
 
     low = goto_map[symbol];
     high = goto_map[symbol + 1];
@@ -329,18 +334,18 @@
 static void
 initialize_F()
 {
-  register int i;
-  register int j;
-  register int k;
-  register shifts *sp;
-  register short *edge;
-  register unsigned *rowp;
-  register short *rp;
-  register short **reads;
-  register int nedges;
-  register int stateno;
-  register int symbol;
-  register int nwords;
+  int i;
+  int j;
+  int k;
+  shifts *sp;
+  short *edge;
+  unsigned *rowp;
+  short *rp;
+  short **reads;
+  int nedges;
+  int stateno;
+  int symbol;
+  int nwords;
 
   nwords = ngotos * tokensetsize;
   F = NEW2(nwords, unsigned);
@@ -407,23 +412,23 @@
 static void
 build_relations()
 {
-  register int i;
-  register int j;
-  register int k;
-  register short *rulep;
-  register short *rp;
-  register shifts *sp;
-  register int length;
-  register int nedges;
-  register int done;
-  register int state1;
-  register int stateno;
-  register int symbol1;
-  register int symbol2;
-  register short *shortp;
-  register short *edge;
-  register short *states;
-  register short **new_includes;
+  int i;
+  int j;
+  int k;
+  short *rulep;
+  short *rp;
+  shifts *sp;
+  int length;
+  int nedges;
+  int done1;
+  int state1;
+  int stateno;
+  int symbol1;
+  int symbol2;
+  short *shortp;
+  short *edge;
+  short *states;
+  short **new_includes;
 
   includes = NEW2(ngotos, short *);
   edge = NEW2(ngotos + 1, short);
@@ -459,16 +464,16 @@
 	  add_lookback_edge(stateno, *rulep, i);
 
 	  length--;
-	  done = 0;
-	  while (!done)
+	  done1 = 0;
+	  while (!done1)
 	    {
-	      done = 1;
+	      done1 = 1;
 	      rp--;
 	      if (ISVAR(*rp))
 		{
 		  stateno = states[--length];
 		  edge[nedges++] = map_goto(stateno, *rp);
-		  if (nullable[*rp] && length > 0) done = 0;
+		  if (nullable[*rp] && length > 0) done1 = 0;
 		}
 	    }
 	}
@@ -501,9 +506,9 @@
 add_lookback_edge(stateno, ruleno, gotono)
 int stateno, ruleno, gotono;
 {
-    register int i, k;
-    register int found;
-    register shorts *sp;
+    int i, k;
+    int found;
+    shorts *sp;
 
     i = lookaheads[stateno];
     k = lookaheads[stateno + 1];
@@ -530,12 +535,12 @@
 short **R;
 int n;
 {
-  register short **new_R;
-  register short **temp_R;
-  register short *nedges;
-  register short *sp;
-  register int i;
-  register int k;
+  short **new_R;
+  short **temp_R;
+  short *nedges;
+  short *sp;
+  int i;
+  int k;
 
   nedges = NEW2(n, short);
 
@@ -593,10 +598,10 @@
 static void
 compute_lookaheads()
 {
-  register int i, n;
-  register unsigned *fp1, *fp2, *fp3;
-  register shorts *sp, *next;
-  register unsigned *rowp;
+  int i, n;
+  unsigned *fp1, *fp2, *fp3;
+  shorts *sp, *next;
+  unsigned *rowp;
 
   rowp = LA;
   n = lookaheads[nstates];
@@ -629,22 +634,20 @@
 digraph(relation)
 short **relation;
 {
-  register int i;
+  int i;
 
   infinity = ngotos + 2;
   INDEX = NEW2(ngotos + 1, short);
   VERTICES = NEW2(ngotos + 1, short);
   top = 0;
 
-  R = relation;
-
   for (i = 0; i < ngotos; i++)
     INDEX[i] = 0;
 
   for (i = 0; i < ngotos; i++)
     {
-      if (INDEX[i] == 0 && R[i])
-	traverse(i);
+      if (INDEX[i] == 0 && relation[i])
+	traverse(i, relation);
     }
 
   FREE(INDEX);
@@ -654,14 +657,15 @@
 
 
 static void
-traverse(i)
-register int i;
+traverse(i, R)
+int i;
+short **R;
 {
-  register unsigned *fp1;
-  register unsigned *fp2;
-  register unsigned *fp3;
-  register int j;
-  register short *rp;
+  unsigned *fp1;
+  unsigned *fp2;
+  unsigned *fp3;
+  int j;
+  short *rp;
 
   int height;
   unsigned *base;
@@ -678,7 +682,7 @@
       while ((j = *rp++) >= 0)
 	{
 	  if (INDEX[j] == 0)
-	    traverse(j);
+	    traverse(j, R);
 
 	  if (INDEX[i] > INDEX[j])
 	    INDEX[i] = INDEX[j];
diff -Naur yayacc.orig/src/lr0.c yayacc/src/lr0.c
--- yayacc.orig/src/lr0.c	Tue Mar 20 12:00:01 2001
+++ yayacc/src/lr0.c	Mon Aug 22 12:57:57 2005
@@ -32,14 +32,20 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/usr.bin/yacc/lr0.c,v 1.6 1999/08/28 01:08:00 peter Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)lr0.c	5.3 (Berkeley) 1/20/91";
-#endif /* not lint */
+static char sccsid[] = "@(#)lr0.c	5.3 (Berkeley) 1/20/91";
+#endif
+#endif
 
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/lr0.c,v 1.13 2002/06/11 11:27:20 robert Exp $");
+#endif
+
+#include <limits.h>
 #include <stdlib.h>
 #include "defs.h"
 
@@ -52,22 +58,22 @@
 shifts *first_shift;
 reductions *first_reduction;
 
-static void allocate_itemsets __P((void));
-static void allocate_storage __P((void));
-static void append_states __P((void));
-static void free_storage __P((void));
-static void generate_states __P((void));
-static int get_state __P((int));
-static void initialize_states __P((void));
-static void new_itemsets __P((void));
-static core *new_state __P((int));
+static void allocate_itemsets(void);
+static void allocate_storage(void);
+static void append_states(void);
+static void free_storage(void);
+static void generate_states(void);
+static int get_state(int);
+static void initialize_states(void);
+static void new_itemsets(void);
+static core *new_state(int);
 #ifdef DEBUG
-static void print_derives __P((void));
+static void print_derives(void);
 #endif
-static void save_reductions __P((void));
-static void save_shifts __P((void));
-static void set_derives __P((void));
-static void set_nullable __P((void));
+static void save_reductions(void);
+static void save_shifts(void);
+static void set_derives(void);
+static void set_nullable(void);
 
 static core **state_set;
 static core *this_state;
@@ -89,13 +95,13 @@
 static void
 allocate_itemsets()
 {
-    register short *itemp;
-    register short *item_end;
-    register int symbol;
-    register int i;
-    register int count;
-    register int max;
-    register short *symbol_count;
+    short *itemp;
+    short *item_end;
+    int symbol;
+    int i;
+    int count;
+    int max;
+    short *symbol_count;
 
     count = 0;
     symbol_count = NEW2(nsyms, short);
@@ -142,9 +148,9 @@
 static void
 append_states()
 {
-    register int i;
-    register int j;
-    register int symbol;
+    int i;
+    int j;
+    int symbol;
 
 #ifdef	TRACE
     fprintf(stderr, "Entering append_states()\n");
@@ -215,13 +221,13 @@
 get_state(symbol)
 int symbol;
 {
-    register int key;
-    register short *isp1;
-    register short *isp2;
-    register short *iend;
-    register core *sp;
-    register int found;
-    register int n;
+    int key;
+    short *isp1;
+    short *isp2;
+    short *iend;
+    core *sp;
+    int found;
+    int n;
 
 #ifdef	TRACE
     fprintf(stderr, "Entering get_state(%d)\n", symbol);
@@ -279,9 +285,9 @@
 static void
 initialize_states()
 {
-    register int i;
-    register short *start_derives;
-    register core *p;
+    int i;
+    short *start_derives;
+    core *p;
 
     start_derives = derives[start_symbol];
     for (i = 0; start_derives[i] >= 0; ++i)
@@ -307,11 +313,11 @@
 static void
 new_itemsets()
 {
-    register int i;
-    register int shiftcount;
-    register short *isp;
-    register short *ksp;
-    register int symbol;
+    int i;
+    int shiftcount;
+    short *isp;
+    short *ksp;
+    int symbol;
 
     for (i = 0; i < nsyms; i++)
 	kernel_end[i] = 0;
@@ -345,17 +351,17 @@
 new_state(symbol)
 int symbol;
 {
-    register int n;
-    register core *p;
-    register short *isp1;
-    register short *isp2;
-    register short *iend;
+    int n;
+    core *p;
+    short *isp1;
+    short *isp2;
+    short *iend;
 
 #ifdef	TRACE
     fprintf(stderr, "Entering new_state(%d)\n", symbol);
 #endif
 
-    if (nstates >= MAXSHORT)
+    if (nstates >= SHRT_MAX)
 	fatal("too many states");
 
     isp1 = kernel_base[symbol];
@@ -461,10 +467,10 @@
 static void
 save_shifts()
 {
-    register shifts *p;
-    register short *sp1;
-    register short *sp2;
-    register short *send;
+    shifts *p;
+    short *sp1;
+    short *sp2;
+    short *send;
 
     p = (shifts *) allocate((unsigned) (sizeof(shifts) +
 			(nshifts - 1) * sizeof(short)));
@@ -496,13 +502,13 @@
 static void
 save_reductions()
 {
-    register short *isp;
-    register short *rp1;
-    register short *rp2;
-    register int item;
-    register int count;
-    register reductions *p;
-    register short *rend;
+    short *isp;
+    short *rp1;
+    short *rp2;
+    int item;
+    int count;
+    reductions *p;
+    short *rend;
 
     count = 0;
     for (isp = itemset; isp < itemsetend; isp++)
@@ -546,9 +552,9 @@
 static void
 set_derives()
 {
-    register int i, k;
-    register int lhs;
-    register short *rules;
+    int i, k;
+    int lhs;
+    short *rules;
 
     derives = NEW2(nsyms, short *);
     rules = NEW2(nvars + nrules, short);
@@ -586,8 +592,8 @@
 static void
 print_derives()
 {
-    register int i;
-    register short *sp;
+    int i;
+    short *sp;
 
     printf("\nDERIVES\n\n");
 
@@ -609,9 +615,9 @@
 static void
 set_nullable()
 {
-    register int i, j;
-    register int empty;
-    int done;
+    int i, j;
+    int empty;
+    int done1;
 
     nullable = MALLOC(nsyms);
     if (nullable == 0) no_space();
@@ -619,10 +625,10 @@
     for (i = 0; i < nsyms; ++i)
 	nullable[i] = 0;
 
-    done = 0;
-    while (!done)
+    done1 = 0;
+    while (!done1)
     {
-	done = 1;
+	done1 = 1;
 	for (i = 1; i < nitems; i++)
 	{
 	    empty = 1;
@@ -638,7 +644,7 @@
 		if (!nullable[j])
 		{
 		    nullable[j] = 1;
-		    done = 0;
+		    done1 = 0;
 		}
 	    }
 	}
diff -Naur yayacc.orig/src/main.c yayacc/src/main.c
--- yayacc.orig/src/main.c	Fri Mar 23 00:55:21 2001
+++ yayacc/src/main.c	Mon Aug 22 17:54:14 2005
@@ -36,25 +36,32 @@
  * SUCH DAMAGE.
  */
 
+#if 0
 #ifndef lint
-static char const copyright[] =
-"@(#) Copyright (c) 2001 GradSoft. (http://www.gradsoft.com.ua)\n\
- All rights reserved.\n";
-#endif /* not lint */
+static char sccsid[] = "@(#)main.c	5.5 (Berkeley) 5/24/93";
+#endif
+#endif
 
-#ifndef lint
-#if 0
-static char const sccsid[] = "@(#)main.c	5.5 (Berkeley) 5/24/93";
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/main.c,v 1.22 2004/03/05 02:05:56 wes Exp $");
 #endif
-static const char rcsid[] =
-  "$FreeBSD: src/usr.bin/yacc/main.c,v 1.12 2000/01/10 20:26:24 kris Exp $";
-#endif /* not lint */
 
 #include <signal.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <stdarg.h>
 #include "defs.h"
+#ifdef HAVE_PATHS_H
+# include <paths.h>
+#endif
+#ifdef _PATH_TMP
+# define YAYACC_TMPDIR _PATH_TMP
+#else
+# define YAYACC_TMPDIR "/tmp"
+#endif
+#define warnx mywarnx
 
 char dflag;
 char lflag;
@@ -62,10 +69,12 @@
 char tflag;
 char vflag;
 
-char *symbol_prefix = NULL;
-char *tag_name = NULL;
-char *file_prefix = "y";
-char *temp_form = "yayacc.XXXXXXXXXXX";
+const char *symbol_prefix = NULL;
+const char *tag_name = NULL;
+const char *file_prefix = "y";
+char temp_form[] = "yayacc.XXXXXXXXXXX";
+const char *mylongname;
+const char *myshortname;
 
 int lineno;
 int outline;
@@ -73,7 +82,7 @@
 char *action_file_name;
 char *code_file_name;
 char *defines_file_name;
-char *input_file_name = "";
+const char *input_file_name = "";
 char *output_file_name;
 char *text_file_name;
 char *union_file_name;
@@ -112,29 +121,32 @@
 short **derives;
 char *nullable;
 
-static void create_file_names __P((void));
-static void getargs __P((int, char **));
-static void onintr __P((int));
-static void open_files __P((void));
-static void set_signals __P((void));
-static void usage __P((void));
+static void create_file_names(void);
+static void getargs(int, char **);
+static void onintr(int);
+static void open_files(void);
+static void set_signals(void);
+static void usage(void);
 
+volatile sig_atomic_t sigdie;
 
-void
+__dead2 void
 done(k)
 int k;
 {
     if (action_file) { fclose(action_file); unlink(action_file_name); }
     if (text_file) { fclose(text_file); unlink(text_file_name); }
     if (union_file) { fclose(union_file); unlink(union_file_name); }
+    if (sigdie) { _exit(k); }
     exit(k);
 }
 
 
 static void
 onintr(signo)
-	int signo;
+	int signo __unused;
 {
+    sigdie = 1;
     done(1);
 }
 
@@ -173,32 +185,19 @@
 int argc;
 char *argv[];
 {
-    register int i;
-    register char *s;
+    int ch;
+    const char *slash;
 
-    for (i = 1; i < argc; ++i)
+   mylongname = argc ? argv[0] : "yayacc";
+   slash = strrchr(mylongname, '/');
+   myshortname = slash ? (slash+1) : mylongname;
+    while ((ch = getopt(argc, argv, "b:dln:o:p:rtv")) != -1)
     {
-	s = argv[i];
-	if (*s != '-') break;
-	switch (*++s)
+	switch (ch)
 	{
-	case '\0':
-	    input_file = stdin;
-	    if (i + 1 < argc) usage();
-	    return;
-
-	case '-':
-	    ++i;
-	    goto no_more_options;
-
 	case 'b':
-	    if (*++s)
-		 file_prefix = s;
-	    else if (++i < argc)
-		file_prefix = argv[i];
-	    else
-		usage();
-	    continue;
+	    file_prefix = optarg;
+	    break;
 
 	case 'd':
 	    dflag = 1;
@@ -209,31 +208,16 @@
 	    break;
 
 	case 'n':
-	    if (*++s)
-		tag_name = s;
-	    else if (++i < argc)
-		tag_name = argv[i];
-	    else
-		usage();
+            tag_name = optarg;
 	    continue;
 
 	case 'o':
-	    if (*++s)
-		output_file_name = s;
-	    else if (++i < argc)
-		output_file_name = argv[i];
-	    else
-		usage();
-	    continue;
+	    output_file_name = optarg;
+	    break;
 
 	case 'p':
-	    if (*++s)
-		symbol_prefix = s;
-	    else if (++i < argc)
-		symbol_prefix = argv[i];
-	    else
-		usage();
-	    continue;
+	    symbol_prefix = optarg;
+	    break;
 
 	case 'r':
 	    rflag = 1;
@@ -250,47 +234,14 @@
 	default:
 	    usage();
 	}
-
-	for (;;)
-	{
-	    switch (*++s)
-	    {
-	    case '\0':
-		goto end_of_option;
-
-	    case 'd':
-                /* we leave this option as historical,
-                 * now dflag is always true 
-		 * dflag = 1;
-                 */
-		break;
-
-	    case 'l':
-		lflag = 1;
-		break;
-
-	    case 'r':
-		rflag = 1;
-		break;
-
-	    case 't':
-		tflag = 1;
-		break;
-
-	    case 'v':
-		vflag = 1;
-		break;
-
-	    default:
-		usage();
-	    }
-	}
-end_of_option:;
     }
 
-no_more_options:;
-    if (i + 1 != argc) usage();
-    input_file_name = argv[i];
+    if (optind + 1 != argc)
+	usage();
+    if (strcmp(argv[optind], "-") == 0)
+	input_file = stdin;
+    else
+	input_file_name = argv[optind];
 }
 
 
@@ -298,7 +249,7 @@
 allocate(n)
 unsigned n;
 {
-    register char *p;
+    char *p;
 
     p = NULL;
     if (n)
@@ -314,13 +265,13 @@
 create_file_names()
 {
     int i, len;
-    char *tmpdir;
+    const char *tmpdir;
 
-    tmpdir = getenv("TMPDIR");
-    if (tmpdir == 0) tmpdir = "/tmp";
+    if (!(tmpdir = getenv("TMPDIR")))
+	tmpdir = YAYACC_TMPDIR;
 
     len = strlen(tmpdir);
-    i = len + 17;
+    i = len + strlen(temp_form) + 1;
     if (len && tmpdir[len-1] != '/')
 	++i;
 
@@ -509,9 +460,7 @@
 
 
 int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
 {
     set_signals();
     getargs(argc, argv);
@@ -526,4 +475,17 @@
     done(0);
     /*NOTREACHED*/
     return (0);
+}
+
+void
+mywarnx(const char *fmt, ...)
+{
+    va_list ap;
+
+    va_start(ap, fmt);
+    fprintf(stderr, "%s: ", myshortname);
+    if (fmt)
+        vfprintf(stderr, fmt, ap);
+    fputc('\n', stderr);
+    va_end(ap);
 }
diff -Naur yayacc.orig/src/mkpar.c yayacc/src/mkpar.c
--- yayacc.orig/src/mkpar.c	Tue Mar 20 12:00:01 2001
+++ yayacc/src/mkpar.c	Mon Aug 22 12:58:33 2005
@@ -34,16 +34,19 @@
  * SUCH DAMAGE.
  */
 
-#ifndef lint
 #if 0
-static char const sccsid[] = "@(#)mkpar.c	5.3 (Berkeley) 1/20/91";
+#ifndef lint
+static char sccsid[] = "@(#)mkpar.c	5.3 (Berkeley) 1/20/91";
+#endif
+#endif
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/mkpar.c,v 1.19 2002/04/09 11:39:05 ru Exp $");
 #endif
-static const char rcsid[] =
-  "$FreeBSD: src/usr.bin/yacc/mkpar.c,v 1.10 1999/08/28 01:08:01 peter Exp $";
-#endif /* not lint */
 
 #include <stdlib.h>
 #include "defs.h"
+#define warnx mywarnx
 
 action **parser;
 int SRexpect;
@@ -59,23 +62,23 @@
 static int SRcount;
 static int RRcount;
 
-static action *add_reduce __P((action *, int, int));
-static action *add_reductions __P((int, action *));
-static void defreds __P((void));
-static void find_final_state __P((void));
-static void free_action_row __P((action *));
-static action *get_shifts __P((int));
-static action *parse_actions __P((int));
-static void remove_conflicts __P((void));
-static int sole_reduction __P((int));
-static void total_conflicts __P((void));
-static void unused_rules __P((void));
+static action *add_reduce(action *, int, int);
+static action *add_reductions(int, action *);
+static void defreds(void);
+static void find_final_state(void);
+static void free_action_row(action *);
+static action *get_shifts(int);
+static action *parse_actions(int);
+static void remove_conflicts(void);
+static int sole_reduction(int);
+static void total_conflicts(void);
+static void unused_rules(void);
 
 
 void
 make_parser()
 {
-    register int i;
+    int i;
 
     parser = NEW2(nstates, action *);
     for (i = 0; i < nstates; i++)
@@ -91,9 +94,9 @@
 
 static action *
 parse_actions(stateno)
-register int stateno;
+int stateno;
 {
-    register action *actions;
+    action *actions;
 
     actions = get_shifts(stateno);
     actions = add_reductions(stateno, actions);
@@ -105,20 +108,20 @@
 get_shifts(stateno)
 int stateno;
 {
-    register action *actions, *temp;
-    register shifts *sp;
-    register short *to_state;
-    register int i, k;
-    register int symbol;
+    action *actions, *temp;
+    shifts *sp;
+    short *tostate;
+    int i, k;
+    int symbol;
 
     actions = 0;
     sp = shift_table[stateno];
     if (sp)
     {
-	to_state = sp->shift;
+	tostate = sp->shift;
 	for (i = sp->nshifts - 1; i >= 0; i--)
 	{
-	    k = to_state[i];
+	    k = tostate[i];
 	    symbol = accessing_symbol[k];
 	    if (ISTOKEN(symbol))
 	    {
@@ -139,11 +142,11 @@
 static action *
 add_reductions(stateno, actions)
 int stateno;
-register action *actions;
+action *actions;
 {
-    register int i, j, m, n;
-    register int ruleno, tokensetsize;
-    register unsigned *rowp;
+    int i, j, m, n;
+    int ruleno, tokensetsize;
+    unsigned *rowp;
 
     tokensetsize = WORDSIZE(ntokens);
     m = lookaheads[stateno];
@@ -164,10 +167,10 @@
 
 static action *
 add_reduce(actions, ruleno, symbol)
-register action *actions;
-register int ruleno, symbol;
+action *actions;
+int ruleno, symbol;
 {
-    register action *temp, *prev, *next;
+    action *temp, *prev, *next;
 
     prev = 0;
     for (next = actions; next && next->symbol < symbol; next = next->next)
@@ -206,16 +209,16 @@
 static void
 find_final_state()
 {
-    register int goal, i;
-    register short *to_state;
-    register shifts *p;
+    int goal, i;
+    short *tostate;
+    shifts *p;
 
     p = shift_table[0];
-    to_state = p->shift;
+    tostate = p->shift;
     goal = ritem[1];
     for (i = p->nshifts - 1; i >= 0; --i)
     {
-	final_state = to_state[i];
+	final_state = tostate[i];
 	if (accessing_symbol[final_state] == goal) break;
     }
 }
@@ -224,8 +227,8 @@
 static void
 unused_rules()
 {
-    register int i;
-    register action *p;
+    int i;
+    action *p;
 
     rules_used = (short *) MALLOC(nrules*sizeof(short));
     if (rules_used == 0) no_space();
@@ -258,10 +261,11 @@
 static void
 remove_conflicts()
 {
-    register int i;
-    register int symbol;
-    register action *p, *pref = NULL;
+    int i;
+    int symbol;
+    action *p, *pref;
 
+    pref = NULL;
     SRtotal = 0;
     RRtotal = 0;
     SRconflicts = NEW2(nstates, short);
@@ -354,8 +358,8 @@
 sole_reduction(stateno)
 int stateno;
 {
-    register int count, ruleno;
-    register action *p;
+    int count, ruleno;
+    action *p;
 
     count = 0;
     ruleno = 0;
@@ -382,7 +386,7 @@
 static void
 defreds()
 {
-    register int i;
+    int i;
 
     defred = NEW2(nstates, short);
     for (i = 0; i < nstates; i++)
@@ -391,9 +395,9 @@
 
 static void
 free_action_row(p)
-register action *p;
+action *p;
 {
-  register action *q;
+  action *q;
 
   while (p)
     {
@@ -406,7 +410,7 @@
 void
 free_parser()
 {
-  register int i;
+  int i;
 
   for (i = 0; i < nstates; i++)
     free_action_row(parser[i]);
diff -Naur yayacc.orig/src/output.c yayacc/src/output.c
--- yayacc.orig/src/output.c	Tue Apr 24 14:28:09 2001
+++ yayacc/src/output.c	Mon Aug 22 12:58:47 2005
@@ -32,44 +32,24 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/usr.bin/yacc/output.c,v 1.13 2000/01/17 01:51:29 bde Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)output.c	5.7 (Berkeley) 5/24/93";
-#endif /* not lint */
+static char sccsid[] = "@(#)output.c	5.7 (Berkeley) 5/24/93";
+#endif
+#endif
+
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/output.c,v 1.28 2002/06/11 11:27:20 robert Exp $");
+#endif
 
+#include <limits.h>
 #include <stdlib.h>
 #include <string.h>
 #include "defs.h"
 
-static int default_goto __P((int));
-static void free_itemsets __P((void));
-static void free_reductions __P((void));
-static void free_shifts __P((void));
-static void goto_actions __P((void));
-static int is_C_identifier __P((char *));
-static int matching_vector __P((int));
-static void output_actions __P((void));
-static void output_base __P((void));
-static void output_check __P((void));
-static void output_debug __P((void));
-static void output_defines __P((void));
-static void output_prefix __P((void));
-static void output_rule_data __P((void));
-static void output_semantic_actions __P((void));
-static void output_stored_text __P((void));
-static void output_stype __P((void));
-static void output_table __P((void));
-static void output_trailing_text __P((void));
-static void output_yydefred __P((void));
-static void pack_table __P((void));
-static int pack_vector __P((int));
-static void save_column __P((int, int));
-static void sort_actions __P((void));
-static void token_actions __P((void));
-
 static int nvectors;
 static int nentries;
 static short **froms;
@@ -86,6 +66,35 @@
 static int lowzero;
 static int high;
 
+static int default_goto(int);
+static void free_itemsets(void);
+static void free_reductions(void);
+static void free_shifts(void);
+static void goto_actions(void);
+static int is_C_identifier(char *);
+static int matching_vector(int);
+static void output_actions(void);
+static void output_base(void);
+static void output_check(void);
+static void output_debug(void);
+static void output_defines(void);
+static void output_prefix(void);
+static void output_rule_data(void);
+static void output_semantic_actions(void);
+static void output_stored_text(void);
+static void output_stype(void);
+static void output_table(void);
+static void output_trailing_text(void);
+static void output_yydefred(void);
+static void pack_table(void);
+static int pack_vector(int);
+static void save_column(int, int);
+static void sort_actions(void);
+static void token_actions(void);
+static int increase_maxtable(int);
+
+static const char line_format[] = "#line %d \"%s\"\n";
+
 
 void
 output()
@@ -168,6 +177,10 @@
 	fprintf(code_file, "#define yyname %sname\n", symbol_prefix);
 	++outline;
 	fprintf(code_file, "#define yyrule %srule\n", symbol_prefix);
+	++outline;
+	fprintf(code_file, "#define yysslim %ssslim\n", symbol_prefix);
+	++outline;
+	fprintf(code_file, "#define yystacksize %sstacksize\n", symbol_prefix);
     }
     ++outline;
     fprintf(code_file, "#define YYPREFIX \"%s\"\n", symbol_prefix);
@@ -184,8 +197,8 @@
 static void
 output_rule_data()
 {
-    register int i;
-    register int j;
+    int i;
+    int j;
 
 
     fprintf(output_file, "const short YYParser<%s>::%slhs[] = {%42d,", 
@@ -234,7 +247,7 @@
 static void
 output_yydefred()
 {
-    register int i, j;
+    int i, j;
 
     fprintf(output_file, "const short YYParser<%s>::%sdefred[] = {%39d,", 
             tag_name, symbol_prefix,
@@ -292,11 +305,11 @@
 static void
 token_actions()
 {
-    register int i, j;
-    register int shiftcount, reducecount;
-    register int max, min;
-    register short *actionrow, *r, *s;
-    register action *p;
+    int i, j;
+    int shiftcount, reducecount;
+    int max, min;
+    short *actionrow, *r, *s;
+    action *p;
 
     actionrow = NEW2(2*ntokens, short);
     for (i = 0; i < nstates; ++i)
@@ -333,7 +346,7 @@
 	    {
 		froms[i] = r = NEW2(shiftcount, short);
 		tos[i] = s = NEW2(shiftcount, short);
-		min = MAXSHORT;
+		min = SHRT_MAX;
 		max = 0;
 		for (j = 0; j < ntokens; ++j)
 		{
@@ -353,7 +366,7 @@
 	    {
 		froms[nstates+i] = r = NEW2(reducecount, short);
 		tos[nstates+i] = s = NEW2(reducecount, short);
-		min = MAXSHORT;
+		min = SHRT_MAX;
 		max = 0;
 		for (j = 0; j < ntokens; ++j)
 		{
@@ -377,7 +390,7 @@
 static void
 goto_actions()
 {
-    register int i, j, k;
+    int i, j, k;
 
     state_count = NEW2(nstates, short);
 
@@ -412,11 +425,11 @@
 default_goto(symbol)
 int symbol;
 {
-    register int i;
-    register int m;
-    register int n;
-    register int default_state;
-    register int max;
+    int i;
+    int m;
+    int n;
+    int default_state;
+    int max;
 
     m = goto_map[symbol];
     n = goto_map[symbol + 1];
@@ -450,14 +463,14 @@
 int symbol;
 int default_state;
 {
-    register int i;
-    register int m;
-    register int n;
-    register short *sp;
-    register short *sp1;
-    register short *sp2;
-    register int count;
-    register int symno;
+    int i;
+    int m;
+    int n;
+    short *sp;
+    short *sp1;
+    short *sp2;
+    int count;
+    int symno;
 
     m = goto_map[symbol];
     n = goto_map[symbol + 1];
@@ -491,11 +504,11 @@
 static void
 sort_actions()
 {
-  register int i;
-  register int j;
-  register int k;
-  register int t;
-  register int w;
+  int i;
+  int j;
+  int k;
+  int t;
+  int w;
 
   order = NEW2(nvectors, short);
   nentries = 0;
@@ -527,14 +540,14 @@
 static void
 pack_table()
 {
-    register int i;
-    register int place;
-    register int state;
+    int i;
+    int place;
+    int state;
 
     base = NEW2(nvectors, short);
     pos = NEW2(nentries, short);
 
-    maxtable = 1000;
+    maxtable = 10000;
     table = NEW2(maxtable, short);
     check = NEW2(maxtable, short);
 
@@ -591,13 +604,13 @@
 matching_vector(vector)
 int vector;
 {
-    register int i;
-    register int j;
-    register int k;
-    register int t;
-    register int w;
-    register int match;
-    register int prev;
+    int i;
+    int j;
+    int k;
+    int t;
+    int w;
+    int match;
+    int prev;
 
     i = order[vector];
     if (i >= 2*nstates)
@@ -632,14 +645,14 @@
 pack_vector(vector)
 int vector;
 {
-    register int i, j, k, l;
-    register int t;
-    register int loc;
-    register int ok;
-    register short *from;
-    register short *to;
-    int newmax;
+    int i, j, k;
+    int t;
+    int loc;
+    int ok;
+    short *from;
+    short *to;
 
+    loc = 0;
     i = order[vector];
     t = tally[i];
     assert(t);
@@ -663,19 +676,7 @@
 	    {
 		if (loc >= MAXTABLE)
 		    fatal("maximum table size exceeded");
-
-		newmax = maxtable;
-		do { newmax += 200; } while (newmax <= loc);
-		table = (short *) REALLOC(table, newmax*sizeof(short));
-		if (table == 0) no_space();
-		check = (short *) REALLOC(check, newmax*sizeof(short));
-		if (check == 0) no_space();
-		for (l  = maxtable; l < newmax; ++l)
-		{
-		    table[l] = 0;
-		    check[l] = -1;
-		}
-		maxtable = newmax;
+		maxtable = increase_maxtable(loc);
 	    }
 
 	    if (check[loc] != -1)
@@ -697,7 +698,19 @@
 	    }
 
 	    while (check[lowzero] != -1)
+	    {
+		if (lowzero >= maxtable)
+		{
+		    if (lowzero >= MAXTABLE)
+		    {
+		      fatal("maximum table size exceeded in check\n");
+		    }
+
+		    maxtable = increase_maxtable(loc);
+		}
+
 		++lowzero;
+	    }
 
 	    return (j);
 	}
@@ -709,7 +722,7 @@
 static void
 output_base()
 {
-    register int i, j;
+    int i, j;
 
     fprintf(output_file, "const short YYParser<%s>::%ssindex[] = {%39d,", 
                           tag_name, symbol_prefix, base[0]);
@@ -779,8 +792,8 @@
 static void
 output_table()
 {
-    register int i;
-    register int j;
+    int i;
+    int j;
 
     ++outline;
     fprintf(code_file, "const int YYParser<%s>::%stableSize=%d;\n", 
@@ -813,8 +826,8 @@
 static void
 output_check()
 {
-    register int i;
-    register int j;
+    int i;
+    int j;
 
     fprintf(output_file, "const short YYParser<%s>::%scheck[] = {%40d,", 
             tag_name, symbol_prefix, check[0]);
@@ -844,8 +857,8 @@
 is_C_identifier(name)
 char *name;
 {
-    register char *s;
-    register int c;
+    char *s;
+    int c;
 
     s = name;
     c = *s;
@@ -876,8 +889,8 @@
 static void
 output_defines()
 {
-    register int c, i;
-    register char *s;
+    int c, i;
+    char *s;
 
     ++outline;
     fprintf(code_file, "#ifndef YYERRCODE \n");
@@ -946,8 +959,8 @@
 static void
 output_stored_text()
 {
-    register int c;
-    register FILE *in, *out;
+    int c;
+    FILE *in, *out;
 
     fclose(text_file);
     text_file = fopen(text_file_name, "r");
@@ -974,8 +987,9 @@
 static void
 output_debug()
 {
-    register int i, j, k, max;
+    int i, j, k, max;
     char **symnam, *s;
+    static char eof[] = "end-of-file";
 
     ++outline;
     fprintf(code_file, "#define YYFINAL %d\n", final_state);
@@ -1002,7 +1016,7 @@
 	symnam[i] = 0;
     for (i = ntokens - 1; i >= 2; --i)
 	symnam[symbol_value[i]] = symbol_name[i];
-    symnam[0] = "end-of-file";
+    symnam[0] = eof;
 
     if (!rflag) ++outline;
     fprintf(output_file, "#if YYDEBUG\n");
@@ -1205,8 +1219,8 @@
 static void
 output_trailing_text()
 {
-    register int c, last;
-    register FILE *in, *out;
+    int c, last;
+    FILE *in, *out;
 
     if (line == 0)
 	return;
@@ -1263,8 +1277,8 @@
 static void
 output_semantic_actions()
 {
-    register int c, last;
-    register FILE *out;
+    int c, last;
+    FILE *out;
 
     fclose(action_file);
     action_file = fopen(action_file_name, "r");
@@ -1301,7 +1315,7 @@
 static void
 free_itemsets()
 {
-    register core *cp, *next;
+    core *cp, *next;
 
     FREE(state_table);
     for (cp = first_state; cp; cp = next)
@@ -1315,7 +1329,7 @@
 static void
 free_shifts()
 {
-    register shifts *sp, *next;
+    shifts *sp, *next;
 
     FREE(shift_table);
     for (sp = first_shift; sp; sp = next)
@@ -1330,7 +1344,7 @@
 static void
 free_reductions()
 {
-    register reductions *rp, *next;
+    reductions *rp, *next;
 
     FREE(reduction_table);
     for (rp = first_reduction; rp; rp = next)
@@ -1338,4 +1352,34 @@
 	next = rp->next;
 	FREE(rp);
     }
+}
+
+/*
+ * increase_maxtable
+ *
+ * inputs	- loc location in table
+ * output	- size increased to
+ * side effects	- table is increase by at least 200 short words
+ */
+
+static int
+increase_maxtable(int loc)
+{
+    int newmax;
+    int l;
+
+    newmax = maxtable;
+
+    do { newmax += 200; } while (newmax <= loc);
+    table = (short *) REALLOC(table, newmax*sizeof(short));
+	if (table == 0) no_space();
+	check = (short *) REALLOC(check, newmax*sizeof(short));
+	if (check == 0) no_space();
+	for (l  = maxtable; l < newmax; ++l)
+	{
+	    table[l] = 0;
+	    check[l] = -1;
+	}
+
+    return(newmax);
 }
diff -Naur yayacc.orig/src/reader.c yayacc/src/reader.c
--- yayacc.orig/src/reader.c	Sat Mar 24 20:19:42 2001
+++ yayacc/src/reader.c	Mon Aug 22 12:58:51 2005
@@ -32,14 +32,20 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/usr.bin/yacc/reader.c,v 1.8 1999/08/28 01:08:02 peter Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)reader.c	5.7 (Berkeley) 1/20/91";
-#endif /* not lint */
+static char sccsid[] = "@(#)reader.c	5.7 (Berkeley) 1/20/91";
+#endif
+#endif
+
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/reader.c,v 1.19 2002/08/25 13:23:09 charnier Exp $");
+#endif
 
+#include <limits.h>
 #include <stdlib.h>
 #include <string.h>
 #include "defs.h"
@@ -75,44 +81,45 @@
 int name_pool_size;
 char *name_pool;
 
-char line_format[] = "#line %d \"%s\"\n";
+static const char line_format[] = "#line %d \"%s\"\n";
 
-static void add_symbol __P((void));
-static void advance_to_start __P((void));
-static void cachec __P((int));
-static void check_symbols __P((void));
-static void copy_action __P((void));
-static void copy_ident __P((void));
-static void copy_text __P((void));
-static void copy_union __P((void));
-static void declare_start __P((void));
-static void declare_tokens __P((int));
-static void declare_types __P((void));
-static char *dup_line __P((void));
-static void end_rule __P((void));
-static void expand_items __P((void));
-static void expand_rules __P((void));
-static void free_tags __P((void));
-static void get_line __P((void));
-static bucket *get_literal __P((void));
-static bucket *get_name __P((void));
-static int get_number __P((void));
-static char *get_tag __P((void));
-static int hexval __P((int));
-static void initialize_grammar __P((void));
-static void insert_empty_rule __P((void));
-static int is_reserved __P((char *));
-static int keyword __P((void));
-static int mark_symbol __P((void));
-static int nextc __P((void));
-static void pack_grammar __P((void));
-static void pack_names __P((void));
-static void pack_symbols __P((void));
-static void print_grammar __P((void));
-static void read_declarations __P((void));
-static void read_grammar __P((void));
-static void skip_comment __P((void));
-static void start_rule __P((bucket *, int));
+static void add_symbol(void);
+static void advance_to_start(void);
+static void cachec(int);
+static void check_symbols(void);
+static void copy_action(void);
+static void copy_ident(void);
+static void copy_text(void);
+static void copy_union(void);
+static void declare_expect(int);
+static void declare_start(void);
+static void declare_tokens(int);
+static void declare_types(void);
+static char *dup_line(void);
+static void end_rule(void);
+static void expand_items(void);
+static void expand_rules(void);
+static void free_tags(void);
+static void get_line(void);
+static bucket *get_literal(void);
+static bucket *get_name(void);
+static int get_number(void);
+static char *get_tag(void);
+static int hexval(int);
+static void initialize_grammar(void);
+static void insert_empty_rule(void);
+static int is_reserved(char *);
+static int keyword(void);
+static int mark_symbol(void);
+static int nextc(void);
+static void pack_grammar(void);
+static void pack_names(void);
+static void pack_symbols(void);
+static void print_grammar(void);
+static void read_declarations(void);
+static void read_grammar(void);
+static void skip_comment(void);
+static void start_rule(bucket *, int);
 
 static void
 cachec(c)
@@ -133,9 +140,9 @@
 static void
 get_line()
 {
-    register FILE *f = input_file;
-    register int c;
-    register int i;
+    FILE *f = input_file;
+    int c;
+    int i;
 
     if (saw_eof || (c = getc(f)) == EOF)
     {
@@ -180,7 +187,7 @@
 static char *
 dup_line()
 {
-    register char *p, *s, *t;
+    char *p, *s, *t;
 
     if (line == 0) return (0);
     s = line;
@@ -198,7 +205,7 @@
 static void
 skip_comment()
 {
-    register char *s;
+    char *s;
 
     int st_lineno = lineno;
     char *st_line = dup_line();
@@ -229,7 +236,7 @@
 static int
 nextc()
 {
-    register char *s;
+    char *s;
 
     if (line == 0)
     {
@@ -278,7 +285,7 @@
 		s = cptr;
 		break;
 	    }
-	    /* fall through */
+	    /* FALLTHROUGH */
 
 	default:
 	    cptr = s;
@@ -291,7 +298,7 @@
 static int
 keyword()
 {
-    register int c;
+    int c;
     char *t_cptr = cptr;
 
     c = *++cptr;
@@ -357,8 +364,8 @@
 static void
 copy_ident()
 {
-    register int c;
-    register FILE *f = output_file;
+    int c;
+    FILE *f = output_file;
 
     c = nextc();
     if (c == EOF) unexpected_EOF();
@@ -387,9 +394,9 @@
 static void
 copy_text()
 {
-    register int c;
+    int c;
     int quote;
-    register FILE *f = text_file;
+    FILE *f = text_file;
     int need_newline = 0;
     int t_lineno = lineno;
     char *t_line = dup_line();
@@ -506,7 +513,7 @@
 	    FREE(t_line);
 	    return;
 	}
-	/* fall through */
+	/* FALLTHROUGH */
 
     default:
 	putc(c, f);
@@ -519,7 +526,7 @@
 static void
 copy_union()
 {
-    register int c;
+    int c;
     int quote;
     int depth;
     int u_lineno = lineno;
@@ -675,11 +682,11 @@
 static bucket *
 get_literal()
 {
-    register int c, quote;
-    register int i;
-    register int n;
-    register char *s;
-    register bucket *bp;
+    int c, quote;
+    int i;
+    int n;
+    char *s;
+    bucket *bp;
     int s_lineno = lineno;
     char *s_line = dup_line();
     char *s_cptr = s_line + (cptr - line);
@@ -717,7 +724,7 @@
 			++cptr;
 		    }
 		}
-		if (n > MAXCHAR) illegal_character(c_cptr);
+		if (n > UCHAR_MAX) illegal_character(c_cptr);
 		c = n;
 	    	break;
 
@@ -733,7 +740,7 @@
 		    if (i < 0 || i >= 16) break;
 		    ++cptr;
 		    n = (n << 4) + i;
-		    if (n > MAXCHAR) illegal_character(c_cptr);
+		    if (n > UCHAR_MAX) illegal_character(c_cptr);
 		}
 		c = n;
 		break;
@@ -836,7 +843,7 @@
 static bucket *
 get_name()
 {
-    register int c;
+    int c;
 
     cinc = 0;
     for (c = *cptr; IS_IDENT(c); c = *++cptr)
@@ -852,8 +859,8 @@
 static int
 get_number()
 {
-    register int c;
-    register int n;
+    int c;
+    int n;
 
     n = 0;
     for (c = *cptr; isdigit(c); c = *++cptr)
@@ -866,9 +873,9 @@
 static char *
 get_tag()
 {
-    register int c;
-    register int i;
-    register char *s;
+    int c;
+    int i;
+    char *s;
     int t_lineno = lineno;
     char *t_line = dup_line();
     char *t_cptr = t_line + (cptr - line);
@@ -918,8 +925,8 @@
 declare_tokens(assoc)
 int assoc;
 {
-    register int c;
-    register bucket *bp;
+    int c;
+    bucket *bp;
     int value;
     char *tag = 0;
 
@@ -986,7 +993,7 @@
 declare_expect(assoc)
 int assoc;
 {
-    register int c;
+    int c;
 
     if (assoc != EXPECT) ++prec;
 
@@ -1025,8 +1032,8 @@
 static void
 declare_types()
 {
-    register int c;
-    register bucket *bp;
+    int c;
+    bucket *bp;
     char *tag;
 
     c = nextc();
@@ -1054,8 +1061,8 @@
 static void
 declare_start()
 {
-    register int c;
-    register bucket *bp;
+    int c;
+    bucket *bp;
 
     c = nextc();
     if (c == EOF) unexpected_EOF();
@@ -1073,7 +1080,7 @@
 static void
 read_declarations()
 {
-    register int c, k;
+    int c, k;
 
     cache_size = 256;
     cache = MALLOC(cache_size);
@@ -1181,8 +1188,8 @@
 static void
 advance_to_start()
 {
-    register int c;
-    register bucket *bp;
+    int c;
+    bucket *bp;
     char *s_cptr;
     int s_lineno;
 
@@ -1231,7 +1238,7 @@
 
 static void
 start_rule(bp, s_lineno)
-register bucket *bp;
+bucket *bp;
 int s_lineno;
 {
     if (bp->class == TERM)
@@ -1248,7 +1255,7 @@
 static void
 end_rule()
 {
-    register int i;
+    int i;
 
     if (!last_was_action && plhs[nrules]->tag)
     {
@@ -1268,7 +1275,7 @@
 static void
 insert_empty_rule()
 {
-    register bucket *bp, **bpp;
+    bucket *bp, **bpp;
 
     assert(cache);
     sprintf(cache, "$$%d", ++gensym);
@@ -1298,8 +1305,8 @@
 static void
 add_symbol()
 {
-    register int c;
-    register bucket *bp;
+    int c;
+    bucket *bp;
     int s_lineno = lineno;
 
     c = *cptr;
@@ -1330,12 +1337,12 @@
 static void
 copy_action()
 {
-    register int c;
-    register int i, n;
+    int c;
+    int i, n;
     int depth;
     int quote;
     char *tag;
-    register FILE *f = action_file;
+    FILE *f = action_file;
     int a_lineno = lineno;
     char *a_line = dup_line();
     char *a_cptr = a_line + (cptr - line);
@@ -1554,8 +1561,8 @@
 static int
 mark_symbol()
 {
-    register int c;
-    register bucket *bp = NULL;
+    int c;
+    bucket *bp = NULL;
 
     c = cptr[1];
     if (c == '%' || c == '\\')
@@ -1598,7 +1605,7 @@
 static void
 read_grammar()
 {
-    register int c;
+    int c;
 
     initialize_grammar();
     advance_to_start();
@@ -1632,7 +1639,7 @@
 static void
 free_tags()
 {
-    register int i;
+    int i;
 
     if (tag_table == 0) return;
 
@@ -1648,8 +1655,8 @@
 static void
 pack_names()
 {
-    register bucket *bp;
-    register char *p, *s, *t;
+    bucket *bp;
+    char *p, *s, *t;
 
     name_pool_size = 13;  /* 13 == sizeof("$end") + sizeof("$accept") */
     for (bp = first_symbol; bp; bp = bp->next)
@@ -1674,7 +1681,7 @@
 static void
 check_symbols()
 {
-    register bucket *bp;
+    bucket *bp;
 
     if (goal->class == UNKNOWN)
 	undefined_goal(goal->name);
@@ -1693,9 +1700,9 @@
 static void
 pack_symbols()
 {
-    register bucket *bp;
-    register bucket **v;
-    register int i, j, k, n;
+    bucket *bp;
+    bucket **v;
+    int i, j, k, n;
 
     nsyms = 2;
     ntokens = 1;
@@ -1818,8 +1825,8 @@
 static void
 pack_grammar()
 {
-    register int i, j;
-    int assoc, prec;
+    int i, j;
+    int assoc, preced;
 
     ritem = (short *) MALLOC(nitems*sizeof(short));
     if (ritem == 0) no_space();
@@ -1849,13 +1856,13 @@
 	rlhs[i] = plhs[i]->index;
 	rrhs[i] = j;
 	assoc = TOKEN;
-	prec = 0;
+	preced = 0;
 	while (pitem[j])
 	{
 	    ritem[j] = pitem[j]->index;
 	    if (pitem[j]->class == TERM)
 	    {
-		prec = pitem[j]->prec;
+		preced = pitem[j]->prec;
 		assoc = pitem[j]->assoc;
 	    }
 	    ++j;
@@ -1864,7 +1871,7 @@
 	++j;
 	if (rprec[i] == UNDEFINED)
 	{
-	    rprec[i] = prec;
+	    rprec[i] = preced;
 	    rassoc[i] = assoc;
 	}
     }
@@ -1878,13 +1885,14 @@
 static void
 print_grammar()
 {
-    register int i, j, k;
-    int spacing = 0;
-    register FILE *f = verbose_file;
+    int i, j, k;
+    int spacing;
+    FILE *f = verbose_file;
 
     if (!vflag) return;
 
     k = 1;
+    spacing = 0;
     for (i = 2; i < nrules; ++i)
     {
 	if (rlhs[i] != rlhs[i-1])
diff -Naur yayacc.orig/src/skeleton.c yayacc/src/skeleton.c
--- yayacc.orig/src/skeleton.c	Mon May  7 12:46:17 2001
+++ yayacc/src/skeleton.c	Mon Aug 22 16:43:53 2005
@@ -39,9 +39,16 @@
  * $Id: skeleton.c,v 1.8 2001/05/07 12:46:17 rssh Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)skeleton.c	1.0 (GradSoft) 26/03/01";
-#endif /* not lint */
+static char sccsid[] = "@(#)skeleton.c	5.8 (Berkeley) 4/29/95";
+#endif
+#endif
+
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.37 2003/02/12 18:03:55 davidc Exp $");
+#endif
 
 #include "defs.h"
 
@@ -57,7 +64,7 @@
 /*  the body either are not useful outside of semantic actions or	*/
 /*  are conditional.							*/
 
-char *banner[] =
+const char *banner[] =
 {
     "#define YYYAYYACC 1",
     "#define YYYAMAJOR 1",
@@ -73,16 +80,21 @@
 };
 
 
-char *tables[] =
+const char *tables[] =
 {
     "",0
 };
 
 
-char *header[] =
+const char *header[] =
 {
-    "#ifdef HAVE_NAMESPACES",
+    "#if YYDEBUG",
+    "#include <iostream>",
+    "#include <iomanip>",
+    "#endif",
+    "#if GRADSOFT_YAYACC_HAVE_NAMESPACES",
     "#define CERR std::cerr", 
+    "using std::endl;", 
     "#else", 
     "#define CERR cerr", 
     "#endif",
@@ -90,14 +102,14 @@
 };
 
 
-char *body[] =
+const char *body[] =
 {
     "#define YYABORT goto yyabort",
     "#define YYREJECT goto yyabort",
     "#define YYACCEPT goto yyaccept",
     "#define YYERROR goto yyerrlab",
     "",
-    "#ifdef HAVE_NAMESPACES",
+    "#if GRADSOFT_YAYACC_HAVE_NAMESPACES",
     "namespace GradSoft {", 
     "#endif",
     "",
@@ -105,7 +117,7 @@
     "int",
     "YYParser<YYPARSERTAG>::parse()",
     "{",
-    "    register int yym, yyn, yystate;",
+    "    int yym, yyn, yystate;",
     "    int yyerrflag, yynerrs, yydebug;",
     "    int yychar;",
     "    const char* yys;",
@@ -248,7 +260,7 @@
 };
 
 
-char *trailer[] =
+const char *trailer[] =
 {
     "    }",
     "    yyssp -= yym;",
@@ -312,23 +324,23 @@
     "yyaccept:",
     "    return (0);",
     "}",
-    "#ifdef HAVE_NAMESPACES",
+    "#if GRADSOFT_YAYACC_HAVE_NAMESPACES",
     "}",
     "#endif",
     0
 };
 
-char *open_gradsoft_namespace[] =
+const char *open_gradsoft_namespace[] =
 {
- "#ifdef HAVE_NAMESPACES",
+ "#if GRADSOFT_YAYACC_HAVE_NAMESPACES",
  "namespace GradSoft {",
  "#endif",
   0
 };
 
-char *close_gradsoft_namespace[] =
+const char *close_gradsoft_namespace[] =
 {
- "#ifdef HAVE_NAMESPACES",
+ "#if GRADSOFT_YAYACC_HAVE_NAMESPACES",
  "}",
  "#endif",
   0
@@ -336,12 +348,12 @@
 
 void
 write_section(section)
-char *section[];
+const char *section[];
 {
-    register int c;
-    register int i;
-    register char *s;
-    register FILE *f;
+    int c;
+    int i;
+    const char *s;
+    FILE *f;
 
     f = code_file;
     for (i = 0; (s = section[i]); ++i)
diff -Naur yayacc.orig/src/symtab.c yayacc/src/symtab.c
--- yayacc.orig/src/symtab.c	Tue Mar 20 12:00:01 2001
+++ yayacc/src/symtab.c	Mon Aug 22 12:59:09 2005
@@ -32,13 +32,18 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/usr.bin/yacc/symtab.c,v 1.6 1999/08/28 01:08:03 peter Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)symtab.c	5.3 (Berkeley) 6/1/90";
-#endif /* not lint */
+static char sccsid[] = "@(#)symtab.c	5.3 (Berkeley) 6/1/90";
+#endif
+#endif
+
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/symtab.c,v 1.12 2002/04/09 11:39:05 ru Exp $");
+#endif
 
 #include <stdlib.h>
 #include <string.h>
@@ -49,7 +54,7 @@
 
 #define	TABLE_SIZE 1024
 
-static int hash __P((char *));
+static int hash(const char *);
 
 bucket **symbol_table;
 bucket *first_symbol;
@@ -58,10 +63,10 @@
 
 static int
 hash(name)
-char *name;
+const char *name;
 {
-    register char *s;
-    register int c, k;
+    const char *s;
+    int c, k;
 
     assert(name && *name);
     s = name;
@@ -75,9 +80,9 @@
 
 bucket *
 make_bucket(name)
-char *name;
+const char *name;
 {
-    register bucket *bp;
+    bucket *bp;
 
     assert(name);
     bp = (bucket *) MALLOC(sizeof(bucket));
@@ -104,7 +109,7 @@
 lookup(name)
 char *name;
 {
-    register bucket *bp, **bpp;
+    bucket *bp, **bpp;
 
     bpp = symbol_table + hash(name);
     bp = *bpp;
@@ -127,8 +132,8 @@
 void
 create_symbol_table()
 {
-    register int i;
-    register bucket *bp;
+    int i;
+    bucket *bp;
 
     symbol_table = (bucket **) MALLOC(TABLE_SIZE*sizeof(bucket *));
     if (symbol_table == 0) no_space();
@@ -156,7 +161,7 @@
 void
 free_symbols()
 {
-    register bucket *p, *q;
+    bucket *p, *q;
 
     for (p = first_symbol; p; p = q)
     {
diff -Naur yayacc.orig/src/verbose.c yayacc/src/verbose.c
--- yayacc.orig/src/verbose.c	Tue Mar 20 12:00:01 2001
+++ yayacc/src/verbose.c	Mon Aug 22 12:59:14 2005
@@ -32,34 +32,39 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/usr.bin/yacc/verbose.c,v 1.6 1999/08/28 01:08:03 peter Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)verbose.c	5.3 (Berkeley) 1/20/91";
-#endif /* not lint */
+static char sccsid[] = "@(#)verbose.c	5.3 (Berkeley) 1/20/91";
+#endif
+#endif
+
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/verbose.c,v 1.13 2002/04/09 11:39:05 ru Exp $");
+#endif
 
 #include <stdlib.h>
 #include "defs.h"
 
-static void log_unused __P((void));
-static void log_conflicts __P((void));
-static void print_actions __P((int));
-static void print_conflicts __P((int));
-static void print_core __P((int));
-static void print_gotos __P((int));
-static void print_nulls __P((int));
-static void print_reductions __P((register action *, register int));
-static void print_shifts __P((register action *));
-static void print_state __P((int));
-
 static short *null_rules;
 
+static void log_unused(void);
+static void log_conflicts(void);
+static void print_actions(int);
+static void print_conflicts(int);
+static void print_core(int);
+static void print_gotos(int);
+static void print_nulls(int);
+static void print_reductions(action *, register int);
+static void print_shifts(action *);
+static void print_state(int);
+
 void
 verbose()
 {
-    register int i;
+    int i;
 
     if (!vflag) return;
 
@@ -84,8 +89,8 @@
 static void
 log_unused()
 {
-    register int i;
-    register short *p;
+    int i;
+    short *p;
 
     fprintf(verbose_file, "\n\nRules never reduced:\n");
     for (i = 3; i < nrules; ++i)
@@ -104,7 +109,7 @@
 static void
 log_conflicts()
 {
-    register int i;
+    int i;
 
     fprintf(verbose_file, "\n\n");
     for (i = 0; i < nstates; i++)
@@ -149,8 +154,8 @@
 print_conflicts(state)
 int state;
 {
-    register int symbol, act = 0, number = 0;
-    register action *p;
+    int symbol, act = 0, number = 0;
+    action *p;
 
     symbol = -1;
     for (p = parser[state]; p; p = p->next)
@@ -198,12 +203,12 @@
 print_core(state)
 int state;
 {
-    register int i;
-    register int k;
-    register int rule;
-    register core *statep;
-    register short *sp;
-    register short *sp1;
+    int i;
+    int k;
+    int rule;
+    core *statep;
+    short *sp;
+    short *sp1;
 
     statep = state_table[state];
     k = statep->nitems;
@@ -235,8 +240,8 @@
 print_nulls(state)
 int state;
 {
-    register action *p;
-    register int i, j, k, nnulls;
+    action *p;
+    int i, j, k, nnulls;
 
     nnulls = 0;
     for (p = parser[state]; p; p = p->next)
@@ -280,9 +285,9 @@
 print_actions(stateno)
 int stateno;
 {
-    register action *p;
-    register shifts *sp;
-    register int as;
+    action *p;
+    shifts *sp;
+    int as;
 
     if (stateno == final_state)
 	fprintf(verbose_file, "\t$end  accept\n");
@@ -306,10 +311,10 @@
 
 static void
 print_shifts(p)
-register action *p;
+action *p;
 {
-    register int count;
-    register action *q;
+    int count;
+    action *q;
 
     count = 0;
     for (q = p; q; q = q->next)
@@ -331,12 +336,12 @@
 
 
 static void
-print_reductions(p, defred)
-register action *p;
-register int defred;
+print_reductions(p, defreduct)
+action *p;
+int defreduct;
 {
-    register int k, anyreds;
-    register action *q;
+    int k, anyreds;
+    action *q;
 
     anyreds = 0;
     for (q = p; q ; q = q->next)
@@ -354,7 +359,7 @@
     {
 	for (; p; p = p->next)
 	{
-	    if (p->action_code == REDUCE && p->number != defred)
+	    if (p->action_code == REDUCE && p->number != defreduct)
 	    {
 		k = p->number - 2;
 		if (p->suppressed == 0)
@@ -363,8 +368,8 @@
 	    }
 	}
 
-        if (defred > 0)
-	    fprintf(verbose_file, "\t.  reduce %d\n", defred - 2);
+        if (defreduct > 0)
+	    fprintf(verbose_file, "\t.  reduce %d\n", defreduct - 2);
     }
 }
 
@@ -373,17 +378,17 @@
 print_gotos(stateno)
 int stateno;
 {
-    register int i, k;
-    register int as;
-    register short *to_state;
-    register shifts *sp;
+    int i, k;
+    int as;
+    short *tostate;
+    shifts *sp;
 
     putc('\n', verbose_file);
     sp = shift_table[stateno];
-    to_state = sp->shift;
+    tostate = sp->shift;
     for (i = 0; i < sp->nshifts; ++i)
     {
-	k = to_state[i];
+	k = tostate[i];
 	as = accessing_symbol[k];
 	if (ISVAR(as))
 	    fprintf(verbose_file, "\t%s  goto %d\n", symbol_name[as], k);
diff -Naur yayacc.orig/src/warshall.c yayacc/src/warshall.c
--- yayacc.orig/src/warshall.c	Tue Mar 20 12:00:01 2001
+++ yayacc/src/warshall.c	Mon Aug 22 12:59:18 2005
@@ -32,32 +32,37 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD: src/usr.bin/yacc/warshall.c,v 1.6 1999/08/28 01:08:04 peter Exp $
  */
 
+#if 0
 #ifndef lint
-static char const sccsid[] = "@(#)warshall.c	5.4 (Berkeley) 5/24/93";
-#endif /* not lint */
+static char sccsid[] = "@(#)warshall.c	5.4 (Berkeley) 5/24/93";
+#endif
+#endif
+
+#ifdef USE_FBSDID
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: src/usr.bin/yacc/warshall.c,v 1.12 2002/04/09 11:39:05 ru Exp $");
+#endif
 
 #include "defs.h"
 
-static void transitive_closure __P((unsigned *, int));
+static void transitive_closure(unsigned *, int);
 
 static void
 transitive_closure(R, n)
 unsigned *R;
 int n;
 {
-    register int rowsize;
-    register unsigned i;
-    register unsigned *rowj;
-    register unsigned *rp;
-    register unsigned *rend;
-    register unsigned *ccol;
-    register unsigned *relend;
-    register unsigned *cword;
-    register unsigned *rowi;
+    int rowsize;
+    unsigned i;
+    unsigned *rowj;
+    unsigned *rp;
+    unsigned *rend;
+    unsigned *ccol;
+    unsigned *relend;
+    unsigned *cword;
+    unsigned *rowi;
 
     rowsize = WORDSIZE(n);
     relend = R + n*rowsize;
@@ -102,10 +107,10 @@
 unsigned *R;
 int n;
 {
-    register int rowsize;
-    register unsigned i;
-    register unsigned *rp;
-    register unsigned *relend;
+    int rowsize;
+    unsigned i;
+    unsigned *rp;
+    unsigned *relend;
 
     transitive_closure(R, n);
 
diff -Naur yayacc.orig/src/yacc.1 yayacc/src/yacc.1
--- yayacc.orig/src/yacc.1	Tue Mar 20 12:00:01 2001
+++ yayacc/src/yacc.1	Mon Aug 22 12:24:51 2005
@@ -33,7 +33,8 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)yacc.1	5.8 (Berkeley) 5/24/93
-.\" $FreeBSD: src/usr.bin/yacc/yacc.1,v 1.10 2000/01/10 08:54:09 kris Exp $
+.\" $FreeBSD: src/usr.bin/yacc/yacc.1,v 1.17 2005/01/18 13:43:56 ru Exp $
+.\"	$OpenBSD: yacc.1,v 1.14 2001/05/01 17:58:05 aaron Exp $
 .\"
 .Dd May 24, 1993
 .Dt YACC 1
@@ -49,14 +50,16 @@
 .Op Fl p Ar symbol_prefix
 .Ar filename
 .Sh DESCRIPTION
-.Nm Yacc
-reads the grammar specification in the file
+The
+.Nm
+utility reads the grammar specification in the file
 .Ar filename
 and generates an LR(1) parser for it.
 The parsers consist of a set of LALR(1) parsing tables and a driver routine
 written in the C programming language.
-.Nm Yacc
-normally writes the parse tables and the driver routine to the file
+The
+.Nm
+utility normally writes the parse tables and the driver routine to the file
 .Pa y.tab.c .
 .Pp
 The following options are available:
@@ -101,7 +104,8 @@
 .It Fl r
 Cause
 .Nm
-to produce separate files for code and tables.  The code file
+to produce separate files for code and tables.
+The code file
 is named
 .Pa y.code.c ,
 and the tables file is named
@@ -115,15 +119,28 @@
 be written to the file
 .Pa y.output .
 .El
-.Pp
-If the environment variable
-.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.
+.Sh ENVIRONMENT
+.Bl -tag -width ".Ev TMPDIR"
+.It Ev TMPDIR
+Name of directory where temporary files are to be created.
+.El
+.Sh TABLES
+The names of the tables generated by this version of
+.Nm
+are
+.Va yylhs , yylen , yydefred , yydgoto , yysindex ,
+.Va yyrindex , yygindex , yytable ,
+and
+.Va yycheck .
+Two additional tables,
+.Va yyname
+and
+.Va yyrule ,
+are created if
+.Dv YYDEBUG
+is defined and non-zero.
 .Sh FILES
-.Bl -tag -width /tmp/yacc.aXXXXXXXXXX -compact
+.Bl -tag -width "Pa /tmp/yacc.aXXXXXXXXXX" -compact
 .It Pa y.code.c
 .It Pa y.tab.c
 .It Pa y.tab.h
@@ -133,7 +150,20 @@
 .It Pa /tmp/yacc.uXXXXXXXXXX
 .El
 .Sh DIAGNOSTICS
-If there are rules that are never reduced, the number of such rules is
-reported on standard error.
-If there are any LALR(1) conflicts, the number of conflicts is reported
-on standard error.
+If there are rules that are never reduced,
+the number of such rules is reported on standard error.
+If there are any
+.Tn LALR(1)
+conflicts,
+the number of conflicts is reported on standard error.
+.Sh SEE ALSO
+.Xr yyfix 1
+.Sh STANDARDS
+The
+.Nm
+utility conforms to
+.St -p1003.2 .
+.Sh HISTORY
+A
+.Nm
+command appeared in PWB UNIX.
diff -Naur yayacc.orig/src/yyfix.1 yayacc/src/yyfix.1
--- yayacc.orig/src/yyfix.1	Tue Mar 20 12:00:00 2001
+++ yayacc/src/yyfix.1	Mon Aug 22 12:24:51 2005
@@ -30,11 +30,11 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)yyfix.1	5.4 (Berkeley) 3/23/93
-.\" $FreeBSD: src/usr.bin/yacc/yyfix.1,v 1.3 1999/08/28 01:08:05 peter Exp $
+.\" $FreeBSD: src/usr.bin/yacc/yyfix.1,v 1.7 2002/11/26 15:34:18 ru Exp $
 .\"
 .Dd March 23, 1993
 .Dt YYFIX 1
-.Os BSD 4.4
+.Os
 .Sh NAME
 .Nm yyfix
 .Nd extract tables from y.tab.c
@@ -50,9 +50,9 @@
 generated file
 .Pa y.tab.c .
 As the names of the tables generated by the current version of
-.Xr yacc
+.Xr yacc 1
 are different from those of historical versions of
-.Xr yacc ,
+.Xr yacc 1 ,
 the shell script
 .Nm
 is provided to simplify the transition.
@@ -68,7 +68,7 @@
 attempts to determine if the
 .Pa y.tab.c
 file is from an old or new
-.Xr yacc ,
+.Xr yacc 1 ,
 and extracts the appropriate tables.
 .Pp
 The tables
@@ -83,7 +83,7 @@
 .Dq yydef
 are extracted
 from historical versions of
-.Xr yacc .
+.Xr yacc 1 .
 .Pp
 The tables
 .Dq yylhs ,
@@ -99,7 +99,7 @@
 and
 .Dq yycheck ,
 are extracted from the current version of
-.Xr yacc .
+.Xr yacc 1 .
 .Sh FILES
 .Bl -tag -width y.tab.c
 .It Pa y.tab.c
@@ -110,5 +110,5 @@
 .Sh HISTORY
 The
 .Nm
-command appeared in
+command first appeared in
 .Bx 4.4 .
