Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/byacc merge conflicts.



details:   https://anonhg.NetBSD.org/src/rev/52ea68a0dd9c
branches:  trunk
changeset: 335343:52ea68a0dd9c
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 03 23:22:52 2015 +0000

description:
merge conflicts.

diffstat:

 external/bsd/byacc/bin/Makefile                   |     4 +-
 external/bsd/byacc/dist/closure.c                 |    32 +-
 external/bsd/byacc/dist/config_h.in               |     9 +
 external/bsd/byacc/dist/defs.h                    |   154 +-
 external/bsd/byacc/dist/error.c                   |   124 +-
 external/bsd/byacc/dist/graph.c                   |    12 +-
 external/bsd/byacc/dist/lalr.c                    |    19 +-
 external/bsd/byacc/dist/lr0.c                     |    91 +-
 external/bsd/byacc/dist/main.c                    |    86 +-
 external/bsd/byacc/dist/mkpar.c                   |    31 +-
 external/bsd/byacc/dist/mstring.c                 |     8 +-
 external/bsd/byacc/dist/output.c                  |   774 ++++++-
 external/bsd/byacc/dist/reader.c                  |  2100 +++++++++++++++----
 external/bsd/byacc/dist/skeleton.c                |   451 ----
 external/bsd/byacc/dist/symtab.c                  |    12 +-
 external/bsd/byacc/dist/test/calc.output          |   461 ----
 external/bsd/byacc/dist/test/calc.tab.c           |   675 ------
 external/bsd/byacc/dist/test/calc.tab.h           |     5 -
 external/bsd/byacc/dist/test/calc1.output         |   877 --------
 external/bsd/byacc/dist/test/calc1.tab.c          |   917 --------
 external/bsd/byacc/dist/test/calc1.tab.h          |    20 -
 external/bsd/byacc/dist/test/calc2.output         |   461 ----
 external/bsd/byacc/dist/test/calc2.tab.c          |   684 ------
 external/bsd/byacc/dist/test/calc2.tab.h          |     5 -
 external/bsd/byacc/dist/test/calc3.output         |   461 ----
 external/bsd/byacc/dist/test/calc3.tab.c          |   689 ------
 external/bsd/byacc/dist/test/calc3.tab.h          |     5 -
 external/bsd/byacc/dist/test/code_calc.code.c     |   582 -----
 external/bsd/byacc/dist/test/code_calc.output     |   461 ----
 external/bsd/byacc/dist/test/code_calc.tab.c      |   201 -
 external/bsd/byacc/dist/test/code_calc.tab.h      |     5 -
 external/bsd/byacc/dist/test/code_error.code.c    |   493 ----
 external/bsd/byacc/dist/test/code_error.output    |    27 -
 external/bsd/byacc/dist/test/code_error.tab.c     |   120 -
 external/bsd/byacc/dist/test/code_error.tab.h     |     2 -
 external/bsd/byacc/dist/test/error.output         |    27 -
 external/bsd/byacc/dist/test/error.tab.c          |   504 ----
 external/bsd/byacc/dist/test/error.tab.h          |     1 -
 external/bsd/byacc/dist/test/ftp.output           |  1625 ---------------
 external/bsd/byacc/dist/test/ftp.tab.c            |  2013 -------------------
 external/bsd/byacc/dist/test/ftp.tab.h            |    78 -
 external/bsd/byacc/dist/test/ftp.y                |  1260 -----------
 external/bsd/byacc/dist/test/grammar.output       |  2214 ---------------------
 external/bsd/byacc/dist/test/grammar.tab.c        |  2027 -------------------
 external/bsd/byacc/dist/test/grammar.tab.h        |    37 -
 external/bsd/byacc/dist/test/pure_calc.output     |   461 ----
 external/bsd/byacc/dist/test/pure_calc.tab.c      |   689 ------
 external/bsd/byacc/dist/test/pure_calc.tab.h      |     5 -
 external/bsd/byacc/dist/test/pure_error.output    |    27 -
 external/bsd/byacc/dist/test/pure_error.tab.c     |   519 ----
 external/bsd/byacc/dist/test/pure_error.tab.h     |     2 -
 external/bsd/byacc/dist/test/quote_calc-s.output  |   557 -----
 external/bsd/byacc/dist/test/quote_calc-s.tab.c   |   689 ------
 external/bsd/byacc/dist/test/quote_calc-s.tab.h   |    11 -
 external/bsd/byacc/dist/test/quote_calc.output    |   557 -----
 external/bsd/byacc/dist/test/quote_calc.tab.c     |   695 ------
 external/bsd/byacc/dist/test/quote_calc.tab.h     |    17 -
 external/bsd/byacc/dist/test/quote_calc2-s.output |   557 -----
 external/bsd/byacc/dist/test/quote_calc2-s.tab.c  |   689 ------
 external/bsd/byacc/dist/test/quote_calc2-s.tab.h  |    11 -
 external/bsd/byacc/dist/test/quote_calc2.output   |   557 -----
 external/bsd/byacc/dist/test/quote_calc2.tab.c    |   695 ------
 external/bsd/byacc/dist/test/quote_calc2.tab.h    |    17 -
 external/bsd/byacc/dist/test/quote_calc3-s.output |   557 -----
 external/bsd/byacc/dist/test/quote_calc3-s.tab.c  |   690 ------
 external/bsd/byacc/dist/test/quote_calc3-s.tab.h  |    11 -
 external/bsd/byacc/dist/test/quote_calc3.output   |   557 -----
 external/bsd/byacc/dist/test/quote_calc3.tab.c    |   690 ------
 external/bsd/byacc/dist/test/quote_calc3.tab.h    |    11 -
 external/bsd/byacc/dist/test/quote_calc4-s.output |   557 -----
 external/bsd/byacc/dist/test/quote_calc4-s.tab.c  |   690 ------
 external/bsd/byacc/dist/test/quote_calc4-s.tab.h  |    11 -
 external/bsd/byacc/dist/test/quote_calc4.output   |   557 -----
 external/bsd/byacc/dist/test/quote_calc4.tab.c    |   690 ------
 external/bsd/byacc/dist/test/quote_calc4.tab.h    |    11 -
 external/bsd/byacc/dist/verbose.c                 |    48 +-
 external/bsd/byacc/dist/yacc.1                    |   176 +-
 77 files changed, 2955 insertions(+), 29900 deletions(-)

diffs (truncated from 34995 to 300 lines):

diff -r 675ac773d9d9 -r 52ea68a0dd9c external/bsd/byacc/bin/Makefile
--- a/external/bsd/byacc/bin/Makefile   Sat Jan 03 22:58:23 2015 +0000
+++ b/external/bsd/byacc/bin/Makefile   Sat Jan 03 23:22:52 2015 +0000
@@ -1,10 +1,10 @@
-#      $NetBSD: Makefile,v 1.3 2011/08/14 13:29:26 christos Exp $
+#      $NetBSD: Makefile,v 1.4 2015/01/03 23:22:52 christos Exp $
 
 .include "bsd.own.mk"
 
 PROG=  yacc
 SRCS=  closure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c \
-       skeleton.c symtab.c verbose.c warshall.c graph.c
+       symtab.c verbose.c warshall.c graph.c mstring.c btyaccpar.c
 
 CPPFLAGS+=     -DGCC_NORETURN=__dead
 
diff -r 675ac773d9d9 -r 52ea68a0dd9c external/bsd/byacc/dist/closure.c
--- a/external/bsd/byacc/dist/closure.c Sat Jan 03 22:58:23 2015 +0000
+++ b/external/bsd/byacc/dist/closure.c Sat Jan 03 23:22:52 2015 +0000
@@ -1,25 +1,32 @@
-/*     $NetBSD: closure.c,v 1.7 2013/04/06 14:52:24 christos Exp $     */
+/*     $NetBSD: closure.c,v 1.8 2015/01/03 23:22:52 christos Exp $     */
 
-/* Id: closure.c,v 1.9 2010/06/09 08:21:47 tom Exp  */
+/* Id: closure.c,v 1.11 2014/09/18 00:40:07 tom Exp  */
 
 #include "defs.h"
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: closure.c,v 1.7 2013/04/06 14:52:24 christos Exp $");
+__RCSID("$NetBSD: closure.c,v 1.8 2015/01/03 23:22:52 christos Exp $");
 
 Value_t *itemset;
 Value_t *itemsetend;
 unsigned *ruleset;
 
+static unsigned *first_base;
 static unsigned *first_derives;
 static unsigned *EFF;
 
+#ifdef DEBUG
+static void print_closure(int);
+static void print_EFF(void);
+static void print_first_derives(void);
+#endif
+
 static void
 set_EFF(void)
 {
     unsigned *row;
     int symbol;
-    short *sp;
+    Value_t *sp;
     int rowsize;
     int i;
     int rule;
@@ -58,7 +65,7 @@
     int j;
     unsigned k;
     unsigned cword = 0;
-    short *rp;
+    Value_t *rp;
 
     int rule;
     int i;
@@ -67,7 +74,8 @@
 
     rulesetsize = WORDSIZE(nrules);
     varsetsize = WORDSIZE(nvars);
-    first_derives = NEW2(nvars * rulesetsize, unsigned) - ntokens * rulesetsize;
+    first_base = NEW2(nvars * rulesetsize, unsigned);
+    first_derives = first_base - ntokens * rulesetsize;
 
     set_EFF();
 
@@ -105,7 +113,7 @@
 }
 
 void
-closure(short *nucleus, int n)
+closure(Value_t *nucleus, int n)
 {
     unsigned ruleno;
     unsigned word;
@@ -175,22 +183,22 @@
 {
     FREE(itemset);
     FREE(ruleset);
-    FREE(first_derives + ntokens * WORDSIZE(nrules));
+    FREE(first_base);
 }
 
 #ifdef DEBUG
 
-void
+static void
 print_closure(int n)
 {
-    short *isp;
+    Value_t *isp;
 
     printf("\n\nn = %d\n\n", n);
     for (isp = itemset; isp < itemsetend; isp++)
        printf("   %d\n", *isp);
 }
 
-void
+static void
 print_EFF(void)
 {
     int i, j;
@@ -221,7 +229,7 @@
     }
 }
 
-void
+static void
 print_first_derives(void)
 {
     int i;
diff -r 675ac773d9d9 -r 52ea68a0dd9c external/bsd/byacc/dist/config_h.in
--- a/external/bsd/byacc/dist/config_h.in       Sat Jan 03 22:58:23 2015 +0000
+++ b/external/bsd/byacc/dist/config_h.in       Sat Jan 03 23:22:52 2015 +0000
@@ -30,6 +30,12 @@
 /* Define to 1 if mkstemp() is available and working. */
 #undef HAVE_MKSTEMP
 
+/* Define to 1 if vsnprintf() is available and working. */
+#undef HAVE_VSNPRINTF
+
+/* Define to maximum table size (default: 32500) */
+#undef MAXTABLE
+
 /* Define to 1 if filesystem supports mixed-case filenames. */
 #undef MIXEDCASE_FILENAMES
 
@@ -48,5 +54,8 @@
 /* "Define to 1 if you want to use valgrind for testing." */
 #undef USE_VALGRIND
 
+/* Define to 1 to enable backtracking extension */
+#undef YYBTYACC
+
 /* Define to 1 if you want to perform memory-leak testing. */
 #undef YY_NO_LEAKS
diff -r 675ac773d9d9 -r 52ea68a0dd9c external/bsd/byacc/dist/defs.h
--- a/external/bsd/byacc/dist/defs.h    Sat Jan 03 22:58:23 2015 +0000
+++ b/external/bsd/byacc/dist/defs.h    Sat Jan 03 23:22:52 2015 +0000
@@ -1,14 +1,15 @@
-/*     $NetBSD: defs.h,v 1.7 2013/12/30 19:08:55 christos Exp $        */
+/*     $NetBSD: defs.h,v 1.8 2015/01/03 23:22:52 christos Exp $        */
 
 #if HAVE_NBTOOL_CONFIG_H
 #include "nbtool_config.h"
 #endif
-/* Id: defs.h,v 1.37 2012/05/26 15:23:00 tom Exp  */
+/* Id: defs.h,v 1.51 2014/10/02 22:38:13 tom Exp  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
+#include <limits.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
@@ -35,14 +36,14 @@
 
 #define VERSION VSTRING(YYMAJOR, YYMINOR)
 
-/*  machine-dependent definitions                      */
-/*  the following definitions are for the Tahoe                */
-/*  they might have to be changed for other machines   */
+/*  machine-dependent definitions:                     */
 
 /*  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                 */
+/*  YYINT is the smallest C integer type that can be   */
+/*     used to address a table of size MAXTABLE        */
+/*  MAXYYINT is the largest value of a YYINT           */
+/*  MINYYINT is the most negative value of a YYINT     */
 /*  BITS_PER_WORD is the number of bits in a C unsigned        */
 /*  WORDSIZE computes the number of words needed to    */
 /*     store n bits                                    */
@@ -50,14 +51,26 @@
 /*     from r (0-indexed)                              */
 /*  SETBIT sets the n-th bit starting from r           */
 
-#define        MAXCHAR         255
-#define        MAXSHORT        32767
-#define MINSHORT       -32768
+#define        MAXCHAR         UCHAR_MAX
+#ifndef MAXTABLE
 #define MAXTABLE       32500
-#define BITS_PER_WORD  32
-#define        WORDSIZE(n)     (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
-#define        BIT(r, n)       ((((r)[(n)>>5])>>((n)&31))&1)
-#define        SETBIT(r, n)    ((r)[(n)>>5]|=((unsigned)1<<((n)&31)))
+#endif
+#if MAXTABLE <= SHRT_MAX
+#define YYINT          short
+#define MAXYYINT       SHRT_MAX
+#define MINYYINT       SHRT_MIN
+#elif MAXTABLE <= INT_MAX
+#define YYINT          int
+#define MAXYYINT       INT_MAX
+#define MINYYINT       INT_MIN
+#else
+#error "MAXTABLE is too large for this machine architecture!"
+#endif
+
+#define BITS_PER_WORD  ((int) sizeof (unsigned) * CHAR_BIT)
+#define WORDSIZE(n)    (((n)+(BITS_PER_WORD-1))/BITS_PER_WORD)
+#define BIT(r, n)      ((((r)[(n)/BITS_PER_WORD])>>((n)&(BITS_PER_WORD-1)))&1)
+#define SETBIT(r, n)   ((r)[(n)/BITS_PER_WORD]|=((unsigned)1<<((n)&(BITS_PER_WORD-1))))
 
 /*  character names  */
 
@@ -111,11 +124,18 @@
 #define POSIX_YACC 15
 #define TOKEN_TABLE 16
 
+#if defined(YYBTYACC)
+#define LOCATIONS 17
+#define DESTRUCTOR 18
+#endif
+
 /*  symbol classes  */
 
 #define UNKNOWN 0
 #define TERM 1
 #define NONTERM 2
+#define ACTION 3
+#define ARGUMENT 4
 
 /*  the undefined value  */
 
@@ -142,6 +162,7 @@
 #define CALLOC(k,n)    (calloc((size_t)(k),(size_t)(n)))
 #define        FREE(x)         (free((char*)(x)))
 #define MALLOC(n)      (malloc((size_t)(n)))
+#define TCMALLOC(t,n)  ((t*) calloc((size_t)(n), sizeof(t)))
 #define TMALLOC(t,n)   ((t*) malloc((size_t)(n) * sizeof(t)))
 #define        NEW(t)          ((t*)allocate(sizeof(t)))
 #define        NEW2(n,t)       ((t*)allocate(((size_t)(n)*sizeof(t))))
@@ -155,10 +176,20 @@
 /* messages */
 #define PLURAL(n) ((n) > 1 ? "s" : "")
 
+/*
+ * Features which depend indirectly on the btyacc configuration, but are not
+ * essential.
+ */
+#if defined(YYBTYACC)
+#define USE_HEADER_GUARDS 1
+#else
+#define USE_HEADER_GUARDS 0
+#endif
+
 typedef char Assoc_t;
 typedef char Class_t;
-typedef short Index_t;
-typedef short Value_t;
+typedef YYINT Index_t;
+typedef YYINT Value_t;
 
 /*  the structure of a symbol table entry  */
 
@@ -169,6 +200,12 @@
     struct bucket *next;
     char *name;
     char *tag;
+#if defined(YYBTYACC)
+    char **argnames;
+    char **argtags;
+    int  args;
+    char *destructor;
+#endif
     Value_t value;
     Index_t index;
     Value_t prec;
@@ -255,6 +292,11 @@
 extern int exit_code;
 extern int pure_parser;
 extern int token_table;
+#if defined(YYBTYACC)
+extern int locations;
+extern int backtrack;
+extern int destructor;
+#endif
 
 extern const char *const banner[];
 extern const char *const xdecls[];
@@ -266,9 +308,7 @@
 extern const char *const body_1[];
 extern const char *const body_vars[];
 extern const char *const body_2[];
-extern const char *const body_3[];



Home | Main Index | Thread Index | Old Index