Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/byacc/dist update yacc to the most recent.
details: https://anonhg.NetBSD.org/src/rev/760f206ccceb
branches: trunk
changeset: 760015:760f206ccceb
user: christos <christos%NetBSD.org@localhost>
date: Fri Dec 24 02:58:20 2010 +0000
description:
update yacc to the most recent.
diffstat:
external/bsd/byacc/dist/closure.c | 12 +-
external/bsd/byacc/dist/defs.h | 58 +-
external/bsd/byacc/dist/error.c | 13 +-
external/bsd/byacc/dist/lr0.c | 26 +-
external/bsd/byacc/dist/main.c | 60 +-
external/bsd/byacc/dist/mkdirs.sh | 51 --
external/bsd/byacc/dist/mkpar.c | 11 +-
external/bsd/byacc/dist/output.c | 434 +++++++++++------
external/bsd/byacc/dist/reader.c | 523 ++++++++++++--------
external/bsd/byacc/dist/skeleton.c | 244 +++++----
external/bsd/byacc/dist/symtab.c | 30 +-
external/bsd/byacc/dist/test/error.tab.c | 309 ++++++++---
external/bsd/byacc/dist/test/ftp.tab.c | 758 ++++++++++++++++++------------
external/bsd/byacc/dist/test/ftp.y | 217 +++++---
external/bsd/byacc/dist/verbose.c | 14 +-
external/bsd/byacc/dist/warshall.c | 14 +-
external/bsd/byacc/dist/yacc.1 | 43 +-
17 files changed, 1665 insertions(+), 1152 deletions(-)
diffs (truncated from 5394 to 300 lines):
diff -r 842e4091b626 -r 760f206ccceb external/bsd/byacc/dist/closure.c
--- a/external/bsd/byacc/dist/closure.c Fri Dec 24 02:56:56 2010 +0000
+++ b/external/bsd/byacc/dist/closure.c Fri Dec 24 02:58:20 2010 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: closure.c,v 1.2 2009/10/29 00:56:19 christos Exp $ */
-/* Id: closure.c,v 1.7 2009/10/27 09:30:14 tom Exp */
+/* $NetBSD: closure.c,v 1.3 2010/12/24 02:58:20 christos Exp $ */
+/* Id: closure.c,v 1.9 2010/06/09 08:21:47 tom Exp */
#include "defs.h"
#include <sys/cdefs.h>
-__RCSID("$NetBSD: closure.c,v 1.2 2009/10/29 00:56:19 christos Exp $");
+__RCSID("$NetBSD: closure.c,v 1.3 2010/12/24 02:58:20 christos Exp $");
Value_t *itemset;
Value_t *itemsetend;
@@ -83,7 +83,7 @@
k = 0;
}
- if (cword & (1 << k))
+ if (cword & (unsigned)(1 << k))
{
rp = derives[j];
while ((rule = *rp++) >= 0)
@@ -93,7 +93,6 @@
}
}
- vrow += varsetsize;
rrow += rulesetsize;
}
@@ -121,7 +120,6 @@
Value_t itemno;
rulesetsize = WORDSIZE(nrules);
- rsp = ruleset;
rsend = ruleset + rulesetsize;
for (rsp = ruleset; rsp < rsend; rsp++)
*rsp = 0;
@@ -149,7 +147,7 @@
{
for (i = 0; i < BITS_PER_WORD; ++i)
{
- if (word & (1 << i))
+ if (word & (unsigned)(1 << i))
{
itemno = rrhs[ruleno + i];
while (csp < csend && *csp < itemno)
diff -r 842e4091b626 -r 760f206ccceb external/bsd/byacc/dist/defs.h
--- a/external/bsd/byacc/dist/defs.h Fri Dec 24 02:56:56 2010 +0000
+++ b/external/bsd/byacc/dist/defs.h Fri Dec 24 02:58:20 2010 +0000
@@ -1,8 +1,9 @@
-/* Id: defs.h,v 1.20 2009/10/27 10:47:43 tom Exp */
+/* $NetBSD: defs.h,v 1.4 2010/12/24 02:58:20 christos Exp $ */
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
+/* Id: defs.h,v 1.30 2010/11/26 15:19:36 tom Exp */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -68,6 +69,8 @@
#define DOUBLE_QUOTE '\"' /* double quote */
#define BACKSLASH '\\' /* backslash */
+#define UCH(c) (unsigned char)(c)
+
/* defines for constructing filenames */
#if defined(VMS)
@@ -99,6 +102,7 @@
#define PURE_PARSER 12
#define PARSE_PARAM 13
#define LEX_PARAM 14
+#define POSIX_YACC 15
/* symbol classes */
@@ -128,15 +132,17 @@
/* storage allocation macros */
-#define CALLOC(k,n) (calloc((unsigned)(k),(unsigned)(n)))
+#define CALLOC(k,n) (calloc((size_t)(k),(size_t)(n)))
#define FREE(x) (free((char*)(x)))
-#define MALLOC(n) (malloc((unsigned)(n)))
+#define MALLOC(n) (malloc((size_t)(n)))
#define NEW(t) ((t*)allocate(sizeof(t)))
-#define NEW2(n,t) ((t*)allocate(((unsigned)(n)*sizeof(t))))
-#define REALLOC(p,n) (realloc((char*)(p),(unsigned)(n)))
+#define NEW2(n,t) ((t*)allocate(((size_t)(n)*sizeof(t))))
+#define REALLOC(p,n) (realloc((char*)(p),(size_t)(n)))
#define DO_FREE(x) if (x) { FREE(x); x = 0; }
+#define NO_SPACE(p) if (p == 0) no_space(); assert(p != 0)
+
/* messages */
#define PLURAL(n) ((n) > 1 ? "s" : "")
@@ -185,13 +191,6 @@
Value_t shift[1];
};
-typedef struct param param;
-struct param {
- struct param *next;
- char *name;
- char *type;
-};
-
/* the structure used to store reductions */
typedef struct reductions reductions;
@@ -217,6 +216,16 @@
char suppressed;
};
+/* the structure used to store parse/lex parameters */
+typedef struct param param;
+struct param
+{
+ struct param *next;
+ char *name; /* parameter name */
+ char *type; /* everything before parameter name */
+ char *type2; /* everything after parameter name */
+};
+
/* global variables */
extern char dflag;
@@ -236,17 +245,19 @@
extern int pure_parser;
extern const char * const banner[];
+extern const char * const xdecls[];
extern const char * const tables[];
-extern const char * const header[];
-extern const char * const body[];
+extern const char * const hdr_defs[];
+extern const char * const hdr_vars[];
+extern const char * const body_1[];
+extern const char * const body_vars[];
+extern const char * const body_2[];
+extern const char * const body_3[];
extern const char * const trailer[];
+extern const char * const trailer_2[];
extern char *code_file_name;
-extern char *defines_file_name;
-extern const char *input_file_name;
-extern char *output_file_name;
-extern char *verbose_file_name;
-extern char *graph_file_name;
+extern char *input_file_name;
extern FILE *action_file;
extern FILE *code_file;
@@ -287,6 +298,7 @@
extern bucket *first_symbol;
extern bucket *last_symbol;
+extern int pure_parser;
extern int nstates;
extern core *first_state;
extern shifts *first_shift;
@@ -335,7 +347,7 @@
#endif
/* closure.c */
-extern void closure(Value_t *nucleus, int n);
+extern void closure(Value_t * nucleus, int n);
extern void finalize_closure(void);
extern void set_first_derives(void);
@@ -351,7 +363,6 @@
extern void open_error(const char *filename);
extern void over_unionized(char *u_cptr);
extern void prec_redeclared(void);
-extern void print_pos(char *st_line, char *st_cptr);
extern void reprec_warning(char *s);
extern void restarted_warning(void);
extern void retyped_warning(char *s);
@@ -377,7 +388,6 @@
extern void graph(void);
/* lalr.c */
-extern int hash(const char *name);
extern void create_symbol_table(void);
extern void free_symbol_table(void);
extern void free_symbols(void);
@@ -393,7 +403,7 @@
extern void show_shifts(void);
/* main.c */
-extern char *allocate(unsigned n);
+extern char *allocate(size_t n);
extern void done(int k) GCC_NORETURN;
/* mkpar.c */
@@ -407,7 +417,7 @@
extern void reader(void);
/* skeleton.c */
-extern void write_section(const char * const section[], int);
+extern void write_section(const char * const section[]);
/* verbose.c */
extern void verbose(void);
diff -r 842e4091b626 -r 760f206ccceb external/bsd/byacc/dist/error.c
--- a/external/bsd/byacc/dist/error.c Fri Dec 24 02:56:56 2010 +0000
+++ b/external/bsd/byacc/dist/error.c Fri Dec 24 02:58:20 2010 +0000
@@ -1,10 +1,9 @@
-/* $NetBSD: error.c,v 1.3 2009/10/29 12:55:52 christos Exp $ */
-/* Id: error.c,v 1.6 2008/11/24 21:30:35 tom Exp */
-
-#include "defs.h"
+/* $NetBSD: error.c,v 1.4 2010/12/24 02:58:20 christos Exp $ */
+/* Id: error.c,v 1.8 2010/11/24 15:10:20 tom Exp */
#include <sys/cdefs.h>
-__RCSID("$NetBSD: error.c,v 1.3 2009/10/29 12:55:52 christos Exp $");
+__RCSID("$NetBSD: error.c,v 1.4 2010/12/24 02:58:20 christos Exp $");
+#include "defs.h"
/* routines for printing error messages */
@@ -38,7 +37,7 @@
done(1);
}
-void
+static void
print_pos(char *st_line, char *st_cptr)
{
char *s;
@@ -47,7 +46,7 @@
return;
for (s = st_line; *s != '\n'; ++s)
{
- if (isprint((unsigned char)*s) || *s == '\t')
+ if (isprint(UCH(*s)) || *s == '\t')
putc(*s, stderr);
else
putc('?', stderr);
diff -r 842e4091b626 -r 760f206ccceb external/bsd/byacc/dist/lr0.c
--- a/external/bsd/byacc/dist/lr0.c Fri Dec 24 02:56:56 2010 +0000
+++ b/external/bsd/byacc/dist/lr0.c Fri Dec 24 02:58:20 2010 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: lr0.c,v 1.2 2009/10/29 00:56:20 christos Exp $ */
-/* Id: lr0.c,v 1.9 2009/10/27 09:20:39 tom Exp */
+/* $NetBSD: lr0.c,v 1.3 2010/12/24 02:58:20 christos Exp $ */
+/* Id: lr0.c,v 1.12 2010/06/09 08:53:17 tom Exp */
#include "defs.h"
#include <sys/cdefs.h>
-__RCSID("$NetBSD: lr0.c,v 1.2 2009/10/29 00:56:20 christos Exp $");
+__RCSID("$NetBSD: lr0.c,v 1.3 2010/12/24 02:58:20 christos Exp $");
static core *new_state(int symbol);
static Value_t get_state(int symbol);
@@ -175,7 +175,7 @@
isp1 = kernel_base[symbol];
iend = kernel_end[symbol];
- n = iend - isp1;
+ n = (int)(iend - isp1);
key = *isp1;
assert(0 <= key && key < nitems);
@@ -232,8 +232,7 @@
continue;
p = (core *)MALLOC(sizeof(core) + i * sizeof(short));
- if (p == 0)
- no_space();
+ NO_SPACE(p);
p->next = 0;
p->link = 0;
@@ -303,7 +302,7 @@
iend = kernel_end[symbol];
n = (unsigned)(iend - isp1);
- p = (core *)allocate((unsigned)(sizeof(core) + (n - 1) * sizeof(short)));
+ p = (core *)allocate((sizeof(core) + (n - 1) * sizeof(short)));
p->accessing_symbol = (Value_t) symbol;
p->number = (Value_t) nstates;
p->nitems = (Value_t) n;
@@ -407,8 +406,8 @@
short *sp2;
short *send;
- p = (shifts *)allocate((unsigned)(sizeof(shifts) +
- (unsigned)(nshifts - 1) * sizeof(short)));
Home |
Main Index |
Thread Index |
Old Index