Hello community,

here is the log from the commit of package colm for openSUSE:Factory checked in 
at 2016-12-02 16:41:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/colm (Old)
 and      /work/SRC/openSUSE:Factory/.colm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "colm"

Changes:
--------
--- /work/SRC/openSUSE:Factory/colm/colm.changes        2016-07-01 
09:58:22.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.colm.new/colm.changes   2016-12-02 
16:41:46.000000000 +0100
@@ -1,0 +2,7 @@
+Mon Nov 28 11:26:37 UTC 2016 - [email protected]
+
+- Update to new upstream release 0.13.0.4
+  * No changelog was provided
+- Drop colm-type.diff, colm-shared.diff (applied upstream)
+
+-------------------------------------------------------------------

Old:
----
  colm-0.13.0.3.tar.gz
  colm-shared.diff
  colm-type.diff

New:
----
  colm-0.13.0.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ colm.spec ++++++
--- /var/tmp/diff_new_pack.tr18oV/_old  2016-12-02 16:41:47.000000000 +0100
+++ /var/tmp/diff_new_pack.tr18oV/_new  2016-12-02 16:41:47.000000000 +0100
@@ -15,18 +15,17 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 Name:           colm
-Version:        0.13.0.3
-%define lname  libcolm-0_13_0_3
+Version:        0.13.0.4
 Release:        0
+%define lname  libcolm-0_13_0_4
 Summary:        The Colm programming language
 License:        GPL-2.0+
 Group:          Development/Languages
-URL:            http://www.colm.net/open-source/colm/
+Url:            http://www.colm.net/open-source/colm/
 
 Source:         http://www.colm.net/files/colm/%name-%version.tar.gz
-Patch1:         colm-type.diff
-Patch2:         colm-shared.diff
 BuildRequires:  gcc-c++
 BuildRequires:  libtool
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -61,7 +60,6 @@
 
 %prep
 %setup -q
-%patch -P 1 -P 2 -p1
 
 %build
 autoreconf -fi
@@ -88,8 +86,7 @@
 %doc COPYING
 %_bindir/colm
 %_includedir/*
-%_libdir/libcolmd.so
-%_libdir/libcolmp.so
+%_libdir/libcolm.so
 %_datadir/vim/
 
 %changelog

++++++ colm-0.13.0.3.tar.gz -> colm-0.13.0.4.tar.gz ++++++
++++ 2039 lines of diff (skipped)
++++    retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/configure.ac new/colm-0.13.0.4/configure.ac
--- old/colm-0.13.0.3/configure.ac      2016-01-28 14:08:55.000000000 +0100
+++ new/colm-0.13.0.4/configure.ac      2016-07-11 21:29:35.000000000 +0200
@@ -18,8 +18,8 @@
 dnl   along with Colm; if not, write to the Free Software
 dnl   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA 
   
-AC_INIT(colm, 0.13.0.3)
-PUBDATE="Jan 2016"
+AC_INIT(colm, 0.13.0.4)
+PUBDATE="July 2016"
 
 AM_INIT_AUTOMAKE([foreign])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/Makefile.am new/colm-0.13.0.4/src/Makefile.am
--- old/colm-0.13.0.3/src/Makefile.am   2015-10-06 23:10:30.000000000 +0200
+++ new/colm-0.13.0.4/src/Makefile.am   2016-06-29 18:45:49.000000000 +0200
@@ -18,7 +18,7 @@
 #   along with Colm; if not, write to the Free Software
 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
 
-AM_CPPFLAGS = -I$(top_srcdir)/aapl
+AM_CPPFLAGS = -I$(top_srcdir)/aapl -Iinclude
 
 AUTOMAKE_OPTIONS = subdir-objects
 
@@ -34,15 +34,12 @@
        bytecode.h config.h defs.h debug.h pool.h input.h \
        pdarun.h map.h type.h tree.h struct.h program.h colm.h internal.h
 
-lib_LIBRARIES = libcolmp.a libcolmd.a
+lib_LTLIBRARIES = libcolm.la
 
 noinst_LIBRARIES = libprog.a
 
-libcolmp_a_SOURCES = $(RUNTIME_SRC)
-libcolmp_a_CFLAGS = -Iinclude
-
-libcolmd_a_SOURCES = $(RUNTIME_SRC)
-libcolmd_a_CFLAGS = -Iinclude
+libcolm_la_SOURCES = $(RUNTIME_SRC)
+libcolm_la_LDFLAGS = -release ${PACKAGE_VERSION}
 
 common_CFLAGS = \
        -Wall \
@@ -67,7 +64,7 @@
 
 bootstrap0_CXXFLAGS = $(common_CFLAGS) -DCONS_INIT
 bootstrap0_SOURCES = consinit.cc consinit.h main.cc
-bootstrap0_LDADD = libprog.a libcolmd.a
+bootstrap0_LDADD = libprog.a libcolm.la
 
 bootstrap1_CXXFLAGS = $(common_CFLAGS) -DLOAD_INIT
 bootstrap1_CFLAGS = $(common_CFLAGS)
@@ -75,7 +72,7 @@
        loadinit.h loadinit.cc main.cc
 nodist_bootstrap1_SOURCES = \
        gen/if1.h gen/if1.cc gen/parse1.c
-bootstrap1_LDADD = libprog.a libcolmd.a
+bootstrap1_LDADD = libprog.a libcolm.la
 
 colm_CXXFLAGS = $(common_CFLAGS) -DLOAD_COLM
 colm_CFLAGS = $(common_CFLAGS)
@@ -83,7 +80,7 @@
        loadcolm.h loadcolm.cc main.cc
 nodist_colm_SOURCES = \
        gen/if2.h gen/if2.cc gen/parse2.c
-colm_LDADD = libprog.a libcolmd.a
+colm_LDADD = libprog.a libcolm.la
 
 colmincdir = $(includedir)/colm
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/bytecode.c new/colm-0.13.0.4/src/bytecode.c
--- old/colm-0.13.0.3/src/bytecode.c    2015-12-15 21:55:52.000000000 +0100
+++ new/colm-0.13.0.4/src/bytecode.c    2016-06-29 18:20:03.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2006-2012 Adrian Thurston <[email protected]>
+ *  Copyright 2006-2016 Adrian Thurston <[email protected]>
  */
 
 /*  This file is part of Colm.
@@ -37,8 +37,6 @@
 
 typedef struct colm_struct struct_t;
 
-tree_t **host_call( program_t *prg, long code, tree_t **sp );
-
 #define TRUE_VAL  1
 #define FALSE_VAL 0
 
@@ -70,7 +68,7 @@
                i = (type) w; \
        } while(0)
 
-       #define read_type_p( type, i, p ) do { \
+       #define read_type_p( Type, i, p ) do { \
                i = ((Type)  p[0]); \
                i |= ((Type) p[1]) << 8; \
                i |= ((Type) p[2]) << 16; \
@@ -699,6 +697,8 @@
                        for ( i = 0; i < n; i++ ) {
                                if ( si->file != 0 )
                                        print_tree_file( prg, sp, si, arg[i], 
false );
+                               else if ( si->collect != 0 )
+                                       print_tree_collect( prg, sp, 
si->collect, arg[i], false );
                        }
 
                        for ( i = 0; i < n; i++ )
@@ -1257,7 +1257,21 @@
 
                        debug( prg, REALM_BYTECODE, "IN_NEW_STRUCT %hd\n", id );
                        struct_t *item = colm_struct_new( prg, id );
-                       vm_push_type( struct_t*, item );
+                       vm_push_struct( item );
+                       break;
+               }
+               case IN_NEW_STREAM: {
+                       debug( prg, REALM_BYTECODE, "IN_NEW_STREAM\n" );
+                       stream_t *item = colm_stream_open_collect( prg );
+                       vm_push_stream( item );
+                       break;
+               }
+               case IN_GET_COLLECT_STRING: {
+                       debug( prg, REALM_BYTECODE, "IN_GET_COLLECT_STRING\n" );
+                       stream_t *stream = vm_pop_stream();
+                       str_t *str = collect_string( prg, stream );
+                       colm_tree_upref( (tree_t*)str );
+                       vm_push_string( str );
                        break;
                }
                case IN_GET_STRUCT_R: {
@@ -3379,7 +3393,7 @@
 
                        debug( prg, REALM_BYTECODE, "IN_HOST %hd\n", func_id );
 
-                       sp = host_call( prg, func_id, sp );
+                       sp = prg->rtd->host_call( prg, func_id, sp );
                        break;
                }
                case IN_CALL_WV: {
@@ -3665,6 +3679,8 @@
 
                        int res = system( cmd0 );
 
+                       free( cmd0 );
+
                        if ( WIFSIGNALED( res ) )
                                raise( WTERMSIG( res ) );
                        res = WEXITSTATUS( res );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/bytecode.h new/colm-0.13.0.4/src/bytecode.h
--- old/colm-0.13.0.3/src/bytecode.h    2015-12-15 21:51:37.000000000 +0100
+++ new/colm-0.13.0.4/src/bytecode.h    2016-04-04 15:55:00.000000000 +0200
@@ -37,9 +37,6 @@
 
 typedef unsigned long colm_value_t;
 
-/* 
- */
-
 
 #define IN_LOAD_INT              0x01
 #define IN_LOAD_STR              0x02
@@ -358,6 +355,9 @@
 #define IN_GET_LOCAL_VAL_R       0x91
 #define IN_SET_LOCAL_VAL_WC      0x92
 
+#define IN_NEW_STREAM            0x24
+#define IN_GET_COLLECT_STRING    0x68
+
 /*
  * IN_FN instructions.
  */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/colm.h new/colm-0.13.0.4/src/colm.h
--- old/colm-0.13.0.3/src/colm.h        2015-12-02 14:55:47.000000000 +0100
+++ new/colm-0.13.0.4/src/colm.h        2016-04-04 15:55:00.000000000 +0200
@@ -106,6 +106,8 @@
 /* Set the pointer to the reduce struct used. */
 void colm_set_reduce_ctx( struct colm_program *prg, void *ctx );
 
+const char **colm_extract_fns( struct colm_program *prg );
+
 #ifdef __cplusplus
 }
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/commit.c new/colm-0.13.0.4/src/commit.c
--- old/colm-0.13.0.3/src/commit.c      2015-12-02 14:55:41.000000000 +0100
+++ new/colm-0.13.0.4/src/commit.c      2016-04-04 15:55:00.000000000 +0200
@@ -105,7 +105,7 @@
        while ( sp != root ) {
                pt = vm_pop_ptree();
 
-               commit_reduce_forward( prg, sp, pda_run, pt );
+               prg->rtd->commit_reduce_forward( prg, sp, pda_run, pt );
                pt->child = 0;
 
                pt->flags |= PF_COMMITTED;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/compiler.cc new/colm-0.13.0.4/src/compiler.cc
--- old/colm-0.13.0.3/src/compiler.cc   2015-11-30 16:20:12.000000000 +0100
+++ new/colm-0.13.0.4/src/compiler.cc   2016-04-04 15:55:00.000000000 +0200
@@ -415,6 +415,15 @@
        /* Delete all the nodes in the action list. Will cause all the
         * string data that represents the actions to be deallocated. */
        actionList.empty();
+
+       for ( CharVectVect::Iter fns = streamFileNames; fns.lte(); fns++ ) {
+               const char **ptr = *fns;
+               while ( *ptr != 0 ) {
+                       ::free( (void*)*ptr );
+                       ptr += 1;
+               }
+               free( (void*) *fns );
+       }
 }
 
 ostream &operator<<( ostream &out, const Token &token )
@@ -990,7 +999,7 @@
 pda_run *Compiler::parsePattern( program_t *prg, tree_t **sp, const InputLoc 
&loc, 
                int parserId, struct stream_impl *sourceStream )
 {
-       struct stream_impl *in = colm_impl_new_generic( "<internal>" );
+       struct stream_impl *in = colm_impl_new_generic( strdup("<internal>") );
 
        struct pda_run *pdaRun = new pda_run;
        colm_pda_init( prg, pdaRun, pdaTables, parserId, 0, false, 0, false );
@@ -1035,13 +1044,13 @@
 
        for ( ConsList::Iter cons = replList; cons.lte(); cons++ ) {
                if ( cons->langEl != 0 ) {
-                       struct stream_impl *in = colm_impl_new_cons( 
"<internal>", cons );
+                       struct stream_impl *in = colm_impl_new_cons( 
strdup("<internal>"), cons );
                        cons->pdaRun = parsePattern( prg, sp, cons->loc, 
cons->langEl->parserId, in );
                }
        }
 
        for ( PatList::Iter pat = patternList; pat.lte(); pat++ ) {
-               struct stream_impl *in = colm_impl_new_pat( "<internal>", pat );
+               struct stream_impl *in = colm_impl_new_pat( 
strdup("<internal>"), pat );
                pat->pdaRun = parsePattern( prg, sp, pat->loc, 
pat->langEl->parserId, in );
        }
 
@@ -1102,7 +1111,7 @@
        }
 
        *outStream <<
-               "tree_t **host_call( program_t *prg, long code, tree_t **sp )\n"
+               "tree_t **" << objectName << "_host_call( program_t *prg, long 
code, tree_t **sp )\n"
                "{\n"
                "       value_t rtn = 0;\n"
                "       switch ( code ) {\n";
@@ -1111,8 +1120,8 @@
                *outStream <<
                        "               case " << hc->funcId << ": {\n";
 
-               int pos = 0;
-               for ( ParameterList::Iter p = *hc->paramList; p.lte(); p++, 
pos++ ) {
+               int pos = hc->paramList->length() - 1;
+               for ( ParameterList::Iter p = *hc->paramList; p.lte(); p++, 
pos-- ) {
                        *outStream <<
                                "                       value_t p" << pos << " 
= vm_pop_value();\n";
                }
@@ -1154,10 +1163,9 @@
        /* Write the runtime data. */
        pdaGen->writeRuntimeData( runtimeData, pdaTables );
 
-       if ( hostAdapters )
-               writeHostCall();
+       writeHostCall();
 
-       if ( hostAdapters && includeCommit )
+       if ( includeCommit )
                writeCommitStub();
 
        if ( !gblLibrary ) 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/compiler.h new/colm-0.13.0.4/src/compiler.h
--- old/colm-0.13.0.3/src/compiler.h    2015-11-30 16:52:05.000000000 +0100
+++ new/colm-0.13.0.4/src/compiler.h    2016-04-04 15:55:00.000000000 +0200
@@ -64,6 +64,8 @@
 #define REDUCE_CODE 0x2
 #define SHIFT_REDUCE_CODE 0x3
 
+typedef Vector<const char**> CharVectVect;
+
 /* This is used for tracking the current stack of include file/machine pairs. 
It is
  * is used to detect and recursive include structure. */
 struct IncludeStackItem
@@ -644,6 +646,8 @@
 
        UniqueType *mainReturnUT;
 
+       CharVectVect streamFileNames;
+
        /* CONTEXT FREE */
        ProdElList *makeProdElList( LangEl *langEl );
        void wrapNonTerminals();
@@ -938,7 +942,10 @@
 
        void declareGlobalFields();
        void declareStrFields();
+
+       void declareStreamField( ObjectDef *objDef, code_t getLength );
        void declareStreamFields();
+
        void declareIntFields();
        void declareTokenFields();
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/config.h new/colm-0.13.0.4/src/config.h
--- old/colm-0.13.0.3/src/config.h      2016-01-28 14:07:33.000000000 +0100
+++ new/colm-0.13.0.4/src/config.h      2016-07-11 21:36:52.000000000 +0200
@@ -2,7 +2,7 @@
 /* src/config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* enable debug statements */
-/* #undef DEBUG */
+#define DEBUG 1
 
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #define HAVE_DLFCN_H 1
@@ -48,7 +48,7 @@
 #define PACKAGE_NAME "colm"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "colm 0.13.0.3"
+#define PACKAGE_STRING "colm 0.13.0.4"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "colm"
@@ -57,7 +57,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "0.13.0.3"
+#define PACKAGE_VERSION "0.13.0.4"
 
 /* allocate pool objects with malloc */
 /* #undef POOL_MALLOC */
@@ -69,4 +69,4 @@
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "0.13.0.3"
+#define VERSION "0.13.0.4"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/consinit.cc new/colm-0.13.0.4/src/consinit.cc
--- old/colm-0.13.0.3/src/consinit.cc   2015-11-30 18:01:32.000000000 +0100
+++ new/colm-0.13.0.4/src/consinit.cc   2016-04-04 15:55:00.000000000 +0200
@@ -31,23 +31,6 @@
 #include "input.h"
 #include "consinit.h"
 
-extern "C" tree_t **host_call( program_t *prg, long code, tree_t **sp )
-{
-       return 0;
-}
-
-extern "C" void commit_reduce_forward( program_t *prg, tree_t **root,
-               struct pda_run *pda_run, parse_tree_t *pt )
-{
-       commit_clear_parse_tree( prg, root, pda_run, pt->child );
-}
-
-extern "C" long commit_union_sz( int reducer ) { return 0; }
-
-extern "C" void init_need() {}
-extern "C" int reducer_need_tok( program_t *prg, struct pda_run *, int id ) { 
return 3; }
-extern "C" int reducer_need_ign( program_t *prg, struct pda_run * ) { return 
3; }
-
 using std::cout;
 using std::cerr;
 using std::endl;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/ctinput.cc new/colm-0.13.0.4/src/ctinput.cc
--- old/colm-0.13.0.3/src/ctinput.cc    2015-11-30 17:32:37.000000000 +0100
+++ new/colm-0.13.0.4/src/ctinput.cc    2016-04-04 15:55:00.000000000 +0200
@@ -38,7 +38,7 @@
  * Pattern
  */
 
-struct stream_impl *colm_impl_new_pat( const char *name, Pattern *pattern )
+struct stream_impl *colm_impl_new_pat( char *name, Pattern *pattern )
 {
        struct stream_impl *ss = (struct stream_impl*)malloc(sizeof(struct 
stream_impl));
        memset( ss, 0, sizeof(struct stream_impl) );
@@ -239,7 +239,7 @@
  * Constructor
  */
 
-struct stream_impl *colm_impl_new_cons( const char *name, Constructor 
*constructor )
+struct stream_impl *colm_impl_new_cons( char *name, Constructor *constructor )
 {
        struct stream_impl *ss = (struct stream_impl*)malloc(sizeof(struct 
stream_impl));
        memset( ss, 0, sizeof(struct stream_impl) );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/declare.cc new/colm-0.13.0.4/src/declare.cc
--- old/colm-0.13.0.3/src/declare.cc    2015-10-05 17:02:52.000000000 +0200
+++ new/colm-0.13.0.4/src/declare.cc    2016-04-04 15:55:00.000000000 +0200
@@ -844,6 +844,19 @@
        addLengthField( strObj, IN_STR_LENGTH );
 }
 
+void Compiler::declareStreamField( ObjectDef *objDef, code_t getLength )
+{
+       /* Create the "length" field. */
+       TypeRef *typeRef = TypeRef::cons( internal, uniqueTypeStr );
+       ObjectField *el = ObjectField::cons( internal,
+                       ObjectField::InbuiltFieldType, typeRef, "tree" );
+       el->isConst = true;
+       el->inGetR = IN_GET_COLLECT_STRING;
+       el->inGetValR = IN_GET_COLLECT_STRING;
+
+       objDef->rootScope->insertField( el->name, el );
+}
+
 void Compiler::declareStreamFields( )
 {
        streamObj = streamSel->structDef->objectDef;
@@ -862,6 +875,8 @@
 
        initFunction( uniqueTypeVoid, streamObj, "close",
                        IN_INPUT_CLOSE_WC, IN_INPUT_CLOSE_WC, false );
+
+       declareStreamField( streamObj, 0 );
 }
 
 ObjectField *Compiler::makeDataEl()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/input.c new/colm-0.13.0.4/src/input.c
--- old/colm-0.13.0.3/src/input.c       2016-01-04 17:27:09.000000000 +0100
+++ new/colm-0.13.0.4/src/input.c       2016-04-04 15:55:00.000000000 +0200
@@ -35,6 +35,26 @@
 #include <unistd.h>
 #include <stdbool.h>
 
+char *colm_filename_add( program_t *prg, const char *fn )
+{
+       /* Search for it. */
+       const char **ptr = prg->stream_fns;
+       while ( *ptr != 0 ) {
+               if ( strcmp( *ptr, fn ) == 0 )
+                       return (char*)*ptr;
+               ptr += 1;
+       }
+
+       /* Not present, find. */
+       int items = ptr - prg->stream_fns;
+
+       prg->stream_fns = realloc( prg->stream_fns, sizeof(char*) * ( items + 2 
) );
+       prg->stream_fns[items] = strdup( fn );
+       prg->stream_fns[items+1] = 0;
+
+       return (char*)prg->stream_fns[items];
+}
+
 struct run_buf *new_run_buf( int sz )
 {
        struct run_buf *rb;
@@ -112,11 +132,21 @@
 
        if ( stream->impl->file != 0 )
                fclose( stream->impl->file );
+       
+       if ( stream->impl->collect != 0 ) {
+               str_collect_destroy( stream->impl->collect );
+               free( stream->impl->collect );
+       }
+
+       /* FIXME: Need to leak this for now. Until we can return strings to a
+        * program loader and free them at a later date (after the colm program 
is
+        * deleted). */
+       // if ( stream->impl->name != 0 )
+       //      free( stream->impl->name );
 
        free( stream->impl );
 }
 
-
 /* Keep the position up to date after consuming text. */
 void update_position( struct stream_impl *is, const char *data, long length )
 {
@@ -367,7 +397,7 @@
  * StreamImpl struct, this wraps the list of input streams.
  */
 
-void init_stream_impl( struct stream_impl *is, const char *name )
+void init_stream_impl( struct stream_impl *is, char *name )
 {
        memset( is, 0, sizeof(struct stream_impl) );
 
@@ -662,6 +692,13 @@
                else if ( buf->type == RunBufIgnoreType )
                        break;
                else {
+                       if ( !loc_set( loc ) ) {
+                               if ( is->line > 0 )
+                                       transfer_loc( loc, is );
+                               else
+                                       default_loc( loc );
+                       }
+
                        /* Anything available in the current buffer. */
                        int avail = buf->length - buf->offset;
                        if ( avail > 0 ) {
@@ -669,16 +706,11 @@
                                int slen = avail <= length ? avail : length;
                                consumed += slen;
                                length -= slen;
+                               update_position( is, buf->data + buf->offset, 
slen );
                                buf->offset += slen;
                                is->consumed += slen;
                        }
 
-                       if ( !loc_set( loc ) ) {
-                               if ( is->line > 0 )
-                                       transfer_loc( loc, is );
-                               else
-                                       default_loc( loc );
-                       }
                }
 
                if ( length == 0 ) {
@@ -783,14 +815,14 @@
        }
        else {
                if ( is_source_stream( is ) ) {
-                       // message( "sourcing line info\n" );
-
-                       /* steal the location information. */
+                       /* Steal the location information. Note that name 
allocations are
+                        * managed separately from streams and so ptr overwrite 
transfer is
+                        * safe. */
                        stream_t *s = ((stream_t*)is->queue->tree);
                        is->line = s->impl->line;
                        is->column = s->impl->column;
                        is->byte = s->impl->byte;
-                       is->name = s->impl->name;
+                       is->name = strdup(s->impl->name);
                }
 
                /* Create a new buffer for the data. This is the easy 
implementation.
@@ -1027,37 +1059,43 @@
 };
 
 
-struct stream_impl *colm_impl_new_file( const char *name, FILE *file )
+static struct stream_impl *colm_impl_new_file( char *name, FILE *file )
 {
        struct stream_impl *ss = (struct stream_impl*)malloc(sizeof(struct 
stream_impl));
        init_stream_impl( ss, name );
        ss->funcs = &file_funcs;
-
        ss->file = file;
-
        return ss;
 }
 
-struct stream_impl *colm_impl_new_fd( const char *name, long fd )
+static struct stream_impl *colm_impl_new_fd( char *name, long fd )
 {
        struct stream_impl *ss = (struct stream_impl*)malloc(sizeof(struct 
stream_impl));
        init_stream_impl( ss, name );
        ss->funcs = &file_funcs;
-
        ss->file = fdopen( fd, ( fd == 0 ) ? "r" : "w" );
-
        return ss;
 }
 
-struct stream_impl *colm_impl_new_generic( const char *name )
+struct stream_impl *colm_impl_new_generic( char *name )
 {
        struct stream_impl *ss = (struct stream_impl*)malloc(sizeof(struct 
stream_impl));
        init_stream_impl( ss, name );
        ss->funcs = &stream_funcs;
+       return ss;
+}
 
+struct stream_impl *colm_impl_new_collect( char *name )
+{
+       struct stream_impl *ss = (struct stream_impl*)malloc(sizeof(struct 
stream_impl));
+       init_stream_impl( ss, name );
+       ss->funcs = &stream_funcs;
+       ss->collect = (StrCollect*) malloc( sizeof( StrCollect ) );
+       init_str_collect( ss->collect );
        return ss;
 }
 
+
 stream_t *colm_stream_new_struct( program_t *prg )
 {
        size_t memsize = sizeof(struct colm_stream);
@@ -1071,7 +1109,7 @@
 
 stream_t *colm_stream_open_fd( program_t *prg, char *name, long fd )
 {
-       struct stream_impl *impl = colm_impl_new_fd( name, fd );
+       struct stream_impl *impl = colm_impl_new_fd( colm_filename_add( prg, 
name ), fd );
 
        struct colm_stream *s = colm_stream_new_struct( prg );
        s->impl = impl;
@@ -1100,19 +1138,37 @@
        char *file_name = (char*)malloc(string_length(head_name)+1);
        memcpy( file_name, string_data(head_name), string_length(head_name) );
        file_name[string_length(head_name)] = 0;
+
        FILE *file = fopen( file_name, fopen_mode );
        if ( file != 0 ) {
                stream = colm_stream_new_struct( prg );
-               stream->impl = colm_impl_new_file( file_name, file );
+               stream->impl = colm_impl_new_file( colm_filename_add( prg, 
file_name ), file );
        }
 
+       free( file_name );
+
        return stream;
 }
 
 stream_t *colm_stream_new( program_t *prg )
 {
-       struct stream_impl *impl = colm_impl_new_generic( "<internal>" );
+       struct stream_impl *impl = colm_impl_new_generic( colm_filename_add( 
prg, "<internal>" ) );
+       struct colm_stream *stream = colm_stream_new_struct( prg );
+       stream->impl = impl;
+       return stream;
+}
 
+str_t *collect_string( program_t *prg, stream_t *s )
+{
+       head_t *head = string_alloc_full( prg, s->impl->collect->data, 
s->impl->collect->length );
+       str_t *str = (str_t*)construct_string( prg, head );
+       return str;
+}
+
+
+stream_t *colm_stream_open_collect( program_t *prg )
+{
+       struct stream_impl *impl = colm_impl_new_collect( colm_filename_add( 
prg, "<internal>" ) );
        struct colm_stream *stream = colm_stream_new_struct( prg );
        stream->impl = impl;
        return stream;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/input.h new/colm-0.13.0.4/src/input.h
--- old/colm-0.13.0.3/src/input.h       2015-11-12 20:56:55.000000000 +0100
+++ new/colm-0.13.0.4/src/input.h       2016-04-04 15:55:00.000000000 +0200
@@ -50,6 +50,8 @@
 struct colm_location;
 struct colm_program;
 struct colm_struct;
+struct colm_str;
+struct colm_stream;
 
 struct stream_impl;
 
@@ -137,9 +139,11 @@
        long column;
        long byte;
 
-       const char *name;
+       char *name;
        FILE *file;
 
+       struct _StrCollect *collect;
+
        struct Pattern *pattern;
        struct PatternItem *pat_item;
        struct Constructor *constructor;
@@ -152,17 +156,19 @@
        int indent;
 };
 
-struct stream_impl *colm_impl_new_pat( const char *name, struct Pattern 
*pattern );
-struct stream_impl *colm_impl_new_cons( const char *name, struct Constructor 
*constructor );
-struct stream_impl *colm_impl_new_file( const char *name, FILE *file );
-struct stream_impl *colm_impl_new_fd( const char *name, long fd );
-struct stream_impl *colm_impl_new_generic( const char *name );
+struct stream_impl *colm_impl_new_pat( char *name, struct Pattern *pattern );
+struct stream_impl *colm_impl_new_cons( char *name, struct Constructor 
*constructor );
+struct stream_impl *colm_impl_new_generic( char *name );
+
 
 void update_position( struct stream_impl *input_stream, const char *data, long 
length );
 void undo_position( struct stream_impl *input_stream, const char *data, long 
length );
 
 struct stream_impl *colm_stream_impl( struct colm_struct *s );
 
+struct colm_str *collect_string( struct colm_program *prg, struct colm_stream 
*s );
+struct colm_stream *colm_stream_open_collect( struct colm_program *prg );
+
 #ifdef __cplusplus
 }
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/loadcolm.cc new/colm-0.13.0.4/src/loadcolm.cc
--- old/colm-0.13.0.3/src/loadcolm.cc   2015-12-15 21:47:45.000000000 +0100
+++ new/colm-0.13.0.4/src/loadcolm.cc   2016-04-04 15:55:00.000000000 +0200
@@ -790,6 +790,7 @@
                }
 
                StmtList *stmtList = walkRootItemList( Start.RootItemList() );
+               pd->streamFileNames.append( colm_extract_fns( program ) );
                colm_delete_program( program );
                return stmtList;
        }
@@ -2703,6 +2704,7 @@
        }
 
        StmtList *stmtList = walkRootItemList( Start.RootItemList() );
+       pd->streamFileNames.append( colm_extract_fns( program ) );
        colm_delete_program( program );
 
        pd->rootCodeBlock = CodeBlock::cons( stmtList, 0 );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/loadinit.cc new/colm-0.13.0.4/src/loadinit.cc
--- old/colm-0.13.0.3/src/loadinit.cc   2015-11-05 18:42:58.000000000 +0100
+++ new/colm-0.13.0.4/src/loadinit.cc   2016-04-04 15:55:00.000000000 +0200
@@ -408,6 +408,7 @@
                ItemList = ItemList.next();
        }
 
+       pd->streamFileNames.append( colm_extract_fns( program ) );
        colm_delete_program( program );
 
        consParseStmt( stmtList );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/main.cc new/colm-0.13.0.4/src/main.cc
--- old/colm-0.13.0.3/src/main.cc       2015-11-27 23:48:03.000000000 +0100
+++ new/colm-0.13.0.4/src/main.cc       2016-07-06 22:53:35.000000000 +0200
@@ -440,7 +440,7 @@
                " -o %s"
                " %s"
                " -L" PREFIX "/lib"
-               " -lcolmd",
+               " -lcolm",
                binaryFn, intermedFn );
        
        for ( ArgsVector::Iter af = additionalCodeFiles; af.lte(); af++ ) {
@@ -475,7 +475,7 @@
                " -o %s"
                " %s"
                " -L%s"
-               " -lcolmd",
+               " -lcolm",
                location, location,
                binaryFn, intermedFn, location );
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/pdabuild.cc new/colm-0.13.0.4/src/pdabuild.cc
--- old/colm-0.13.0.3/src/pdabuild.cc   2015-11-30 16:19:37.000000000 +0100
+++ new/colm-0.13.0.4/src/pdabuild.cc   2016-04-04 15:55:00.000000000 +0200
@@ -44,6 +44,36 @@
 
 char startDefName[] = "start";
 
+extern "C" tree_t **internal_host_call( program_t *prg, long code, tree_t **sp 
)
+{
+       return 0;
+}
+
+extern "C" void internal_commit_reduce_forward( program_t *prg, tree_t **root,
+               struct pda_run *pda_run, parse_tree_t *pt )
+{
+       commit_clear_parse_tree( prg, root, pda_run, pt->child );
+}
+
+extern "C" long internal_commit_union_sz( int reducer )
+{
+       return 0;
+}
+
+extern "C" void internal_init_need()
+{
+}
+
+extern "C" int internal_reducer_need_tok( program_t *prg, struct pda_run *, 
int id )
+{
+       return 3;
+}
+
+extern "C" int internal_reducer_need_ign( program_t *prg, struct pda_run * )
+{
+       return 3;
+}
+
 /* Count the transitions in the fsm by walking the state list. */
 int countTransitions( PdaGraph *fsm )
 {
@@ -1687,6 +1717,12 @@
        runtimeData->init_bindings = &internalInitBindings;
        runtimeData->pop_binding = &internalPopBinding;
 
+       runtimeData->host_call = &internal_host_call;
+       runtimeData->commit_reduce_forward = &internal_commit_reduce_forward;
+       runtimeData->commit_union_sz = &internal_commit_union_sz;
+       runtimeData->init_need = &internal_init_need;
+       runtimeData->reducer_need_tok = &internal_reducer_need_tok;
+       runtimeData->reducer_need_ign = &internal_reducer_need_ign;
 }
 
 /* Borrow alg->state for mapsTo. */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/pdacodegen.cc new/colm-0.13.0.4/src/pdacodegen.cc
--- old/colm-0.13.0.3/src/pdacodegen.cc 2015-11-27 22:46:17.000000000 +0100
+++ new/colm-0.13.0.4/src/pdacodegen.cc 2016-04-04 15:55:00.000000000 +0200
@@ -66,7 +66,7 @@
 void PdaCodeGen::defineRuntime()
 {
        out << 
-               "extern struct colm_sections colm_program_text;\n"
+               "extern struct colm_sections " << objectName << ";\n"
                "\n";
 }
 
@@ -445,6 +445,18 @@
        out << "};\n\n";
 
        out <<
+               "tree_t **" << objectName << "_host_call( program_t *prg, long 
code, tree_t **sp );\n"
+               "void " << objectName << "_commit_reduce_forward( program_t 
*prg, tree_t **root,\n"
+               "               struct pda_run *pda_run, parse_tree_t *pt );\n"
+               "long " << objectName << "_commit_union_sz( int reducer );\n"
+               "void " << objectName << "_init_need();\n"
+               "int " << objectName << "_reducer_need_tok( program_t *prg, "
+                               "struct pda_run *pda_run, int id );\n"
+               "int " << objectName << "_reducer_need_ign( program_t *prg, "
+                               "struct pda_run *pda_run );\n"
+               "\n";
+
+       out <<
                "struct colm_sections " << objectName << " = \n"
                "{\n"
                "       " << lelInfo() << ",\n"
@@ -505,6 +517,12 @@
                "       &sendNamedLangEl,\n"
                "       &initBindings,\n"
                "       &popBinding,\n"
+               "       &" << objectName << "_host_call,\n"
+               "       &" << objectName << "_commit_reduce_forward,\n" 
+               "       &" << objectName << "_commit_union_sz,\n"
+               "       &" << objectName << "_init_need,\n"
+               "       &" << objectName << "_reducer_need_tok,\n"
+               "       &" << objectName << "_reducer_need_ign,\n"
                "};\n"
                "\n";
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/pdarun.c new/colm-0.13.0.4/src/pdarun.c
--- old/colm-0.13.0.3/src/pdarun.c      2015-11-30 22:25:10.000000000 +0100
+++ new/colm-0.13.0.4/src/pdarun.c      2016-06-29 18:14:23.000000000 +0200
@@ -877,7 +877,7 @@
 static void send_ignore( program_t *prg, tree_t **sp,
                struct pda_run *pda_run, struct stream_impl *is, long id )
 {
-       if ( reducer_need_ign( prg, pda_run ) == RN_NONE ) {
+       if ( prg->rtd->reducer_need_ign( prg, pda_run ) == RN_NONE ) {
                consume_match( prg, sp, pda_run, is );
        }
        else {
@@ -905,7 +905,7 @@
 
        /* Make the token data. */
        head_t *tokdata = 0;
-       int rn = reducer_need_tok( prg, pda_run, id );
+       int rn = prg->rtd->reducer_need_tok( prg, pda_run, id );
 
        switch ( rn ) {
                case RN_NONE:
@@ -1312,9 +1312,14 @@
        pda_run->target_steps = -1;
        pda_run->reducer = reducer;
 
+       /* An initial commit shift count of -1 means we won't ever back up to 
zero
+        * shifts and think parsing cannot continue. */
+       pda_run->shift_count = 0;
+       pda_run->commit_shift_count = -1;
+
        if ( reducer ) {
                init_pool_alloc( &pda_run->local_pool, sizeof(parse_tree_t) +
-                               commit_union_sz(reducer) );
+                               prg->rtd->commit_union_sz(reducer) );
                pda_run->parse_tree_pool = &pda_run->local_pool;
        }
        else {
@@ -1508,11 +1513,16 @@
         */
 
        if ( pda_run->pda_tables->commit_len[pos] != 0 ) {
+               debug( prg, REALM_PARSE, "commit point\n" );
                pda_run->commit_shift_count = pda_run->shift_count;
 
                /* Not in a reverting context and the parser result is not 
used. */
                if ( pda_run->reducer )
                        commit_reduce( prg, sp, pda_run );
+
+               if ( pda_run->fail_parsing )
+                       goto fail;
+                       
        }
 
        /*
@@ -2182,6 +2192,12 @@
                        debug( prg, REALM_PARSE, "parsing stopped by a parse 
error\n" );
                        break;
                }
+
+               /* Disregard any alternate parse paths, just go right to 
failure. */
+               if ( pda_run->fail_parsing ) {
+                       debug( prg, REALM_PARSE, "parsing failed by explicit 
request\n" );
+                       break;
+               }
        }
 
        /* COROUTINE */
@@ -2267,6 +2283,10 @@
        /* Flush out anything not committed. */
        if ( pda_run->reducer )
                commit_reduce( prg, sp, pda_run );
+       
+       /* What to do here.
+        * if ( pda_run->fail_parsing )
+        *   goto fail; */
 
        if ( !revert_on )
                colm_rcode_downref_all( prg, sp, &pda_run->reverse_code );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/pdarun.h new/colm-0.13.0.4/src/pdarun.h
--- old/colm-0.13.0.3/src/pdarun.h      2015-12-01 16:15:13.000000000 +0100
+++ new/colm-0.13.0.4/src/pdarun.h      2016-04-04 15:55:00.000000000 +0200
@@ -317,6 +317,12 @@
 
        long steps;
        long target_steps;
+
+
+       /* The shift count simply tracks the number of shifts that have happend.
+        * The commit shift count is the shift count when the last commit 
occurred.
+        * If we back up to this number of shifts then we decide we cannot 
proceed.
+        * The commit shift count is initialized to -1. */
        long shift_count;
        long commit_shift_count;
 
@@ -363,6 +369,9 @@
 
        struct pool_alloc *parse_tree_pool;
        struct pool_alloc local_pool;
+
+       /* Disregard any alternate parse paths, just go right to failure. */
+       int fail_parsing;
 };
 
 void colm_pda_init( struct colm_program *prg, struct pda_run *pda_run,
@@ -458,15 +467,6 @@
 void commit_reduce( program_t *prg, tree_t **root,
                struct pda_run *pda_run );
 
-/* Supplied by generated code. */
-void commit_reduce_forward( program_t *prg, tree_t **root,
-               struct pda_run *pda_run, parse_tree_t *pt );
-
-long commit_union_sz( int reducer );
-void init_need();
-int reducer_need_tok( program_t *prg, struct pda_run *pda_run, int id );
-int reducer_need_ign( program_t *prg, struct pda_run *pda_run );
-
 #ifdef __cplusplus
 }
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/program.c new/colm-0.13.0.4/src/program.c
--- old/colm-0.13.0.3/src/program.c     2015-11-30 17:12:55.000000000 +0100
+++ new/colm-0.13.0.4/src/program.c     2016-04-04 15:55:00.000000000 +0200
@@ -194,7 +194,10 @@
        /* Allocate the VM stack. */
        vm_init( prg );
 
-       init_need();
+       rtd->init_need();
+
+       prg->stream_fns = malloc( sizeof(char*) * 1 );
+       prg->stream_fns[0] = 0;
        return prg;
 }
 
@@ -233,6 +236,13 @@
        prg->red_ctx = ctx;
 }
 
+const char **colm_extract_fns( struct colm_program *prg )
+{
+       const char **fns = prg->stream_fns;
+       prg->stream_fns = 0;
+       return fns;
+}
+
 int colm_delete_program( program_t *prg )
 {
        tree_t **sp = prg->stack_root;
@@ -281,6 +291,16 @@
 
        vm_clear( prg );
 
+       if ( prg->stream_fns ) {
+               char **ptr = prg->stream_fns;
+               while ( *ptr != 0 ) {
+                       free( *ptr );
+                       ptr += 1;
+               }
+
+               free( prg->stream_fns );
+       }
+
        free( prg );
 
        return exit_status;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/program.h new/colm-0.13.0.4/src/program.h
--- old/colm-0.13.0.3/src/program.h     2015-11-30 17:11:53.000000000 +0100
+++ new/colm-0.13.0.4/src/program.h     2016-04-04 15:55:00.000000000 +0200
@@ -100,7 +100,13 @@
        void (*init_bindings)( struct pda_run *pda_run );
        void (*pop_binding)( struct pda_run *pda_run, parse_tree_t *tree );
 
+       tree_t **(*host_call)( program_t *prg, long code, tree_t **sp );
+
+       void (*commit_reduce_forward)( program_t *prg, tree_t **root, struct 
pda_run *pda_run, parse_tree_t *pt );
+       long (*commit_union_sz)( int reducer );
        void (*init_need)();
+       int (*reducer_need_tok)( program_t *prg, struct pda_run *pda_run, int 
id );
+       int (*reducer_need_ign)( program_t *prg, struct pda_run *pda_run );
 };
 
 struct heap_list
@@ -153,6 +159,9 @@
        tree_t *return_val;
 
        void *red_ctx;
+
+       /* This can be extracted for ownership transfer before a program is 
deleted. */
+       const char **stream_fns;
 };
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/reduce.cc new/colm-0.13.0.4/src/reduce.cc
--- old/colm-0.13.0.3/src/reduce.cc     2015-12-02 21:51:04.000000000 +0100
+++ new/colm-0.13.0.4/src/reduce.cc     2016-04-04 15:55:00.000000000 +0200
@@ -43,17 +43,17 @@
 void Compiler::writeCommitStub()
 {
        *outStream <<
-               "void commit_reduce_forward( program_t *prg, tree_t **root,\n"
+               "void " << objectName << "_commit_reduce_forward( program_t 
*prg, tree_t **root,\n"
                "               struct pda_run *pda_run, parse_tree_t *pt )\n"
                "{\n"
                "       commit_clear_parse_tree( prg, root, pda_run, pt->child 
);\n"
                "}\n"
                "\n"
-               "long commit_union_sz( int reducer ) { return 0; }\n"
-               "void init_need() {}\n"
-               "int reducer_need_tok( program_t *prg, "
+               "long " << objectName << "_commit_union_sz( int reducer ) { 
return 0; }\n"
+               "void " << objectName << "_init_need() {}\n"
+               "int " << objectName << "_reducer_need_tok( program_t *prg, "
                                "struct pda_run *pda_run, int id ) { return 
COLM_RN_BOTH; }\n"
-               "int reducer_need_ign( program_t *prg, "
+               "int " << objectName << "_reducer_need_ign( program_t *prg, "
                                "struct pda_run *pda_run ) { return 
COLM_RN_BOTH; }\n"
                "\n";
        ;
@@ -346,7 +346,7 @@
                "\n";
 
        *outStream <<
-               "extern \"C\" void init_need()\n"
+               "extern \"C\" void " << objectName << "_init_need()\n"
                "{\n";
        
        for ( ReductionVect::Iter r = rootNamespace->reductions; r.lte(); r++ ) 
{
@@ -374,7 +374,7 @@
                "}\n";
 
        *outStream <<
-               "extern \"C\" int reducer_need_tok( program_t *prg, "
+               "extern \"C\" int " << objectName << "_reducer_need_tok( 
program_t *prg, "
                                "struct pda_run *pda_run, int id )\n"
                "{\n"
                "       if ( pda_run->reducer > 0 ) {\n"
@@ -386,7 +386,7 @@
                "       return COLM_RN_BOTH;\n"
                "}\n"
                "\n"
-               "extern \"C\" int reducer_need_ign( program_t *prg, struct 
pda_run *pda_run )\n"
+               "extern \"C\" int " << objectName << "_reducer_need_ign( 
program_t *prg, struct pda_run *pda_run )\n"
                "{\n"
                // Using this requires finding a solution for backtracking push 
back.
                //"     if ( pda_run->reducer > 0 )\n"
@@ -453,14 +453,14 @@
                "\n";
 
        *outStream <<
-               "long commit_union_sz( int reducer )\n"
+               "extern \"C\" long " << objectName << "_commit_union_sz( int 
reducer )\n"
                "{\n"
                "       return sizeof( commit_reduce_union );\n"
                "}\n";
 
        *outStream <<
                "\n"
-               "void commit_reduce_forward( program_t *prg, tree_t **root,\n"
+               "extern \"C\" void " << objectName << "_commit_reduce_forward( 
program_t *prg, tree_t **root,\n"
                "               struct pda_run *pda_run, parse_tree_t *pt )\n"
                "{\n"
                "       switch ( pda_run->reducer ) {\n";
@@ -500,7 +500,7 @@
                        "               vm_push_kid( kid );\n"
                        "\n"
                        "               lel = lel->child;\n"
-                       "               kid = kid->tree->child;\n"
+                       "               kid = tree_child( prg, kid->tree );\n"
                        "               while ( lel != 0 ) {\n"
                        "                       goto recurse;\n"
                        "                       resume:\n"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/synthesis.cc new/colm-0.13.0.4/src/synthesis.cc
--- old/colm-0.13.0.3/src/synthesis.cc  2015-12-15 21:48:24.000000000 +0100
+++ new/colm-0.13.0.4/src/synthesis.cc  2016-04-04 15:55:00.000000000 +0200
@@ -1235,6 +1235,9 @@
 
                }
        }
+       else if ( newUT->typeId == TYPE_STRUCT && newUT->structEl == 
pd->streamSel ) {
+               code.append( IN_NEW_STREAM );
+       }
        else {
                code.append( IN_NEW_STRUCT );
                code.appendHalf( newUT->structEl->id );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude 
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh 
old/colm-0.13.0.3/src/version.h new/colm-0.13.0.4/src/version.h
--- old/colm-0.13.0.3/src/version.h     2016-01-28 14:09:05.000000000 +0100
+++ new/colm-0.13.0.4/src/version.h     2016-07-11 21:36:53.000000000 +0200
@@ -1,2 +1,2 @@
-#define VERSION "0.13.0.3"
-#define PUBDATE "Jan 2016"
+#define VERSION "0.13.0.4"
+#define PUBDATE "July 2016"


Reply via email to