summaryrefslogtreecommitdiff
path: root/devel/ruby-byaccr
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2001-07-01 14:39:15 +0000
committertaca <taca@pkgsrc.org>2001-07-01 14:39:15 +0000
commit424f8e0a4ee7a93c32625ec80210ccdd4d29c1da (patch)
tree9f46dd378815ad31b1d23aa8b40832619bf08790 /devel/ruby-byaccr
parent7d7a8f62a0ffc44ceb45e78845753c5fe73c4a63 (diff)
downloadpkgsrc-424f8e0a4ee7a93c32625ec80210ccdd4d29c1da.tar.gz
Importing ruby-byaccr, ruby-byaccr-0.1 package.
byaccr is a parser generator for ruby based on 'Berkeley Yacc' and 'Berkeley Yacc for Java'.
Diffstat (limited to 'devel/ruby-byaccr')
-rw-r--r--devel/ruby-byaccr/Makefile25
-rw-r--r--devel/ruby-byaccr/distinfo11
-rw-r--r--devel/ruby-byaccr/patches/patch-aa62
-rw-r--r--devel/ruby-byaccr/patches/patch-ab38
-rw-r--r--devel/ruby-byaccr/patches/patch-ac14
-rw-r--r--devel/ruby-byaccr/patches/patch-ad70
-rw-r--r--devel/ruby-byaccr/patches/patch-ae32
-rw-r--r--devel/ruby-byaccr/patches/patch-af120
-rw-r--r--devel/ruby-byaccr/patches/patch-ag60
-rw-r--r--devel/ruby-byaccr/pkg/DESCR4
-rw-r--r--devel/ruby-byaccr/pkg/PLIST7
11 files changed, 443 insertions, 0 deletions
diff --git a/devel/ruby-byaccr/Makefile b/devel/ruby-byaccr/Makefile
new file mode 100644
index 00000000000..49fdb3a9bd4
--- /dev/null
+++ b/devel/ruby-byaccr/Makefile
@@ -0,0 +1,25 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+# FreeBSD: ports/devel/ruby-byaccr/Makefile,v 1.2 2000/11/03 15:49:06 knu Exp
+
+DISTNAME= byaccr-0.1
+PKGNAME= ${RUBY_PKGNAMEPREFIX}${DISTNAME}
+CATEGORIES= devel
+MASTER_SITES= http://kt-www.jaist.ac.jp:8000/~ttate/ftp/
+
+MAINTAINER= taca@netbsd.org
+HOMEPAGE= # none
+COMMENT= Parser generator for ruby based on 'Berkeley Yacc/Yacc for Java'
+
+DIST_SUBDIR= ruby
+USE_RUBY= yes
+
+EXAMPLES= Makefile cal.y calfunc.rb main.rb
+
+post-install:
+ ${INSTALL_DATA_DIR} ${RUBY_EXAMPLESDIR}/byaccr
+.for f in ${EXAMPLES}
+ ${INSTALL_DATA} ${WRKSRC}/sample/${f} ${RUBY_EXAMPLESDIR}/byaccr
+.endfor
+
+.include "../../lang/ruby-base/Makefile.common"
+.include "../../mk/bsd.pkg.mk"
diff --git a/devel/ruby-byaccr/distinfo b/devel/ruby-byaccr/distinfo
new file mode 100644
index 00000000000..402ce4d727b
--- /dev/null
+++ b/devel/ruby-byaccr/distinfo
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+
+SHA1 (ruby/byaccr-0.1.tar.gz) = a4971742083d2570bb630908d0b15010af134e9f
+Size (ruby/byaccr-0.1.tar.gz) = 34786 bytes
+SHA1 (patch-aa) = c096eafa8cf381c3c275e89c8127e2688f7bd37e
+SHA1 (patch-ab) = f21e616d460f84b294d33e005243ecd2bfa12440
+SHA1 (patch-ac) = d76cbfd9367961604f4bb8fefe71625860fdfc00
+SHA1 (patch-ad) = 858e40ceef10f208438517aa24586e43db5e3bd1
+SHA1 (patch-ae) = 34a62d838dc36392e0cf3e014b7721c03f1d3f0b
+SHA1 (patch-af) = 3b2dc22bff3c712a908c23eaa86220007ebcd540
+SHA1 (patch-ag) = 5f3614bcc154a586eef3d045160fe8f101883ab3
diff --git a/devel/ruby-byaccr/patches/patch-aa b/devel/ruby-byaccr/patches/patch-aa
new file mode 100644
index 00000000000..8e4d2efabe2
--- /dev/null
+++ b/devel/ruby-byaccr/patches/patch-aa
@@ -0,0 +1,62 @@
+$NetBSD: patch-aa,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+
+--- Makefile.orig Wed Nov 1 23:03:49 2000
++++ Makefile
+@@ -1,51 +1,8 @@
+-CC = gcc
+-CFLAGS = -O
+-PROGRAM = byaccr
+-OBJ = closure.o \
+- error.o \
+- lalr.o \
+- lr0.o \
+- main.o \
+- mkpar.o \
+- output.o \
+- reader.o \
+- skeleton.o \
+- symtab.o \
+- verbose.o \
+- warshall.o
++PROG= byaccr
++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
+
+-all: $(PROGRAM)
++BINDIR= ${LOCALBASE}/bin
++MKMAN= no
+
+-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
+-
+-$(PROGRAM): $(OBJ)
+- $(CC) -o $(PROGRAM) $(OBJ)
+- @echo "done"
+-
+-clean:
+- /bin/rm -rf $(OBJ) *~
+-
+-###
+-closure.o: closure.c defs.h
+-error.o: error.c defs.h
+-lalr.o: lalr.c defs.h
+-lr0.o: lr0.c defs.h
+-main.o: main.c defs.h
+-mkpar.o: mkpar.c defs.h
+-output.o: output.c defs.h
+-reader.o: reader.c defs.h
+-skeleton.o: skeleton.c defs.h
+-symtab.o: symtab.c defs.h
+-verbose.o: verbose.c defs.h
+-warshall.o: warshall.c defs.h
++.include <bsd.prog.mk>
diff --git a/devel/ruby-byaccr/patches/patch-ab b/devel/ruby-byaccr/patches/patch-ab
new file mode 100644
index 00000000000..993408293ff
--- /dev/null
+++ b/devel/ruby-byaccr/patches/patch-ab
@@ -0,0 +1,38 @@
+$NetBSD: patch-ab,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+
+--- defs.h.orig Thu Nov 2 01:29:07 2000
++++ defs.h
+@@ -6,7 +6,8 @@
+ #include <ctype.h>
+ #include <stdio.h>
+ #include <malloc.h>
+-
++#include <unistd.h>
++#include <unistd.h>
+
+
+ /* machine-dependent definitions */
+@@ -241,8 +242,8 @@
+ extern int ntags;
+
+ extern char unionized;
+-extern char line_format[];
+-extern char jline_format[];/*rwj*/
++extern const char *line_format;
++extern const char *jline_format;/*rwj*/
+
+ extern int start_symbol;
+ extern char **symbol_name;
+@@ -290,8 +291,11 @@
+
+ /* system variables */
+
++#ifdef NEED_ERRNO
+ extern int errno;
+-
++#else
++#include <errno.h>
++#endif
+
+ /************************
+ ## PROTOTYPES
diff --git a/devel/ruby-byaccr/patches/patch-ac b/devel/ruby-byaccr/patches/patch-ac
new file mode 100644
index 00000000000..28ee577b0c1
--- /dev/null
+++ b/devel/ruby-byaccr/patches/patch-ac
@@ -0,0 +1,14 @@
+$NetBSD: patch-ac,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+
+--- lr0.c.orig Thu Nov 2 01:29:07 2000
++++ lr0.c
+@@ -12,9 +12,6 @@
+ shifts *first_shift;
+ reductions *first_reduction;
+
+-int get_state();
+-core *new_state();
+-
+ static core **state_set;
+ static core *this_state;
+ static core *last_state;
diff --git a/devel/ruby-byaccr/patches/patch-ad b/devel/ruby-byaccr/patches/patch-ad
new file mode 100644
index 00000000000..0d1864c16db
--- /dev/null
+++ b/devel/ruby-byaccr/patches/patch-ad
@@ -0,0 +1,70 @@
+$NetBSD: patch-ad,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+
+--- main.c.orig Thu Nov 2 01:29:07 2000
++++ main.c
+@@ -307,9 +307,11 @@
+ text_file_name[len + 5] = 't';
+ union_file_name[len + 5] = 'u';
+
++#ifdef WITHOUT_MKSTEMP
+ mktemp(action_file_name);
+ mktemp(text_file_name);
+ mktemp(union_file_name);
++#endif
+
+ if (jflag)/*rwj*/
+ {
+@@ -363,6 +365,9 @@
+
+ void open_files(void)
+ {
++#ifndef WITHOUT_MKSTEMP
++ int fd;
++#endif
+ create_file_names();
+
+ if (input_file == 0)
+@@ -372,11 +377,25 @@
+ open_error(input_file_name);
+ }
+
+- action_file = fopen(action_file_name, "w");
++#ifdef WITHOUT_MKSTEMP
++ action_file = fopen(action_file_name, "w+");
++#else
++ action_file = NULL;
++ fd = mkstemp(action_file_name);
++ if (fd >= 0)
++ action_file = fdopen(fd, "w");
++#endif
+ if (action_file == 0)
+ open_error(action_file_name);
+
+- text_file = fopen(text_file_name, "w");
++#ifdef WITHOUT_MKSTEMP
++ text_file = fopen(text_file_name, "w+");
++#else
++ text_file = NULL;
++ fd = mkstemp(text_file_name);
++ if (fd >= 0)
++ action_file = fdopen(fd, "w");
++#endif
+ if (text_file == 0)
+ open_error(text_file_name);
+
+@@ -392,7 +411,14 @@
+ defines_file = fopen(defines_file_name, "w");
+ if (defines_file == 0)
+ open_error(defines_file_name);
+- union_file = fopen(union_file_name, "w");
++#ifdef WITHOUT_MKSTEMP
++ union_file = fopen(union_file_name, "w+");
++#else
++ union_file = NULL;
++ fd = mkstemp(union_file_name);
++ if (fd >= 0)
++ union_file = fdopen(fd, "w");
++#endif
+ if (union_file == 0)
+ open_error(union_file_name);
+ }
diff --git a/devel/ruby-byaccr/patches/patch-ae b/devel/ruby-byaccr/patches/patch-ae
new file mode 100644
index 00000000000..119bed55acd
--- /dev/null
+++ b/devel/ruby-byaccr/patches/patch-ae
@@ -0,0 +1,32 @@
+$NetBSD: patch-ae,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+
+--- mkpar.c.orig Thu Nov 2 01:29:07 2000
++++ mkpar.c
+@@ -16,12 +16,6 @@
+ static int SRcount;
+ static int RRcount;
+
+-extern action *parse_actions();
+-extern action *get_shifts();
+-extern action *add_reductions();
+-extern action *add_reduce();
+-
+-
+ void make_parser(void)
+ {
+ int i;
+@@ -174,11 +168,12 @@
+ for (i = 3; i < nrules; ++i)
+ if (!rules_used[i]) ++nunused;
+
+- if (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);
++ fprintf(stderr, "%s: %d rules never reduced\n", myname, nunused);
++ }
+ }
+
+
diff --git a/devel/ruby-byaccr/patches/patch-af b/devel/ruby-byaccr/patches/patch-af
new file mode 100644
index 00000000000..5d06125f5b5
--- /dev/null
+++ b/devel/ruby-byaccr/patches/patch-af
@@ -0,0 +1,120 @@
+$NetBSD: patch-af,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+
+--- output.c.orig Tue Nov 14 17:42:19 2000
++++ output.c
+@@ -834,9 +834,7 @@
+ s = symbol_name[i];
+ if (is_C_identifier(s))
+ {
+- if (jflag) /*rwj*/
+- fprintf(code_file, "");
+- else
++ if (!jflag) /*rwj*/
+ fprintf(code_file, "#define ");
+ if (dflag) fprintf(defines_file, "#define ");
+ c = *s;
+@@ -876,8 +874,17 @@
+
+ if (dflag && unionized)
+ {
++#ifdef WITHOUT_MKSTEMP
+ fclose(union_file);
+ union_file = fopen(union_file_name, "r");
++#else
++ if (fflush(union_file) == 0)
++ rewind(union_file);
++ else {
++ fclose(union_file);
++ union_file = NULL;
++ }
++#endif
+ if (union_file == NULL) open_error(union_file_name);
+ while ((c = getc(union_file)) != EOF)
+ putc(c, defines_file);
+@@ -891,8 +898,17 @@
+ int c;
+ FILE *in, *out;
+
++#ifdef WITHOUT_MKSTEMP
+ fclose(text_file);
+ text_file = fopen(text_file_name, "r");
++#else
++ if (fflush(text_file) == 0)
++ rewind(text_file);
++ else {
++ fclose(text_file);
++ text_file = NULL;
++ }
++#endif
+ if (text_file == NULL)
+ open_error(text_file_name);
+ in = text_file;
+@@ -908,11 +924,12 @@
+ ++outline;
+ putc(c, out);
+ }
+- if (!lflag)
++ if (!lflag) {
+ if (jflag)/*rwj*/
+ fprintf(out, jline_format, ++outline + 1, code_file_name);
+ else
+ fprintf(out, line_format, ++outline + 1, code_file_name);
++ }
+ }
+
+
+@@ -1191,8 +1208,6 @@
+ void output_stype(void)
+ {
+ int prim; /*is the Ruby semantic type a primitive?*/
+-char filenam[128];
+-FILE *f;
+ if (jflag){ /*rwj*/
+ prim=0;
+ fprintf(code_file,"\n\n");
+@@ -1313,11 +1328,12 @@
+ ++outline;
+ putc('\n', out);
+ }
+- if (!lflag)
++ if (!lflag) {
+ if (jflag)
+ fprintf(out, jline_format, ++outline + 1, code_file_name);
+ else
+ fprintf(out, line_format, ++outline + 1, code_file_name);
++ }
+ }
+
+
+@@ -1326,8 +1342,17 @@
+ int c, last;
+ FILE *out;
+
++#ifdef WITHOUT_MKSTEMP
+ fclose(action_file);
+ action_file = fopen(action_file_name, "r");
++#else
++ if (fflush(action_file) == 0)
++ rewind(action_file);
++ else {
++ fclose(action_file);
++ action_file = NULL;
++ }
++#endif
+ if (action_file == NULL)
+ open_error(action_file_name);
+
+@@ -1353,11 +1378,12 @@
+ putc('\n', out);
+ }
+
+- if (!lflag)
++ if (!lflag) {
+ if (jflag)/*rwj*/
+ fprintf(out, jline_format, ++outline + 1, code_file_name);
+ else
+ fprintf(out, line_format, ++outline + 1, code_file_name);
++ }
+ }
+
+ void free_itemsets(void)
diff --git a/devel/ruby-byaccr/patches/patch-ag b/devel/ruby-byaccr/patches/patch-ag
new file mode 100644
index 00000000000..d5e20652d4c
--- /dev/null
+++ b/devel/ruby-byaccr/patches/patch-ag
@@ -0,0 +1,60 @@
+$NetBSD: patch-ag,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+
+--- reader.c.orig Thu Nov 2 01:29:07 2000
++++ reader.c
+@@ -35,8 +35,8 @@
+ int name_pool_size;
+ char *name_pool;
+
+-char line_format[] = "#line %d \"%s\"\n";
+-char jline_format[] = "#line %d \"%s\"\n";
++const char *line_format = "#line %d \"%s\"\n";
++const char *jline_format = "#line %d \"%s\"\n";
+
+
+ void cachec(int c)
+@@ -315,11 +315,12 @@
+ if (line == 0)
+ unterminated_text(t_lineno, t_line, t_cptr);
+ }
+- if (!lflag)/*rwj*/
++ if (!lflag) { /*rwj*/
+ if (jflag)
+ fprintf(f, jline_format, lineno, input_file_name);
+ else
+ fprintf(f, line_format, lineno, input_file_name);
++ }
+
+ loop:
+ c = *cptr++;
+@@ -446,11 +447,12 @@
+ if (unionized) over_unionized(cptr - 6);
+ unionized = 1;
+
+- if (!lflag)
++ if (!lflag) {
+ if (jflag)
+ fprintf(text_file, jline_format, lineno, input_file_name);
+ else
+ fprintf(text_file, line_format, lineno, input_file_name);
++ }
+
+ fprintf(text_file, "typedef union");
+ if (dflag) fprintf(union_file, "typedef union");
+@@ -1190,7 +1192,7 @@
+ insert_empty_rule();
+ last_was_action = 1;
+
+- if (!lflag)/*rwj*/
++ if (!lflag)/*rwj*/ {
+ if (jflag){
+ fprintf(f, "when %d\n", nrules - 2);
+ fprintf(f, jline_format, lineno, input_file_name);
+@@ -1199,6 +1201,7 @@
+ fprintf(f, "%d:\n", nrules - 2);
+ fprintf(f, line_format, lineno, input_file_name);
+ };
++ }
+
+ if (*cptr == '=') ++cptr;
+
diff --git a/devel/ruby-byaccr/pkg/DESCR b/devel/ruby-byaccr/pkg/DESCR
new file mode 100644
index 00000000000..8d9e4145208
--- /dev/null
+++ b/devel/ruby-byaccr/pkg/DESCR
@@ -0,0 +1,4 @@
+byaccr is a parser generator for ruby based on 'Berkeley Yacc' and
+'Berkeley Yacc for Java'.
+
+Author: Takaaki Tateishi <ttate@jaist.ac.jp>
diff --git a/devel/ruby-byaccr/pkg/PLIST b/devel/ruby-byaccr/pkg/PLIST
new file mode 100644
index 00000000000..da138813141
--- /dev/null
+++ b/devel/ruby-byaccr/pkg/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2001/07/01 14:39:15 taca Exp $
+bin/byaccr
+${RUBY_EXAMPLESDIR}/byaccr/Makefile
+${RUBY_EXAMPLESDIR}/byaccr/cal.y
+${RUBY_EXAMPLESDIR}/byaccr/calfunc.rb
+${RUBY_EXAMPLESDIR}/byaccr/main.rb
+@dirrm ${RUBY_EXAMPLESDIR}/byaccr