summaryrefslogtreecommitdiff
path: root/devel/asdlgen
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2008-05-24 06:39:32 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2008-05-24 06:39:32 +0000
commit6ec7d6368c2a82af02f18dc07211e0bc95b9e84d (patch)
tree24ee203adaab1205c9d18542ea6286ff9b3f4dd4 /devel/asdlgen
parent[maintainer update] Upgrade to sysutils/AFFLIB 3.2.0 (diff)
New port: devel/asdlgen generate serializers for C,C++,Haskell,Icon,Java,ML
asdlGen generates data structure and serializer code from ASDL specifications [1]. It is especially helpful for exchanging tree like data structures between different programming languages. Currently C, C++, Haskell, Java, Icon, OCaml and SML are supported. Although the asdlGen project itself seems no longer actively maintained, ASDL is "alive" as it is used (at least) in the Moby [2] and Python [3,4] compilers. The port optionally installs a simple usage example [5] for all seven programming languages. I developed it primarily to test the port, but it could be helpful to users of asdlGen to get a quicker start, especially if a less familiar programming language is involved in their project. Reviewers/committers can easily make use of it via the "test-demo" target. PR: ports/117703 Submitted by: Johannes 5 Joemann <joemann@beefree.free.de>
Notes
Notes: svn path=/head/; revision=213586
Diffstat (limited to 'devel/asdlgen')
-rw-r--r--devel/asdlgen/Makefile123
-rw-r--r--devel/asdlgen/distinfo6
-rw-r--r--devel/asdlgen/files/patch-Makefile.in20
-rw-r--r--devel/asdlgen/files/patch-README.sgml19
-rw-r--r--devel/asdlgen/files/patch-configure11
-rw-r--r--devel/asdlgen/files/patch-src_haskell_SexpLex.hs10
-rw-r--r--devel/asdlgen/files/patch-src_haskell_StdPkl.hs31
-rw-r--r--devel/asdlgen/files/patch-src_haskell_StdPrimsUtil.hs13
-rw-r--r--devel/asdlgen/files/patch-src_icon_libasdl.icn27
-rw-r--r--devel/asdlgen/files/patch-src_java_asts_stdpkl_PklJava.java8
-rw-r--r--devel/asdlgen/files/patch-src_java_asts_stdpkl_g.java8
-rw-r--r--devel/asdlgen/files/patch-src_java_asts_stdprims_g.java28
-rw-r--r--devel/asdlgen/files/patch-src_java_asts_stdprims_identifier.java8
-rw-r--r--devel/asdlgen/files/patch-src_java_asts_stdtypes_g.java9
-rw-r--r--devel/asdlgen/files/patch-src_misc_sml-batch.in19
-rw-r--r--devel/asdlgen/files/patch-src_sml_main_export.sml11
-rw-r--r--devel/asdlgen/files/patch-src_sml_main_lib-files.sml36
-rw-r--r--devel/asdlgen/files/patch-src_sml_test_harness.sml42
-rw-r--r--devel/asdlgen/files/patch-src_sml_translate_oo_java-pp.sml36
-rw-r--r--devel/asdlgen/files/patch-src_sml_translate_support_idmaps.sml36
-rw-r--r--devel/asdlgen/files/patch-src_sml_translate_support_mk-file-set.sml21
-rw-r--r--devel/asdlgen/files/patch-src_sml_util_misc_file-set.sml31
-rw-r--r--devel/asdlgen/pkg-descr11
-rw-r--r--devel/asdlgen/pkg-plist115
24 files changed, 679 insertions, 0 deletions
diff --git a/devel/asdlgen/Makefile b/devel/asdlgen/Makefile
new file mode 100644
index 000000000000..bcf5b6871ab8
--- /dev/null
+++ b/devel/asdlgen/Makefile
@@ -0,0 +1,123 @@
+# New ports collection makefile for: asdlgen
+# Date created: 5 October 2007
+# Whom: Johannes 5 Joemann <joemann@beefree.free.de>
+#
+# $FreeBSD$
+#
+
+PORTNAME= asdlgen
+PORTVERSION= 2.0.b20060323
+CATEGORIES= devel haskell java
+MASTER_SITES= http://moby.cs.uchicago.edu/downloads/ \
+ ftp://mirror.free.de/http/moby.cs.uchicago.edu/downloads/
+DISTNAME= asdlGen
+
+MAINTAINER= joemann@beefree.free.de
+COMMENT= Interoperable serializers for C,C++,Haskell,Icon,Java,ML
+
+BUILD_DEPENDS= smlnj-devel>=110.65:${PORTSDIR}/lang/sml-nj-devel
+.if !defined(NOPORTDOCS)
+BUILD_DEPENDS+= sgmlfmt:${PORTSDIR}/textproc/sgmlformat
+.endif
+
+USE_DOS2UNIX= src/icon/libasdl.icn
+
+OPTIONS= CII "Install libcii for use by generated C and C++ code" on \
+ EXAMPLES "Install the simple 'arithexp' usage example" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_CII)
+RUN_DEPENDS+= libcii>=1.1:${PORTSDIR}/devel/libcii
+.endif
+
+.if defined(WITH_EXAMPLES)
+DEMOVERSION= 20071030
+DEMOARCHIVE= asdlgen-demo.${DEMOVERSION}.tar.gz
+DEMODIR= arithexp
+MASTER_SITES+= ftp://offshore.free.de/pub/dist/FreeBSD/ports/devel/:demo
+DISTFILES+= ${DEMOARCHIVE}:demo
+PLIST_SUB+= EXAMPLES="" DEMODIR=${DEMODIR}
+.else
+PLIST_SUB+= EXAMPLES="@comment " DEMODIR=${DEMODIR}
+.endif
+
+WRKSRC= ${WRKDIR}/asdlGen
+HAS_CONFIGURE= yes
+CONFIGURE_ENV+= SMLNJ_DEVEL=yes
+ALL_TARGET= build
+MAKE_ENV+= SMLNJ_DEVEL=yes
+
+# Nowadays Java package names must be all lowercase, says JDK1.5. Cf.
+# http://java.sun.com/docs/books/tutorial/java/package/namingpkgs.html
+pre-patch:
+.for dir in StdPkl StdPrims StdTypes
+ cd ${WRKSRC}/src/java/asts && [ -d ${dir} ] && ${MV} ${dir} ${dir:L}
+.endfor
+
+post-build:
+ cd ${WRKSRC}/src/sml && heap2exec asdlGen.*-bsd asdlGen
+.if !defined(NOPORTDOCS)
+.for format in ascii html ps
+ @${MKDIR} ${WRKSRC}/doc-build/README
+ cd ${WRKSRC}/doc-build/README && \
+ sgmlfmt -f ${format} ${WRKSRC}/README.sgml
+ @${MKDIR} ${WRKSRC}/doc-build/manual
+ cd ${WRKSRC}/doc-build/manual && \
+ sgmlfmt -f ${format} ${WRKSRC}/src/doc/manual.sgml
+.endfor
+.endif
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/src/sml/asdlGen ${PREFIX}/bin
+ @${MKDIR} ${EXAMPLESDIR}
+ cd ${WRKSRC}/src/asdl/tests && ${COPYTREE_SHARE} \* ${EXAMPLESDIR}
+ ${INSTALL_DATA} -p ${WRKSRC}/src/asdl/std-types.asdl ${EXAMPLESDIR}
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ ${INSTALL_MAN} -p ${WRKSRC}/COPYRIGHT ${DOCSDIR}
+ cd ${WRKSRC}/doc-build && ${COPYTREE_SHARE} \* ${DOCSDIR}
+.endif
+.if defined(WITH_EXAMPLES)
+ cd ${WRKDIR}/${DEMODIR} && ${MAKE} clean
+ cd ${WRKDIR} && ${COPYTREE_SHARE} ${DEMODIR} ${EXAMPLESDIR}
+.endif
+
+# The following test-* targets are used for maintaining this port but
+# might be interesting for users exploring different target languages.
+
+.ifmake test-compile || test-demo
+BUILD_DEPENDS+= libcii>=1.1:${PORTSDIR}/devel/libcii \
+ hugs:${PORTSDIR}/lang/hugs \
+ icont:${PORTSDIR}/lang/icon \
+ javac:${PORTSDIR}/java/diablo-jdk15 \
+ ocaml:${PORTSDIR}/lang/ocaml
+
+.ifmake test-compile
+# This target runs the generate+compile tests from the asdlGen distribution
+# for all supported languages. The "Test" structure is defined in
+# ${WRKSRC}/src/sml/test/harness.sml .
+test-compile: depends clean-depends build
+.if defined(WITH_CII)
+ cd ${WRKSRC}/src/sml && export SMLNJ_DEVEL=yes && \
+ ${ECHO_CMD} "Test.do_it ();" | sml -m sources.cm
+.else
+ @${ECHO_CMD} "You have to set the CII option (make config)"
+ @${ECHO_CMD} "before you can use the test-compile target."
+ @exit 1
+.endif
+.endif
+
+.ifmake test-demo
+test-demo: clean depends clean-depends build
+.if defined(WITH_CII) && defined(WITH_EXAMPLES)
+ cd ${WRKDIR}/${DEMODIR} && ${MAKE} ASDLGEN=${WRKSRC}/src/sml/asdlGen
+.else
+ @${ECHO_CMD} "You have to set the CII and EXAMPLES options"
+ @${ECHO_CMD} "(make config) before you can use the test-demo target."
+ @exit 1
+.endif
+.endif
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/devel/asdlgen/distinfo b/devel/asdlgen/distinfo
new file mode 100644
index 000000000000..e2a8582e40f3
--- /dev/null
+++ b/devel/asdlgen/distinfo
@@ -0,0 +1,6 @@
+MD5 (asdlGen.tar.gz) = e61e9b1c2cfb3b22a1d0008c7b54c8e0
+SHA256 (asdlGen.tar.gz) = d833ad73aa16259422f42d8c80fe58cd7b9809e875a5a568237250c3332aa020
+SIZE (asdlGen.tar.gz) = 409079
+MD5 (asdlgen-demo.20071030.tar.gz) = fe10aaf4399f3b1093f1ed797be08653
+SHA256 (asdlgen-demo.20071030.tar.gz) = 525618e13871dca6aca808edbd1ba3cb3e3997a1ab0ab9397c0bfb337b68caa5
+SIZE (asdlgen-demo.20071030.tar.gz) = 5934
diff --git a/devel/asdlgen/files/patch-Makefile.in b/devel/asdlgen/files/patch-Makefile.in
new file mode 100644
index 000000000000..ae2b2200ee4b
--- /dev/null
+++ b/devel/asdlgen/files/patch-Makefile.in
@@ -0,0 +1,20 @@
+--- Makefile.in.orig Thu Mar 23 17:06:31 2006
++++ Makefile.in Tue Sep 11 08:56:38 2007
+@@ -8,7 +8,7 @@
+ INSTALL_BINDIR = $(PREFIX)/bin
+ INSTALL_HEAPDIR = $(INSTALL_BINDIR)/.heap
+ INSTALL_WRAPPER = @top_srcdir@/bin/install-sml-wrapper.sh
+-SML = @SMLNJ_CMD@
++SML = @SMLNJ@
+ ML_BUILD = @ML_BUILD@
+
+ PROGRAM = asdlGen
+@@ -20,7 +20,7 @@
+
+ INSTALL=@INSTALL@
+
+-build: $(TARGET)
++build: $(HEAP)
+
+ $(HEAP):
+ (cd $(SRCDIR); \
diff --git a/devel/asdlgen/files/patch-README.sgml b/devel/asdlgen/files/patch-README.sgml
new file mode 100644
index 000000000000..1d34031587c4
--- /dev/null
+++ b/devel/asdlgen/files/patch-README.sgml
@@ -0,0 +1,19 @@
+--- README.sgml.orig 2000-02-10 21:02:02.000000000 +0100
++++ README.sgml 2007-09-28 18:48:26.000000000 +0200
+@@ -77,13 +77,13 @@
+ &asdlGen; tacks this on to any set of input files to remain compatible with
+ existing code. Users, can add their own primitive types by simply including
+ there own primitive module declaration. See
+-<htmlurl url="src/asdl/std-types.asdl" name="src/asdl/std-types.asdl">
++<htmlurl url="../../../examples/asdlgen/std-types.asdl" name="std-types.asdl">
+ for an example that defines a richer set fix width integer and word types,
+ for various languages.
+ <item> Support for an unnamed "Toplevel" module. Allowing one to generate less
+ verbose code for pedagogical purposes. See
+-<htmlurl url="src/asdl/tests/toplevel.asdl"
+-name="src/asdl/tests/toplevel.asdl"> for an example usage.
++<htmlurl url="../../../examples/asdlgen/toplevel.asdl"
++name="toplevel.asdl"> for an example usage.
+ </itemize>
+
+ <sect>COPYRIGHT<p>
diff --git a/devel/asdlgen/files/patch-configure b/devel/asdlgen/files/patch-configure
new file mode 100644
index 000000000000..335cebeff314
--- /dev/null
+++ b/devel/asdlgen/files/patch-configure
@@ -0,0 +1,11 @@
+--- configure.orig Thu Mar 23 16:55:38 2006
++++ configure Tue Sep 11 08:39:10 2007
+@@ -1328,7 +1328,7 @@
+
+
+ if test z$SMLNJ = z ; then
+- for ac_prog in sml-cm sml sml.bat
++ for ac_prog in sml
+ do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+ set dummy $ac_prog; ac_word=$2
diff --git a/devel/asdlgen/files/patch-src_haskell_SexpLex.hs b/devel/asdlgen/files/patch-src_haskell_SexpLex.hs
new file mode 100644
index 000000000000..5f009e44039f
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_haskell_SexpLex.hs
@@ -0,0 +1,10 @@
+--- src/haskell/SexpLex.hs.orig 1999-08-10 20:05:41.000000000 +0200
++++ src/haskell/SexpLex.hs 2007-10-01 14:24:55.000000000 +0200
+@@ -1,5 +1,7 @@
+ module SexpLex(Tok(..),scan,toString,) where
+
++import Data.Char
++
+ data Tok =
+ LP | RP
+ | INT Int
diff --git a/devel/asdlgen/files/patch-src_haskell_StdPkl.hs b/devel/asdlgen/files/patch-src_haskell_StdPkl.hs
new file mode 100644
index 000000000000..dfac116a0c3f
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_haskell_StdPkl.hs
@@ -0,0 +1,31 @@
+--- src/haskell/StdPkl.hs.orig 1999-09-13 00:27:00.000000000 +0200
++++ src/haskell/StdPkl.hs 2007-10-01 12:43:41.000000000 +0200
+@@ -50,9 +50,9 @@
+ write_integral :: Integral a => a -> Handle -> IO ()
+ write_integral n s = loop (abs n)
+ where
+- loop x | x <= 63 = hPutChar s (chr (toInt(finish (n<0) x)))
++ loop x | x <= 63 = hPutChar s (chr (fromIntegral(finish (n<0) x)))
+ | otherwise = do
+- hPutChar s (chr (toInt(nibble x)))
++ hPutChar s (chr (fromIntegral(nibble x)))
+ loop (x `shiftr` 7)
+ nibble n = ((n `andb` 0x7f) `orb` 0x80) `andb` 0xff
+ finish False n = n `andb` 255
+@@ -63,14 +63,14 @@
+ read_integral s
+ = do {
+ c <- hGetChar s;
+- loop (fromInt (ord c)) 0 0
++ loop (fromIntegral (ord c)) 0 0
+ }
+ where
+ loop n acc shift =
+ if (continue_bit_set n) then
+ do {
+ c <- hGetChar s;
+- loop (fromInt(ord c) `andb` 255)
++ loop (fromIntegral(ord c) `andb` 255)
+ (acc `orb` ((n `andb` 0x7f) `shiftl` shift))
+ (shift+7)
+ }
diff --git a/devel/asdlgen/files/patch-src_haskell_StdPrimsUtil.hs b/devel/asdlgen/files/patch-src_haskell_StdPrimsUtil.hs
new file mode 100644
index 000000000000..4e7fa5b097fe
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_haskell_StdPrimsUtil.hs
@@ -0,0 +1,13 @@
+--- src/haskell/StdPrimsUtil.hs.orig 1999-09-13 00:27:01.000000000 +0200
++++ src/haskell/StdPrimsUtil.hs 2007-10-04 21:22:09.000000000 +0200
+@@ -81,8 +81,8 @@
+
+ sexp_rd_identifier s = do t <- get_prim "identifier" s
+ (case t of
+- SexpLex.STR str -> return str
+- _ -> error "expected identifier")
++ SexpLex.STR str -> return str
++ _ -> error "expected identifier")
+
+
+
diff --git a/devel/asdlgen/files/patch-src_icon_libasdl.icn b/devel/asdlgen/files/patch-src_icon_libasdl.icn
new file mode 100644
index 000000000000..1e9afc1e8463
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_icon_libasdl.icn
@@ -0,0 +1,27 @@
+--- src/icon/libasdl.icn.orig 1999-05-22 00:39:15.000000000 +0200
++++ src/icon/libasdl.icn 2007-10-19 23:53:57.000000000 +0200
+@@ -29,6 +29,7 @@
+ t := abs(i)
+ while t > 63 do {
+ b := iand(t, 127)
++ b := ior(b, 128)
+ writes(f, char(b))
+ t := ishift(t, -7)
+ }
+@@ -36,7 +37,6 @@
+ if i < 0 then {
+ b := ior(t, 64)
+ }
+- b := ior(b, 128)
+ writes(f, char(b))
+ end
+
+@@ -46,7 +46,7 @@
+ v := 0
+ repeat {
+ b := ord(reads(f)) | runerr(500)
+- if iand(b, 128) ~= 0 then {
++ if iand(b, 128) = 0 then {
+ s := iand(b, 64)
+ b := iand(b, 63)
+ v := ior(b, ishift(v, 6))
diff --git a/devel/asdlgen/files/patch-src_java_asts_stdpkl_PklJava.java b/devel/asdlgen/files/patch-src_java_asts_stdpkl_PklJava.java
new file mode 100644
index 000000000000..80017ae532cf
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_java_asts_stdpkl_PklJava.java
@@ -0,0 +1,8 @@
+--- src/java/asts/stdpkl/PklJava.java.orig 1999-09-13 00:27:01.000000000 +0200
++++ src/java/asts/stdpkl/PklJava.java 2007-10-11 19:12:08.000000000 +0200
+@@ -1,4 +1,4 @@
+-package asts.StdPkl;
++package asts.stdpkl;
+ import java.io.*;
+ import java.math.BigInteger;
+
diff --git a/devel/asdlgen/files/patch-src_java_asts_stdpkl_g.java b/devel/asdlgen/files/patch-src_java_asts_stdpkl_g.java
new file mode 100644
index 000000000000..0a6abeb8c412
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_java_asts_stdpkl_g.java
@@ -0,0 +1,8 @@
+--- src/java/asts/stdpkl/g.java.orig 1999-09-13 00:27:02.000000000 +0200
++++ src/java/asts/stdpkl/g.java 2007-10-11 19:12:08.000000000 +0200
+@@ -1,4 +1,4 @@
+-package asts.StdPkl;
++package asts.stdpkl;
+ final public class g extends PklJava {
+ public static void write_tag (int x, java.io.OutputStream s) {
+ PklJava.write_java_int(x,s);
diff --git a/devel/asdlgen/files/patch-src_java_asts_stdprims_g.java b/devel/asdlgen/files/patch-src_java_asts_stdprims_g.java
new file mode 100644
index 000000000000..eaf2ccb28665
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_java_asts_stdprims_g.java
@@ -0,0 +1,28 @@
+--- src/java/asts/stdprims/g.java.orig 1999-09-13 00:27:02.000000000 +0200
++++ src/java/asts/stdprims/g.java 2007-10-11 19:12:08.000000000 +0200
+@@ -1,13 +1,13 @@
+-package asts.StdPrims;
++package asts.stdprims;
+ import java.io.*;
+
+-final public class g extends asts.StdPkl.PklJava {
++final public class g extends asts.stdpkl.PklJava {
+
+ public static void write_java_lang_String(String x,OutputStream s) {
+ int sz = x.length();
+ int i = 0;
+ try {
+- asts.StdPkl.g.write_tag(sz,s);
++ asts.stdpkl.g.write_tag(sz,s);
+ while(i < sz) {
+ s.write((byte)x.charAt(i++));
+ }
+@@ -17,7 +17,7 @@
+ }
+
+ public static String read_java_lang_String(InputStream s) {
+- int sz = asts.StdPkl.g.read_tag(s);
++ int sz = asts.stdpkl.g.read_tag(s);
+ StringBuffer sb = new StringBuffer(sz);
+ try {
+ while(sz > 0) {
diff --git a/devel/asdlgen/files/patch-src_java_asts_stdprims_identifier.java b/devel/asdlgen/files/patch-src_java_asts_stdprims_identifier.java
new file mode 100644
index 000000000000..61abe2e9d343
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_java_asts_stdprims_identifier.java
@@ -0,0 +1,8 @@
+--- src/java/asts/stdprims/identifier.java.orig 1999-05-31 21:21:29.000000000 +0200
++++ src/java/asts/stdprims/identifier.java 2007-10-11 19:12:08.000000000 +0200
+@@ -1,4 +1,4 @@
+-package asts.StdPrims;
++package asts.stdprims;
+
+ public class identifier {
+ private identifier() {}
diff --git a/devel/asdlgen/files/patch-src_java_asts_stdtypes_g.java b/devel/asdlgen/files/patch-src_java_asts_stdtypes_g.java
new file mode 100644
index 000000000000..6aabd014436d
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_java_asts_stdtypes_g.java
@@ -0,0 +1,9 @@
+--- src/java/asts/stdtypes/g.java.orig 1999-09-13 00:27:04.000000000 +0200
++++ src/java/asts/stdtypes/g.java 2007-10-11 19:13:53.000000000 +0200
+@@ -1,4 +1,4 @@
+-package asts.StdTypes;
+-final public class g extends asts.StdPkl.PklJava {
++package asts.stdtypes;
++final public class g extends asts.stdpkl.PklJava {
+ // inherit methods from PklJava
+ }
diff --git a/devel/asdlgen/files/patch-src_misc_sml-batch.in b/devel/asdlgen/files/patch-src_misc_sml-batch.in
new file mode 100644
index 000000000000..636bb6fe96df
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_misc_sml-batch.in
@@ -0,0 +1,19 @@
+--- src/misc/sml-batch.in.orig 2001-10-02 16:20:32.000000000 +0200
++++ src/misc/sml-batch.in 2007-10-04 23:56:09.000000000 +0200
+@@ -3,12 +3,15 @@
+ cmfile=sources-$$.cm
+ cat > ${cmfile} <<EOF
+ Group is
++\$/basis.cm
+ $@
+ EOF
+ @SMLNJ@ <<EOF
++(*
+ val path = String.tokens (fn x => x = #":") "${cmpath}";
+ CM.set_path (SOME (path@(CM.set_path NONE)));
+-((CM.make' ("${cmfile}") handle _ => OS.Process.exit OS.Process.failure);
++*)
++((CM.make ("${cmfile}") handle _ => OS.Process.exit OS.Process.failure);
+ OS.Process.exit OS.Process.success; ())
+ EOF
+ ret=$?
diff --git a/devel/asdlgen/files/patch-src_sml_main_export.sml b/devel/asdlgen/files/patch-src_sml_main_export.sml
new file mode 100644
index 000000000000..1031ce24e90b
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_sml_main_export.sml
@@ -0,0 +1,11 @@
+--- src/sml/main/export.sml.orig 2000-01-14 03:02:38.000000000 +0100
++++ src/sml/main/export.sml 2007-10-27 18:26:21.000000000 +0200
+@@ -81,7 +81,7 @@
+
+ fun asdlGen (name,args) =
+ (run_it (name,args);OS.Process.success) handle e =>
+- (Error.say ("Error: "^(exnMessage e)^"\n");
++ (Error.say ("Error: "^(General.exnMessage e)^"\n");
+ OS.Process.failure)
+
+ end
diff --git a/devel/asdlgen/files/patch-src_sml_main_lib-files.sml b/devel/asdlgen/files/patch-src_sml_main_lib-files.sml
new file mode 100644
index 000000000000..3ca7230601c3
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_sml_main_lib-files.sml
@@ -0,0 +1,36 @@
+--- src/sml/main/lib-files.sml.orig 2000-02-10 19:51:47.000000000 +0100
++++ src/sml/main/lib-files.sml 2007-10-11 17:41:21.000000000 +0200
+@@ -58,23 +58,23 @@
+ fun join (x,y) = OS.Path.concat("asts",OS.Path.concat(x,y))
+
+ val std_pkl_lib =
+- FileSet.mkLib {name=join("StdPkl","g.java"),depends=[],impl=
++ FileSet.mkLib {name=join("stdpkl","g.java"),depends=[],impl=
+ MkFileSet.file_set (mkroot ["java"]) FileSet.empty
+- [(join("StdPkl","g.java"),[]),
+- (join("StdPkl","PklJava.java"),[join("StdPkl","g.java")])]}
++ [(join("stdpkl","g.java"),[]),
++ (join("stdpkl","PklJava.java"),[join("stdpkl","g.java")])]}
+
+ val std_prims_lib =
+- FileSet.mkLib {name=join("StdPrims","g.java"),
+- depends=[join("StdPkl","g.java")],impl=
++ FileSet.mkLib {name=join("stdprims","g.java"),
++ depends=[join("stdpkl","g.java")],impl=
+ MkFileSet.file_set (mkroot ["java"]) FileSet.empty
+- [(join("StdPrims","g.java"),[join("StdPkl","g.java")]),
+- (join("StdPrims","identifier.java"),[join("StdPrims","g.java")])]}
++ [(join("stdprims","g.java"),[join("stdpkl","g.java")]),
++ (join("stdprims","identifier.java"),[join("stdprims","g.java")])]}
+
+ val std_types_lib =
+- FileSet.mkLib {name=join("StdTypes","g.java"),
+- depends=[join("StdPkl","g.java")],impl=
++ FileSet.mkLib {name=join("stdtypes","g.java"),
++ depends=[join("stdpkl","g.java")],impl=
+ MkFileSet.file_set (mkroot ["java"]) FileSet.empty
+- [(join("StdTypes","g.java"),[])]}
++ [(join("stdtypes","g.java"),[])]}
+ in val java = add_files [std_pkl_lib,std_prims_lib,std_types_lib]
+ end
+ local
diff --git a/devel/asdlgen/files/patch-src_sml_test_harness.sml b/devel/asdlgen/files/patch-src_sml_test_harness.sml
new file mode 100644
index 000000000000..155f8fc5530b
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_sml_test_harness.sml
@@ -0,0 +1,42 @@
+--- src/sml/test/harness.sml.orig 2001-10-02 16:20:32.000000000 +0200
++++ src/sml/test/harness.sml 2007-10-07 20:09:45.000000000 +0200
+@@ -69,15 +69,15 @@
+ val c_includes = (mk_path ["c"])@ ["/usr/local/include"]
+ val c_libs = mk_path ["c"]@ ["/usr/local/lib"]
+
+- val cxx_includes = mk_path ["c"]
+- val cxx_libs = mk_path ["cxx"]
++ val cxx_includes = (mk_path ["cxx"])@ ["/usr/local/include"]
++ val cxx_libs = mk_path ["cxx"]@ ["/usr/local/lib"]
+
+ val java_classes = [] (*mk_path ["java"]*)
+
+ val cm_path = [] (* mk_path ["sml","base"]*)
+ val icon_ucode = [] (* mk_path ["icon"] *)
+ val haskell_path = (* (mk_path ["haskell"])@*)
+- ["/usr/share/hugs/lib"]
++ [ (*"/usr/share/hugs/lib"*) ]
+ val ocaml_path = [] (* (mk_path ["ocaml"]) *)
+ end
+
+@@ -208,7 +208,7 @@
+ val sigs = (get_files "sml" i)
+ val outs = strs@sigs
+ val cm_path = S.cm_path
+- in P.sml_batch{cm_path=cm_path,inputs="smlnj-lib.cm"::outs}
++ in P.sml_batch{cm_path=cm_path,inputs="$/smlnj-lib.cm"::outs}
+ end
+
+ fun ocaml_comp i =
+@@ -295,9 +295,9 @@
+ mk_path ["modTest","pos.asdl"]])
+
+ val big_int_test =
+- (test_all "generic.asdl" [mk_path ["generic.asdl"]])
++ (test_all "generic.asdl" [mk_path ["..","generic.asdl"]])
+ val asdl_test =
+- (test_all "asdl.asdl" [mk_path ["asdl.asdl"]])
++ (test_all "asdl.asdl" [mk_path ["..","asdl.asdl"]])
+
+ val pattern_test =
+ (test_all "pattern.asdl" [mk_path ["pattern.asdl"]])
diff --git a/devel/asdlgen/files/patch-src_sml_translate_oo_java-pp.sml b/devel/asdlgen/files/patch-src_sml_translate_oo_java-pp.sml
new file mode 100644
index 000000000000..bbf7f5f79596
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_sml_translate_oo_java-pp.sml
@@ -0,0 +1,36 @@
+--- src/sml/translate/oo/java-pp.sml.orig 2000-01-14 02:42:28.000000000 +0100
++++ src/sml/translate/oo/java-pp.sml 2007-10-12 21:02:26.000000000 +0200
+@@ -36,7 +36,8 @@
+ (case qualifier of
+ [] => NONE
+ | [""] => SOME {base=base,qualifier=[package_prefix]}
+- | _ => SOME {base=base,qualifier=[package_prefix]@qualifier})
++ | _ => SOME {base=base,qualifier=[package_prefix]@
++ (map (String.map Char.toLower) qualifier)})
+ fun fix_ty_path {qualifier,base} =
+ case base of
+ "java_boolean" => SOME {qualifier=[],base="boolean"}
+@@ -280,6 +281,7 @@
+ end
+ | pp_cls mn x =
+ let
++ val mn = String.map Char.toLower mn
+ fun get_name (DeclClass x) = PP.fix_tid(#name(x))
+ | get_name (DeclAbstractClass x) = PP.fix_tid(#name(x))
+ | get_name _ = raise Error.internal
+@@ -311,6 +313,7 @@
+
+ fun mk_dep name =
+ let val mn = ModuleId.toString (PP.fix_mid name)
++ val mn = String.map Char.toLower mn
+ in
+ OS.Path.concat(package_prefix,
+ OS.Path.concat(mn,
+@@ -337,6 +340,7 @@
+ end
+ | pp_consts mn x props imports =
+ let
++ val mn = String.map Char.toLower mn
+ val pp =
+ cat
+ [str ("package "^package_prefix^"."^mn^";"), nl,
diff --git a/devel/asdlgen/files/patch-src_sml_translate_support_idmaps.sml b/devel/asdlgen/files/patch-src_sml_translate_support_idmaps.sml
new file mode 100644
index 000000000000..937e092450cc
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_sml_translate_support_idmaps.sml
@@ -0,0 +1,36 @@
+--- src/sml/translate/support/idmaps.sml.orig 1999-09-13 00:27:25.000000000 +0200
++++ src/sml/translate/support/idmaps.sml 2007-10-12 18:43:12.000000000 +0200
+@@ -102,15 +102,17 @@
+ struct
+ val id_map =
+ List.map (fix_kw "_")
+- ["abstract","boolean", "break", "byte", "case", "char",
+- "class", "const", "continue", "do", "double", "else",
+- "extends", "final","finally", "int", "float", "for",
+- "default", "if", "implements", "import", "instanceof",
+- "interface", "long", "native", "new", "public",
+- "short", "super", "switch", "synchroinized", "package",
+- "private", "protected", "transient", "return", "void",
+- "static", "while", "throw", "throws", "try",
+- "volatile","kind"]
++ ["abstract", "assert", "boolean", "break", "byte",
++ "case", "catch", "char", "class", "const", "continue",
++ "default", "do", "double", "else", "enum", "extends",
++ "final", "finally", "float", "for", "goto", "if",
++ "implements", "import", "instanceof", "int",
++ "interface", "long", "native", "new", "package",
++ "private", "protected", "public", "return", "short",
++ "static", "strictfp", "super", "switch",
++ "synchronized", "this", "throw", "throws",
++ "transient", "try", "void", "volatile", "while",
++ "kind"]
+
+ val ty_map = id_map
+ val name = "Java"
+@@ -129,4 +131,4 @@
+ val name = "Icon"
+ end
+
+- end
+\ No newline at end of file
++ end
diff --git a/devel/asdlgen/files/patch-src_sml_translate_support_mk-file-set.sml b/devel/asdlgen/files/patch-src_sml_translate_support_mk-file-set.sml
new file mode 100644
index 000000000000..06ff05599760
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_sml_translate_support_mk-file-set.sml
@@ -0,0 +1,21 @@
+--- src/sml/translate/support/mk-file-set.sml.orig 2000-01-10 01:09:21.000000000 +0100
++++ src/sml/translate/support/mk-file-set.sml 2007-09-25 18:00:55.000000000 +0200
+@@ -9,9 +9,9 @@
+ let
+ fun do_one ((name,depends),fs) =
+ let
+- val path = Paths.pathConcat (root,Paths.pathFromArcs [name])
++ val path = Paths.pathConcat (root,Paths.pathFromNative name)
+ val fname = (Paths.pathToNative path)
+- val ins = TextIO.openIn (Paths.pathToNative path)
++ val ins = TextIO.openIn fname
+ val file = TextIO.inputAll ins
+ val _ = (TextIO.closeIn ins;print ("Read file:"^fname^"\n"))
+ val body = PPUtil.s file
+@@ -21,4 +21,4 @@
+ end
+ in List.foldl do_one init rest
+ end
+- end
+\ No newline at end of file
++ end
diff --git a/devel/asdlgen/files/patch-src_sml_util_misc_file-set.sml b/devel/asdlgen/files/patch-src_sml_util_misc_file-set.sml
new file mode 100644
index 000000000000..70fb498d1639
--- /dev/null
+++ b/devel/asdlgen/files/patch-src_sml_util_misc_file-set.sml
@@ -0,0 +1,31 @@
+--- src/sml/util/misc/file-set.sml.orig 2000-01-14 02:42:30.000000000 +0100
++++ src/sml/util/misc/file-set.sml 2007-09-28 22:50:55.000000000 +0200
+@@ -68,11 +68,18 @@
+ fun libPath x = d@x
+ fun get_node "" = NONE
+ | get_node x = OM.find(fs',x)
+- fun fix_dep x = case OM.find(fs',x) of
+- (SOME (L _)) => libPath [x] | _ => [x]
+- fun cvt (F x) = {name=[#name x],
++ fun fix_dep x = let open OS.Path
++ val xarcs = (#arcs o fromString) x
++ in case OM.find(fs',x) of
++ (SOME (L _)) => libPath xarcs | _ => xarcs
++ end
++ fun cvt (F x) = let open OS.Path
++ val xarcs = (#arcs o fromString) (#name x)
++ in
++ {name=xarcs,
+ depends=List.map fix_dep (#depends x),
+ body=(#body x)}
++ end
+ | cvt _ = raise (Fail "impossible")
+
+ fun prefix_it {name,depends,body} =
+@@ -90,4 +97,4 @@
+ val components = Scc.topOrder {root="",follow=follow}
+ in List.foldl no_cycle [] components
+ end
+- end
+\ No newline at end of file
++ end
diff --git a/devel/asdlgen/pkg-descr b/devel/asdlgen/pkg-descr
new file mode 100644
index 000000000000..b9061daaf090
--- /dev/null
+++ b/devel/asdlgen/pkg-descr
@@ -0,0 +1,11 @@
+asdlGen is a tool for generating data marshalling and
+unmarshalling code from a high-level (ASDL) specification.
+It can generate such code for sml, ocaml, ansi-c, java, haskell,
+icon, c++.
+
+The Abstract Syntax Description Lanuguage (ASDL) is a language
+designed to describe the tree-like data structures in compilers.
+Its main goal is to provide a method for compiler components
+written in different languages to interoperate.
+
+WWW: http://asdl.sourceforge.net/
diff --git a/devel/asdlgen/pkg-plist b/devel/asdlgen/pkg-plist
new file mode 100644
index 000000000000..7ded6a560500
--- /dev/null
+++ b/devel/asdlgen/pkg-plist
@@ -0,0 +1,115 @@
+bin/asdlGen
+%%PORTDOCS%%%%DOCSDIR%%/COPYRIGHT
+%%PORTDOCS%%%%DOCSDIR%%/README/README.ascii
+%%PORTDOCS%%%%DOCSDIR%%/README/README.html
+%%PORTDOCS%%%%DOCSDIR%%/README/README.ps
+%%PORTDOCS%%%%DOCSDIR%%/README/README1.html
+%%PORTDOCS%%%%DOCSDIR%%/README/README2.html
+%%PORTDOCS%%%%DOCSDIR%%/README/README_toc.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual.ascii
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual.ps
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual1.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual10.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual11.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual12.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual13.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual14.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual15.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual16.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual17.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual18.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual19.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual2.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual20.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual21.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual22.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual23.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual24.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual25.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual26.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual27.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual28.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual29.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual3.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual30.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual31.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual32.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual33.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual34.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual35.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual36.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual37.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual4.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual5.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual6.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual7.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual8.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual9.html
+%%PORTDOCS%%%%DOCSDIR%%/manual/manual_toc.html
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ArithExp.asdl
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/Common/Makefile.inc
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/Common/input.pickle.uu
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/Common/result.pickle.uu
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ansi-c/EvalArithExp.c
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ansi-c/EvalArithExp.h
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ansi-c/Main.c
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ansi-c/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/cxx/EvalArithExp.cxx
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/cxx/EvalArithExp.hxx
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/cxx/Main.cxx
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/cxx/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/haskell/EvalArithExp.hs
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/haskell/Main.hs
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/haskell/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/icon/EvalArithExp.icn
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/icon/Main.icn
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/icon/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/java/EvalArithExp.java
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/java/Main.java
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/java/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ocaml/EvalArithExp.ml
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ocaml/EvalArithExp.mli
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ocaml/Main.ml
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ocaml/Main.mli
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/ocaml/Makefile
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/sml/EvalArithExp.sml
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/sml/Main.cm
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/sml/Main.sml
+%%EXAMPLES%%%%EXAMPLESDIR%%/%%DEMODIR%%/sml/Makefile
+%%EXAMPLESDIR%%/asdl.asdl
+%%EXAMPLESDIR%%/bugs/bug3.asdl
+%%EXAMPLESDIR%%/bugs/bug4.asdl
+%%EXAMPLESDIR%%/bugs/bug5.asdl
+%%EXAMPLESDIR%%/errors.asdl
+%%EXAMPLESDIR%%/modTest/all.asdl
+%%EXAMPLESDIR%%/modTest/base.asdl
+%%EXAMPLESDIR%%/modTest/exp.asdl
+%%EXAMPLESDIR%%/modTest/op.asdl
+%%EXAMPLESDIR%%/modTest/pos.asdl
+%%EXAMPLESDIR%%/modTest/stm.asdl
+%%EXAMPLESDIR%%/pattern.asdl
+%%EXAMPLESDIR%%/rcc.asdl
+%%EXAMPLESDIR%%/slp.asdl
+%%EXAMPLESDIR%%/slp3.asdl
+%%EXAMPLESDIR%%/std-types.asdl
+%%EXAMPLESDIR%%/test.asdl
+%%EXAMPLESDIR%%/toplevel.asdl
+%%EXAMPLESDIR%%/views.asdl
+%%EXAMPLESDIR%%/zsuif.asdl
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/README
+%%PORTDOCS%%@dirrm %%DOCSDIR%%/manual
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%/Common
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%/ansi-c
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%/cxx
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%/haskell
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%/icon
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%/java
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%/ocaml
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%/sml
+%%EXAMPLES%%@dirrm %%EXAMPLESDIR%%/%%DEMODIR%%
+@dirrm %%EXAMPLESDIR%%/bugs
+@dirrm %%EXAMPLESDIR%%/modTest
+@dirrm %%EXAMPLESDIR%%