pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/lang/f2c Pregenerate the parser (gram.c) and disable i...
details: https://anonhg.NetBSD.org/pkgsrc/rev/b000df21566c
branches: trunk
changeset: 569011:b000df21566c
user: tnn <tnn%pkgsrc.org@localhost>
date: Sun Jan 03 01:37:59 2010 +0000
description:
Pregenerate the parser (gram.c) and disable implicit regeneration.
Drop yacc(1) dependency.
This solves the circular dependency f2c->bison->libiconv->libtool-base->f2c
diffstat:
lang/f2c/Makefile | 6 +-
lang/f2c/files/f2c.mk | 6 +-
lang/f2c/files/gram.c | 2768 +++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 2776 insertions(+), 4 deletions(-)
diffs (truncated from 2831 to 300 lines):
diff -r 2b18dc1182d1 -r b000df21566c lang/f2c/Makefile
--- a/lang/f2c/Makefile Sat Jan 02 13:58:17 2010 +0000
+++ b/lang/f2c/Makefile Sun Jan 03 01:37:59 2010 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.52 2009/12/28 11:42:19 tnn Exp $
+# $NetBSD: Makefile,v 1.53 2010/01/03 01:37:59 tnn Exp $
DISTNAME= f2c-20090411 # see notes below
-PKGREVISION= 3
+PKGREVISION= 4
CATEGORIES= lang
MASTER_SITES= ${MASTER_SITE_LOCAL}
@@ -18,7 +18,6 @@
BUILD_DIRS= src
USE_BSD_MAKEFILE= yes
MAKE_ENV+= MKCATPAGES=no
-USE_TOOLS+= yacc
INSTALLATION_DIRS= bin share/doc/f2c ${PKGMANDIR}/man1
.include "../../mk/bsd.prefs.mk"
@@ -33,6 +32,7 @@
post-extract:
@${CP} ${FILESDIR:Q}/f2c.mk ${WRKSRC}/src/Makefile
+ @${CP} ${FILESDIR:Q}/gram.c ${WRKSRC}/src/gram.c
@mv ${WRKSRC}/src/.depend ${WRKSRC}/src/depend.orig
@mv ${WRKSRC}/src/f2c.1 ${WRKSRC}/src/f2c.1.orig
diff -r 2b18dc1182d1 -r b000df21566c lang/f2c/files/f2c.mk
--- a/lang/f2c/files/f2c.mk Sat Jan 02 13:58:17 2010 +0000
+++ b/lang/f2c/files/f2c.mk Sun Jan 03 01:37:59 2010 +0000
@@ -1,7 +1,7 @@
# Makefile for f2c, a Fortran 77 to C converter
PROG= f2c
-SRCS= main.c init.c gram.y lex.c proc.c equiv.c data.c format.c \
+SRCS= main.c init.c gram.c lex.c proc.c equiv.c data.c format.c \
expr.c exec.c intr.c io.c misc.c error.c mem.c names.c \
output.c p1output.c pread.c put.c putpcc.c vax.c formatdata.c \
parse_args.c niceprintf.c cds.c sysdep.c version.c $(MALLOC)
@@ -21,6 +21,7 @@
# (derived with a Unix variant of the yacc from plan9).
# There should be 4 shift/reduce conflicts:
+.if make(gram.c)
gram.y: gram.head gram.dcl gram.expr gram.exec gram.io tokdefs.h
( sed "s/#define/%token/" < $(.ALLSRC:M*tokdefs.h) ; \
cat $(.ALLSRC:M*gram.head) \
@@ -29,6 +30,9 @@
$(.ALLSRC:M*gram.exec) \
$(.ALLSRC:M*gram.io) ) > $@
CLEANFILES+= gram.y
+.else
+gram.c:
+.endif
DPADD= defs.h ftypes.h defines.h machdefs.h sysdep.h
diff -r 2b18dc1182d1 -r b000df21566c lang/f2c/files/gram.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/f2c/files/gram.c Sun Jan 03 01:37:59 2010 +0000
@@ -0,0 +1,2768 @@
+#ifndef lint
+static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93";
+#endif
+
+#ifdef _LIBC
+#include "namespace.h"
+#endif
+#include <stdlib.h>
+#include <string.h>
+
+#define YYBYACC 1
+#define YYMAJOR 1
+#define YYMINOR 9
+
+#define YYEMPTY (-1)
+#define yyclearin (yychar = YYEMPTY)
+#define yyerrok (yyerrflag = 0)
+#define YYRECOVERING() (yyerrflag != 0)
+
+/* compatibility with bison */
+#ifdef YYPARSE_PARAM
+/* compatibility with FreeBSD */
+# ifdef YYPARSE_PARAM_TYPE
+# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
+# else
+# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
+# endif
+#else
+# define YYPARSE_DECL() yyparse(void)
+#endif
+
+/* Pure parsers. */
+#define YYPURE 0
+#ifdef YYLEX_PARAM
+# define YYLEX yylex(YYLEX_PARAM)
+#else
+# define YYLEX yylex()
+#endif
+
+#define YYPREFIX "yy"
+#line 125 "gram.y"
+#include "defs.h"
+#include "p1defs.h"
+
+static int nstars; /* Number of labels in an
+ alternate return CALL */
+static int datagripe;
+static int ndim;
+static int vartype;
+int new_dcl;
+static ftnint varleng;
+static struct Dims dims[MAXDIM+1];
+extern struct Labelblock **labarray; /* Labels in an alternate
+ return CALL */
+extern int maxlablist;
+
+/* The next two variables are used to verify that each statement might be reached
+ during runtime. lastwasbranch is tested only in the defintion of the
+ stat: nonterminal. */
+
+int lastwasbranch = NO;
+static int thiswasbranch = NO;
+extern ftnint yystno;
+extern flag intonly;
+static chainp datastack;
+extern long laststfcn, thisstno;
+extern int can_include; /* for netlib */
+extern void endcheck Argdcl((void));
+extern struct Primblock *primchk Argdcl((expptr));
+
+#define ESNULL (Extsym *)0
+#define NPNULL (Namep)0
+#define LBNULL (struct Listblock *)0
+
+ static void
+pop_datastack(Void) {
+ chainp d0 = datastack;
+ if (d0->datap)
+ curdtp = (chainp)d0->datap;
+ datastack = d0->nextp;
+ d0->nextp = 0;
+ frchain(&d0);
+ }
+
+#line 172 "gram.y"
+typedef union YYSTYPE {
+ int ival;
+ ftnint lval;
+ char *charpval;
+ chainp chval;
+ tagptr tagval;
+ expptr expval;
+ struct Labelblock *labval;
+ struct Nameblock *namval;
+ struct Eqvchain *eqvval;
+ Extsym *extval;
+ } YYSTYPE;
+#line 98 "gram.c"
+#define SEOS 1
+#define SCOMMENT 2
+#define SLABEL 3
+#define SUNKNOWN 4
+#define SHOLLERITH 5
+#define SICON 6
+#define SRCON 7
+#define SDCON 8
+#define SBITCON 9
+#define SOCTCON 10
+#define SHEXCON 11
+#define STRUE 12
+#define SFALSE 13
+#define SNAME 14
+#define SNAMEEQ 15
+#define SFIELD 16
+#define SSCALE 17
+#define SINCLUDE 18
+#define SLET 19
+#define SASSIGN 20
+#define SAUTOMATIC 21
+#define SBACKSPACE 22
+#define SBLOCK 23
+#define SCALL 24
+#define SCHARACTER 25
+#define SCLOSE 26
+#define SCOMMON 27
+#define SCOMPLEX 28
+#define SCONTINUE 29
+#define SDATA 30
+#define SDCOMPLEX 31
+#define SDIMENSION 32
+#define SDO 33
+#define SDOUBLE 34
+#define SELSE 35
+#define SELSEIF 36
+#define SEND 37
+#define SENDFILE 38
+#define SENDIF 39
+#define SENTRY 40
+#define SEQUIV 41
+#define SEXTERNAL 42
+#define SFORMAT 43
+#define SFUNCTION 44
+#define SGOTO 45
+#define SASGOTO 46
+#define SCOMPGOTO 47
+#define SARITHIF 48
+#define SLOGIF 49
+#define SIMPLICIT 50
+#define SINQUIRE 51
+#define SINTEGER 52
+#define SINTRINSIC 53
+#define SLOGICAL 54
+#define SNAMELIST 55
+#define SOPEN 56
+#define SPARAM 57
+#define SPAUSE 58
+#define SPRINT 59
+#define SPROGRAM 60
+#define SPUNCH 61
+#define SREAD 62
+#define SREAL 63
+#define SRETURN 64
+#define SREWIND 65
+#define SSAVE 66
+#define SSTATIC 67
+#define SSTOP 68
+#define SSUBROUTINE 69
+#define STHEN 70
+#define STO 71
+#define SUNDEFINED 72
+#define SWRITE 73
+#define SLPAR 74
+#define SRPAR 75
+#define SEQUALS 76
+#define SCOLON 77
+#define SCOMMA 78
+#define SCURRENCY 79
+#define SPLUS 80
+#define SMINUS 81
+#define SSTAR 82
+#define SSLASH 83
+#define SPOWER 84
+#define SCONCAT 85
+#define SAND 86
+#define SOR 87
+#define SNEQV 88
+#define SEQV 89
+#define SNOT 90
+#define SEQ 91
+#define SLT 92
+#define SGT 93
+#define SLE 94
+#define SGE 95
+#define SNE 96
+#define SENDDO 97
+#define SWHILE 98
+#define SSLASHD 99
+#define SBYTE 100
+#define YYERRCODE 256
+static const short yylhs[] = { -1,
+ 0, 0, 54, 54, 54, 54, 54, 54, 54, 1,
+ 55, 55, 55, 55, 55, 55, 55, 59, 51, 32,
+ 52, 52, 60, 60, 61, 61, 62, 62, 25, 25,
+ 25, 26, 26, 33, 33, 16, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 9, 9,
+ 9, 73, 6, 7, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 15, 15, 15, 49,
+ 49, 49, 49, 50, 50, 63, 63, 64, 64, 65,
+ 65, 79, 53, 53, 66, 66, 80, 81, 75, 82,
+ 84, 76, 76, 83, 83, 44, 44, 44, 69, 69,
+ 85, 85, 71, 71, 86, 35, 17, 17, 18, 18,
+ 74, 74, 89, 87, 87, 88, 88, 42, 42, 90,
+ 90, 2, 67, 67, 91, 91, 94, 92, 93, 93,
+ 95, 95, 10, 68, 68, 96, 19, 19, 70, 20,
+ 20, 21, 21, 37, 37, 37, 38, 38, 38, 38,
+ 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
+ 11, 11, 12, 12, 12, 12, 12, 12, 36, 36,
+ 36, 36, 31, 39, 39, 43, 43, 47, 47, 47,
+ 47, 47, 47, 47, 46, 48, 48, 48, 40, 40,
+ 41, 41, 41, 41, 41, 41, 41, 41, 57, 57,
+ 57, 57, 57, 57, 99, 57, 57, 57, 98, 22,
+ 23, 100, 23, 97, 97, 97, 97, 97, 97, 97,
+ 97, 97, 97, 97, 3, 101, 102, 102, 102, 102,
+ 72, 72, 34, 24, 24, 45, 45, 13, 13, 27,
+ 27, 58, 77, 78, 103, 104, 104, 104, 104, 104,
+ 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
+ 105, 112, 112, 112, 107, 114, 114, 114, 109, 109,
+ 106, 106, 115, 115, 116, 116, 116, 116, 116, 116,
+ 14, 108, 110, 111, 111, 28, 28, 5, 5, 29,
+ 29, 29, 30, 30, 30, 30, 30, 30, 4, 4,
+ 4, 4, 4, 113,
+};
+static const short yylen[] = { 2,
+ 0, 3, 2, 2, 2, 3, 3, 2, 1, 1,
+ 3, 4, 3, 4, 4, 5, 3, 0, 1, 1,
+ 0, 1, 2, 3, 1, 3, 1, 3, 0, 2,
+ 3, 1, 3, 1, 1, 1, 1, 1, 1, 1,
Home |
Main Index |
Thread Index |
Old Index