2007-03-14  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* defs.h: Add declarations for unterminated_comment, syntax_error,
	unexpected_EOF, unterminated_text, unterminated_string, over_unionized,
	unterminated_union, illegal_character, used_reserved, illegal_tag,
	tokenized_start, retyped_warning, reprec_warning, revalued_warning,
	terminal_start, restarted_warning, no_grammar, terminal_lhs,
	default_action_warning, dollar_warning, dollar_error, untyped_lhs,
	unknown_rhs, untyped_rhs, unterminated_action, prec_redeclared,
	undefined_goal, undefined_symbol_warning, create_symbol_table,
	free_symbol_table, free_symbols to global function declarations.

	* reader.c (insert_empty_rule): Parentheses added around assignment
	used as truth value.
	(pack_names): Parentheses added around assignment used as truth value.
	(keyword): NO-OP return statement added at end of non-void function.
	(mark_symbol): Initialize *bp to a sane default.
	(print_grammar): Initialize spacing to a sane default.

	* Makefile: Add variables EXEEXT, INSTALL and yacc target.
	Change CFLAGS, DEST and LINKER values.
	Modify install target to reflect actual installation tree.

	* main.c: Change program name from yacc to byacc.
	Add DJGPP specific s-flag.  If LFN support available s = 0 means
	that posix names shall be used. If s = 1 the DOS names shall be used
	even if LFN support is available.  If LFN support is not available
	s-flag is ignored.
	Define new global file descriptors action_file_descriptor,
	text_file_descriptor and union_file_descriptor for action_file_name,
	text_file_name and union_file_name.
	Replace explicit 0 with NULL for all pointer tests.
	[__MSDOS__]: On DOS use yXXXXXXX as pattern for temporary file names
	and define macro OFFSET to determinate the second or the fifth string
	character.
	(usage): Add sflag to the flag set.
	(getargs): Add the sflsg case to the switch statement.
	(create_file_names) [__MSDOS__]: On DOS/Win32 systems check also TMP
	and TEMP.  If neither are set then default to cwd.
	Define out declarations for mktemp and getenv.
	(create_file_names): Use mkstemp instead of mktemp.
	(open_files): Use fdopen instead of fopen to create/open
	action_file_name, text_file_name and union_file_name.

	* defs.h: Modifications concerning defines for contructing the file
	 names.
	[__MSDOS__] [__DJGPP__]: On OS that have LFN support use pathconf and
	 the value of the s-flag to determinate at run time what sort of file
	 name will be used.
	[__MSDOS__]: If __MSDOS__ but not __DJGPP__ use short file names, else
	use long (posix) file names.
	[__DJGPP__]: Add declaration of sflag to global variables.

	* yacc.1: Document DJGPP specific behavior depending if LFN support is
	available or not.


2007-03-13  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* lr0.c: Define out not used functions show_cores, show_ritems,
	show_rrhs, show_shifts, free_derives and free_nullable

	* warshall.c: Define function transitive_closure as static void.
	Define function reflexive_transitive_closure as void.

	* skeleton.c: Define function write_section as void.
	(write_section): Put parentheses around assignment used as truth value.

	* symtab.c: Define function hash as static.
	(hash): Put parentheses around assignment used as truth value.
	Define functions create_symbol_table, free_symbol_table and
	free_symbols as void.

	* mkpar.c: Define functions find_final_state, unused_rules,
	remove_conflicts, total_conflicts, defreds, free_action_row as
	static void.
	Define function free_parser as void.
	Define functions parse_actions, get_shifts, add_reductions, add_reduce
	and sole_reduction as static.
	Add function declarations for parse_actions, get_shifts,
	add_reductions, add_reduce, find_final_state, unused_rules,
	remove_conflicts, total_conflicts, sole_reduction, defreds,
	free_action_row and free_parser.
	(unused_rules): Put explicit braces to avoid ambiguous 'else'.
	(make_parser): Initialize pref to a sane default.

	* defs.h: Add declarations for free_parser and write_section to global
	function declarations.

	* verbose.c: Define functions log_unused, log_conflicts, print_state,
	print_conflicts, print_core, print_nulls, print_actions, print_shifts,
	print_reductions and print_gotos as static void.
	Add function declarations for log_unused, log_conflicts, print_state,
	print_conflicts, print_core, print_nulls, print_actions, print_shifts,
	print_reductions and print_gotos as static void.
	(print_conflicts): Initilize act and number to a sane default.

	* output.c: Define function output_prefix, output_rule_data,
	output_yydefred, output_actions, token_actions, goto_actions,
	save_column, sort_actions, pack_table, output_base, output_table,
	output_check, output_defines, output_stored_text, output_debug,
	output_stype, output_trailing_text, output_semantic_actions,
	free_itemsets, free_shifts and free_reductions as static void.
	Define functions default_goto, matching_vector, pack_vector and
	is_C_identifier as static int.
	Add function declarations for output_prefix, output_rule_data,
	output_yydefred, output_actions, token_actions, goto_actions,
	save_column, sort_actions, pack_table, output_base, output_table,
	output_check, output_defines, output_stored_text, output_debug,
	output_stype, output_trailing_text, output_semantic_actions,
	free_itemsets, free_shifts, free_reductions, default_goto,
	matching_vector, pack_vector and is_C_identifier.
	(is_C_identifier): Parentheses added around assignment used as truth
	value.
	(output_defines): Parentheses added around assignment used as truth
	value.
	(output_debug): Parentheses added around assignment used as truth
	value.

	* reader.c: Define functions cachec, get_line, skip_comment,
	copy_ident, copy_text, copy_union, declare_tokens, declare_types,
	declare_start, read_declarations, initialize_grammar, expand_items,
	expand_rules, advance_to_start, start_rule, end_rule,
	insert_empty_rule, add_symbol, copy_action, read_grammar, free_tags,
	pack_names, check_symbols, pack_symbols, pack_grammar and print_grammar
	as static void.
	Define functions get_literal and get_name as static bucket.
	Define functions dup_line and get_tag as static char.
	Define functions nextc, keyword, hexval, is_reserved, get_number and
	mark_symbol as static int.
	Add function declarations for cachec, get_line, skip_comment,
	copy_ident, copy_text, copy_union, declare_tokens, declare_types,
	declare_start, read_declarations, initialize_grammar, expand_items,
	expand_rules, advance_to_start, start_rule, end_rule,
	insert_empty_rule, add_symbol, copy_action, read_grammar, free_tags,
	pack_names, check_symbols, pack_symbols, pack_grammar, print_grammar,
	get_literal, get_name,dup_line, get_tag, nextc, keyword, hexval,
	is_reserved, get_number and mark_symbol.


2007-03-12  Juan Manuel Guerrero  <juan.guerrero@gmx.de>

	* closure.c: Define functions set_EFF, print_closure, print_EFF and
	print_first_derives as static void.
	Define functions set_first_derives, closure and	finalize_closure as
	void.
	(set_first_derives): Initialize cword to a sane default.

	* defs.h: Add declaration for reflexive_transitive_closure, done, lr0,
	lalr, make_parser, verbose, output, no_space, open_error, fatal,
	reader, set_first_derives, closure and finalize_closure to global
	function declarations.
	Define out the declations for library functions free, calloc, malloc,
	realloc and strcpy and include the corresponding headers.

	* error.c: Define functions fatal, no_space, open_error,
	unexpected_EOF, syntax_error, unterminated_comment,
	unterminated_string, unterminated_text, unterminated_union,
	over_unionized, illegal_tag, illegal_character, used_reserved,
	tokenized_start, retyped_warning, reprec_warning, revalued_warning,
	terminal_start, restarted_warning, no_grammar, terminal_lhs,
	prec_redeclared, unterminated_action, dollar_warning, dollar_error,
	untyped_lhs, untyped_rhs, unknown_rhs, default_action_warning,
	undefined_goal and undefined_symbol_warning as void.
	Define function print_pos as static void.

	* main.c: Include <unistd.h> for unlink declarations.
	Define functions onintr, set_signals, usage, getargs,
	create_file_names, open_files as static void.
	Define function done as void.
	Add return 0 statement to main.

	* reader.c: Define function reader as void.

	* lr0.c: Define function lr0 as void.
	Define functions allocate_itemsets, allocate_storage, append_states,
	free_storage, generate_states, initialize_states, new_itemsets,
	show_cores, show_ritems, show_rrhs, show_shifts, save_shifts,
	save_reductions, set_derives, free_derives, set_nullable and
	free_nullable as static void.
	Define function get_state and new_state as static.
	Add function declarations for allocate_itemsets, allocate_storage,
	append_states, free_storage, generate_states, get_state,
	initialize_states, new_itemsets, new_state, show_cores,
	show_ritems, show_rrhs, show_shifts, save_shifts,
	save_reductions, set_derives, free_derives, set_nullable and
	free_nullable.

	* lalr.c: Define function lalr as void.
	Move function lalr to the end of the file.
	Define functions set_state_table, set_accessing_symbol,
	set_shift_table, set_reduction_table, set_maxrhs, initialize_LA,
	set_goto_map, initialize_F, build_relations, add_lookback_edge,
	compute_FOLLOWS, compute_lookaheads, digraph and traverse as
	static void.
	Define transpose and map_goto as static.
	Add function declarations for set_state_table, set_accessing_symbol,
	set_shift_table, set_reduction_table, set_maxrhs, initialize_LA,
	set_goto_map, map_goto, initialize_F, build_relations,
	add_lookback_edge, transpose, compute_FOLLOWS, compute_lookaheads,
	digraph and traverse.

	* mkpar.c: Define function make_parser as void.
	Move function make_parser to the end of the file.

	* output.c: Define function output as void.
	Move function output to the end of the file.

	* verbose.c: Define function verbose as void.
	Move function verbose to the end of the file.



diff -aprNU5 byacc-1.9.orig/Makefile byacc-1.9/Makefile
--- byacc-1.9.orig/Makefile	1991-01-14 05:22:28 +0000
+++ byacc-1.9/Makefile	2007-03-14 06:48:40 +0000
@@ -1,16 +1,20 @@
-DEST	      = .
+DEST	      = /dev/env/DJDIR
+
+EXEEXT     = .exe
 
 HDRS	      = defs.h
 
-CFLAGS	      = -O -DNDEBUG
+CFLAGS        = -O2 -g -DNDEBUG
 
 LDFLAGS	      =
 
 LIBS	      =
 
-LINKER	      = cc
+LINKER	      = gcc
+
+INSTALL       = /dev/env/DJDIR/bin/ginstall.exe
 
 MAKEFILE      = Makefile
 
 OBJS	      = closure.o \
 		error.o \
@@ -25,11 +29,11 @@ OBJS	      = closure.o \
 		verbose.o \
 		warshall.o
 
 PRINT	      = pr -f -l88
 
-PROGRAM	      = yacc
+PROGRAM	      = byacc$(EXEEXT)
 
 SRCS	      = closure.c \
 		error.c \
 		lalr.c \
 		lr0.c \
@@ -40,35 +44,42 @@ SRCS	      = closure.c \
 		skeleton.c \
 		symtab.c \
 		verbose.c \
 		warshall.c
 
-all:		$(PROGRAM)
+all:		$(PROGRAM) yacc$(EXEEXT)
 
 $(PROGRAM):     $(OBJS) $(LIBS)
 		@echo -n "Loading $(PROGRAM) ... "
 		@$(LINKER) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
 		@echo "done"
 
 clean:;		@rm -f $(OBJS)
 
-clobber:;	@rm -f $(OBJS) $(PROGRAM)
+clobber:;	@rm -f $(OBJS) $(PROGRAM) yacc$(EXEEXT)
 
 depend:;	@mkmf -f $(MAKEFILE) PROGRAM=$(PROGRAM) DEST=$(DEST)
 
 index:;		@ctags -wx $(HDRS) $(SRCS)
 
-install:	$(PROGRAM)
+install:	$(PROGRAM) yacc$(EXEEXT)
 		@echo Installing $(PROGRAM) in $(DEST)
-		@install -s $(PROGRAM) $(DEST)
+		@$(INSTALL) -d $(DEST)/bin
+		@$(INSTALL) -d $(DEST)/man/man1
+		@$(INSTALL) -s $(PROGRAM) $(DEST)/bin/$(PROGRAM)
+		@$(INSTALL)    yacc$(EXEEXT) $(DEST)/bin/yacc$(EXEEXT)
+		@$(INSTALL)    yacc.1 $(DEST)/man/man1/yacc.1
 
 listing:;	@$(PRINT) Makefile $(HDRS) $(SRCS) | lpr
 
 lint:;		@lint $(SRCS)
 
 program:        $(PROGRAM)
 
+yacc$(EXEEXT):  $(PROGRAM)
+		ln -s $(PROGRAM) yacc
+
 tags:           $(HDRS) $(SRCS); @ctags $(HDRS) $(SRCS)
 
 ###
 closure.o: defs.h
 error.o: defs.h
diff -aprNU5 byacc-1.9.orig/closure.c byacc-1.9/closure.c
--- byacc-1.9.orig/closure.c	1993-02-22 06:32:44 +0000
+++ byacc-1.9/closure.c	2007-03-14 06:48:40 +0000
@@ -6,10 +6,11 @@ unsigned *ruleset;
 
 static unsigned *first_derives;
 static unsigned *EFF;
 
 
+static void
 set_EFF()
 {
     register unsigned *row;
     register int symbol;
     register short *sp;
@@ -42,17 +43,18 @@ set_EFF()
     print_EFF();
 #endif
 }
 
 
+void
 set_first_derives()
 {
     register unsigned *rrow;
     register unsigned *vrow;
     register int j;
     register unsigned k;
-    register unsigned cword;
+    register unsigned cword = 0;
     register short *rp;
 
     int rule;
     int i;
     int rulesetsize;
@@ -97,10 +99,11 @@ set_first_derives()
 
     FREE(EFF);
 }
 
 
+void
 closure(nucleus, n)
 short *nucleus;
 int n;
 {
     register int ruleno;
@@ -167,20 +170,22 @@ int n;
 #endif
 }
 
 
 
+void
 finalize_closure()
 {
   FREE(itemset);
   FREE(ruleset);
   FREE(first_derives + ntokens * WORDSIZE(nrules));
 }
 
 
 #ifdef	DEBUG
 
+static void
 print_closure(n)
 int n;
 {
   register short *isp;
 
@@ -188,10 +193,11 @@ int n;
   for (isp = itemset; isp < itemsetend; isp++)
     printf("   %d\n", *isp);
 }
 
 
+static void
 print_EFF()
 {
     register int i, j;
     register unsigned *rowp;
     register unsigned word;
@@ -219,10 +225,11 @@ print_EFF()
 	}
     }
 }
 
 
+static void
 print_first_derives()
 {
     register int i;
     register int j;
     register unsigned *rp;
diff -aprNU5 byacc-1.9.orig/defs.h byacc-1.9/defs.h
--- byacc-1.9.orig/defs.h	1992-10-12 01:27:48 +0000
+++ byacc-1.9/defs.h	2007-03-14 07:19:46 +0000
@@ -1,9 +1,12 @@
 #include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 
+#include <stdlib.h>  /*  For free(), calloc(), malloc(), realloc().  */
+#include <string.h>  /*  For strcpy().  */
+
 
 /*  machine-dependent definitions			*/
 /*  the following definitions are for the Tahoe		*/
 /*  they might have to be changed for other machines	*/
 
@@ -43,14 +46,43 @@
 #define	BACKSLASH	'\\'    /*  backslash  */
 
 
 /* defines for constructing filenames */
 
-#define CODE_SUFFIX	".code.c"
-#define	DEFINES_SUFFIX	".tab.h"
-#define	OUTPUT_SUFFIX	".tab.c"
-#define	VERBOSE_SUFFIX	".output"
+#ifdef __MSDOS__
+# ifdef __DJGPP__
+/* sflag is defined in main.c and is 0
+   if the command-line option `-s' has not been specified.
+*/
+#  define CODE_SUFFIX     ((pathconf (NULL, _PC_NAME_MAX) > 12) \
+                           ? ((sflag == 0) \
+                              ? ".code.c" : "_code.c") \
+                           : "_code.c")
+#  define DEFINES_SUFFIX  ((pathconf (NULL, _PC_NAME_MAX) > 12) \
+                           ? ((sflag == 0) \
+                              ? ".tab.h" : "_tab.h") \
+                           : "_tab.h")
+#  define OUTPUT_SUFFIX   ((pathconf (NULL, _PC_NAME_MAX) > 12) \
+                           ? ((sflag == 0) \
+                              ? ".tab.c" : "_tab.c") \
+                           : "_tab.c")
+#  define VERBOSE_SUFFIX  ((pathconf (NULL, _PC_NAME_MAX) > 12) \
+                           ? ((sflag == 0) \
+                              ? ".output" : ".out") \
+                           : ".out")
+# else /* ! __DJGPP__ */
+#  define CODE_SUFFIX     "_code.c"
+#  define DEFINES_SUFFIX  "_tab.h"
+#  define OUTPUT_SUFFIX   "_tab.c"
+#  define VERBOSE_SUFFIX  ".out"
+# endif /* ! __DJGPP__ */
+#else /* ! MSDOS */
+# define CODE_SUFFIX      ".code.c"
+# define DEFINES_SUFFIX   ".tab.h"
+# define OUTPUT_SUFFIX    ".tab.c"
+# define VERBOSE_SUFFIX   ".output"
+#endif /* ! __MSDOS__ */
 
 
 /* keyword codes */
 
 #define TOKEN 0
@@ -179,10 +211,13 @@ struct action
 /* global variables */
 
 extern char dflag;
 extern char lflag;
 extern char rflag;
+#ifdef __DJGPP__
+extern char sflag;
+#endif
 extern char tflag;
 extern char vflag;
 extern char *symbol_prefix;
 
 extern char *myname;
@@ -271,19 +306,67 @@ extern short final_state;
 /* global functions */
 
 extern char *allocate();
 extern bucket *lookup();
 extern bucket *make_bucket();
-
+extern void reflexive_transitive_closure();
+extern void done();
+extern void lalr();
+extern void lr0();
+extern void make_parser();
+extern void verbose();
+extern void output();
+extern void reader();
+extern void no_space();
+extern void open_error();
+extern void fatal();
+extern void set_first_derives();
+extern void closure();
+extern void finalize_closure();
+extern void free_parser();
+extern void write_section();
+extern void unterminated_comment();
+extern void syntax_error();
+extern void unexpected_EOF();
+extern void unterminated_text();
+extern void unterminated_string();
+extern void over_unionized();
+extern void unterminated_union();
+extern void illegal_character();
+extern void used_reserved();
+extern void illegal_tag();
+extern void tokenized_start();
+extern void retyped_warning();
+extern void reprec_warning();
+extern void revalued_warning();
+extern void terminal_start();
+extern void restarted_warning();
+extern void no_grammar();
+extern void terminal_lhs();
+extern void default_action_warning();
+extern void dollar_warning();
+extern void dollar_error();
+extern void untyped_lhs();
+extern void unknown_rhs();
+extern void untyped_rhs();
+extern void unterminated_action();
+extern void prec_redeclared();
+extern void undefined_goal();
+extern void undefined_symbol_warning();
+extern void create_symbol_table();
+extern void free_symbol_table();
+extern void free_symbols();
 
 /* system variables */
 
 extern int errno;
 
 
+#if 0
 /* system functions */
 
 extern void free();
 extern char *calloc();
 extern char *malloc();
 extern char *realloc();
 extern char *strcpy();
+#endif
diff -aprNU5 byacc-1.9.orig/error.c byacc-1.9/error.c
--- byacc-1.9.orig/error.c	1990-02-05 05:43:46 +0000
+++ byacc-1.9/error.c	2007-03-14 06:48:40 +0000
@@ -1,41 +1,46 @@
 /* routines for printing error messages  */
 
 #include "defs.h"
 
 
+void
 fatal(msg)
 char *msg;
 {
     fprintf(stderr, "%s: f - %s\n", myname, msg);
     done(2);
 }
 
 
+void
 no_space()
 {
     fprintf(stderr, "%s: f - out of space\n", myname);
     done(2);
 }
 
 
+void
 open_error(filename)
 char *filename;
 {
     fprintf(stderr, "%s: f - cannot open \"%s\"\n", myname, filename);
     done(2);
 }
 
 
+void
 unexpected_EOF()
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", unexpected end-of-file\n",
 	    myname, lineno, input_file_name);
     done(1);
 }
 
 
+static void
 print_pos(st_line, st_cptr)
 char *st_line;
 char *st_cptr;
 {
     register char *s;
@@ -59,10 +64,11 @@ char *st_cptr;
     putc('^', stderr);
     putc('\n', stderr);
 }
 
 
+void
 syntax_error(st_lineno, st_line, st_cptr)
 int st_lineno;
 char *st_line;
 char *st_cptr;
 {
@@ -71,10 +77,11 @@ char *st_cptr;
     print_pos(st_line, st_cptr);
     done(1);
 }
 
 
+void
 unterminated_comment(c_lineno, c_line, c_cptr)
 int c_lineno;
 char *c_line;
 char *c_cptr;
 {
@@ -83,10 +90,11 @@ char *c_cptr;
     print_pos(c_line, c_cptr);
     done(1);
 }
 
 
+void
 unterminated_string(s_lineno, s_line, s_cptr)
 int s_lineno;
 char *s_line;
 char *s_cptr;
 {
@@ -95,10 +103,11 @@ char *s_cptr;
     print_pos(s_line, s_cptr);
     done(1);
 }
 
 
+void
 unterminated_text(t_lineno, t_line, t_cptr)
 int t_lineno;
 char *t_line;
 char *t_cptr;
 {
@@ -107,10 +116,11 @@ char *t_cptr;
     print_pos(t_line, t_cptr);
     done(1);
 }
 
 
+void
 unterminated_union(u_lineno, u_line, u_cptr)
 int u_lineno;
 char *u_line;
 char *u_cptr;
 {
@@ -119,20 +129,22 @@ declaration\n", myname, u_lineno, input_
     print_pos(u_line, u_cptr);
     done(1);
 }
 
 
+void
 over_unionized(u_cptr)
 char *u_cptr;
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", too many %%union \
 declarations\n", myname, lineno, input_file_name);
     print_pos(line, u_cptr);
     done(1);
 }
 
 
+void
 illegal_tag(t_lineno, t_line, t_cptr)
 int t_lineno;
 char *t_line;
 char *t_cptr;
 {
@@ -141,102 +153,114 @@ char *t_cptr;
     print_pos(t_line, t_cptr);
     done(1);
 }
 
 
+void
 illegal_character(c_cptr)
 char *c_cptr;
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", illegal character\n",
 	    myname, lineno, input_file_name);
     print_pos(line, c_cptr);
     done(1);
 }
 
 
+void
 used_reserved(s)
 char *s;
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", illegal use of reserved symbol \
 %s\n", myname, lineno, input_file_name, s);
     done(1);
 }
 
 
+void
 tokenized_start(s)
 char *s;
 {
      fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s cannot be \
 declared to be a token\n", myname, lineno, input_file_name, s);
      done(1);
 }
 
 
+void
 retyped_warning(s)
 char *s;
 {
     fprintf(stderr, "%s: w - line %d of \"%s\", the type of %s has been \
 redeclared\n", myname, lineno, input_file_name, s);
 }
 
 
+void
 reprec_warning(s)
 char *s;
 {
     fprintf(stderr, "%s: w - line %d of \"%s\", the precedence of %s has been \
 redeclared\n", myname, lineno, input_file_name, s);
 }
 
 
+void
 revalued_warning(s)
 char *s;
 {
     fprintf(stderr, "%s: w - line %d of \"%s\", the value of %s has been \
 redeclared\n", myname, lineno, input_file_name, s);
 }
 
 
+void
 terminal_start(s)
 char *s;
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", the start symbol %s is a \
 token\n", myname, lineno, input_file_name, s);
     done(1);
 }
 
 
+void
 restarted_warning()
 {
     fprintf(stderr, "%s: w - line %d of \"%s\", the start symbol has been \
 redeclared\n", myname, lineno, input_file_name);
 }
 
 
+void
 no_grammar()
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", no grammar has been \
 specified\n", myname, lineno, input_file_name);
     done(1);
 }
 
 
+void
 terminal_lhs(s_lineno)
 int s_lineno;
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", a token appears on the lhs \
 of a production\n", myname, s_lineno, input_file_name);
     done(1);
 }
 
 
+void
 prec_redeclared()
 {
     fprintf(stderr, "%s: w - line %d of  \"%s\", conflicting %%prec \
 specifiers\n", myname, lineno, input_file_name);
 }
 
 
+void
 unterminated_action(a_lineno, a_line, a_cptr)
 int a_lineno;
 char *a_line;
 char *a_cptr;
 {
@@ -245,19 +269,21 @@ char *a_cptr;
     print_pos(a_line, a_cptr);
     done(1);
 }
 
 
+void
 dollar_warning(a_lineno, i)
 int a_lineno;
 int i;
 {
     fprintf(stderr, "%s: w - line %d of \"%s\", $%d references beyond the \
 end of the current rule\n", myname, a_lineno, input_file_name, i);
 }
 
 
+void
 dollar_error(a_lineno, a_line, a_cptr)
 int a_lineno;
 char *a_line;
 char *a_cptr;
 {
@@ -266,52 +292,58 @@ char *a_cptr;
     print_pos(a_line, a_cptr);
     done(1);
 }
 
 
+void
 untyped_lhs()
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", $$ is untyped\n",
 	    myname, lineno, input_file_name);
     done(1);
 }
 
 
+void
 untyped_rhs(i, s)
 int i;
 char *s;
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", $%d (%s) is untyped\n",
 	    myname, lineno, input_file_name, i, s);
     done(1);
 }
 
 
+void
 unknown_rhs(i)
 int i;
 {
     fprintf(stderr, "%s: e - line %d of \"%s\", $%d is untyped\n",
 	    myname, lineno, input_file_name, i);
     done(1);
 }
 
 
+void
 default_action_warning()
 {
     fprintf(stderr, "%s: w - line %d of \"%s\", the default action assigns an \
 undefined value to $$\n", myname, lineno, input_file_name);
 }
 
 
+void
 undefined_goal(s)
 char *s;
 {
     fprintf(stderr, "%s: e - the start symbol %s is undefined\n", myname, s);
     done(1);
 }
 
 
+void
 undefined_symbol_warning(s)
 char *s;
 {
     fprintf(stderr, "%s: w - the symbol %s is undefined\n", myname, s);
 }
diff -aprNU5 byacc-1.9.orig/lalr.c byacc-1.9/lalr.c
--- byacc-1.9.orig/lalr.c	1990-02-05 05:51:16 +0000
+++ byacc-1.9/lalr.c	2007-03-14 06:48:40 +0000
@@ -18,11 +18,26 @@ shifts **shift_table;
 reductions **reduction_table;
 short *goto_map;
 short *from_state;
 short *to_state;
 
-short **transpose();
+static void set_state_table();
+static void set_accessing_symbol();
+static void set_shift_table();
+static void set_reduction_table();
+static void set_maxrhs();
+static void initialize_LA();
+static void set_goto_map();
+static int map_goto();
+static void initialize_F();
+static void build_relations();
+static void add_lookback_edge();
+static short ** transpose();
+static void compute_FOLLOWS();
+static void compute_lookaheads();
+static void digraph();
+static void traverse();
 
 static int infinity;
 static int maxrhs;
 static int ngotos;
 static unsigned *F;
@@ -32,29 +47,11 @@ static short **R;
 static short *INDEX;
 static short *VERTICES;
 static int top;
 
 
-lalr()
-{
-    tokensetsize = WORDSIZE(ntokens);
-
-    set_state_table();
-    set_accessing_symbol();
-    set_shift_table();
-    set_reduction_table();
-    set_maxrhs();
-    initialize_LA();
-    set_goto_map();
-    initialize_F();
-    build_relations();
-    compute_FOLLOWS();
-    compute_lookaheads();
-}
-
-
-
+static void
 set_state_table()
 {
     register core *sp;
 
     state_table = NEW2(nstates, core *);
@@ -62,10 +59,11 @@ set_state_table()
 	state_table[sp->number] = sp;
 }
 
 
 
+static void
 set_accessing_symbol()
 {
     register core *sp;
 
     accessing_symbol = NEW2(nstates, short);
@@ -73,10 +71,11 @@ set_accessing_symbol()
 	accessing_symbol[sp->number] = sp->accessing_symbol;
 }
 
 
 
+static void
 set_shift_table()
 {
     register shifts *sp;
 
     shift_table = NEW2(nstates, shifts *);
@@ -84,10 +83,11 @@ set_shift_table()
 	shift_table[sp->number] = sp;
 }
 
 
 
+static void
 set_reduction_table()
 {
     register reductions *rp;
 
     reduction_table = NEW2(nstates, reductions *);
@@ -95,10 +95,11 @@ set_reduction_table()
 	reduction_table[rp->number] = rp;
 }
 
 
 
+static void
 set_maxrhs()
 {
   register short *itemp;
   register short *item_end;
   register int length;
@@ -123,10 +124,11 @@ set_maxrhs()
   maxrhs = max;
 }
 
 
 
+static void
 initialize_LA()
 {
   register int i, j, k;
   register reductions *rp;
 
@@ -160,10 +162,12 @@ initialize_LA()
 	}
     }
 }
 
 
+
+static void
 set_goto_map()
 {
   register shifts *sp;
   register int i;
   register int symbol;
@@ -229,11 +233,11 @@ set_goto_map()
 
 
 
 /*  Map_goto maps a state/symbol pair into its numeric representation.	*/
 
-int
+static int
 map_goto(state, symbol)
 int state;
 int symbol;
 {
     register int high;
@@ -258,10 +262,11 @@ int symbol;
     }
 }
 
 
 
+static void
 initialize_F()
 {
   register int i;
   register int j;
   register int k;
@@ -335,10 +340,11 @@ initialize_F()
   FREE(edge);
 }
 
 
 
+static void
 build_relations()
 {
   register int i;
   register int j;
   register int k;
@@ -427,10 +433,12 @@ build_relations()
   FREE(edge);
   FREE(states);
 }
 
 
+
+static void
 add_lookback_edge(stateno, ruleno, gotono)
 int stateno, ruleno, gotono;
 {
     register int i, k;
     register int found;
@@ -454,11 +462,11 @@ int stateno, ruleno, gotono;
     lookback[i] = sp;
 }
 
 
 
-short **
+static short **
 transpose(R, n)
 short **R;
 int n;
 {
   register short **new_R;
@@ -512,16 +520,19 @@ int n;
   return (new_R);
 }
 
 
 
+static void
 compute_FOLLOWS()
 {
   digraph(includes);
 }
 
 
+
+static void
 compute_lookaheads()
 {
   register int i, n;
   register unsigned *fp1, *fp2, *fp3;
   register shorts *sp, *next;
@@ -552,10 +563,12 @@ compute_lookaheads()
   FREE(lookback);
   FREE(F);
 }
 
 
+
+static void
 digraph(relation)
 short **relation;
 {
   register int i;
 
@@ -579,10 +592,11 @@ short **relation;
   FREE(VERTICES);
 }
 
 
 
+static void
 traverse(i)
 register int i;
 {
   register unsigned *fp1;
   register unsigned *fp2;
@@ -634,5 +648,25 @@ register int i;
 	  while (fp1 < fp3)
 	    *fp2++ = *fp1++;
 	}
     }
 }
+
+
+
+void
+lalr()
+{
+    tokensetsize = WORDSIZE(ntokens);
+
+    set_state_table();
+    set_accessing_symbol();
+    set_shift_table();
+    set_reduction_table();
+    set_maxrhs();
+    initialize_LA();
+    set_goto_map();
+    initialize_F();
+    build_relations();
+    compute_FOLLOWS();
+    compute_lookaheads();
+}
diff -aprNU5 byacc-1.9.orig/lr0.c byacc-1.9/lr0.c
--- byacc-1.9.orig/lr0.c	1991-01-14 05:22:32 +0000
+++ byacc-1.9/lr0.c	2007-03-14 06:48:40 +0000
@@ -1,19 +1,40 @@
 
 #include "defs.h"
 
+#define NOT_USED  0
+
 extern short *itemset;
 extern short *itemsetend;
 extern unsigned *ruleset;
 
 int nstates;
 core *first_state;
 shifts *first_shift;
 reductions *first_reduction;
 
-int get_state();
-core *new_state();
+static void allocate_itemsets();
+static void allocate_storage();
+static void append_states();
+static void free_storage();
+static void generate_states();
+static int get_state();
+static void initialize_states();
+static void new_itemsets();
+static core * new_state();
+#if NOT_USED
+static void show_cores();
+static void show_ritems();
+static void show_rrhs();
+static void show_shifts();
+static void free_derives();
+static void free_nullable();
+#endif
+static void save_shifts();
+static void save_reductions();
+static void set_derives();
+static void set_nullable();
 
 static core **state_set;
 static core *this_state;
 static core *last_state;
 static shifts *last_shift;
@@ -28,10 +49,11 @@ static short *shiftset;
 static short **kernel_base;
 static short **kernel_end;
 static short *kernel_items;
 
 
+static void
 allocate_itemsets()
 {
     register short *itemp;
     register short *item_end;
     register int symbol;
@@ -70,19 +92,23 @@ allocate_itemsets()
     shift_symbol = symbol_count;
     kernel_end = NEW2(nsyms, short *);
 }
 
 
+
+static void
 allocate_storage()
 {
     allocate_itemsets();
     shiftset = NEW2(nsyms, short);
     redset = NEW2(nrules + 1, short);
     state_set = NEW2(nitems, core *);
 }
 
 
+
+static void
 append_states()
 {
     register int i;
     register int j;
     register int symbol;
@@ -108,10 +134,11 @@ append_states()
 	shiftset[i] = get_state(symbol);
     }
 }
 
 
+static void
 free_storage()
 {
     FREE(shift_symbol);
     FREE(redset);
     FREE(shiftset);
@@ -121,10 +148,11 @@ free_storage()
     FREE(state_set);
 }
 
 
 
+static void
 generate_states()
 {
     allocate_storage();
     itemset = NEW2(nitems, short);
     ruleset = NEW2(WORDSIZE(nrules), unsigned);
@@ -148,11 +176,11 @@ generate_states()
     free_storage();
 }
 
 
 
-int
+static int
 get_state(symbol)
 int symbol;
 {
     register int key;
     register short *isp1;
@@ -213,10 +241,11 @@ int symbol;
     return (sp->number);
 }
 
 
 
+static void
 initialize_states()
 {
     register int i;
     register short *start_derives;
     register core *p;
@@ -240,10 +269,12 @@ initialize_states()
     first_state = last_state = this_state = p;
     nstates = 1;
 }
 
 
+
+static void
 new_itemsets()
 {
     register int i;
     register int shiftcount;
     register short *isp;
@@ -276,11 +307,11 @@ new_itemsets()
     nshifts = shiftcount;
 }
 
 
 
-core *
+static core *
 new_state(symbol)
 int symbol;
 {
     register int n;
     register core *p;
@@ -317,10 +348,12 @@ int symbol;
 }
 
 
 /* show_cores is used for debugging */
 
+#if NOT_USED
+static void
 show_cores()
 {
     core *p;
     int i, j, k, n;
     int itemno;
@@ -348,35 +381,45 @@ show_cores()
 	    printf("\n");
 	    fflush(stdout);
 	}
     }
 }
+#endif
 
 
 /* show_ritems is used for debugging */
 
+#if NOT_USED
+static void
 show_ritems()
 {
     int i;
 
     for (i = 0; i < nitems; ++i)
 	printf("ritem[%d] = %d\n", i, ritem[i]);
 }
+#endif
 
 
 /* show_rrhs is used for debugging */
+
+#if NOT_USED
+static void
 show_rrhs()
 {
     int i;
 
     for (i = 0; i < nrules; ++i)
 	printf("rrhs[%d] = %d\n", i, rrhs[i]);
 }
+#endif
 
 
 /* show_shifts is used for debugging */
 
+#if NOT_USED
+static void
 show_shifts()
 {
     shifts *p;
     int i, j, k;
 
@@ -389,12 +432,15 @@ show_shifts()
 	j = p->nshifts;
 	for (i = 0; i < j; ++i)
 	    printf("\t%d\n", p->shift[i]);
     }
 }
+#endif
+
 
 
+static void
 save_shifts()
 {
     register shifts *p;
     register short *sp1;
     register short *sp2;
@@ -425,10 +471,11 @@ save_shifts()
     }
 }
 
 
 
+static void
 save_reductions()
 {
     register short *isp;
     register short *rp1;
     register short *rp2;
@@ -474,10 +521,11 @@ save_reductions()
 	}
     }
 }
 
 
+static void
 set_derives()
 {
     register int i, k;
     register int lhs;
     register short *rules;
@@ -504,15 +552,20 @@ set_derives()
 #ifdef	DEBUG
     print_derives();
 #endif
 }
 
+
+
+#if NOT_USED
+static void
 free_derives()
 {
     FREE(derives[start_symbol]);
     FREE(derives);
 }
+#endif
 
 #ifdef	DEBUG
 print_derives()
 {
     register int i;
@@ -533,10 +586,12 @@ print_derives()
     putchar('\n');
 }
 #endif
 
 
+
+static void
 set_nullable()
 {
     register int i, j;
     register int empty;
     int done;
@@ -582,16 +637,22 @@ set_nullable()
     }
 #endif
 }
 
 
+
+#if NOT_USED
+static void
 free_nullable()
 {
     FREE(nullable);
 }
+#endif
+
 
 
+void
 lr0()
 {
     set_derives();
     set_nullable();
     generate_states();
diff -aprNU5 byacc-1.9.orig/main.c byacc-1.9/main.c
--- byacc-1.9.orig/main.c	1993-02-22 06:32:46 +0000
+++ byacc-1.9/main.c	2007-03-14 22:03:58 +0000
@@ -1,18 +1,35 @@
 #include <signal.h>
+#include <unistd.h>
 #include "defs.h"
 
 char dflag;
 char lflag;
 char rflag;
+#ifdef __DJGPP__
+ /* DJGPP specific flag:
+    A value of 0 means that the command-line option `-s'
+    has not been specified and 1 that it has been specified.
+    sflag = 0: use LFN on Win9X with LFN support available.
+    sflag = 1: use SFN on Win9X with LFN support available.
+    sflag is ignored on plain DOS and Win9X without LFN support available.
+ */
+ char sflag = 0;
+#endif
 char tflag;
 char vflag;
 
 char *symbol_prefix;
 char *file_prefix = "y";
-char *myname = "yacc";
+char *myname = "byacc";
+#ifdef __MSDOS__
+#define OFFSET  1
+char *temp_form = "yXXXXXXX";
+#else /* ! __MSDOS__ */
+#define OFFSET  5
 char *temp_form = "yacc.XXXXXXX";
+#endif /* ! __MSDOS__ */
 
 int lineno;
 int outline;
 
 char *action_file_name;
@@ -22,10 +39,14 @@ char *input_file_name = "";
 char *output_file_name;
 char *text_file_name;
 char *union_file_name;
 char *verbose_file_name;
 
+int action_file_descriptor;
+int text_file_descriptor;
+int union_file_descriptor;
+
 FILE *action_file;	/*  a temp file, used to save actions associated    */
 			/*  with rules until the parser is written	    */
 FILE *code_file;	/*  y.code.c (used when the -r option is specified) */
 FILE *defines_file;	/*  y.tab.h					    */
 FILE *input_file;	/*  the input file				    */
@@ -55,30 +76,36 @@ short *rrhs;
 short *rprec;
 char  *rassoc;
 short **derives;
 char *nullable;
 
+#if 0
 extern char *mktemp();
 extern char *getenv();
+#endif
 
 
+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); }
     exit(k);
 }
 
 
-onintr()
+static void
+onintr(signo)
+int signo;
 {
     done(1);
 }
 
 
+static void
 set_signals()
 {
 #ifdef SIGINT
     if (signal(SIGINT, SIG_IGN) != SIG_IGN)
 	signal(SIGINT, onintr);
@@ -92,17 +119,19 @@ set_signals()
 	signal(SIGHUP, onintr);
 #endif
 }
 
 
+static void
 usage()
 {
-    fprintf(stderr, "usage: %s [-dlrtv] [-b file_prefix] [-p symbol_prefix] filename\n", myname);
+    fprintf(stderr, "usage: %s [-dlrstv] [-b file_prefix] [-p symbol_prefix] filename\n", myname);
     exit(1);
 }
 
 
+static void
 getargs(argc, argv)
 int argc;
 char *argv[];
 {
     register int i;
@@ -152,10 +181,16 @@ char *argv[];
 
 	case 'r':
 	    rflag = 1;
 	    break;
 
+#ifdef __DJGPP__
+	case 's':
+	    sflag = 1;
+	    break;
+#endif
+
 	case 't':
 	    tflag = 1;
 	    break;
 
 	case 'v':
@@ -183,10 +218,16 @@ char *argv[];
 
 	    case 'r':
 		rflag = 1;
 		break;
 
+#ifdef __DJGPP__
+	    case 's':
+		sflag = 1;
+		break;
+#endif
+
 	    case 't':
 		tflag = 1;
 		break;
 
 	    case 'v':
@@ -220,29 +261,39 @@ unsigned n;
     }
     return (p);
 }
 
 
+static void
 create_file_names()
 {
     int i, len;
     char *tmpdir;
 
     tmpdir = getenv("TMPDIR");
-    if (tmpdir == 0) tmpdir = "/tmp";
+#ifdef __MSDOS__
+    if (tmpdir == NULL) tmpdir = getenv("TMP");
+    if (tmpdir == NULL) tmpdir = getenv("TEMP");
+    if (tmpdir == NULL) tmpdir = ".";
+    for (i = 0; tmpdir[i] != '\0'; i++)
+      if (tmpdir[i] == BACKSLASH)
+        tmpdir[i] = '/';
+#else
+    if (tmpdir == NULL) tmpdir = "/tmp";
+#endif
 
     len = strlen(tmpdir);
     i = len + 13;
     if (len && tmpdir[len-1] != '/')
 	++i;
 
     action_file_name = MALLOC(i);
-    if (action_file_name == 0) no_space();
+    if (action_file_name == NULL) no_space();
     text_file_name = MALLOC(i);
-    if (text_file_name == 0) no_space();
+    if (text_file_name == NULL) no_space();
     union_file_name = MALLOC(i);
-    if (union_file_name == 0) no_space();
+    if (union_file_name == NULL) no_space();
 
     strcpy(action_file_name, tmpdir);
     strcpy(text_file_name, tmpdir);
     strcpy(union_file_name, tmpdir);
 
@@ -256,101 +307,102 @@ create_file_names()
 
     strcpy(action_file_name + len, temp_form);
     strcpy(text_file_name + len, temp_form);
     strcpy(union_file_name + len, temp_form);
 
-    action_file_name[len + 5] = 'a';
-    text_file_name[len + 5] = 't';
-    union_file_name[len + 5] = 'u';
-
-    mktemp(action_file_name);
-    mktemp(text_file_name);
-    mktemp(union_file_name);
+    action_file_name[len + OFFSET] = 'a';
+    text_file_name[len + OFFSET] = 't';
+    union_file_name[len + OFFSET] = 'u';
+
+    action_file_descriptor = mkstemp(action_file_name);
+    text_file_descriptor = mkstemp(text_file_name);
+    union_file_descriptor = mkstemp(union_file_name);
 
     len = strlen(file_prefix);
 
     output_file_name = MALLOC(len + 7);
-    if (output_file_name == 0)
+    if (output_file_name == NULL)
 	no_space();
     strcpy(output_file_name, file_prefix);
     strcpy(output_file_name + len, OUTPUT_SUFFIX);
 
     if (rflag)
     {
 	code_file_name = MALLOC(len + 8);
-	if (code_file_name == 0)
+	if (code_file_name == NULL)
 	    no_space();
 	strcpy(code_file_name, file_prefix);
 	strcpy(code_file_name + len, CODE_SUFFIX);
     }
     else
 	code_file_name = output_file_name;
 
     if (dflag)
     {
 	defines_file_name = MALLOC(len + 7);
-	if (defines_file_name == 0)
+	if (defines_file_name == NULL)
 	    no_space();
 	strcpy(defines_file_name, file_prefix);
 	strcpy(defines_file_name + len, DEFINES_SUFFIX);
     }
 
     if (vflag)
     {
 	verbose_file_name = MALLOC(len + 8);
-	if (verbose_file_name == 0)
+	if (verbose_file_name == NULL)
 	    no_space();
 	strcpy(verbose_file_name, file_prefix);
 	strcpy(verbose_file_name + len, VERBOSE_SUFFIX);
     }
 }
 
 
+static void
 open_files()
 {
     create_file_names();
 
-    if (input_file == 0)
+    if (input_file == NULL)
     {
 	input_file = fopen(input_file_name, "r");
-	if (input_file == 0)
+	if (input_file == NULL)
 	    open_error(input_file_name);
     }
 
-    action_file = fopen(action_file_name, "w");
-    if (action_file == 0)
+    action_file = fdopen(action_file_descriptor, "w");
+    if (action_file == NULL)
 	open_error(action_file_name);
 
-    text_file = fopen(text_file_name, "w");
-    if (text_file == 0)
+    text_file = fdopen(text_file_descriptor, "w");
+    if (text_file == NULL)
 	open_error(text_file_name);
 
     if (vflag)
     {
 	verbose_file = fopen(verbose_file_name, "w");
-	if (verbose_file == 0)
+	if (verbose_file == NULL)
 	    open_error(verbose_file_name);
     }
 
     if (dflag)
     {
 	defines_file = fopen(defines_file_name, "w");
-	if (defines_file == 0)
+	if (defines_file == NULL)
 	    open_error(defines_file_name);
-	union_file = fopen(union_file_name, "w");
-	if (union_file ==  0)
+	union_file = fdopen(union_file_descriptor, "w");
+	if (union_file == NULL)
 	    open_error(union_file_name);
     }
 
     output_file = fopen(output_file_name, "w");
-    if (output_file == 0)
+    if (output_file == NULL)
 	open_error(output_file_name);
 
     if (rflag)
     {
 	code_file = fopen(code_file_name, "w");
-	if (code_file == 0)
+	if (code_file == NULL)
 	    open_error(code_file_name);
     }
     else
 	code_file = output_file;
 }
@@ -370,6 +422,7 @@ char *argv[];
     make_parser();
     verbose();
     output();
     done(0);
     /*NOTREACHED*/
+    return 0;
 }
diff -aprNU5 byacc-1.9.orig/mkpar.c byacc-1.9/mkpar.c
--- byacc-1.9.orig/mkpar.c	1991-01-21 02:32:58 +0000
+++ byacc-1.9/mkpar.c	2007-03-14 06:48:40 +0000
@@ -12,33 +12,23 @@ short nunused;
 short final_state;
 
 static int SRcount;
 static int RRcount;
 
-extern action *parse_actions();
-extern action *get_shifts();
-extern action *add_reductions();
-extern action *add_reduce();
+static action *parse_actions();
+static action *get_shifts();
+static action *add_reductions();
+static action *add_reduce();
+static void find_final_state();
+static void unused_rules();
+static void remove_conflicts();
+static void total_conflicts();
+static int sole_reduction();
+static void defreds();
+static void free_action_row();
 
-
-make_parser()
-{
-    register int i;
-
-    parser = NEW2(nstates, action *);
-    for (i = 0; i < nstates; i++)
-	parser[i] = parse_actions(i);
-
-    find_final_state();
-    remove_conflicts();
-    unused_rules();
-    if (SRtotal + RRtotal > 0) total_conflicts();
-    defreds();
-}
-
-
-action *
+static action *
 parse_actions(stateno)
 register int stateno;
 {
     register action *actions;
 
@@ -46,11 +36,11 @@ register int stateno;
     actions = add_reductions(stateno, actions);
     return (actions);
 }
 
 
-action *
+static action *
 get_shifts(stateno)
 int stateno;
 {
     register action *actions, *temp;
     register shifts *sp;
@@ -81,11 +71,11 @@ int stateno;
 	}
     }
     return (actions);
 }
 
-action *
+static action *
 add_reductions(stateno, actions)
 int stateno;
 register action *actions;
 {
     register int i, j, m, n;
@@ -107,11 +97,11 @@ register action *actions;
     }
     return (actions);
 }
 
 
-action *
+static action *
 add_reduce(actions, ruleno, symbol)
 register action *actions;
 register int ruleno, symbol;
 {
     register action *temp, *prev, *next;
@@ -148,10 +138,11 @@ register int ruleno, symbol;
 
     return (actions);
 }
 
 
+static void
 find_final_state()
 {
     register int goal, i;
     register short *to_state;
     register shifts *p;
@@ -165,10 +156,11 @@ find_final_state()
 	if (accessing_symbol[final_state] == goal) break;
     }
 }
 
 
+static void
 unused_rules()
 {
     register int i;
     register action *p;
 
@@ -190,22 +182,25 @@ unused_rules()
     nunused = 0;
     for (i = 3; i < nrules; ++i)
 	if (!rules_used[i]) ++nunused;
 
     if (nunused)
+    {
 	if (nunused == 1)
 	    fprintf(stderr, "%s: 1 rule never reduced\n", myname);
 	else
 	    fprintf(stderr, "%s: %d rules never reduced\n", myname, nunused);
+    }
 }
 
 
+static void
 remove_conflicts()
 {
     register int i;
     register int symbol;
-    register action *p, *pref;
+    register action *p, *pref = NULL;
 
     SRtotal = 0;
     RRtotal = 0;
     SRconflicts = NEW2(nstates, short);
     RRconflicts = NEW2(nstates, short);
@@ -272,10 +267,11 @@ remove_conflicts()
 	RRconflicts[i] = RRcount;
     }
 }
 
 
+static void
 total_conflicts()
 {
     fprintf(stderr, "%s: ", myname);
     if (SRtotal == 1)
 	fprintf(stderr, "1 shift/reduce conflict");
@@ -292,11 +288,11 @@ total_conflicts()
 
     fprintf(stderr, ".\n");
 }
 
 
-int
+static int
 sole_reduction(stateno)
 int stateno;
 {
     register int count, ruleno;
     register action *p;
@@ -321,19 +317,22 @@ int stateno;
 	return (0);
     return (ruleno);
 }
 
 
+static void
 defreds()
 {
     register int i;
 
     defred = NEW2(nstates, short);
     for (i = 0; i < nstates; i++)
 	defred[i] = sole_reduction(i);
 }
  
+
+static void
 free_action_row(p)
 register action *p;
 {
   register action *q;
 
@@ -343,15 +342,33 @@ register action *p;
       FREE(p);
       p = q;
     }
 }
 
+
+void
 free_parser()
 {
   register int i;
 
   for (i = 0; i < nstates; i++)
     free_action_row(parser[i]);
 
   FREE(parser);
 }
 
+
+void
+make_parser()
+{
+    register int i;
+
+    parser = NEW2(nstates, action *);
+    for (i = 0; i < nstates; i++)
+	parser[i] = parse_actions(i);
+
+    find_final_state();
+    remove_conflicts();
+    unused_rules();
+    if (SRtotal + RRtotal > 0) total_conflicts();
+    defreds();
+}
diff -aprNU5 byacc-1.9.orig/output.c byacc-1.9/output.c
--- byacc-1.9.orig/output.c	1993-02-22 06:32:46 +0000
+++ byacc-1.9/output.c	2007-03-14 06:48:40 +0000
@@ -15,33 +15,38 @@ static short *table;
 static short *check;
 static int lowzero;
 static int high;
 
 
-output()
-{
-    free_itemsets();
-    free_shifts();
-    free_reductions();
-    output_prefix();
-    output_stored_text();
-    output_defines();
-    output_rule_data();
-    output_yydefred();
-    output_actions();
-    free_parser();
-    output_debug();
-    output_stype();
-    if (rflag) write_section(tables);
-    write_section(header);
-    output_trailing_text();
-    write_section(body);
-    output_semantic_actions();
-    write_section(trailer);
-}
+static void output_prefix();
+static void output_rule_data();
+static void output_yydefred();
+static void output_actions();
+static void token_actions();
+static void goto_actions();
+static int default_goto();
+static void save_column();
+static void sort_actions();
+static void pack_table();
+static int matching_vector();
+static int pack_vector();
+static void output_base();
+static void output_table();
+static void output_check();
+static int is_C_identifier();
+static void output_defines();
+static void output_stored_text();
+static void output_debug();
+static void output_stype();
+static void output_trailing_text();
+static void output_semantic_actions();
+static void free_itemsets();
+static void free_shifts();
+static void free_reductions();
 
 
+static void
 output_prefix()
 {
     if (symbol_prefix == NULL)
 	symbol_prefix = "yy";
     else
@@ -98,10 +103,11 @@ output_prefix()
     ++outline;
     fprintf(code_file, "#define YYPREFIX \"%s\"\n", symbol_prefix);
 }
 
 
+static void
 output_rule_data()
 {
     register int i;
     register int j;
 
@@ -145,10 +151,11 @@ output_rule_data()
     if (!rflag) outline += 2;
     fprintf(output_file, "\n};\n");
 }
 
 
+static void
 output_yydefred()
 {
     register int i, j;
 
     fprintf(output_file, "short %sdefred[] = {%39d,", symbol_prefix,
@@ -172,10 +179,11 @@ output_yydefred()
     if (!rflag) outline += 2;
     fprintf(output_file, "\n};\n");
 }
 
 
+static void
 output_actions()
 {
     nvectors = 2*nstates + nvars;
 
     froms = NEW2(nvectors, short *);
@@ -200,10 +208,11 @@ output_actions()
     output_table();
     output_check();
 }
 
 
+static void
 token_actions()
 {
     register int i, j;
     register int shiftcount, reducecount;
     register int max, min;
@@ -284,10 +293,12 @@ token_actions()
 	}
     }
     FREE(actionrow);
 }
 
+
+static void
 goto_actions()
 {
     register int i, j, k;
 
     state_count = NEW2(nstates, short);
@@ -316,11 +327,12 @@ goto_actions()
     if (!rflag) outline += 2;
     fprintf(output_file, "\n};\n");
     FREE(state_count);
 }
 
-int
+
+static int
 default_goto(symbol)
 int symbol;
 {
     register int i;
     register int m;
@@ -352,11 +364,11 @@ int symbol;
 
     return (default_state);
 }
 
 
-
+static void
 save_column(symbol, default_state)
 int symbol;
 int default_state;
 {
     register int i;
@@ -395,10 +407,12 @@ int default_state;
 
     tally[symno] = count;
     width[symno] = sp1[-1] - sp[0] + 1;
 }
 
+
+static void
 sort_actions()
 {
   register int i;
   register int j;
   register int k;
@@ -430,10 +444,11 @@ sort_actions()
 	}
     }
 }
 
 
+static void
 pack_table()
 {
     register int i;
     register int place;
     register int state;
@@ -492,11 +507,11 @@ pack_table()
 /*									*/
 /*  Matching_vector is poorly designed.  The test could easily be made	*/
 /*  faster.  Also, it depends on the vectors being in a specific	*/
 /*  order.								*/
 
-int
+static int
 matching_vector(vector)
 int vector;
 {
     register int i;
     register int j;
@@ -532,12 +547,11 @@ int vector;
 
     return (-1);
 }
 
 
-
-int
+static int
 pack_vector(vector)
 int vector;
 {
     register int i, j, k, l;
     register int t;
@@ -610,11 +624,11 @@ int vector;
 	}
     }
 }
 
 
-
+static void
 output_base()
 {
     register int i, j;
 
     fprintf(output_file, "short %ssindex[] = {%39d,", symbol_prefix, base[0]);
@@ -676,11 +690,11 @@ output_base()
     fprintf(output_file, "\n};\n");
     FREE(base);
 }
 
 
-
+static void
 output_table()
 {
     register int i;
     register int j;
 
@@ -708,11 +722,11 @@ output_table()
     fprintf(output_file, "\n};\n");
     FREE(table);
 }
 
 
-
+static void
 output_check()
 {
     register int i;
     register int j;
 
@@ -738,11 +752,11 @@ output_check()
     fprintf(output_file, "\n};\n");
     FREE(check);
 }
 
 
-int
+static int
 is_C_identifier(name)
 char *name;
 {
     register char *s;
     register int c;
@@ -762,19 +776,20 @@ char *name;
 	return (1);
     }
 
     if (!isalpha(c) && c != '_' && c != '$')
 	return (0);
-    while (c = *++s)
+    while ((c = *++s))
     {
 	if (!isalnum(c) && c != '_' && c != '$')
 	    return (0);
     }
     return (1);
 }
 
 
+static void
 output_defines()
 {
     register int c, i;
     register char *s;
 
@@ -799,11 +814,11 @@ output_defines()
 		do
 		{
 		    putc(c, code_file);
 		    if (dflag) putc(c, defines_file);
 		}
-		while (c = *++s);
+		while ((c = *++s));
 	    }
 	    ++outline;
 	    fprintf(code_file, " %d\n", symbol_value[i]);
 	    if (dflag) fprintf(defines_file, " %d\n", symbol_value[i]);
 	}
@@ -823,10 +838,11 @@ output_defines()
 		symbol_prefix);
     }
 }
 
 
+static void
 output_stored_text()
 {
     register int c;
     register FILE *in, *out;
 
@@ -850,10 +866,11 @@ output_stored_text()
     if (!lflag)
 	fprintf(out, line_format, ++outline + 1, code_file_name);
 }
 
 
+static void
 output_debug()
 {
     register int i, j, k, max;
     char **symnam, *s;
 
@@ -887,11 +904,11 @@ output_debug()
     if (!rflag) ++outline;
     fprintf(output_file, "#if YYDEBUG\nchar *%sname[] = {", symbol_prefix);
     j = 80;
     for (i = 0; i <= max; ++i)
     {
-	if (s = symnam[i])
+	if ((s = symnam[i]))
 	{
 	    if (s[0] == '"')
 	    {
 		k = 7;
 		while (*++s != '"')
@@ -1064,20 +1081,22 @@ output_debug()
     if (!rflag) outline += 2;
     fprintf(output_file, "};\n#endif\n");
 }
 
 
+static void
 output_stype()
 {
     if (!unionized && ntags == 0)
     {
 	outline += 3;
 	fprintf(code_file, "#ifndef YYSTYPE\ntypedef int YYSTYPE;\n#endif\n");
     }
 }
 
 
+static void
 output_trailing_text()
 {
     register int c, last;
     register FILE *in, *out;
 
@@ -1131,10 +1150,11 @@ output_trailing_text()
     if (!lflag)
 	fprintf(out, line_format, ++outline + 1, code_file_name);
 }
 
 
+static void
 output_semantic_actions()
 {
     register int c, last;
     register FILE *out;
 
@@ -1168,10 +1188,11 @@ output_semantic_actions()
     if (!lflag)
 	fprintf(out, line_format, ++outline + 1, code_file_name);
 }
 
 
+static void
 free_itemsets()
 {
     register core *cp, *next;
 
     FREE(state_table);
@@ -1181,10 +1202,11 @@ free_itemsets()
 	FREE(cp);
     }
 }
 
 
+static void
 free_shifts()
 {
     register shifts *sp, *next;
 
     FREE(shift_table);
@@ -1194,11 +1216,11 @@ free_shifts()
 	FREE(sp);
     }
 }
 
 
-
+static void
 free_reductions()
 {
     register reductions *rp, *next;
 
     FREE(reduction_table);
@@ -1206,5 +1228,29 @@ free_reductions()
     {
 	next = rp->next;
 	FREE(rp);
     }
 }
+
+
+void
+output()
+{
+    free_itemsets();
+    free_shifts();
+    free_reductions();
+    output_prefix();
+    output_stored_text();
+    output_defines();
+    output_rule_data();
+    output_yydefred();
+    output_actions();
+    free_parser();
+    output_debug();
+    output_stype();
+    if (rflag) write_section(tables);
+    write_section(header);
+    output_trailing_text();
+    write_section(body);
+    output_semantic_actions();
+    write_section(trailer);
+}
diff -aprNU5 byacc-1.9.orig/reader.c byacc-1.9/reader.c
--- byacc-1.9.orig/reader.c	1993-02-22 06:32:46 +0000
+++ byacc-1.9/reader.c	2007-03-14 06:48:40 +0000
@@ -32,10 +32,49 @@ int name_pool_size;
 char *name_pool;
 
 char line_format[] = "#line %d \"%s\"\n";
 
 
+static void cachec();
+static void get_line();
+static char * dup_line();
+static void skip_comment();
+static int nextc();
+static int keyword();
+static void copy_ident();
+static void copy_text();
+static void copy_union();
+static int hexval();
+static bucket * get_literal();
+static int is_reserved();
+static bucket * get_name();
+static int get_number();
+static char * get_tag();
+static void declare_tokens();
+static void declare_types();
+static void declare_start();
+static void read_declarations();
+static void initialize_grammar();
+static void expand_items();
+static void expand_rules();
+static void advance_to_start();
+static void start_rule();
+static void end_rule();
+static void insert_empty_rule();
+static void add_symbol();
+static void copy_action();
+static int mark_symbol();
+static void read_grammar();
+static void free_tags();
+static void pack_names();
+static void check_symbols();
+static void pack_symbols();
+static void pack_grammar();
+static void print_grammar();
+
+
+static void
 cachec(c)
 int c;
 {
     assert(cinc >= 0);
     if (cinc >= cache_size)
@@ -47,10 +86,11 @@ int c;
     cache[cinc] = c;
     ++cinc;
 }
 
 
+static void
 get_line()
 {
     register FILE *f = input_file;
     register int c;
     register int i;
@@ -93,11 +133,11 @@ get_line()
 	}
     }
 }
 
 
-char *
+static char *
 dup_line()
 {
     register char *p, *s, *t;
 
     if (line == 0) return (0);
@@ -111,10 +151,11 @@ dup_line()
     while ((*t++ = *s++) != '\n') continue;
     return (p);
 }
 
 
+static void
 skip_comment()
 {
     register char *s;
 
     int st_lineno = lineno;
@@ -141,11 +182,11 @@ skip_comment()
 	    ++s;
     }
 }
 
 
-int
+static int
 nextc()
 {
     register char *s;
 
     if (line == 0)
@@ -203,11 +244,11 @@ nextc()
 	}
     }
 }
 
 
-int
+static int
 keyword()
 {
     register int c;
     char *t_cptr = cptr;
 
@@ -263,13 +304,15 @@ keyword()
 	if (c == '2')
 	    return (NONASSOC);
     }
     syntax_error(lineno, line, t_cptr);
     /*NOTREACHED*/
+    return 0;
 }
 
 
+static void
 copy_ident()
 {
     register int c;
     register FILE *f = output_file;
 
@@ -295,10 +338,11 @@ copy_ident()
 	}
     }
 }
 
 
+static void
 copy_text()
 {
     register int c;
     int quote;
     register FILE *f = text_file;
@@ -426,10 +470,11 @@ loop:
 	goto loop;
     }
 }
 
 
+static void
 copy_union()
 {
     register int c;
     int quote;
     int depth;
@@ -566,11 +611,11 @@ loop:
 	goto loop;
     }
 }
 
 
-int
+static int
 hexval(c)
 int c;
 {
     if (c >= '0' && c <= '9')
 	return (c - '0');
@@ -580,11 +625,11 @@ int c;
 	return (c - 'a' + 10);
     return (-1);
 }
 
 
-bucket *
+static bucket *
 get_literal()
 {
     register int c, quote;
     register int i;
     register int n;
@@ -719,11 +764,11 @@ get_literal()
 
     return (bp);
 }
 
 
-int
+static int
 is_reserved(name)
 char *name;
 {
     char *s;
 
@@ -741,11 +786,11 @@ char *name;
 
     return (0);
 }
 
 
-bucket *
+static bucket *
 get_name()
 {
     register int c;
 
     cinc = 0;
@@ -757,11 +802,11 @@ get_name()
 
     return (lookup(cache));
 }
 
 
-int
+static int
 get_number()
 {
     register int c;
     register int n;
 
@@ -771,11 +816,11 @@ get_number()
 
     return (n);
 }
 
 
-char *
+static char *
 get_tag()
 {
     register int c;
     register int i;
     register char *s;
@@ -822,10 +867,11 @@ get_tag()
     FREE(t_line);
     return (s);
 }
 
 
+static void
 declare_tokens(assoc)
 int assoc;
 {
     register int c;
     register bucket *bp;
@@ -884,10 +930,11 @@ int assoc;
 	}
     }
 }
 
 
+static void
 declare_types()
 {
     register int c;
     register bucket *bp;
     char *tag;
@@ -912,10 +959,11 @@ declare_types()
 	bp->tag = tag;
     }
 }
 
 
+static void
 declare_start()
 {
     register int c;
     register bucket *bp;
 
@@ -930,10 +978,11 @@ declare_start()
 	restarted_warning();
     goal = bp;
 }
 
 
+static void
 read_declarations()
 {
     register int c, k;
 
     cache_size = 256;
@@ -979,10 +1028,11 @@ read_declarations()
 	}
     }
 }
 
 
+static void
 initialize_grammar()
 {
     nitems = 4;
     maxitems = 300;
     pitem = (bucket **) MALLOC(maxitems*sizeof(bucket *));
@@ -1010,18 +1060,20 @@ initialize_grammar()
     rassoc[1] = TOKEN;
     rassoc[2] = TOKEN;
 }
 
 
+static void
 expand_items()
 {
     maxitems += 300;
     pitem = (bucket **) REALLOC(pitem, maxitems*sizeof(bucket *));
     if (pitem == 0) no_space();
 }
 
 
+static void
 expand_rules()
 {
     maxrules += 100;
     plhs = (bucket **) REALLOC(plhs, maxrules*sizeof(bucket *));
     if (plhs == 0) no_space();
@@ -1030,10 +1082,11 @@ expand_rules()
     rassoc = (char *) REALLOC(rassoc, maxrules*sizeof(char));
     if (rassoc == 0) no_space();
 }
 
 
+static void
 advance_to_start()
 {
     register int c;
     register bucket *bp;
     char *s_cptr;
@@ -1080,10 +1133,11 @@ advance_to_start()
     start_rule(bp, s_lineno);
     ++cptr;
 }
 
 
+static void
 start_rule(bp, s_lineno)
 register bucket *bp;
 int s_lineno;
 {
     if (bp->class == TERM)
@@ -1095,10 +1149,11 @@ int s_lineno;
     rprec[nrules] = UNDEFINED;
     rassoc[nrules] = TOKEN;
 }
 
 
+static void
 end_rule()
 {
     register int i;
 
     if (!last_was_action && plhs[nrules]->tag)
@@ -1114,10 +1169,11 @@ end_rule()
     ++nitems;
     ++nrules;
 }
 
 
+static void
 insert_empty_rule()
 {
     register bucket *bp, **bpp;
 
     assert(cache);
@@ -1130,11 +1186,11 @@ insert_empty_rule()
 
     if ((nitems += 2) > maxitems)
 	expand_items();
     bpp = pitem + nitems - 1;
     *bpp-- = bp;
-    while (bpp[0] = bpp[-1]) --bpp;
+    while ((bpp[0] = bpp[-1])) --bpp;
 
     if (++nrules >= maxrules)
 	expand_rules();
     plhs[nrules] = plhs[nrules-1];
     plhs[nrules-1] = bp;
@@ -1143,10 +1199,11 @@ insert_empty_rule()
     rassoc[nrules] = rassoc[nrules-1];
     rassoc[nrules-1] = TOKEN;
 }
 
 
+static void
 add_symbol()
 {
     register int c;
     register bucket *bp;
     int s_lineno = lineno;
@@ -1174,10 +1231,11 @@ add_symbol()
 	expand_items();
     pitem[nitems-1] = bp;
 }
 
 
+static void
 copy_action()
 {
     register int c;
     register int i, n;
     int depth;
@@ -1397,15 +1455,15 @@ loop:
 	goto loop;
     }
 }
 
 
-int
+static int
 mark_symbol()
 {
     register int c;
-    register bucket *bp;
+    register bucket *bp = NULL;
 
     c = cptr[1];
     if (c == '%' || c == '\\')
     {
 	cptr += 2;
@@ -1441,10 +1499,11 @@ mark_symbol()
     rassoc[nrules] = bp->assoc;
     return (0);
 }
 
 
+static void
 read_grammar()
 {
     register int c;
 
     initialize_grammar();
@@ -1474,10 +1533,11 @@ read_grammar()
     }
     end_rule();
 }
 
 
+static void
 free_tags()
 {
     register int i;
 
     if (tag_table == 0) return;
@@ -1489,10 +1549,11 @@ free_tags()
     }
     FREE(tag_table);
 }
 
 
+static void
 pack_names()
 {
     register bucket *bp;
     register char *p, *s, *t;
 
@@ -1507,17 +1568,18 @@ pack_names()
     t = name_pool + 13;
     for (bp = first_symbol; bp; bp = bp->next)
     {
 	p = t;
 	s = bp->name;
-	while (*t++ = *s++) continue;
+	while ((*t++ = *s++)) continue;
 	FREE(bp->name);
 	bp->name = p;
     }
 }
 
 
+static void
 check_symbols()
 {
     register bucket *bp;
 
     if (goal->class == UNKNOWN)
@@ -1532,10 +1594,11 @@ check_symbols()
 	}
     }
 }
 
 
+static void
 pack_symbols()
 {
     register bucket *bp;
     register bucket **v;
     register int i, j, k, n;
@@ -1656,10 +1719,11 @@ pack_symbols()
 
     FREE(v);
 }
 
 
+static void
 pack_grammar()
 {
     register int i, j;
     int assoc, prec;
 
@@ -1715,14 +1779,15 @@ pack_grammar()
     FREE(plhs);
     FREE(pitem);
 }
 
 
+static void
 print_grammar()
 {
     register int i, j, k;
-    int spacing;
+    int spacing = 0;
     register FILE *f = verbose_file;
 
     if (!vflag) return;
 
     k = 1;
@@ -1751,10 +1816,11 @@ print_grammar()
 	putc('\n', f);
     }
 }
 
 
+void
 reader()
 {
     write_section(banner);
     create_symbol_table();
     read_declarations();
diff -aprNU5 byacc-1.9.orig/skeleton.c byacc-1.9/skeleton.c
--- byacc-1.9.orig/skeleton.c	1993-02-22 06:53:26 +0000
+++ byacc-1.9/skeleton.c	2007-03-14 06:48:40 +0000
@@ -282,23 +282,24 @@ char *trailer[] =
     "}",
     0
 };
 
 
+void
 write_section(section)
 char *section[];
 {
     register int c;
     register int i;
     register char *s;
     register FILE *f;
 
     f = code_file;
-    for (i = 0; s = section[i]; ++i)
+    for (i = 0; (s = section[i]); ++i)
     {
 	++outline;
-	while (c = *s)
+	while ((c = *s))
 	{
 	    putc(c, f);
 	    ++s;
 	}
 	putc('\n', f);
diff -aprNU5 byacc-1.9.orig/symtab.c byacc-1.9/symtab.c
--- byacc-1.9.orig/symtab.c	1990-02-05 06:03:20 +0000
+++ byacc-1.9/symtab.c	2007-03-14 06:48:40 +0000
@@ -10,21 +10,21 @@
 bucket **symbol_table;
 bucket *first_symbol;
 bucket *last_symbol;
 
 
-int
+static int
 hash(name)
 char *name;
 {
     register char *s;
     register int c, k;
 
     assert(name && *name);
     s = name;
     k = *s;
-    while (c = *++s)
+    while ((c = *++s))
 	k = (31*k + c) & (TABLE_SIZE - 1);
 
     return (k);
 }
 
@@ -78,10 +78,11 @@ char *name;
 
     return (bp);
 }
 
 
+void
 create_symbol_table()
 {
     register int i;
     register bucket *bp;
 
@@ -98,17 +99,19 @@ create_symbol_table()
     last_symbol = bp;
     symbol_table[hash("error")] = bp;
 }
 
 
+void
 free_symbol_table()
 {
     FREE(symbol_table);
     symbol_table = 0;
 }
 
 
+void
 free_symbols()
 {
     register bucket *p, *q;
 
     for (p = first_symbol; p; p = q)
diff -aprNU5 byacc-1.9.orig/verbose.c byacc-1.9/verbose.c
--- byacc-1.9.orig/verbose.c	1991-01-21 02:00:02 +0000
+++ byacc-1.9/verbose.c	2007-03-14 06:48:40 +0000
@@ -2,34 +2,24 @@
 #include "defs.h"
 
 
 static short *null_rules;
 
-verbose()
-{
-    register int i;
-
-    if (!vflag) return;
-
-    null_rules = (short *) MALLOC(nrules*sizeof(short));
-    if (null_rules == 0) no_space();
-    fprintf(verbose_file, "\f\n");
-    for (i = 0; i < nstates; i++)
-	print_state(i);
-    FREE(null_rules);
 
-    if (nunused)
-	log_unused();
-    if (SRtotal || RRtotal)
-	log_conflicts();
-
-    fprintf(verbose_file, "\n\n%d terminals, %d nonterminals\n", ntokens,
-	    nvars);
-    fprintf(verbose_file, "%d grammar rules, %d states\n", nrules - 2, nstates);
-}
+static void log_unused();
+static void log_conflicts();
+static void print_state();
+static void print_conflicts();
+static void print_core();
+static void print_nulls();
+static void print_actions();
+static void print_shifts();
+static void print_reductions();
+static void print_gotos();
 
 
+static void
 log_unused()
 {
     register int i;
     register short *p;
 
@@ -45,10 +35,11 @@ log_unused()
 	}
     }
 }
 
 
+static void
 log_conflicts()
 {
     register int i;
 
     fprintf(verbose_file, "\n\n");
@@ -73,10 +64,11 @@ log_conflicts()
 	}
     }
 }
 
 
+static void
 print_state(state)
 int state;
 {
     if (state)
 	fprintf(verbose_file, "\n\n");
@@ -87,14 +79,15 @@ int state;
     print_nulls(state);
     print_actions(state);
 }
 
 
+static void
 print_conflicts(state)
 int state;
 {
-    register int symbol, act, number;
+    register int symbol, act = 0, number = 0;
     register action *p;
 
     symbol = -1;
     for (p = parser[state]; p; p = p->next)
     {
@@ -135,10 +128,11 @@ int state;
 	}
     }
 }
 
 
+static void
 print_core(state)
 int state;
 {
     register int i;
     register int k;
@@ -171,10 +165,11 @@ int state;
 	fprintf(verbose_file, "  (%d)\n", -2 - *sp);
     }
 }
 
 
+static void
 print_nulls(state)
 int state;
 {
     register action *p;
     register int i, j, k, nnulls;
@@ -215,10 +210,11 @@ int state;
     }
     fprintf(verbose_file, "\n");
 }
 
 
+static void
 print_actions(stateno)
 int stateno;
 {
     register action *p;
     register shifts *sp;
@@ -242,10 +238,11 @@ int stateno;
 	    print_gotos(stateno);
     }
 }
 
 
+static void
 print_shifts(p)
 register action *p;
 {
     register int count;
     register action *q;
@@ -267,10 +264,11 @@ register action *p;
 	}
     }
 }
 
 
+static void
 print_reductions(p, defred)
 register action *p;
 register int defred;
 {
     register int k, anyreds;
@@ -305,10 +303,11 @@ register int defred;
 	    fprintf(verbose_file, "\t.  reduce %d\n", defred - 2);
     }
 }
 
 
+static void
 print_gotos(stateno)
 int stateno;
 {
     register int i, k;
     register int as;
@@ -325,5 +324,29 @@ int stateno;
 	if (ISVAR(as))
 	    fprintf(verbose_file, "\t%s  goto %d\n", symbol_name[as], k);
     }
 }
 
+
+void
+verbose()
+{
+    register int i;
+
+    if (!vflag) return;
+
+    null_rules = (short *) MALLOC(nrules*sizeof(short));
+    if (null_rules == 0) no_space();
+    fprintf(verbose_file, "\f\n");
+    for (i = 0; i < nstates; i++)
+	print_state(i);
+    FREE(null_rules);
+
+    if (nunused)
+	log_unused();
+    if (SRtotal || RRtotal)
+	log_conflicts();
+
+    fprintf(verbose_file, "\n\n%d terminals, %d nonterminals\n", ntokens,
+	    nvars);
+    fprintf(verbose_file, "%d grammar rules, %d states\n", nrules - 2, nstates);
+}
diff -aprNU5 byacc-1.9.orig/warshall.c byacc-1.9/warshall.c
--- byacc-1.9.orig/warshall.c	1993-02-22 06:46:12 +0000
+++ byacc-1.9/warshall.c	2007-03-14 06:48:40 +0000
@@ -1,7 +1,8 @@
 #include "defs.h"
 
+static void
 transitive_closure(R, n)
 unsigned *R;
 int n;
 {
     register int rowsize;
@@ -50,10 +51,11 @@ int n;
 
 	rowi += rowsize;
     }
 }
 
+void
 reflexive_transitive_closure(R, n)
 unsigned *R;
 int n;
 {
     register int rowsize;
diff -aprNU5 byacc-1.9.orig/yacc.1 byacc-1.9/yacc.1
--- byacc-1.9.orig/yacc.1	1992-10-12 06:12:24 +0000
+++ byacc-1.9/yacc.1	2007-03-14 06:48:40 +0000
@@ -3,11 +3,11 @@
 .TH YACC 1 "July\ 15,\ 1990"
 .UC 6
 .SH NAME
 Yacc \- an LALR(1) parser generator
 .SH SYNOPSIS
-.B yacc [ -dlrtv ] [ -b
+.B yacc [ -dlrstv ] [ -b
 .I file_prefix
 .B ] [ -p
 .I symbol_prefix
 .B ]
 .I filename
@@ -18,11 +18,32 @@ reads the grammar specification in the f
 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.
 .I Yacc
 normally writes the parse tables and the driver routine to the file
-.IR y.tab.c.
+.IR y.tab.c
+The same file name is usualy used on Win9X if LFN support is available.
+On Win9X with LFN support available, you can control the type of
+.IR tab
+.IR extension
+.IR separator
+you prefer to use by seting or omiting the
+.B -s
+command-line option. On Win9X with LFN support available and an omited
+.B -s
+option a dot is used as extension separator in all file names and you will
+get the same file names as on a posix system.
+On plain DOS the 
+.B -s
+option is ignored.
+On Win9X with LFN support available, you can force the use of
+.IR y_tab.c
+as file name if you specify the
+.B -s
+option. On plain DOS
+.IR y_tab.c
+is always used as file name.
 .PP
 The following options are available:
 .RS
 .TP
 \fB-b \fIfile_prefix\fR
@@ -36,23 +57,34 @@ The default prefix is the character
 .TP
 .B -d
 The \fB-d\fR option causes the header file
 .IR y.tab.h
 to be written.
+The
+.IR y.tab.h
+file name is also used on Win9X if LFN support is available
+and the
+.B -s
+option has been omited.
+On plain DOS or Win9X with LFN support available and with the
+.B -s
+option specified,
+.IR y_tab.h
+will be used as the file name.
 .TP
 .B -l
 If the
 .B -l
 option is not specified,
 .I yacc
-will insert \#line directives in the generated code.
-The \#line directives let the C compiler relate errors in the
+will insert #line directives in the generated code.
+The #line directives let the C compiler relate errors in the
 generated code to the user's original code.
 If the \fB-l\fR option is specified,
 .I yacc
-will not insert the \#line directives.
-\&\#line directives specified by the user will be retained.
+will not insert the #line directives.
+#line directives specified by the user will be retained.
 .TP
 \fB-p \fIsymbol_prefix\fR
 The
 .B -p
 option changes the prefix prepended to yacc-generated symbols to
@@ -66,13 +98,58 @@ The
 .B -r
 option causes
 .I yacc
 to produce separate files for code and tables.  The code file
 is named
-.IR y.code.c,
+.IR y.code.c
 and the tables file is named
 .IR y.tab.c.
+The
+.IR y.code.c
+and
+.IR y.tab.c
+file names are also used on Win9X if LFN support is available and the
+.B -s
+option has been omited.
+On plain DOS or Win9X with LFN support available
+.IR y_code.c
+and
+.IR y_tab.c
+are used as file name if the
+.B -s
+option has been specified.
+.TP
+.B -s
+The
+.B -s
+is a DJGPP specific option that allows the user to choose the
+type of prefered
+.IR tab
+.IR extension
+.IR separator.
+The
+.B -s
+option is ignored on plain DOS and Win9X without LFN support.
+In this case always file names with an underscore as
+.IR tab
+.IR extension
+.IR separator
+will be used.
+On Win9X with LFN support available, if the
+.B -s
+option is specified, always file names with an undersore as
+.IR tab
+.IR extension
+.IR separator
+will be used.
+On Win9X with LFN support available, if the
+.B -s
+option is omited, always file names with a dot as
+.IR tab
+.IR extension
+.IR separator
+will be used.
 .TP
 .B -t
 The
 .B -t
 option changes the preprocessor directives generated by
@@ -83,15 +160,28 @@ so that debugging statements will be inc
 The
 .B -v
 option causes a human-readable description of the generated parser to
 be written to the file
 .IR y.output.
+The
+.IR y.output
+file name is also used on Win9X if LFN support is available and the
+.B -s
+option has not been specified.
+On plain DOS or Win9X with LFN support available
+.IR y.out
+is used as file name if the
+.B -s
+option has been specified.
 .RE
 .PP
 If the environment variable TMPDIR is set, the string denoted by
 TMPDIR will be used as the name of the directory where the temporary
 files are created.
+On MS-DOS the string denoted by one of the following environment variables TMPDIR, TMP
+or TEMP (in this order) will be used as the name of the directory where the temporary
+files are created. If non of them are set, the working directory will be used.
 .SH FILES
 .IR y.code.c
 .br
 .IR y.tab.c
 .br
@@ -102,10 +192,51 @@ files are created.
 .IR /tmp/yacc.aXXXXXX
 .br
 .IR /tmp/yacc.tXXXXXX
 .br
 .IR /tmp/yacc.uXXXXXX
+
+
+On Win9X with LFN support available and the
+.B -s
+option omited the following files will be generated:
+
+.IR y.code.c
+.br
+.IR y.tab.c
+.br
+.IR y.tab.h
+.br
+.IR y.output
+.br
+.IR $TMPDIR/yaXXXXXX
+.br
+.IR $TMPDIR/ytXXXXXX
+.br
+.IR $TMPDIR/yuXXXXXX
+
+On plain DOS and Win9X with LFN support available and the
+.B -s
+option specified the following files will be generated:
+
+.IR y_code.c
+.br
+.IR y_tab.c
+.br
+.IR y_tab.h
+.br
+.IR y.out
+.br
+.IR $TMPDIR/yaXXXXXX
+.br
+.IR $TMPDIR/ytXXXXXX
+.br
+.IR $TMPDIR/yuXXXXXX
+
+$TMPDIR denotes the value of one of the environment variables TMPDIR, TMP or TEMP or the working
+directory if non of them are set.
+
 .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.
