Pre-ansification changes for usr.bin/yacc
authorNick Downing <downing.nick@gmail.com>
Tue, 31 Jan 2017 09:17:01 +0000 (20:17 +1100)
committerNick Downing <downing.nick@gmail.com>
Tue, 31 Jan 2017 10:21:23 +0000 (21:21 +1100)
15 files changed:
.gitignore
cproto-4.6/cproto.c
cproto-4.6/grammar.y
cproto-4.6/lex.l
cproto-4.6/semantic.c
cproto-4.6/yyerror.c
usr.bin/yacc/Makefile
usr.bin/yacc/conflicts.txt [new file with mode: 0644]
usr.bin/yacc/dextern.h [moved from usr.bin/yacc/dextern with 99% similarity]
usr.bin/yacc/files.h [moved from usr.bin/yacc/files with 100% similarity]
usr.bin/yacc/groups.txt [new file with mode: 0644]
usr.bin/yacc/y1.c
usr.bin/yacc/y2.c
usr.bin/yacc/y3.c
usr.bin/yacc/y4.c

index 30c23db..c5fc9dd 100644 (file)
@@ -122,6 +122,9 @@ usr.bin/crypt
 usr.bin/deroff
 usr.bin/fgrep
 usr.bin/file
+usr.bin/find/bigram
+usr.bin/find/code
+usr.bin/find/find
 usr.bin/join
 usr.bin/look
 usr.bin/mesg
index 25c7ab3..4b1d744 100644 (file)
@@ -820,7 +820,12 @@ char *argv[];
                while (s != temp && s[-1] != '/')
                    s--;
                (void)strcpy(s, "XXXXXX.c");
+#if 1 /* Nick */
+               char *__mktemp(char *template);
+               __mktemp(temp);
+#else
                mktemp(temp);
+#endif
                if (link(argv[i], temp) < 0)
                    (void)strcpy(temp, argv[i]);
            }
index 55531ab..83c457a 100644 (file)
@@ -816,7 +816,7 @@ direct_abs_declarator
 
 static void
 yaccError (msg)
-char *msg;
+const char *msg;
 {
     func_params = NULL;
     put_error();               /* tell what line we're on, and what file */
index d91a65f..1298457 100644 (file)
@@ -694,6 +694,10 @@ get_comment ()
            break;
        case '/':
            if (lastc == '*') {
+#if 1 /* Nick */
+ if (curly)
+  return;
+#endif
                if (cur_file->convert) {
                    if (func_params && cur_declarator) {
                        cur_declarator->begin_comment = cur_file->begin_comment;
index 1781ce3..24bcf55 100644 (file)
@@ -1169,6 +1169,14 @@ Declarator *declarator;
     } else {
        comment_len = 0;
     }
+#if 0 /* Nick */
+ /* note that the "comment" is actually the entire function body, usually */
+ /* from the opening brace to the closing brace inclusive, but may contain */
+ /* a comment before the opening brace (I think can only occur for ANSI) */
+ fprintf(stderr, "comment \"");
+ fwrite(comment, comment_len, 1, stderr);
+ fprintf(stderr, "\"\n");
+#endif
 
     format = FMT_FUNC;
     nestedParams = 0;
index 3c9c9bf..782b2f6 100644 (file)
@@ -89,7 +89,7 @@
  * Any way we define it, 'yyerror()' is a real function (that we provide,
  * rather than use the one from a library).
  */
-static void yaccError    ARGS((char *));
+static void yaccError    ARGS((const char *));
 
 #ifdef yyerror
 static int  compar       ARGS((const void *a, const void *b));
index 7415c35..b67495c 100644 (file)
@@ -3,15 +3,15 @@
 #
 DESTDIR=
 CFLAGS=-O -DWORD32
-SRCS = Makefile dextern files yaccpar \
+SRCS = Makefile dextern.h files.h yaccpar \
        y1.c y2.c y3.c y4.c \
        yaccdiffs yaccnews
 
 all: yacc
 
 yacc: y1.o y2.o y3.o y4.o
-       $(CC) -o yacc y?.o 
-y1.o y2.o y3.o y4.o: dextern files
+       $(CC) -o yacc y1.o y2.o y3.o y4.o
+y1.o y2.o y3.o y4.o: dextern.h files.h
 install:
        install -s yacc $(DESTDIR)/usr/bin
        install -c yaccpar $(DESTDIR)/usr/lib
diff --git a/usr.bin/yacc/conflicts.txt b/usr.bin/yacc/conflicts.txt
new file mode 100644 (file)
index 0000000..36e3d86
--- /dev/null
@@ -0,0 +1,4 @@
+dextern.h math.h
+dextern.h sys/ttydev.h
+files.h math.h
+y1.c sys/ttydev.h
similarity index 99%
rename from usr.bin/yacc/dextern
rename to usr.bin/yacc/dextern.h
index 295da7a..29421cf 100644 (file)
@@ -3,7 +3,7 @@
  */
 # include <stdio.h>
 # include <ctype.h>
-# include "files"
+# include "files.h"
 
        /*  MANIFEST CONSTANT DEFINITIONS */
 
similarity index 100%
rename from usr.bin/yacc/files
rename to usr.bin/yacc/files.h
diff --git a/usr.bin/yacc/groups.txt b/usr.bin/yacc/groups.txt
new file mode 100644 (file)
index 0000000..e0ee9c7
--- /dev/null
@@ -0,0 +1,4 @@
+y1.c dextern.h
+y2.c dextern.h
+y3.c dextern.h
+y4.c dextern.h
index 429d314..a8e1054 100644 (file)
@@ -2,7 +2,8 @@
 static char sccsid[] = "@(#)y1.c       4.1     (Berkeley)      2/11/83";
 #endif not lint
 
-# include "dextern"
+# include <varargs.h>
+# include "dextern.h"
 
        /* variables used locally */
 
@@ -190,12 +191,14 @@ summary(){ /* output the summary on the tty */
        if( fdefine != NULL ) fclose( fdefine );
        }
 
-/* VARARGS1 */
-error(s,a1) char *s; { /* write out error comment */
-       
+error(s,va_alist) char *s; va_dcl { /* write out error comment */
+       va_list argp;
+
        ++nerrors;
        fprintf( stderr, "\n fatal error: ");
-       fprintf( stderr, s,a1);
+       va_start(argp);
+       vfprintf( stderr, s, argp);
+       va_end(argp);
        fprintf( stderr, ", line %d\n", lineno );
        if( !fatfl ) return;
        summary();
index 6ebcce8..3436cca 100644 (file)
@@ -2,7 +2,7 @@
 static char sccsid[] = "@(#)y2.c       4.1     (Berkeley)      2/11/83";
 #endif not lint
 
-# include "dextern"
+# include "dextern.h"
 # define IDENTIFIER 257
 # define MARK 258
 # define TERM 259
index 13739cb..f472677 100644 (file)
@@ -2,7 +2,7 @@
 static char sccsid[] = "@(#)y3.c       4.1     (Berkeley)      2/11/83";
 #endif not lint
 
-# include "dextern"
+# include "dextern.h"
 
        /* important local variables */
 int lastred;  /* the number of the last reduction of a state */
index 3afbe23..8777b03 100644 (file)
@@ -2,7 +2,7 @@
 static char sccsid[] = "@(#)y4.c       4.1     (Berkeley)      2/11/83";
 #endif not lint
 
-# include "dextern"
+# include "dextern.h"
 
 # define a amem
 # define mem mem0