You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/04/27 01:11:31 UTC

[lucy-commits] [01/54] [abbrv] Remove bundled Clownfish.

Repository: lucy
Updated Branches:
  refs/heads/sortex_ptr_only ad8f92cf4 -> c15909359 (forced update)


http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/binding/801-pod_checker.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/binding/801-pod_checker.t b/clownfish/runtime/perl/t/binding/801-pod_checker.t
deleted file mode 100644
index 2769e77..0000000
--- a/clownfish/runtime/perl/t/binding/801-pod_checker.t
+++ /dev/null
@@ -1,54 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More;
-use Pod::Checker;
-BEGIN {
-    if ( $] < 5.010 ) {
-        plan( 'skip_all', "Old Pod::Checker is buggy" );
-    }
-    else {
-        plan('no_plan');
-    }
-}
-
-use File::Find qw( find );
-
-my @filepaths;
-find(
-    {   no_chdir => 1,
-        wanted   => sub {
-            return unless $File::Find::name =~ /\.(pm|pod)$/;
-            push @filepaths, $File::Find::name;
-            }
-    },
-    'lib'
-);
-
-for my $path (@filepaths) {
-    my $pod_ok = podchecker( $path, undef, -warnings => 0 );
-    if ( $pod_ok == -1 ) {
-        # No POD.
-    }
-    elsif ( $pod_ok == 0 ) {
-        pass("POD ok for '$path'");
-    }
-    else {
-        fail("Bad POD for '$path'");
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/016-varray.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/016-varray.t b/clownfish/runtime/perl/t/core/016-varray.t
deleted file mode 100644
index 5ddb5c1..0000000
--- a/clownfish/runtime/perl/t/core/016-varray.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestVArray");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/017-hash.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/017-hash.t b/clownfish/runtime/perl/t/core/017-hash.t
deleted file mode 100644
index f8583c8..0000000
--- a/clownfish/runtime/perl/t/core/017-hash.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestHash");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/019-obj.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/019-obj.t b/clownfish/runtime/perl/t/core/019-obj.t
deleted file mode 100644
index ea51ecf..0000000
--- a/clownfish/runtime/perl/t/core/019-obj.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestObj");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/020-err.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/020-err.t b/clownfish/runtime/perl/t/core/020-err.t
deleted file mode 100644
index 0679130..0000000
--- a/clownfish/runtime/perl/t/core/020-err.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestErr");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/022-bytebuf.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/022-bytebuf.t b/clownfish/runtime/perl/t/core/022-bytebuf.t
deleted file mode 100644
index 5dd7437..0000000
--- a/clownfish/runtime/perl/t/core/022-bytebuf.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestByteBuf");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/023-string.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/023-string.t b/clownfish/runtime/perl/t/core/023-string.t
deleted file mode 100644
index d2836ff..0000000
--- a/clownfish/runtime/perl/t/core/023-string.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestString");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/029-charbuf.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/029-charbuf.t b/clownfish/runtime/perl/t/core/029-charbuf.t
deleted file mode 100644
index 39041fb..0000000
--- a/clownfish/runtime/perl/t/core/029-charbuf.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestCharBuf");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/030-number_utils.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/030-number_utils.t b/clownfish/runtime/perl/t/core/030-number_utils.t
deleted file mode 100644
index 1035f96..0000000
--- a/clownfish/runtime/perl/t/core/030-number_utils.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests(
-    "Clownfish::Test::Util::TestNumberUtils"
-);
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/031-num.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/031-num.t b/clownfish/runtime/perl/t/core/031-num.t
deleted file mode 100644
index e784ae6..0000000
--- a/clownfish/runtime/perl/t/core/031-num.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::TestNum");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/032-string_helper.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/032-string_helper.t b/clownfish/runtime/perl/t/core/032-string_helper.t
deleted file mode 100644
index ffa4fbe..0000000
--- a/clownfish/runtime/perl/t/core/032-string_helper.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests(
-    "Clownfish::Test::Util::TestStringHelper"
-);
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/037-atomic.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/037-atomic.t b/clownfish/runtime/perl/t/core/037-atomic.t
deleted file mode 100644
index 1ed26e9..0000000
--- a/clownfish/runtime/perl/t/core/037-atomic.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::Util::TestAtomic");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/038-lock_free_registry.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/038-lock_free_registry.t b/clownfish/runtime/perl/t/core/038-lock_free_registry.t
deleted file mode 100644
index f6484c6..0000000
--- a/clownfish/runtime/perl/t/core/038-lock_free_registry.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests(
-    "Clownfish::Test::TestLockFreeRegistry"
-);
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/core/039-memory.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/core/039-memory.t b/clownfish/runtime/perl/t/core/039-memory.t
deleted file mode 100644
index 16c1c68..0000000
--- a/clownfish/runtime/perl/t/core/039-memory.t
+++ /dev/null
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::Test;
-my $success = Clownfish::Test::run_tests("Clownfish::Test::Util::TestMemory");
-
-exit($success ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/xs/XSBind.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.c b/clownfish/runtime/perl/xs/XSBind.c
deleted file mode 100644
index 4c7a275..0000000
--- a/clownfish/runtime/perl/xs/XSBind.c
+++ /dev/null
@@ -1,928 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_OBJ
-#define C_CFISH_VTABLE
-#define C_CFISH_LOCKFREEREGISTRY
-#define NEED_newRV_noinc
-#include "charmony.h"
-#include "XSBind.h"
-#include "Clownfish/LockFreeRegistry.h"
-#include "Clownfish/Util/StringHelper.h"
-#include "Clownfish/Util/NumberUtils.h"
-#include "Clownfish/Util/Memory.h"
-
-#define XSBIND_REFCOUNT_FLAG   1
-#define XSBIND_REFCOUNT_SHIFT  1
-
-// Convert a Perl hash into a Clownfish Hash.  Caller takes responsibility for
-// a refcount.
-static cfish_Hash*
-S_perl_hash_to_cfish_hash(HV *phash);
-
-// Convert a Perl array into a Clownfish VArray.  Caller takes responsibility
-// for a refcount.
-static cfish_VArray*
-S_perl_array_to_cfish_array(AV *parray);
-
-// Convert a VArray to a Perl array.  Caller takes responsibility for a
-// refcount.
-static SV*
-S_cfish_array_to_perl_array(cfish_VArray *varray);
-
-// Convert a Hash to a Perl hash.  Caller takes responsibility for a refcount.
-static SV*
-S_cfish_hash_to_perl_hash(cfish_Hash *hash);
-
-cfish_Obj*
-XSBind_new_blank_obj(SV *either_sv) {
-    cfish_VTable *vtable;
-
-    // Get a VTable.
-    if (sv_isobject(either_sv)
-        && sv_derived_from(either_sv, "Clownfish::Obj")
-       ) {
-        // Use the supplied object's VTable.
-        IV iv_ptr = SvIV(SvRV(either_sv));
-        cfish_Obj *self = INT2PTR(cfish_Obj*, iv_ptr);
-        vtable = self->vtable;
-    }
-    else {
-        // Use the supplied class name string to find a VTable.
-        STRLEN len;
-        char *ptr = SvPVutf8(either_sv, len);
-        cfish_StackString *klass = CFISH_SSTR_WRAP_UTF8(ptr, len);
-        vtable = cfish_VTable_singleton((cfish_String*)klass, NULL);
-    }
-
-    // Use the VTable to allocate a new blank object of the right size.
-    return CFISH_VTable_Make_Obj(vtable);
-}
-
-cfish_Obj*
-XSBind_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable, void *allocation) {
-    cfish_Obj *retval = XSBind_maybe_sv_to_cfish_obj(sv, vtable, allocation);
-    if (!retval) {
-        THROW(CFISH_ERR, "Not a %o", CFISH_VTable_Get_Name(vtable));
-    }
-    return retval;
-}
-
-cfish_Obj*
-XSBind_maybe_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable, void *allocation) {
-    cfish_Obj *retval = NULL;
-    if (XSBind_sv_defined(sv)) {
-        // Assume that the class name is always NULL-terminated. Somewhat
-        // dangerous but should be safe.
-        if (sv_isobject(sv)
-            && sv_derived_from(sv, CFISH_Str_Get_Ptr8(CFISH_VTable_Get_Name(vtable)))
-           ) {
-            // Unwrap a real Clownfish object.
-            IV tmp = SvIV(SvRV(sv));
-            retval = INT2PTR(cfish_Obj*, tmp);
-        }
-        else if (allocation &&
-                 (vtable == CFISH_STACKSTRING
-                  || vtable == CFISH_STRING
-                  || vtable == CFISH_OBJ)
-                ) {
-            // Wrap the string from an ordinary Perl scalar inside a
-            // StackString.
-            STRLEN size;
-            char *ptr = SvPVutf8(sv, size);
-            retval = (cfish_Obj*)cfish_SStr_wrap_str(allocation, ptr, size);
-        }
-        else if (SvROK(sv)) {
-            // Attempt to convert Perl hashes and arrays into their Clownfish
-            // analogues.
-            SV *inner = SvRV(sv);
-            if (SvTYPE(inner) == SVt_PVAV && vtable == CFISH_VARRAY) {
-                retval = (cfish_Obj*)S_perl_array_to_cfish_array((AV*)inner);
-            }
-            else if (SvTYPE(inner) == SVt_PVHV && vtable == CFISH_HASH) {
-                retval = (cfish_Obj*)S_perl_hash_to_cfish_hash((HV*)inner);
-            }
-
-            if (retval) {
-                // Mortalize the converted object -- which is somewhat
-                // dangerous, but is the only way to avoid requiring that the
-                // caller take responsibility for a refcount.
-                SV *mortal = (SV*)CFISH_Obj_To_Host(retval);
-                CFISH_DECREF(retval);
-                sv_2mortal(mortal);
-            }
-        }
-    }
-
-    return retval;
-}
-
-SV*
-XSBind_cfish_to_perl(cfish_Obj *obj) {
-    if (obj == NULL) {
-        return newSV(0);
-    }
-    else if (CFISH_Obj_Is_A(obj, CFISH_STRING)) {
-        return XSBind_str_to_sv((cfish_String*)obj);
-    }
-    else if (CFISH_Obj_Is_A(obj, CFISH_BYTEBUF)) {
-        return XSBind_bb_to_sv((cfish_ByteBuf*)obj);
-    }
-    else if (CFISH_Obj_Is_A(obj, CFISH_VARRAY)) {
-        return S_cfish_array_to_perl_array((cfish_VArray*)obj);
-    }
-    else if (CFISH_Obj_Is_A(obj, CFISH_HASH)) {
-        return S_cfish_hash_to_perl_hash((cfish_Hash*)obj);
-    }
-    else if (CFISH_Obj_Is_A(obj, CFISH_FLOATNUM)) {
-        return newSVnv(CFISH_Obj_To_F64(obj));
-    }
-    else if (obj == (cfish_Obj*)CFISH_TRUE) {
-        return newSViv(1);
-    }
-    else if (obj == (cfish_Obj*)CFISH_FALSE) {
-        return newSViv(0);
-    }
-    else if (sizeof(IV) == 8 && CFISH_Obj_Is_A(obj, CFISH_INTNUM)) {
-        int64_t num = CFISH_Obj_To_I64(obj);
-        return newSViv((IV)num);
-    }
-    else if (sizeof(IV) == 4 && CFISH_Obj_Is_A(obj, CFISH_INTEGER32)) {
-        int32_t num = (int32_t)CFISH_Obj_To_I64(obj);
-        return newSViv((IV)num);
-    }
-    else if (sizeof(IV) == 4 && CFISH_Obj_Is_A(obj, CFISH_INTEGER64)) {
-        int64_t num = CFISH_Obj_To_I64(obj);
-        return newSVnv((double)num); // lossy
-    }
-    else {
-        return (SV*)CFISH_Obj_To_Host(obj);
-    }
-}
-
-cfish_Obj*
-XSBind_perl_to_cfish(SV *sv) {
-    cfish_Obj *retval = NULL;
-
-    if (XSBind_sv_defined(sv)) {
-        if (SvROK(sv)) {
-            // Deep conversion of references.
-            SV *inner = SvRV(sv);
-            if (SvTYPE(inner) == SVt_PVAV) {
-                retval = (cfish_Obj*)S_perl_array_to_cfish_array((AV*)inner);
-            }
-            else if (SvTYPE(inner) == SVt_PVHV) {
-                retval = (cfish_Obj*)S_perl_hash_to_cfish_hash((HV*)inner);
-            }
-            else if (sv_isobject(sv)
-                     && sv_derived_from(sv, "Clownfish::Obj")
-                    ) {
-                IV tmp = SvIV(inner);
-                retval = INT2PTR(cfish_Obj*, tmp);
-                (void)CFISH_INCREF(retval);
-            }
-        }
-
-        // It's either a plain scalar or a non-Clownfish Perl object, so
-        // stringify.
-        if (!retval) {
-            STRLEN len;
-            char *ptr = SvPVutf8(sv, len);
-            retval = (cfish_Obj*)cfish_Str_new_from_trusted_utf8(ptr, len);
-        }
-    }
-    else if (sv) {
-        // Deep conversion of raw AVs and HVs.
-        if (SvTYPE(sv) == SVt_PVAV) {
-            retval = (cfish_Obj*)S_perl_array_to_cfish_array((AV*)sv);
-        }
-        else if (SvTYPE(sv) == SVt_PVHV) {
-            retval = (cfish_Obj*)S_perl_hash_to_cfish_hash((HV*)sv);
-        }
-    }
-
-    return retval;
-}
-
-SV*
-XSBind_bb_to_sv(cfish_ByteBuf *bb) {
-    return bb
-           ? newSVpvn(CFISH_BB_Get_Buf(bb), CFISH_BB_Get_Size(bb))
-           : newSV(0);
-}
-
-SV*
-XSBind_str_to_sv(cfish_String *str) {
-    if (!str) {
-        return newSV(0);
-    }
-    else {
-        SV *sv = newSVpvn(CFISH_Str_Get_Ptr8(str), CFISH_Str_Get_Size(str));
-        SvUTF8_on(sv);
-        return sv;
-    }
-}
-
-static cfish_Hash*
-S_perl_hash_to_cfish_hash(HV *phash) {
-    uint32_t    num_keys = hv_iterinit(phash);
-    cfish_Hash *retval   = cfish_Hash_new(num_keys);
-
-    while (num_keys--) {
-        HE        *entry    = hv_iternext(phash);
-        STRLEN     key_len  = HeKLEN(entry);
-        SV        *value_sv = HeVAL(entry);
-        cfish_Obj *value    = XSBind_perl_to_cfish(value_sv); // Recurse.
-
-        // Force key to UTF-8 if necessary.
-        if (key_len == (STRLEN)HEf_SVKEY) {
-            // Key is stored as an SV.  Use its UTF-8 flag?  Not sure about
-            // this.
-            SV   *key_sv  = HeKEY_sv(entry);
-            char *key_str = SvPVutf8(key_sv, key_len);
-            CFISH_Hash_Store_Utf8(retval, key_str, key_len, value);
-        }
-        else if (HeKUTF8(entry)) {
-            CFISH_Hash_Store_Utf8(retval, HeKEY(entry), key_len, value);
-        }
-        else {
-            char *key_str = HeKEY(entry);
-            bool pure_ascii = true;
-            for (STRLEN i = 0; i < key_len; i++) {
-                if ((key_str[i] & 0x80) == 0x80) { pure_ascii = false; }
-            }
-            if (pure_ascii) {
-                CFISH_Hash_Store_Utf8(retval, key_str, key_len, value);
-            }
-            else {
-                SV *key_sv = HeSVKEY_force(entry);
-                key_str = SvPVutf8(key_sv, key_len);
-                CFISH_Hash_Store_Utf8(retval, key_str, key_len, value);
-            }
-        }
-    }
-
-    return retval;
-}
-
-static cfish_VArray*
-S_perl_array_to_cfish_array(AV *parray) {
-    const uint32_t  size   = av_len(parray) + 1;
-    cfish_VArray   *retval = cfish_VA_new(size);
-
-    // Iterate over array elems.
-    for (uint32_t i = 0; i < size; i++) {
-        SV **elem_sv = av_fetch(parray, i, false);
-        if (elem_sv) {
-            cfish_Obj *elem = XSBind_perl_to_cfish(*elem_sv);
-            if (elem) { CFISH_VA_Store(retval, i, elem); }
-        }
-    }
-    CFISH_VA_Resize(retval, size); // needed if last elem is NULL
-
-    return retval;
-}
-
-static SV*
-S_cfish_array_to_perl_array(cfish_VArray *varray) {
-    AV *perl_array = newAV();
-    uint32_t num_elems = CFISH_VA_Get_Size(varray);
-
-    // Iterate over array elems.
-    if (num_elems) {
-        av_fill(perl_array, num_elems - 1);
-        for (uint32_t i = 0; i < num_elems; i++) {
-            cfish_Obj *val = CFISH_VA_Fetch(varray, i);
-            if (val == NULL) {
-                continue;
-            }
-            else {
-                // Recurse for each value.
-                SV *const val_sv = XSBind_cfish_to_perl(val);
-                av_store(perl_array, i, val_sv);
-            }
-        }
-    }
-
-    return newRV_noinc((SV*)perl_array);
-}
-
-static SV*
-S_cfish_hash_to_perl_hash(cfish_Hash *hash) {
-    HV *perl_hash = newHV();
-    SV *key_sv    = newSV(1);
-    cfish_String *key;
-    cfish_Obj     *val;
-
-    // Prepare the SV key.
-    SvPOK_on(key_sv);
-    SvUTF8_on(key_sv);
-
-    // Iterate over key-value pairs.
-    CFISH_Hash_Iterate(hash);
-    while (CFISH_Hash_Next(hash, (cfish_Obj**)&key, &val)) {
-        // Recurse for each value.
-        SV *val_sv = XSBind_cfish_to_perl(val);
-        if (!CFISH_Obj_Is_A((cfish_Obj*)key, CFISH_STRING)) {
-            CFISH_THROW(CFISH_ERR,
-                        "Can't convert a key of class %o to a Perl hash key",
-                        CFISH_Obj_Get_Class_Name((cfish_Obj*)key));
-        }
-        else {
-            STRLEN key_size = CFISH_Str_Get_Size(key);
-            char *key_sv_ptr = SvGROW(key_sv, key_size + 1);
-            memcpy(key_sv_ptr, CFISH_Str_Get_Ptr8(key), key_size);
-            SvCUR_set(key_sv, key_size);
-            *SvEND(key_sv) = '\0';
-            (void)hv_store_ent(perl_hash, key_sv, val_sv, 0);
-        }
-    }
-    SvREFCNT_dec(key_sv);
-
-    return newRV_noinc((SV*)perl_hash);
-}
-
-struct trap_context {
-    SV *routine;
-    SV *context;
-};
-
-static void
-S_attempt_perl_call(void *context) {
-    struct trap_context *args = (struct trap_context*)context;
-    dSP;
-    ENTER;
-    SAVETMPS;
-    PUSHMARK(SP);
-    XPUSHs(sv_2mortal(newSVsv(args->context)));
-    PUTBACK;
-    call_sv(args->routine, G_DISCARD);
-    FREETMPS;
-    LEAVE;
-}
-
-cfish_Err*
-XSBind_trap(SV *routine, SV *context) {
-    struct trap_context args;
-    args.routine = routine;
-    args.context = context;
-    return cfish_Err_trap(S_attempt_perl_call, &args);
-}
-
-void
-XSBind_enable_overload(void *pobj) {
-    SV *perl_obj = (SV*)pobj;
-    HV *stash = SvSTASH(SvRV(perl_obj));
-#if (PERL_VERSION > 10)
-    Gv_AMupdate(stash, false);
-#else
-    Gv_AMupdate(stash);
-#endif
-    SvAMAGIC_on(perl_obj);
-}
-
-static bool
-S_extract_from_sv(SV *value, void *target, const char *label,
-                  bool required, int type, cfish_VTable *vtable,
-                  void *allocation) {
-    bool valid_assignment = false;
-
-    if (XSBind_sv_defined(value)) {
-        switch (type) {
-            case XSBIND_WANT_I8:
-                *((int8_t*)target) = (int8_t)SvIV(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_I16:
-                *((int16_t*)target) = (int16_t)SvIV(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_I32:
-                *((int32_t*)target) = (int32_t)SvIV(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_I64:
-                if (sizeof(IV) == 8) {
-                    *((int64_t*)target) = (int64_t)SvIV(value);
-                }
-                else { // sizeof(IV) == 4
-                    // lossy.
-                    *((int64_t*)target) = (int64_t)SvNV(value);
-                }
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_U8:
-                *((uint8_t*)target) = (uint8_t)SvUV(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_U16:
-                *((uint16_t*)target) = (uint16_t)SvUV(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_U32:
-                *((uint32_t*)target) = (uint32_t)SvUV(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_U64:
-                if (sizeof(UV) == 8) {
-                    *((uint64_t*)target) = (uint64_t)SvUV(value);
-                }
-                else { // sizeof(UV) == 4
-                    // lossy.
-                    *((uint64_t*)target) = (uint64_t)SvNV(value);
-                }
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_BOOL:
-                *((bool*)target) = !!SvTRUE(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_F32:
-                *((float*)target) = (float)SvNV(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_F64:
-                *((double*)target) = SvNV(value);
-                valid_assignment = true;
-                break;
-            case XSBIND_WANT_OBJ: {
-                    cfish_Obj *object
-                        = XSBind_maybe_sv_to_cfish_obj(value, vtable,
-                                                       allocation);
-                    if (object) {
-                        *((cfish_Obj**)target) = object;
-                        valid_assignment = true;
-                    }
-                    else {
-                        cfish_String *mess
-                            = CFISH_MAKE_MESS(
-                                  "Invalid value for '%s' - not a %o",
-                                  label, CFISH_VTable_Get_Name(vtable));
-                        cfish_Err_set_error(cfish_Err_new(mess));
-                        return false;
-                    }
-                }
-                break;
-            case XSBIND_WANT_SV:
-                *((SV**)target) = value;
-                valid_assignment = true;
-                break;
-            default: {
-                    cfish_String *mess
-                        = CFISH_MAKE_MESS("Unrecognized type: %i32 for param '%s'",
-                                          (int32_t)type, label);
-                    cfish_Err_set_error(cfish_Err_new(mess));
-                    return false;
-                }
-        }
-    }
-
-    // Enforce that required params cannot be undef and must present valid
-    // values.
-    if (required && !valid_assignment) {
-        cfish_String *mess = CFISH_MAKE_MESS("Missing required param %s",
-                                             label);
-        cfish_Err_set_error(cfish_Err_new(mess));
-        return false;
-    }
-
-    return true;
-}
-
-bool
-XSBind_allot_params(SV** stack, int32_t start, int32_t num_stack_elems, ...) {
-    va_list args;
-    size_t size = sizeof(int64_t) + num_stack_elems / 64;
-    void *verified_labels = alloca(size);
-    memset(verified_labels, 0, size);
-
-    // Verify that our args come in pairs. Return success if there are no
-    // args.
-    if ((num_stack_elems - start) % 2 != 0) {
-        cfish_String *mess
-            = CFISH_MAKE_MESS(
-                  "Expecting hash-style params, got odd number of args");
-        cfish_Err_set_error(cfish_Err_new(mess));
-        return false;
-    }
-
-    void *target;
-    va_start(args, num_stack_elems);
-    while (NULL != (target = va_arg(args, void*))) {
-        char *label     = va_arg(args, char*);
-        int   label_len = va_arg(args, int);
-        int   required  = va_arg(args, int);
-        int   type      = va_arg(args, int);
-        cfish_VTable *vtable = va_arg(args, cfish_VTable*);
-        void *allocation = va_arg(args, void*);
-
-        // Iterate through the stack looking for labels which match this param
-        // name.  If the label appears more than once, keep track of where it
-        // appears *last*, as the last time a param appears overrides all
-        // previous appearances.
-        int32_t found_arg = -1;
-        for (int32_t tick = start; tick < num_stack_elems; tick += 2) {
-            SV *const key_sv = stack[tick];
-            if (SvCUR(key_sv) == (STRLEN)label_len) {
-                if (memcmp(SvPVX(key_sv), label, label_len) == 0) {
-                    found_arg = tick;
-                    cfish_NumUtil_u1set(verified_labels, tick);
-                }
-            }
-        }
-
-        if (found_arg == -1) {
-            // Didn't find this parameter. Throw an error if it was required.
-            if (required) {
-                cfish_String *mess
-                    = CFISH_MAKE_MESS("Missing required parameter: '%s'",
-                                      label);
-                cfish_Err_set_error(cfish_Err_new(mess));
-                return false;
-            }
-        }
-        else {
-            // Found the arg.  Extract the value.
-            SV *value = stack[found_arg + 1];
-            bool got_arg = S_extract_from_sv(value, target, label,
-                                                   required, type, vtable,
-                                                   allocation);
-            if (!got_arg) {
-                CFISH_ERR_ADD_FRAME(cfish_Err_get_error());
-                return false;
-            }
-        }
-    }
-    va_end(args);
-
-    // Ensure that all parameter labels were valid.
-    for (int32_t tick = start; tick < num_stack_elems; tick += 2) {
-        if (!cfish_NumUtil_u1get(verified_labels, tick)) {
-            SV *const key_sv = stack[tick];
-            char *key = SvPV_nolen(key_sv);
-            cfish_String *mess
-                = CFISH_MAKE_MESS("Invalid parameter: '%s'", key);
-            cfish_Err_set_error(cfish_Err_new(mess));
-            return false;
-        }
-    }
-
-    return true;
-}
-
-/***************************************************************************
- * The routines below are declared within the Clownfish core but left
- * unimplemented and must be defined for each host language.
- ***************************************************************************/
-
-/**************************** Clownfish::Obj *******************************/
-
-static void
-S_lazy_init_host_obj(cfish_Obj *self) {
-    SV *inner_obj = newSV(0);
-    SvOBJECT_on(inner_obj);
-#if (PERL_VERSION <= 16)
-    PL_sv_objcount++;
-#endif
-    (void)SvUPGRADE(inner_obj, SVt_PVMG);
-    sv_setiv(inner_obj, PTR2IV(self));
-
-    // Connect class association.
-    cfish_String *class_name = CFISH_VTable_Get_Name(self->vtable);
-    HV *stash = gv_stashpvn(CFISH_Str_Get_Ptr8(class_name),
-                            CFISH_Str_Get_Size(class_name), TRUE);
-    SvSTASH_set(inner_obj, (HV*)SvREFCNT_inc(stash));
-
-    /* Up till now we've been keeping track of the refcount in
-     * self->ref.count.  We're replacing ref.count with ref.host_obj, which
-     * will assume responsibility for maintaining the refcount.  ref.host_obj
-     * starts off with a refcount of 1, so we need to transfer any refcounts
-     * in excess of that. */
-    size_t old_refcount = self->ref.count;
-    self->ref.host_obj = inner_obj;
-    SvREFCNT(inner_obj) += (old_refcount >> XSBIND_REFCOUNT_SHIFT) - 1;
-}
-
-uint32_t
-CFISH_Obj_Get_RefCount_IMP(cfish_Obj *self) {
-    return self->ref.count & XSBIND_REFCOUNT_FLAG
-           ? self->ref.count >> XSBIND_REFCOUNT_SHIFT
-           : SvREFCNT((SV*)self->ref.host_obj);
-}
-
-cfish_Obj*
-CFISH_Obj_Inc_RefCount_IMP(cfish_Obj *self) {
-    if (self->ref.count & XSBIND_REFCOUNT_FLAG) {
-        if (self->ref.count == XSBIND_REFCOUNT_FLAG) {
-            CFISH_THROW(CFISH_ERR, "Illegal refcount of 0");
-        }
-        self->ref.count += 1 << XSBIND_REFCOUNT_SHIFT;
-    }
-    else {
-        SvREFCNT_inc_simple_void_NN((SV*)self->ref.host_obj);
-    }
-    return self;
-}
-
-uint32_t
-CFISH_Obj_Dec_RefCount_IMP(cfish_Obj *self) {
-    uint32_t modified_refcount = I32_MAX;
-    if (self->ref.count & XSBIND_REFCOUNT_FLAG) {
-        if (self->ref.count == XSBIND_REFCOUNT_FLAG) {
-            CFISH_THROW(CFISH_ERR, "Illegal refcount of 0");
-        }
-        if (self->ref.count
-            == ((1 << XSBIND_REFCOUNT_SHIFT) | XSBIND_REFCOUNT_FLAG)) {
-            modified_refcount = 0;
-            CFISH_Obj_Destroy(self);
-        }
-        else {
-            self->ref.count -= 1 << XSBIND_REFCOUNT_SHIFT;
-            modified_refcount = self->ref.count >> XSBIND_REFCOUNT_SHIFT;
-        }
-    }
-    else {
-        modified_refcount = SvREFCNT((SV*)self->ref.host_obj) - 1;
-        // If the SV's refcount falls to 0, DESTROY will be invoked from
-        // Perl-space.
-        SvREFCNT_dec((SV*)self->ref.host_obj);
-    }
-    return modified_refcount;
-}
-
-void*
-CFISH_Obj_To_Host_IMP(cfish_Obj *self) {
-    if (self->ref.count & XSBIND_REFCOUNT_FLAG) { S_lazy_init_host_obj(self); }
-    return newRV_inc((SV*)self->ref.host_obj);
-}
-
-/*************************** Clownfish::VTable ******************************/
-
-cfish_Obj*
-CFISH_VTable_Make_Obj_IMP(cfish_VTable *self) {
-    cfish_Obj *obj
-        = (cfish_Obj*)cfish_Memory_wrapped_calloc(self->obj_alloc_size, 1);
-    obj->vtable = self;
-    obj->ref.count = (1 << XSBIND_REFCOUNT_SHIFT) | XSBIND_REFCOUNT_FLAG;
-    return obj;
-}
-
-cfish_Obj*
-CFISH_VTable_Init_Obj_IMP(cfish_VTable *self, void *allocation) {
-    cfish_Obj *obj = (cfish_Obj*)allocation;
-    obj->vtable = self;
-    obj->ref.count = (1 << XSBIND_REFCOUNT_SHIFT) | XSBIND_REFCOUNT_FLAG;
-    return obj;
-}
-
-cfish_Obj*
-CFISH_VTable_Foster_Obj_IMP(cfish_VTable *self, void *host_obj) {
-    cfish_Obj *obj
-        = (cfish_Obj*)cfish_Memory_wrapped_calloc(self->obj_alloc_size, 1);
-    SV *inner_obj = SvRV((SV*)host_obj);
-    obj->vtable = self;
-    sv_setiv(inner_obj, PTR2IV(obj));
-    obj->ref.host_obj = inner_obj;
-    return obj;
-}
-
-void
-cfish_VTable_register_with_host(cfish_VTable *singleton, cfish_VTable *parent) {
-    dSP;
-    ENTER;
-    SAVETMPS;
-    EXTEND(SP, 2);
-    PUSHMARK(SP);
-    mPUSHs((SV*)CFISH_VTable_To_Host(singleton));
-    mPUSHs((SV*)CFISH_VTable_To_Host(parent));
-    PUTBACK;
-    call_pv("Clownfish::VTable::_register", G_VOID | G_DISCARD);
-    FREETMPS;
-    LEAVE;
-}
-
-cfish_VArray*
-cfish_VTable_fresh_host_methods(cfish_String *class_name) {
-    dSP;
-    ENTER;
-    SAVETMPS;
-    EXTEND(SP, 1);
-    PUSHMARK(SP);
-    mPUSHs(XSBind_str_to_sv(class_name));
-    PUTBACK;
-    call_pv("Clownfish::VTable::_fresh_host_methods", G_SCALAR);
-    SPAGAIN;
-    cfish_VArray *methods = (cfish_VArray*)XSBind_perl_to_cfish(POPs);
-    PUTBACK;
-    FREETMPS;
-    LEAVE;
-    return methods;
-}
-
-cfish_String*
-cfish_VTable_find_parent_class(cfish_String *class_name) {
-    dSP;
-    ENTER;
-    SAVETMPS;
-    EXTEND(SP, 1);
-    PUSHMARK(SP);
-    mPUSHs(XSBind_str_to_sv(class_name));
-    PUTBACK;
-    call_pv("Clownfish::VTable::_find_parent_class", G_SCALAR);
-    SPAGAIN;
-    SV *parent_class_sv = POPs;
-    PUTBACK;
-    cfish_String *parent_class
-        = (cfish_String*)XSBind_perl_to_cfish(parent_class_sv);
-    FREETMPS;
-    LEAVE;
-    return parent_class;
-}
-
-void*
-CFISH_VTable_To_Host_IMP(cfish_VTable *self) {
-    bool first_time = self->ref.count & XSBIND_REFCOUNT_FLAG ? true : false;
-    CFISH_VTable_To_Host_t to_host
-        = CFISH_SUPER_METHOD_PTR(CFISH_VTABLE, CFISH_VTable_To_Host);
-    SV *host_obj = (SV*)to_host(self);
-    if (first_time) {
-        SvSHARE((SV*)self->ref.host_obj);
-    }
-    return host_obj;
-}
-
-
-/***************************** Clownfish::Err *******************************/
-
-// Anonymous XSUB helper for Err#trap().  It wraps the supplied C function
-// so that it can be run inside a Perl eval block.
-static SV *attempt_xsub = NULL;
-
-XS(cfish_Err_attempt_via_xs) {
-    dXSARGS;
-    CHY_UNUSED_VAR(cv);
-    SP -= items;
-    if (items != 2) {
-        CFISH_THROW(CFISH_ERR, "Usage: $sub->(routine, context)");
-    };
-    IV routine_iv = SvIV(ST(0));
-    IV context_iv = SvIV(ST(1));
-    CFISH_Err_Attempt_t routine = INT2PTR(CFISH_Err_Attempt_t, routine_iv);
-    void *context               = INT2PTR(void*, context_iv);
-    routine(context);
-    XSRETURN(0);
-}
-
-void
-cfish_Err_init_class(void) {
-    char *file = (char*)__FILE__;
-    attempt_xsub = (SV*)newXS(NULL, cfish_Err_attempt_via_xs, file);
-}
-
-cfish_Err*
-cfish_Err_get_error() {
-    dSP;
-    ENTER;
-    SAVETMPS;
-    PUSHMARK(SP);
-    PUTBACK;
-    call_pv("Clownfish::Err::get_error", G_SCALAR);
-    SPAGAIN;
-    cfish_Err *error = (cfish_Err*)XSBind_perl_to_cfish(POPs);
-    PUTBACK;
-    FREETMPS;
-    LEAVE;
-    return error;
-}
-
-void
-cfish_Err_set_error(cfish_Err *error) {
-    dSP;
-    ENTER;
-    SAVETMPS;
-    EXTEND(SP, 2);
-    PUSHMARK(SP);
-    PUSHmortal;
-    if (error) {
-        mPUSHs((SV*)CFISH_Err_To_Host(error));
-    }
-    else {
-        PUSHmortal;
-    }
-    PUTBACK;
-    call_pv("Clownfish::Err::set_error", G_VOID | G_DISCARD);
-    FREETMPS;
-    LEAVE;
-}
-
-void
-cfish_Err_do_throw(cfish_Err *err) {
-    dSP;
-    SV *error_sv = (SV*)CFISH_Err_To_Host(err);
-    CFISH_DECREF(err);
-    ENTER;
-    SAVETMPS;
-    PUSHMARK(SP);
-    XPUSHs(sv_2mortal(error_sv));
-    PUTBACK;
-    call_pv("Clownfish::Err::do_throw", G_DISCARD);
-    FREETMPS;
-    LEAVE;
-}
-
-void*
-CFISH_Err_To_Host_IMP(cfish_Err *self) {
-    CFISH_Err_To_Host_t super_to_host
-        = CFISH_SUPER_METHOD_PTR(CFISH_ERR, CFISH_Err_To_Host);
-    SV *perl_obj = (SV*)super_to_host(self);
-    XSBind_enable_overload(perl_obj);
-    return perl_obj;
-}
-
-void
-cfish_Err_throw_mess(cfish_VTable *vtable, cfish_String *message) {
-    CHY_UNUSED_VAR(vtable);
-    cfish_Err *err = cfish_Err_new(message);
-    cfish_Err_do_throw(err);
-}
-
-void
-cfish_Err_warn_mess(cfish_String *message) {
-    SV *error_sv = XSBind_str_to_sv(message);
-    CFISH_DECREF(message);
-    warn("%s", SvPV_nolen(error_sv));
-    SvREFCNT_dec(error_sv);
-}
-
-cfish_Err*
-cfish_Err_trap(CFISH_Err_Attempt_t routine, void *context) {
-    cfish_Err *error = NULL;
-    SV *routine_sv = newSViv(PTR2IV(routine));
-    SV *context_sv = newSViv(PTR2IV(context));
-    dSP;
-    ENTER;
-    SAVETMPS;
-    PUSHMARK(SP);
-    EXTEND(SP, 2);
-    PUSHs(sv_2mortal(routine_sv));
-    PUSHs(sv_2mortal(context_sv));
-    PUTBACK;
-
-    int count = call_sv(attempt_xsub, G_EVAL | G_DISCARD);
-    if (count != 0) {
-        cfish_String *mess
-            = cfish_Str_newf("'attempt' returned too many values: %i32",
-                             (int32_t)count);
-        error = cfish_Err_new(mess);
-    }
-    else {
-        SV *dollar_at = get_sv("@", FALSE);
-        if (SvTRUE(dollar_at)) {
-            if (sv_isobject(dollar_at)
-                && sv_derived_from(dollar_at,"Clownfish::Err")
-               ) {
-                IV error_iv = SvIV(SvRV(dollar_at));
-                error = INT2PTR(cfish_Err*, error_iv);
-                CFISH_INCREF(error);
-            }
-            else {
-                STRLEN len;
-                char *ptr = SvPVutf8(dollar_at, len);
-                cfish_String *mess = cfish_Str_new_from_trusted_utf8(ptr, len);
-                error = cfish_Err_new(mess);
-            }
-        }
-    }
-    FREETMPS;
-    LEAVE;
-
-    return error;
-}
-
-/*********************** Clownfish::LockFreeRegistry ************************/
-
-void*
-CFISH_LFReg_To_Host_IMP(cfish_LockFreeRegistry *self) {
-    bool first_time = self->ref.count & XSBIND_REFCOUNT_FLAG ? true : false;
-    CFISH_LFReg_To_Host_t to_host
-        = CFISH_SUPER_METHOD_PTR(CFISH_LOCKFREEREGISTRY, CFISH_LFReg_To_Host);
-    SV *host_obj = (SV*)to_host(self);
-    if (first_time) {
-        SvSHARE((SV*)self->ref.host_obj);
-    }
-    return host_obj;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/xs/XSBind.h
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/xs/XSBind.h b/clownfish/runtime/perl/xs/XSBind.h
deleted file mode 100644
index e37058c..0000000
--- a/clownfish/runtime/perl/xs/XSBind.h
+++ /dev/null
@@ -1,352 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* XSBind.h -- Functions to help bind Clownfish to Perl XS api.
- */
-
-#ifndef H_CFISH_XSBIND
-#define H_CFISH_XSBIND 1
-
-#include "Clownfish/Obj.h"
-#include "Clownfish/ByteBuf.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#define NEED_newRV_noinc_GLOBAL
-#include "ppport.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Given either a class name or a perl object, manufacture a new Clownfish
- * object suitable for supplying to a cfish_Foo_init() function.
- */
-CFISH_VISIBLE cfish_Obj*
-cfish_XSBind_new_blank_obj(SV *either_sv);
-
-/** Test whether an SV is defined.  Handles "get" magic, unlike SvOK on its
- * own.
- */
-static CFISH_INLINE bool
-cfish_XSBind_sv_defined(SV *sv) {
-    if (!sv || !SvANY(sv)) { return false; }
-    if (SvGMAGICAL(sv)) { mg_get(sv); }
-    return SvOK(sv);
-}
-
-/** If the SV contains a Clownfish object which passes an "isa" test against the
- * passed-in VTable, return a pointer to it.  If not, but
- * <code>allocation</code> is non-NULL and a StackString would satisfy the
- * "isa" test, stringify the SV, create a StackString using
- * <code>allocation</code>, assign the SV's string to it, and return that
- * instead.  If all else fails, throw an exception.
- */
-CFISH_VISIBLE cfish_Obj*
-cfish_XSBind_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable, void *allocation);
-
-/** As XSBind_sv_to_cfish_obj above, but returns NULL instead of throwing an
- * exception.
- */
-CFISH_VISIBLE cfish_Obj*
-cfish_XSBind_maybe_sv_to_cfish_obj(SV *sv, cfish_VTable *vtable,
-                                   void *allocation);
-
-
-/** Derive an SV from a Clownfish object.  If the Clownfish object is NULL, the SV
- * will be undef.
- *
- * The new SV has single refcount for which the caller must take
- * responsibility.
- */
-static CFISH_INLINE SV*
-cfish_XSBind_cfish_obj_to_sv(cfish_Obj *obj) {
-    return obj ? (SV*)CFISH_Obj_To_Host(obj) : newSV(0);
-}
-
-/** XSBind_cfish_obj_to_sv, with a cast.
- */
-#define CFISH_OBJ_TO_SV(_obj) cfish_XSBind_cfish_obj_to_sv((cfish_Obj*)_obj)
-
-/** As XSBind_cfish_obj_to_sv above, except decrements the object's refcount
- * after creating the SV. This is useful when the Clownfish expression creates a new
- * refcount, e.g.  a call to a constructor.
- */
-static CFISH_INLINE SV*
-cfish_XSBind_cfish_obj_to_sv_noinc(cfish_Obj *obj) {
-    SV *retval;
-    if (obj) {
-        retval = (SV*)CFISH_Obj_To_Host(obj);
-        CFISH_Obj_Dec_RefCount(obj);
-    }
-    else {
-        retval = newSV(0);
-    }
-    return retval;
-}
-
-/** XSBind_cfish_obj_to_sv_noinc, with a cast.
- */
-#define CFISH_OBJ_TO_SV_NOINC(_obj) \
-    cfish_XSBind_cfish_obj_to_sv_noinc((cfish_Obj*)_obj)
-
-/** Deep conversion of Clownfish objects to Perl objects -- Strings to UTF-8
- * SVs, ByteBufs to SVs, VArrays to Perl array refs, Hashes to Perl hashrefs,
- * and any other object to a Perl object wrapping the Clownfish Obj.
- */
-CFISH_VISIBLE SV*
-cfish_XSBind_cfish_to_perl(cfish_Obj *obj);
-
-/** Deep conversion of Perl data structures to Clownfish objects -- Perl hash
- * to Hash, Perl array to VArray, Clownfish objects stripped of their
- * wrappers, and everything else stringified and turned to a String.
- */
-CFISH_VISIBLE cfish_Obj*
-cfish_XSBind_perl_to_cfish(SV *sv);
-
-/** Convert a ByteBuf into a new string SV.
- */
-CFISH_VISIBLE SV*
-cfish_XSBind_bb_to_sv(cfish_ByteBuf *bb);
-
-/** Convert a String into a new UTF-8 string SV.
- */
-CFISH_VISIBLE SV*
-cfish_XSBind_str_to_sv(cfish_String *str);
-
-/** Perl-specific wrapper for Err#trap.  The "routine" must be either a
- * subroutine reference or the name of a subroutine.
- */
-cfish_Err*
-cfish_XSBind_trap(SV *routine, SV *context);
-
-/** Turn on overloading for the supplied Perl object and its class.
- */
-CFISH_VISIBLE void
-cfish_XSBind_enable_overload(void *pobj);
-
-/** Process hash-style params passed to an XS subroutine.  The varargs must be
- * a NULL-terminated series of ALLOT_ macros.
- *
- *     cfish_XSBind_allot_params(stack, start, num_stack_elems,
- *          ALLOT_OBJ(&field, "field", 5, CFISH_STRING, true, alloca(cfish_SStr_size()),
- *          ALLOT_OBJ(&term, "term", 4, CFISH_STRING, true, alloca(cfish_SStr_size()),
- *          NULL);
- *
- * The following ALLOT_ macros are available for primitive types:
- *
- *     ALLOT_I8(ptr, key, keylen, required)
- *     ALLOT_I16(ptr, key, keylen, required)
- *     ALLOT_I32(ptr, key, keylen, required)
- *     ALLOT_I64(ptr, key, keylen, required)
- *     ALLOT_U8(ptr, key, keylen, required)
- *     ALLOT_U16(ptr, key, keylen, required)
- *     ALLOT_U32(ptr, key, keylen, required)
- *     ALLOT_U64(ptr, key, keylen, required)
- *     ALLOT_BOOL(ptr, key, keylen, required)
- *     ALLOT_CHAR(ptr, key, keylen, required)
- *     ALLOT_SHORT(ptr, key, keylen, required)
- *     ALLOT_INT(ptr, key, keylen, required)
- *     ALLOT_LONG(ptr, key, keylen, required)
- *     ALLOT_SIZE_T(ptr, key, keylen, required)
- *     ALLOT_F32(ptr, key, keylen, required)
- *     ALLOT_F64(ptr, key, keylen, required)
- *
- * The four arguments to these ALLOT_ macros have the following meanings:
- *
- *     ptr -- A pointer to the variable to be extracted.
- *     key -- The name of the parameter as a C string.
- *     keylen -- The length of the parameter name in bytes.
- *     required -- A boolean indicating whether the parameter is required.
- *
- * If a required parameter is not present, allot_params() will set Err_error
- * and return false.
- *
- * Use the following macro if a Clownfish object is desired:
- *
- *     ALLOT_OBJ(ptr, key, keylen, required, vtable, allocation)
- *
- * The "vtable" argument must be the VTable corresponding to the class of the
- * desired object.  The "allocation" argument must be a blob of memory
- * allocated on the stack sufficient to hold a StackString.  (Use
- * cfish_SStr_size() to find the allocation size.)
- *
- * To extract a Perl scalar, use the following ALLOT_ macro:
- *
- *     ALLOT_SV(ptr, key, keylen, required)
- *
- * All possible valid param names must be passed via the ALLOT_ macros; if a
- * user-supplied param cannot be matched up with an ALLOT_ macro,
- * allot_params() will set Err_error and return false.
- *
- * @param stack The Perl stack.
- * @param start Where on the Perl stack to start looking for params.  For
- * methods, this would typically be 1; for functions, most likely 0.
- * @param num_stack_elems The number of arguments passed to the Perl function
- * (generally, the XS variable "items").
- * @return true on success, false on failure (sets Err_error).
- */
-CFISH_VISIBLE bool
-cfish_XSBind_allot_params(SV** stack, int32_t start,
-                          int32_t num_stack_elems, ...);
-
-#define XSBIND_WANT_I8       0x1
-#define XSBIND_WANT_I16      0x2
-#define XSBIND_WANT_I32      0x3
-#define XSBIND_WANT_I64      0x4
-#define XSBIND_WANT_U8       0x5
-#define XSBIND_WANT_U16      0x6
-#define XSBIND_WANT_U32      0x7
-#define XSBIND_WANT_U64      0x8
-#define XSBIND_WANT_BOOL     0x9
-#define XSBIND_WANT_F32      0xA
-#define XSBIND_WANT_F64      0xB
-#define XSBIND_WANT_OBJ      0xC
-#define XSBIND_WANT_SV       0xD
-
-#if (CFISH_SIZEOF_CHAR == 1)
-  #define XSBIND_WANT_CHAR XSBIND_WANT_I8
-#else
-  #error "Can't build unless sizeof(char) == 1"
-#endif
-
-#if (CFISH_SIZEOF_SHORT == 2)
-  #define XSBIND_WANT_SHORT XSBIND_WANT_I16
-#else
-  #error "Can't build unless sizeof(short) == 2"
-#endif
-
-#if (CFISH_SIZEOF_INT == 4)
-  #define XSBIND_WANT_INT XSBIND_WANT_I32
-#elif (CFISH_SIZEOF_INT == 8)
-  #define XSBIND_WANT_INT XSBIND_WANT_I64
-#else
-  #error "Can't build unless sizeof(int) == 4 or sizeof(int) == 8"
-#endif
-
-#if (CFISH_SIZEOF_LONG == 4)
-  #define XSBIND_WANT_LONG XSBIND_WANT_I32
-#elif (CFISH_SIZEOF_LONG == 8)
-  #define XSBIND_WANT_LONG XSBIND_WANT_I64
-#else
-  #error "Can't build unless sizeof(long) == 4 or sizeof(long) == 8"
-#endif
-
-#if (CFISH_SIZEOF_SIZE_T == 4)
-  #define XSBIND_WANT_SIZE_T XSBIND_WANT_U32
-#elif (CFISH_SIZEOF_SIZE_T == 8)
-  #define XSBIND_WANT_SIZE_T XSBIND_WANT_U64
-#else
-  #error "Can't build unless sizeof(size_t) == 4 or sizeof(size_t) == 8"
-#endif
-
-#define XSBIND_ALLOT_I8(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_I8, NULL, NULL
-#define XSBIND_ALLOT_I16(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_I16, NULL, NULL
-#define XSBIND_ALLOT_I32(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_I32, NULL, NULL
-#define XSBIND_ALLOT_I64(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_I64, NULL, NULL
-#define XSBIND_ALLOT_U8(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_U8, NULL, NULL
-#define XSBIND_ALLOT_U16(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_U16, NULL, NULL
-#define XSBIND_ALLOT_U32(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_U32, NULL, NULL
-#define XSBIND_ALLOT_U64(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_U64, NULL, NULL
-#define XSBIND_ALLOT_BOOL(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_BOOL, NULL, NULL
-#define XSBIND_ALLOT_CHAR(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_CHAR, NULL, NULL
-#define XSBIND_ALLOT_SHORT(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_SHORT, NULL, NULL
-#define XSBIND_ALLOT_INT(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_INT, NULL, NULL
-#define XSBIND_ALLOT_LONG(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_LONG, NULL, NULL
-#define XSBIND_ALLOT_SIZE_T(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_SIZE_T, NULL, NULL
-#define XSBIND_ALLOT_F32(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_F32, NULL, NULL
-#define XSBIND_ALLOT_F64(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_F64, NULL, NULL
-#define XSBIND_ALLOT_OBJ(ptr, key, keylen, required, vtable, allocation) \
-    ptr, key, keylen, required, XSBIND_WANT_OBJ, vtable, allocation
-#define XSBIND_ALLOT_SV(ptr, key, keylen, required) \
-    ptr, key, keylen, required, XSBIND_WANT_SV, NULL, NULL
-
-/* Define short names for most of the symbols in this file.  Note that these
- * short names are ALWAYS in effect, since they are only used for Perl and we
- * can be confident they don't conflict with anything.  (It's prudent to use
- * full symbols nevertheless in case someone else defines e.g. a function
- * named "XSBind_sv_defined".)
- */
-#define XSBind_new_blank_obj           cfish_XSBind_new_blank_obj
-#define XSBind_sv_defined              cfish_XSBind_sv_defined
-#define XSBind_sv_to_cfish_obj         cfish_XSBind_sv_to_cfish_obj
-#define XSBind_maybe_sv_to_cfish_obj   cfish_XSBind_maybe_sv_to_cfish_obj
-#define XSBind_cfish_obj_to_sv         cfish_XSBind_cfish_obj_to_sv
-#define XSBind_cfish_obj_to_sv_noinc   cfish_XSBind_cfish_obj_to_sv_noinc
-#define XSBind_cfish_to_perl           cfish_XSBind_cfish_to_perl
-#define XSBind_perl_to_cfish           cfish_XSBind_perl_to_cfish
-#define XSBind_bb_to_sv                cfish_XSBind_bb_to_sv
-#define XSBind_str_to_sv               cfish_XSBind_str_to_sv
-#define XSBind_trap                    cfish_XSBind_trap
-#define XSBind_enable_overload         cfish_XSBind_enable_overload
-#define XSBind_allot_params            cfish_XSBind_allot_params
-#define ALLOT_I8                       XSBIND_ALLOT_I8
-#define ALLOT_I16                      XSBIND_ALLOT_I16
-#define ALLOT_I32                      XSBIND_ALLOT_I32
-#define ALLOT_I64                      XSBIND_ALLOT_I64
-#define ALLOT_U8                       XSBIND_ALLOT_U8
-#define ALLOT_U16                      XSBIND_ALLOT_U16
-#define ALLOT_U32                      XSBIND_ALLOT_U32
-#define ALLOT_U64                      XSBIND_ALLOT_U64
-#define ALLOT_BOOL                     XSBIND_ALLOT_BOOL
-#define ALLOT_CHAR                     XSBIND_ALLOT_CHAR
-#define ALLOT_SHORT                    XSBIND_ALLOT_SHORT
-#define ALLOT_INT                      XSBIND_ALLOT_INT
-#define ALLOT_LONG                     XSBIND_ALLOT_LONG
-#define ALLOT_SIZE_T                   XSBIND_ALLOT_SIZE_T
-#define ALLOT_F32                      XSBIND_ALLOT_F32
-#define ALLOT_F64                      XSBIND_ALLOT_F64
-#define ALLOT_OBJ                      XSBIND_ALLOT_OBJ
-#define ALLOT_SV                       XSBIND_ALLOT_SV
-
-/* Strip the prefix from some common ClownFish symbols where we know there's
- * no conflict with Perl.  It's a little inconsistent to do this rather than
- * leave all symbols at full size, but the succinctness is worth it.
- */
-#define THROW            CFISH_THROW
-#define WARN             CFISH_WARN
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // H_CFISH_XSBIND
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/ruby/Rakefile
----------------------------------------------------------------------
diff --git a/clownfish/runtime/ruby/Rakefile b/clownfish/runtime/ruby/Rakefile
deleted file mode 100644
index f9a821a..0000000
--- a/clownfish/runtime/ruby/Rakefile
+++ /dev/null
@@ -1,148 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-require 'rake/clean' 
-require 'rake/extensiontask'
-import '../../runtime/ruby/Rakefile.common'
-
-def exe_path(*args)
-  File.join(args).ext(RbConfig::CONFIG["EXEEXT"])
-end
-
-BASE_PATH            = '..'
-CFC_DIR              = File.join( BASE_PATH, '..', 'compiler', 'ruby' );
-CFC_BUILD            = File.join( CFC_DIR, 'Build' );
-COMMON_SOURCE_DIR    = File.join(BASE_PATH, "common")
-CHARMONIZER_C        = File.join(COMMON_SOURCE_DIR, 'charmonizer.c')
-CHARMONIZER_EXE_PATH = File.absolute_path(exe_path('charmonizer'))
-CHARMONIZER_ORIG_DIR = File.absolute_path( File.join( BASE_PATH, '..', '..', 'charmonizer' ) )
-CHARMONY_H_PATH      = 'charmony.h'
-CHARMONY_RB_PATH     = 'Charmony.rb'
-CORE_SOURCE_DIR      = File.absolute_path( BASE_PATH, 'core' );
-LIB_DIR              = 'lib';
-
-Rake::ExtensionTask.new do |ext|
-  ext.name = 'Bind' 
-  ext.ext_dir = './ext'
-  ext.lib_dir = './lib'
-  ext.tmp_dir = './tmp'
-  ext.source_pattern = "*.c"
-  ext.config_options << '-std=gnu99 -D_GNU_SOURCE -fvsibility=hidden'
-end
-
-desc "Build Clownfish"
-task :build_clownfish => [:build_charmonizer_tests] do
-  puts "Building Clownfish"
-  old_dir = Dir.pwd
-  chdir(CFC_DIR);
-  if ( File.exists?('Rakefile') ) 
-    puts "\nBuilding Clownfish compiler... "
-    if system("rake").nil?
-      abort "Couldn't build rake"
-    end
-    puts "\nFinished building Clownfish compiler.\n"
-  end
-  chdir(old_dir);
-  require_relative '../../compiler/ruby/ext/Clownfish/CFC'
-  hierarchy = Clownfish::CFC::Model::Hierarchy.new(:dest => "autogen")
-
-  hierarchy.add_source_dir('../core')
-  hierarchy.add_source_dir('ext')
-  hierarchy.add_source_dir('autogen/source')
-  hierarchy.build
-  
-  core_binding = Clownfish::CFC::Binding::Core.new(:hierarchy => hierarchy, :header => autogen_header, :footer => '')
-  modified = core_binding.write_all_modified
-
-  ruby_binding = Clownfish::CFC::Binding::Ruby.new(
-    :parcel     => "Clownfish",
-    :hierarchy  => hierarchy,
-    :lib_dir    => LIB_DIR,
-    :boot_class => "Clownfish",
-    :header     => autogen_header,
-    :footer     => ''
-  )
-
-  if (modified)
-    puts "Building Binding Code"
-    ruby_binding.write_boot
-    ruby_binding.write_hostdefs
-  end
-  Rake::Task['compile'].invoke
-
-end
-
-desc "Building Charmonizer Tests"
-task :build_charmonizer_tests => [:charmony] do
-  puts "Building Charmonizer Tests"
-  flags = [
-    '-fno-common',
-    '-DFCRUBY',
-    '-fno-strict-aliasing',
-    '-pipe',
-    '-fstack-protector',
-    '-std=gnu99',
-    '-D_GNU_SOURCE',
-    '-I' + Dir.pwd
-  ].join(" ").gsub(/"/,'\"')
-
-  run_make( CHARMONIZER_ORIG_DIR, [ "DEFS=#{flags}", "tests"])
-end
-
-desc "Build and run charmonizer, creating charmony.h and charmony.rb"
-task :charmony do
-  # Compile charmonizer executable.
-  if !uptodate? CHARMONIZER_EXE_PATH, [CHARMONIZER_C]
-    outflag = cc_command.match(/cl\b/) ? "/Fe" : "-o "
-    command = "#{cc_command} #{outflag}#{CHARMONIZER_EXE_PATH} #{CHARMONIZER_C}"
-    puts command
-    if !system(command)
-      raise "Failed to compile #{CHARMONIZER_EXE_PATH}"
-    end
-  end
-
-  # Return if charmonizer output is current.
-  if uptodate? CHARMONY_RB_PATH, [CHARMONIZER_EXE_PATH]
-    next
-  end
-  puts "Running #{CHARMONIZER_EXE_PATH}...\n"
-
-  # Prepare arguments to charmonizer.
-  command = [
-    CHARMONIZER_EXE_PATH,
-    '--cc=' + quotify(cc_command),
-    '--enable-c',
-    '--enable-ruby',
-    '--',
-    all_ccflags,
-  ]
-  if (ENV['CHARM_VALGRIND'])
-    command.unshift("valgrind", "--leak-check=yes")
-  end
-
-  # Run charmonizer.
-  puts command.join(" ")
-  if !system(*command)
-    raise "Failed to run #{CHARMONIZER_EXE_PATH}: " + $?
-  end
-end
-
-CLEAN.include(CHARMONIZER_EXE_PATH)
-CLEAN.include(CHARMONY_H_PATH)
-CLEAN.include(CHARMONY_RB_PATH)
-# Clean up after charmonizer if it doesn't succeed on its own.
-CLEAN.include("_charm*")
-
-task :default => [:build_clownfish]

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/ruby/Rakefile.common
----------------------------------------------------------------------
diff --git a/clownfish/runtime/ruby/Rakefile.common b/clownfish/runtime/ruby/Rakefile.common
deleted file mode 100644
index 28051eb..0000000
--- a/clownfish/runtime/ruby/Rakefile.common
+++ /dev/null
@@ -1,140 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-require 'rbconfig'
-
-def rbconfig
-  RbConfig::CONFIG
-end
-
-def all_ccflags
-  ccflags = '-DCFCRUBY '
-  
-  if defined?(rbconfig["CFLAGS"])
-    ccflags += rbconfig['CFLAGS'] + ' '
-  end
-
-  if ENV.has_key?('CFLAGS')
-    ccflags += ENV['CFLAGS']
-  end
-  
-  if ENV.has_key?('LUCY_VALGRIND')
-    ccflags += "-fno-inline-functions "
-  end
-  
-  # Compile as C++ under MSVC.  Turn off stupid warnings, too.
-  if cc_command =~ /^cl\b/ 
-    ccflags += '/TP -D_CRT_SECURE_NO_WARNINGS '
-  end
-  
-  # Blindly include GCC-specific flags even though we don't know that the
-  # compiler is GCC.
-  if ccflags !~ /-std=/
-    ccflags += "-std=gnu99 "
-  end
-  if ccflags !~ /-D_GNU_SOURCE/ 
-    ccflags += "-D_GNU_SOURCE "
-  end
-  
-  return ccflags
-end
-
-def cc_command
-  rbconfig["CC"]
-end
-
-def extra_ccflags 
-  ccflags = '-DCFCRUBY '
-  
-  if defined?(rbconfig["CFLAGS"])
-    ccflags += rbconfig['CFLAGS'] + ' '
-  end
-  
-  if ENV.has_key?('CFLAGS')
-    ccflags += ENV['CFLAGS']
-  end
-  
-  if ENV.has_key?('LUCY_VALGRIND')
-    ccflags += "-fno-inline-functions "
-  end
-  
-  # Compile as C++ under MSVC.  Turn off stupid warnings, too.
-  if cc_command =~ /^cl\b/ 
-    ccflags += '/TP -D_CRT_SECURE_NO_WARNINGS '
-  end
-  
-  # Blindly include GCC-specific flags even though we don't know that the
-  # compiler is GCC.
-  if ccflags !~ /-std=/
-    ccflags += "-std=gnu99 "
-  end
-  if ccflags !~ /-D_GNU_SOURCE/ 
-    ccflags += "-D_GNU_SOURCE "
-  end
-  
-  return ccflags
-end
-
-def make_command
-  command = rbconfig["make-prog"]
-  if !command
-    if RUBY_PLATFORM =~ /mswin/i
-      if cc_command =~ /^cl\b/
-        command = "nmake"
-      end
-    end
-  end
-  if !command
-    command = 'make'
-  end
-  return command
-end
-
-def run_make(dir, params)
-  current_dir = Dir.pwd
-  chdir(dir) if dir
-  command = params.clone
-  command.unshift("CC=#{cc_command}")
-  if RUBY_PLATFORM =~ /(mswin|mingw)/i
-    if cc_command =~ /^cl\b/ 
-      command.unshift("-f", "Makefile.MSVC")
-    else
-      command.unshift("-f", "Makefile.MinGW")
-    end
-  end
-  command.unshift(make_command)
-  success = system(*command)
-  if !success
-    raise "Make failed"
-  end
-  chdir(current_dir) if dir
-end
-
-def quotify(string)
-  return '"' + string.gsub(/([\\\"])/,'\\\\\\1') + '"'
-end
-
-def autogen_header
-  "
-/***********************************************
-
- !!!! DO NOT EDIT !!!!
-
- This file was auto-generated by Rakefile.
-
- ***********************************************/
- "
-
-end

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/ruby/ext/Bind.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/ruby/ext/Bind.c b/clownfish/runtime/ruby/ext/Bind.c
deleted file mode 100644
index e44737b..0000000
--- a/clownfish/runtime/ruby/ext/Bind.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ruby.h"
-#include "Bind.h"
-#include "Clownfish/Util/StringHelper.h"
-#include "Clownfish/Util/NumberUtils.h"
-
-VALUE
-Bind_cfish_to_ruby(cfish_Obj *obj) {
-  if (CFISH_Obj_Is_A(obj, CFISH_STRING)) {
-      return Bind_str_to_ruby((cfish_String*)obj);
-  }
-  else if (CFISH_Obj_Is_A(obj, CFISH_VARRAY)) {
-      return S_cfish_array_to_ruby_array((cfish_VArray*)obj);
-  }
-}
-
-VALUE
-Bind_str_to_ruby(cfish_String *str) {
-    if (!str) {
-        return rb_str_new2("");
-    }
-    else {
-        return rb_str_new(CFISH_Str_Get_Ptr8(str), CFISH_Str_Get_Size(str));
-    }
-}
-
-static VALUE
-S_cfish_array_to_ruby_array(cfish_VArray *varray) {
-    uint32_t num_elems = CFISH_VA_Get_Size(varray);
-
-    VALUE ruby_array = rb_ary_new2(num_elems - 1);
-
-    if (num_elems) {
-        //TODO Need to determine why c99 mode is not being honored
-        uint32_t i;
-        for (uint32_t i = 0; i < num_elems; i++) {
-            cfish_Obj *val = CFISH_VA_Fetch(varray, i);
-            if (val == NULL) {
-                continue;
-            }
-            else {
-                // Recurse for each value.
-                VALUE const val_ruby = Bind_cfish_to_ruby(val);
-                rb_ary_store(ruby_array, i, val_ruby);
-            }
-        }
-    }
-    return ruby_array;
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/ruby/ext/Bind.h
----------------------------------------------------------------------
diff --git a/clownfish/runtime/ruby/ext/Bind.h b/clownfish/runtime/ruby/ext/Bind.h
deleted file mode 100644
index 805afae..0000000
--- a/clownfish/runtime/ruby/ext/Bind.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* XSBind.h -- Functions to help bind Clownfish to Perl XS api.
- */
-
-#ifndef H_CFISH_XSBIND
-#define H_CFISH_XSBIND 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "ruby.h"
-#include "Clownfish/Obj.h"
-#include "Clownfish/ByteBuf.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
-
-VALUE Bind_cfish_to_ruby(cfish_Obj *obj);
-VALUE Bind_str_to_ruby(cfish_String *str);
-static VALUE S_cfish_array_to_ruby_array(cfish_VArray *varray);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // H_CFISH_XSBIND

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/ruby/ext/Clownfish.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/ruby/ext/Clownfish.c b/clownfish/runtime/ruby/ext/Clownfish.c
deleted file mode 100644
index 72a703b..0000000
--- a/clownfish/runtime/ruby/ext/Clownfish.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ruby.h"
-
-#include "Clownfish/Host.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/Util/StringHelper.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Test/TestCharBuf.h"
-#include "Clownfish/Test.h"
-
-static VALUE mClownfish;
-static VALUE cTest;
-
-static VALUE
-S_CFC_Test_Run_Tests(VALUE self_rb, VALUE package) {
-
-  /*if (strEQ(StringValuePtr(package), "TestCharBuf")) {
-    lucy_TestCB_run_tests();
-  }*/
-
-  return Qnil;
-}
-
-static void
-S_init_Test(void) {
-    cTest = rb_define_class_under(mClownfish, "Test", rb_cObject);
-//    rb_define_singleton_method(cTest, "run_tests", S_CFC_Hierarchy_Build, 0);
-}
-
-void
-Init_Clownfish() { 
-    mClownfish  = rb_define_module("Clownfish");
-    S_init_Test();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/ruby/ext/Clownfish.h
----------------------------------------------------------------------
diff --git a/clownfish/runtime/ruby/ext/Clownfish.h b/clownfish/runtime/ruby/ext/Clownfish.h
deleted file mode 100644
index 67987ab..0000000
--- a/clownfish/runtime/ruby/ext/Clownfish.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ruby.h"
-
-static VALUE S_CFC_Test_Run_Tests(VALUE self_rb, VALUE package);
-static void S_init_Test(void);
-void Init_Clownfish();

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/ruby/ext/extconf.rb
----------------------------------------------------------------------
diff --git a/clownfish/runtime/ruby/ext/extconf.rb b/clownfish/runtime/ruby/ext/extconf.rb
deleted file mode 100644
index ae52bb0..0000000
--- a/clownfish/runtime/ruby/ext/extconf.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-require 'mkmf'
-require 'rbconfig'
-
-CORE    = File.join('..','..','..','..','..','..','runtime','core')
-RUBY    = File.join('..','..','..','..','..','..','runtime','ruby')
-AUTOGEN = File.join('..','..','..','..','..','..','runtime','ruby','autogen','include')
-$CFLAGS = "-I#{CORE} -I#{RUBY} -I#{AUTOGEN}"
-
-create_makefile 'Bind'

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/ruby/tests/029-charbuf.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/ruby/tests/029-charbuf.t b/clownfish/runtime/ruby/tests/029-charbuf.t
deleted file mode 100644
index 605d9e4..0000000
--- a/clownfish/runtime/ruby/tests/029-charbuf.t
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-require Clownfish::Test
-Clownfish::Test::run_tests("TestCharBuf")


[lucy-commits] [09/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCType.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCType.h b/clownfish/compiler/src/CFCType.h
deleted file mode 100644
index fbf18e7..0000000
--- a/clownfish/compiler/src/CFCType.h
+++ /dev/null
@@ -1,281 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::Type - A variable's type.
- */
-
-#ifndef H_CFCTYPE
-#define H_CFCTYPE
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCType CFCType;
-struct CFCClass;
-struct CFCParcel;
-
-#define CFCTYPE_CONST       0x00000001
-#define CFCTYPE_NULLABLE    0x00000002
-#define CFCTYPE_VOID        0x00000004
-#define CFCTYPE_INCREMENTED 0x00000008
-#define CFCTYPE_DECREMENTED 0x00000010
-#define CFCTYPE_OBJECT      0x00000020
-#define CFCTYPE_PRIMITIVE   0x00000040
-#define CFCTYPE_INTEGER     0x00000080
-#define CFCTYPE_FLOATING    0x00000100
-#define CFCTYPE_STRING_TYPE 0x00000200
-#define CFCTYPE_VA_LIST     0x00000400
-#define CFCTYPE_ARBITRARY   0x00000800
-#define CFCTYPE_COMPOSITE   0x00001000
-
-/** Generic constructor.
- *
- * @param flags Flags which apply to the Type.  Supplying incompatible flags
- * will trigger an error.
- * @param parcel A Clownfish::CFC::Model::Parcel.
- * @param specifier The C name for the type, not including any indirection or
- * array subscripts.
- * @param indirection integer indicating level of indirection. Example: the C
- * type "float**" has a specifier of "float" and indirection 2.
- */
-CFCType*
-CFCType_new(int flags, struct CFCParcel *parcel, const char *specifier,
-            int indirection);
-
-CFCType*
-CFCType_init(CFCType *self, int flags, struct CFCParcel *parcel,
-             const char *specifier, int indirection);
-
-/** Return a Type representing an integer primitive.
- *
- * Support is limited to a subset of the standard C integer types:
- *
- *     int8_t
- *     int16_t
- *     int32_t
- *     int64_t
- *     uint8_t
- *     uint16_t
- *     uint32_t
- *     uint64_t
- *     char
- *     short
- *     int
- *     long
- *     size_t
- *
- * Many others are not supported: "signed" or "unsigned" anything, "long
- * long", "ptrdiff_t", "off_t", etc.
- *
- * The following Charmonizer typedefs are supported:
- *
- *     bool
- *
- * @param flags Allowed flags: CONST, INTEGER, PRIMITIVE.
- * @param specifier Must match one of the supported types.
- */
-CFCType*
-CFCType_new_integer(int flags, const char *specifier);
-
-/** Return a Type representing a floating point primitive.
- *
- * @param flags Allowed flags: CONST, FLOATING, PRIMITIVE.
- * @param specifier Must be either 'float' or 'double'.
- */
-CFCType*
-CFCType_new_float(int flags, const char *specifier);
-
-/** Create a Type representing an object.
- *
- * The supplied <code>specifier</code> must match the last component of the
- * class name -- i.e. for the class "Crustacean::Lobster" it must be
- * "Lobster".
- *
- * The Parcel's prefix will be prepended to the specifier by new_object().
- *
- * @param flags Allowed flags: OBJECT, STRING_TYPE, CONST, NULLABLE,
- * INCREMENTED, DECREMENTED.
- * @param parcel A Clownfish::CFC::Model::Parcel.
- * @param specifier Required.  Must follow the rules for
- * Clownfish::CFC::Model::Class class name components.
- * @param indirection Level of indirection.  Must be 1 if supplied.
- */
-CFCType*
-CFCType_new_object(int flags, struct CFCParcel *parcel, const char *specifier,
-                   int indirection);
-
-/** Constructor for a composite type which is made up of repetitions of a
- * single, uniform subtype.
- *
- * @param flags Allowed flags: COMPOSITE, NULLABLE
- * @param child The Clownfish::CFC::Model::Type which the composite is
- * comprised of.
- * @param indirection integer indicating level of indirection.  Example: the C
- * type "float**" has indirection 2.
- * @param array A string describing an array postfix.
- */
-CFCType*
-CFCType_new_composite(int flags, CFCType *child, int indirection,
-                      const char *array);
-
-/** Return a Clownfish::CFC::Model::Type representing a the 'void' keyword in
- * C.  It can be used either for a void return type, or in conjuction with
- * with new_composite() to support the <code>void*</code> opaque pointer type.
- *
- * @param is_const Should be true if the type is const.  (Useful in the
- * context of <code>const void*</code>).
- */
-CFCType*
-CFCType_new_void(int is_const);
-
-/** Create a Type representing C's va_list, from stdarg.h.
- */
-CFCType*
-CFCType_new_va_list(void);
-
-/** "Arbitrary" types are a hack that spares us from having to support C types
- * with complex declaration syntaxes -- such as unions, structs, enums, or
- * function pointers -- from within Clownfish itself.
- *
- * The only constraint is that the <code>specifier</code> must end in "_t".
- * This allows us to create complex types in a C header file...
- *
- *    typedef union { float f; int i; } floatint_t;
- *
- * ... pound-include the C header, then use the resulting typedef in a
- * Clownfish header file and have it parse as an "arbitrary" type.
- *
- *    floatint_t floatint;
- *
- * If <code>parcel</code> is supplied and <code>specifier</code> begins with a
- * capital letter, the Parcel's prefix will be prepended to the specifier:
- *
- *    foo_t         -> foo_t                # no prefix prepending
- *    Lobster_foo_t -> crust_Lobster_foo_t  # prefix prepended
- *
- * @param specifier The name of the type, which must end in "_t".
- * @param parcel A Clownfish::CFC::Model::Parcel.
- */
-CFCType*
-CFCType_new_arbitrary(struct CFCParcel *parcel, const char *specifier);
-
-/** Find the actual class of an object variable without prefix.
- */
-void
-CFCType_resolve(CFCType *self, struct CFCClass **classes);
-
-void
-CFCType_destroy(CFCType *self);
-
-/** Returns true if two Clownfish::CFC::Model::Type objects are equivalent.
- */
-int
-CFCType_equals(CFCType *self, CFCType *other);
-
-/** Weak checking of type which allows for covariant return types.  Calling
- * this method on anything other than an object type is an error.
- */
-int
-CFCType_similar(CFCType *self, CFCType *other);
-
-void
-CFCType_set_specifier(CFCType *self, const char *specifier);
-
-const char*
-CFCType_get_specifier(CFCType *self);
-
-/** Return the name of the VTable variable which corresponds to the object
- * type.  Returns NULL for non-object types.
- */
-const char*
-CFCType_get_vtable_var(CFCType *self);
-
-int
-CFCType_get_indirection(CFCType *self);
-
-/* Return the parcel in which the Type is used. Note that for class types,
- * this is not neccessarily the parcel where class is defined.
- */
-struct CFCParcel*
-CFCType_get_parcel(CFCType *self);
-
-/** Return the C representation of the type.
- */
-const char*
-CFCType_to_c(CFCType *self);
-
-size_t
-CFCType_get_width(CFCType *self);
-
-const char*
-CFCType_get_array(CFCType *self);
-
-int
-CFCType_const(CFCType *self);
-
-void
-CFCType_set_nullable(CFCType *self, int nullable);
-
-int
-CFCType_nullable(CFCType *self);
-
-/** Returns true if the Type is incremented.  Only applicable to object Types.
- */
-int
-CFCType_incremented(CFCType *self);
-
-/** Returns true if the Type is decremented.  Only applicable to object Types.
- */
-int
-CFCType_decremented(CFCType *self);
-
-int
-CFCType_is_void(CFCType *self);
-
-int
-CFCType_is_object(CFCType *self);
-
-int
-CFCType_is_primitive(CFCType *self);
-
-int
-CFCType_is_integer(CFCType *self);
-
-int
-CFCType_is_floating(CFCType *self);
-
-/** Returns true if $type represents a Clownfish type which holds unicode
- * strings.
- */
-int
-CFCType_is_string_type(CFCType *self);
-
-int
-CFCType_is_va_list(CFCType *self);
-
-int
-CFCType_is_arbitrary(CFCType *self);
-
-int
-CFCType_is_composite(CFCType *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCTYPE */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCUtil.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCUtil.c b/clownfish/compiler/src/CFCUtil.c
deleted file mode 100644
index 7d8f7a5..0000000
--- a/clownfish/compiler/src/CFCUtil.c
+++ /dev/null
@@ -1,539 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <errno.h>
-#include <sys/stat.h>
-
-// For mkdir.
-#ifdef CHY_HAS_DIRECT_H
-  #include <direct.h>
-#endif
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-#include "CFCUtil.h"
-
-void
-CFCUtil_null_check(const void *arg, const char *name, const char *file,
-                   int line) {
-    if (!arg) {
-        CFCUtil_die("%s cannot be NULL at %s line %d", name, file, line);
-    }
-}
-
-char*
-CFCUtil_strdup(const char *string) {
-    if (!string) { return NULL; }
-    return CFCUtil_strndup(string, strlen(string));
-}
-
-char*
-CFCUtil_strndup(const char *string, size_t len) {
-    if (!string) { return NULL; }
-    char *copy = (char*)MALLOCATE(len + 1);
-    memcpy(copy, string, len);
-    copy[len] = '\0';
-    return copy;
-}
-
-#if defined(CHY_HAS_C99_SNPRINTF) || defined(CHY_HAS__SCPRINTF)
-
-char*
-CFCUtil_sprintf(const char *fmt, ...) {
-    va_list args;
-
-    va_start(args, fmt);
-#if defined(CHY_HAS_C99_SNPRINTF)
-    int size = vsnprintf(NULL, 0, fmt, args);
-    if (size < 0) { CFCUtil_die("snprintf failed"); }
-#else
-    int size = _vscprintf(fmt, args);
-    if (size < 0) { CFCUtil_die("_scprintf failed"); }
-#endif
-    va_end(args);
-
-    char *string = (char*)MALLOCATE((size_t)size + 1);
-    va_start(args, fmt);
-    vsprintf(string, fmt, args);
-    va_end(args);
-
-    return string;
-}
-
-#elif defined(CHY_HAS__SNPRINTF)
-
-char*
-CFCUtil_sprintf(const char *fmt, ...) {
-    for (size_t size = 32; size * 2 > size; size *= 2) {
-        char *string = (char*)MALLOCATE(size);
-        va_list args;
-        va_start(args, fmt);
-        int result = _vsnprintf(string, size, fmt, args);
-        va_end(args);
-        if (result >= 0 && (size_t)result < size) { return string; }
-        FREEMEM(string);
-    }
-    CFCUtil_die("_snprintf failed");
-    return NULL;
-}
-
-#else
-  #error "snprintf or replacement not available."
-#endif
-
-char*
-CFCUtil_cat(char *string, ...) {
-    va_list args;
-    char *appended;
-    CFCUTIL_NULL_CHECK(string);
-    size_t size = strlen(string) + 1;
-    va_start(args, string);
-    while (NULL != (appended = va_arg(args, char*))) {
-        size += strlen(appended);
-        string = (char*)REALLOCATE(string, size);
-        strcat(string, appended);
-    }
-    va_end(args);
-    return string;
-}
-
-void
-CFCUtil_trim_whitespace(char *text) {
-    if (!text) {
-        return;
-    }
-
-    // Find start.
-    char *ptr = text;
-    while (*ptr != '\0' && isspace(*ptr)) { ptr++; }
-
-    // Find end.
-    size_t orig_len = strlen(text);
-    char *limit = text + orig_len;
-    for (; limit > text; limit--) {
-        if (!isspace(*(limit - 1))) { break; }
-    }
-
-    // Modify string in place and NULL-terminate.
-    while (ptr < limit) {
-        *text++ = *ptr++;
-    }
-    *text = '\0';
-}
-
-void*
-CFCUtil_wrapped_malloc(size_t count, const char *file, int line) {
-    void *pointer = malloc(count);
-    if (pointer == NULL && count != 0) {
-        if (sizeof(long) >= sizeof(size_t)) {
-            fprintf(stderr, "Can't malloc %lu bytes at %s line %d\n",
-                    (unsigned long)count, file, line);
-        }
-        else {
-            fprintf(stderr, "malloc failed at %s line %d\n", file, line);
-        }
-        exit(1);
-    }
-    return pointer;
-}
-
-void*
-CFCUtil_wrapped_calloc(size_t count, size_t size, const char *file, int line) {
-    void *pointer = calloc(count, size);
-    if (pointer == NULL && count != 0) {
-        if (sizeof(long) >= sizeof(size_t)) {
-            fprintf(stderr,
-                    "Can't calloc %lu elements of size %lu at %s line %d\n",
-                    (unsigned long)count, (unsigned long)size, file, line);
-        }
-        else {
-            fprintf(stderr, "calloc failed at %s line %d\n", file, line);
-        }
-        exit(1);
-    }
-    return pointer;
-}
-
-void*
-CFCUtil_wrapped_realloc(void *ptr, size_t size, const char *file, int line) {
-    void *pointer = realloc(ptr, size);
-    if (pointer == NULL && size != 0) {
-        if (sizeof(long) >= sizeof(size_t)) {
-            fprintf(stderr, "Can't realloc %lu bytes at %s line %d\n",
-                    (unsigned long)size, file, line);
-        }
-        else {
-            fprintf(stderr, "realloc failed at %s line %d\n", file, line);
-        }
-        exit(1);
-    }
-    return pointer;
-}
-
-void
-CFCUtil_wrapped_free(void *ptr) {
-    free(ptr);
-}
-
-int
-CFCUtil_current(const char *orig, const char *dest) {
-    // If the destination file doesn't exist, we're not current.
-    struct stat dest_stat;
-    if (stat(dest, &dest_stat) == -1) {
-        return false;
-    }
-
-    // If the source file is newer than the dest, we're not current.
-    struct stat orig_stat;
-    if (stat(orig, &orig_stat) == -1) {
-        CFCUtil_die("Missing source file '%s'", orig);
-    }
-    if (orig_stat.st_mtime > dest_stat.st_mtime) {
-        return false;
-    }
-
-    // Current!
-    return 1;
-}
-
-void
-CFCUtil_write_file(const char *filename, const char *content, size_t len) {
-    FILE *fh = fopen(filename, "w+");
-    if (fh == NULL) {
-        CFCUtil_die("Couldn't open '%s': %s", filename, strerror(errno));
-    }
-    fwrite(content, sizeof(char), len, fh);
-    if (fclose(fh)) {
-        CFCUtil_die("Error when closing '%s': %s", filename, strerror(errno));
-    }
-}
-
-char*
-CFCUtil_slurp_text(const char *file_path, size_t *len_ptr) {
-    FILE   *const file = fopen(file_path, "r");
-    char   *contents;
-    size_t  binary_len;
-    long    text_len;
-
-    /* Sanity check. */
-    if (file == NULL) {
-        CFCUtil_die("Error opening file '%s': %s", file_path, strerror(errno));
-    }
-
-    /* Find length; return NULL if the file has a zero-length. */
-    binary_len = CFCUtil_flength(file);
-    if (binary_len == 0) {
-        *len_ptr = 0;
-        return NULL;
-    }
-
-    /* Allocate memory and read the file. */
-    contents = (char*)MALLOCATE(binary_len * sizeof(char) + 1);
-    text_len = fread(contents, sizeof(char), binary_len, file);
-
-    /* Weak error check, because CRLF might result in fewer chars read. */
-    if (text_len <= 0) {
-        CFCUtil_die("Tried to read %ld bytes of '%s', got return code %ld",
-                    (long)binary_len, file_path, (long)text_len);
-    }
-
-    /* NULL-terminate. */
-    contents[text_len] = '\0';
-
-    /* Set length pointer for benefit of caller. */
-    *len_ptr = text_len;
-
-    /* Clean up. */
-    if (fclose(file)) {
-        CFCUtil_die("Error closing file '%s': %s", file_path, strerror(errno));
-    }
-
-    return contents;
-}
-
-int
-CFCUtil_write_if_changed(const char *path, const char *content, size_t len) {
-    FILE *f = fopen(path, "r");
-    if (f) { // Does file exist?
-        if (fclose(f)) {
-            CFCUtil_die("Error closing file '%s': %s", path, strerror(errno));
-        }
-        size_t existing_len;
-        char *existing = CFCUtil_slurp_text(path, &existing_len);
-        int changed = true;
-        if (existing_len == len && strcmp(content, existing) == 0) {
-            changed = false;
-        }
-        FREEMEM(existing);
-        if (changed == false) {
-            return false;
-        }
-    }
-    CFCUtil_write_file(path, content, len);
-    return true;
-}
-
-long
-CFCUtil_flength(void *file) {
-    FILE *f = (FILE*)file;
-    const long bookmark = (long)ftell(f);
-    long check_val;
-    long len;
-
-    /* Seek to end of file and check length. */
-    check_val = fseek(f, 0, SEEK_END);
-    if (check_val == -1) { CFCUtil_die("fseek error : %s\n", strerror(errno)); }
-    len = (long)ftell(f);
-    if (len == -1) { CFCUtil_die("ftell error : %s\n", strerror(errno)); }
-
-    /* Return to where we were. */
-    check_val = fseek(f, bookmark, SEEK_SET);
-    if (check_val == -1) { CFCUtil_die("fseek error : %s\n", strerror(errno)); }
-
-    return len;
-}
-
-// Note: this has to be defined before including the Perl headers because they
-// redefine stat() in an incompatible way on certain systems (Windows).
-int
-CFCUtil_is_dir(const char *path) {
-    struct stat stat_buf;
-    int stat_check = stat(path, &stat_buf);
-    if (stat_check == -1) {
-        return false;
-    }
-    return (stat_buf.st_mode & S_IFDIR) ? true : false;
-}
-
-int
-CFCUtil_make_path(const char *path) {
-    CFCUTIL_NULL_CHECK(path);
-    char *target = CFCUtil_strdup(path);
-    size_t orig_len = strlen(target);
-    size_t len = orig_len;
-    for (size_t i = 0; i <= len; i++) {
-        if (target[i] == CHY_DIR_SEP_CHAR || i == len) {
-            target[i] = 0; // NULL-terminate.
-            struct stat stat_buf;
-            int stat_check = stat(target, &stat_buf);
-            if (stat_check != -1) {
-                if (!(stat_buf.st_mode & S_IFDIR)) {
-                    CFCUtil_die("%s isn't a directory", target);
-                }
-            }
-            else {
-                int success = CFCUtil_make_dir(target);
-                if (!success) {
-                    FREEMEM(target);
-                    return false;
-                }
-            }
-            target[i] = CHY_DIR_SEP_CHAR;
-        }
-    }
-
-    FREEMEM(target);
-    return true;
-}
-
-void
-CFCUtil_walk(const char *path, CFCUtil_walk_callback_t callback,
-             void *context) {
-    // If it's a valid file system entry, invoke the callback.
-    struct stat stat_buf;
-    int stat_check = stat(path, &stat_buf);
-    if (stat_check == -1) {
-        return;
-    }
-    callback(path, context);
-
-    // Recurse into directories.
-    if (!(stat_buf.st_mode & S_IFDIR)) {
-        return;
-    }
-    void   *dirhandle = CFCUtil_opendir(path);
-    const char *entry = NULL;
-    while (NULL != (entry = CFCUtil_dirnext(dirhandle))) {
-        if (strcmp(entry, ".") == 0 || strcmp(entry, "..") == 0) {
-            continue;
-        }
-        char *subpath = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s", path, entry);
-        CFCUtil_walk(subpath, callback, context);
-        FREEMEM(subpath);
-    }
-    CFCUtil_closedir(dirhandle, path);
-}
-
-int
-CFCUtil_make_dir(const char *dir) {
-    return !chy_makedir(dir, 0777);
-}
-
-/******************************** WINDOWS **********************************/
-#if (defined(CHY_HAS_WINDOWS_H) && !defined(__CYGWIN__))
-
-#include <windows.h>
-
-typedef struct WinDH {
-    HANDLE handle;
-    WIN32_FIND_DATA *find_data;
-    char path[MAX_PATH + 1];
-    int first_time;
-} WinDH;
-
-void*
-CFCUtil_opendir(const char *dir) {
-    size_t dirlen = strlen(dir);
-    if (dirlen >= MAX_PATH - 2) {
-        CFCUtil_die("Exceeded MAX_PATH(%d): %s", (int)MAX_PATH, dir);
-    }
-    WinDH *dh = (WinDH*)CALLOCATE(1, sizeof(WinDH));
-    dh->find_data = (WIN32_FIND_DATA*)MALLOCATE(sizeof(WIN32_FIND_DATA));
-
-    // Tack on wildcard needed by FindFirstFile.
-    sprintf(dh->path, "%s\\*", dir);
-
-    dh->handle = FindFirstFile(dh->path, dh->find_data);
-    if (dh->handle == INVALID_HANDLE_VALUE) {
-        CFCUtil_die("Can't open dir '%s'", dh->path);
-    }
-    dh->first_time = true;
-
-    return dh;
-}
-
-const char*
-CFCUtil_dirnext(void *dirhandle) {
-    WinDH *dh = (WinDH*)dirhandle;
-    if (dh->first_time) {
-        dh->first_time = false;
-    }
-    else {
-        if ((FindNextFile(dh->handle, dh->find_data) == 0)) {
-            if (GetLastError() != ERROR_NO_MORE_FILES) {
-                CFCUtil_die("Error occurred while reading '%s'",
-                            dh->path);
-            }
-            return NULL;
-        }
-    }
-    return dh->find_data->cFileName;
-}
-
-void
-CFCUtil_closedir(void *dirhandle, const char *dir) {
-    WinDH *dh = (WinDH*)dirhandle;
-    if (!FindClose(dh->handle)) {
-        CFCUtil_die("Error occurred while closing dir '%s'", dir);
-    }
-    FREEMEM(dh->find_data);
-    FREEMEM(dh);
-}
-
-/******************************** UNIXEN ***********************************/
-#elif defined(CHY_HAS_DIRENT_H)
-
-#include <dirent.h>
-
-void*
-CFCUtil_opendir(const char *dir) {
-    DIR *dirhandle = opendir(dir);
-    if (!dirhandle) {
-        CFCUtil_die("Failed to opendir for '%s': %s", dir, strerror(errno));
-    }
-    return dirhandle;
-}
-
-const char*
-CFCUtil_dirnext(void *dirhandle) {
-    struct dirent *entry = readdir((DIR*)dirhandle);
-    return entry ? entry->d_name : NULL;
-}
-
-void
-CFCUtil_closedir(void *dirhandle, const char *dir) {
-    if (closedir((DIR*)dirhandle) == -1) {
-        CFCUtil_die("Error closing dir '%s': %s", dir, strerror(errno));
-    }
-}
-
-#else
-  #error "Need either dirent.h or windows.h"
-#endif // CHY_HAS_DIRENT_H vs. CHY_HAS_WINDOWS_H
-
-/***************************************************************************/
-
-#ifdef CFCPERL
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-#include "ppport.h"
-
-void
-CFCUtil_die(const char* format, ...) {
-    SV *errsv = get_sv("@", 1);
-    va_list args;
-    va_start(args, format);
-    sv_vsetpvf_mg(errsv, format, &args);
-    va_end(args);
-    croak(NULL);
-}
-
-void
-CFCUtil_warn(const char* format, ...) {
-    SV *mess = newSVpv("", 0);
-    va_list args;
-    va_start(args, format);
-    sv_vsetpvf(mess, format, &args);
-    va_end(args);
-    fprintf(stderr, "%s\n", SvPV_nolen(mess));
-    SvREFCNT_dec(mess);
-}
-
-#else
-
-void
-CFCUtil_die(const char* format, ...) {
-    va_list args;
-    va_start(args, format);
-    vfprintf(stderr, format, args);
-    va_end(args);
-    fprintf(stderr, "\n");
-    exit(1);
-}
-
-void
-CFCUtil_warn(const char* format, ...) {
-    va_list args;
-    va_start(args, format);
-    vfprintf(stderr, format, args);
-    va_end(args);
-    fprintf(stderr, "\n");
-}
-
-#endif /* CFCPERL */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCUtil.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCUtil.h b/clownfish/compiler/src/CFCUtil.h
deleted file mode 100644
index 961bccf..0000000
--- a/clownfish/compiler/src/CFCUtil.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Util - Miscellaneous helper functions.
- *
- * Clownfish::CFC::Util provides a few convenience functions used internally by
- * other Clownfish modules.
- */
-
-#ifndef H_CFCUTIL
-#define H_CFCUTIL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-
-/** Create an inner Perl object with a refcount of 1.  For use in actual
- * Perl-space, it is necessary to wrap this inner object in an RV.
- */
-void*
-CFCUtil_make_perl_obj(void *ptr, const char *klass);
-
-/** Throw an error if the supplied argument is NULL.
- */
-void
-CFCUtil_null_check(const void *arg, const char *name, const char *file, int line);
-#define CFCUTIL_NULL_CHECK(arg) \
-    CFCUtil_null_check(arg, #arg, __FILE__, __LINE__)
-
-/** Portable, NULL-safe implementation of strdup().
- */
-char*
-CFCUtil_strdup(const char *string);
-
-/** Portable, NULL-safe implementation of strndup().
- */
-char*
-CFCUtil_strndup(const char *string, size_t len);
-
-/** Return a dynamically allocated string with content defined by a printf
- * format string and additional arguments. Similar to asprintf().
- */
-char*
-CFCUtil_sprintf(const char *fmt, ...);
-
-/** Concatenate a NULL-terminated list of strings onto the first, reallocating
- * with each argument.
- */
-char*
-CFCUtil_cat(char *string, ...);
-
-/** Trim whitespace from the beginning and the end of a string.
- */
-void
-CFCUtil_trim_whitespace(char *text);
-
-/** Attempt to allocate memory with malloc, but print an error and exit if the
- * call fails.
- */
-void*
-CFCUtil_wrapped_malloc(size_t count, const char *file, int line);
-
-/** Attempt to allocate memory with calloc, but print an error and exit if the
- * call fails.
- */
-void*
-CFCUtil_wrapped_calloc(size_t count, size_t size, const char *file, int line);
-
-/** Attempt to allocate memory with realloc, but print an error and exit if
- * the call fails.
- */
-void*
-CFCUtil_wrapped_realloc(void *ptr, size_t size, const char *file, int line);
-
-/** Free memory.  (Wrapping is necessary in cases where memory allocated
- * within Clownfish has to be freed in an external environment where "free"
- * may have been redefined.)
- */
-void
-CFCUtil_wrapped_free(void *ptr);
-
-#define MALLOCATE(_count) \
-    CFCUtil_wrapped_malloc((_count), __FILE__, __LINE__)
-#define CALLOCATE(_count, _size) \
-    CFCUtil_wrapped_calloc((_count), (_size), __FILE__, __LINE__)
-#define REALLOCATE(_ptr, _count) \
-    CFCUtil_wrapped_realloc((_ptr), (_count), __FILE__, __LINE__)
-#define FREEMEM(_ptr) \
-    CFCUtil_wrapped_free(_ptr)
-
-/** Given two filepaths, return true if the second exists and has a
- * modification time which more recent than that of the first.
- */
-int
-CFCUtil_current(const char *orig, const char *dest);
-
-/* Open a file (truncating if necessary) and write [content] to it.  CFCUtil_die() if
- * an error occurs.
- */
-void
-CFCUtil_write_file(const char *filename, const char *content, size_t len);
-
-/** Test whether there's a file at <code>path</code> which already matches
- * <code>content</code> exactly.  If something has changed, write the file.
- * Otherwise do nothing (and avoid bumping the file's modification time).
- *
- * @return true if the file was written, false otherwise.
- */
-int
-CFCUtil_write_if_changed(const char *path, const char *content, size_t len);
-
-/* Read an entire file (as text) into memory.
- */
-char*
-CFCUtil_slurp_text(const char *file_path, size_t *len_ptr);
-
-/* Get the length of a file (may overshoot on text files under DOS).
- */
-long
-CFCUtil_flength(void *file);
-
-/* Platform-agnostic opendir wrapper.
- */
-void*
-CFCUtil_opendir(const char *dir);
-
-/* Platform-agnostic readdir wrapper.
- */
-const char*
-CFCUtil_dirnext(void *dirhandle);
-
-/* Platform-agnostic closedir wrapper.
- */
-void
-CFCUtil_closedir(void *dirhandle, const char *dir);
-
-/* Returns true if the supplied path is a directory, false otherwise.
- */
-int
-CFCUtil_is_dir(const char *path);
-
-/* Create the specified directory.  Returns true on success, false on failure.
- */
-int
-CFCUtil_make_dir(const char *dir);
-
-/* Create the specified path including all subdirectories.  Returns true on
- * success, false on failure.  Intermediate directories may be left behind on
- * failure.
- */
-int
-CFCUtil_make_path(const char *path);
-
-/* Walk the file system, recursing into subdirectories.  Invoke the supplied
- * callback for each valid, accessible file system entry.
- */
-typedef void
-(*CFCUtil_walk_callback_t)(const char *path, void *context);
-void
-CFCUtil_walk(const char *dir, CFCUtil_walk_callback_t callback,
-             void *context);
-
-/* Print an error message to stderr and exit.
- */
-void
-CFCUtil_die(const char *format, ...);
-
-/* Print an error message to stderr.
- */
-void
-CFCUtil_warn(const char *format, ...);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCUTIL */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCVariable.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCVariable.c b/clownfish/compiler/src/CFCVariable.c
deleted file mode 100644
index 4292e35..0000000
--- a/clownfish/compiler/src/CFCVariable.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-#define CFC_NEED_SYMBOL_STRUCT_DEF
-#include "CFCSymbol.h"
-#include "CFCVariable.h"
-#include "CFCParcel.h"
-#include "CFCType.h"
-#include "CFCUtil.h"
-
-struct CFCVariable {
-    struct CFCSymbol symbol;
-    CFCType *type;
-    char *local_c;
-    char *global_c;
-    char *local_dec;
-    int   inert;
-};
-
-static const CFCMeta CFCVARIABLE_META = {
-    "Clownfish::CFC::Model::Variable",
-    sizeof(CFCVariable),
-    (CFCBase_destroy_t)CFCVariable_destroy
-};
-
-static void
-S_generate_c_strings(CFCVariable *self);
-
-CFCVariable*
-CFCVariable_new(struct CFCParcel *parcel, const char *exposure,
-                const char *class_name, const char *class_cnick,
-                const char *micro_sym, struct CFCType *type, int inert) {
-    CFCVariable *self = (CFCVariable*)CFCBase_allocate(&CFCVARIABLE_META);
-    return CFCVariable_init(self, parcel, exposure, class_name, class_cnick,
-                            micro_sym, type, inert);
-}
-
-CFCVariable*
-CFCVariable_init(CFCVariable *self, struct CFCParcel *parcel,
-                 const char *exposure, const char *class_name,
-                 const char *class_cnick, const char *micro_sym,
-                 struct CFCType *type, int inert) {
-    // Validate params.
-    CFCUTIL_NULL_CHECK(type);
-    if (!parcel) {
-        parcel = CFCParcel_default_parcel();
-    }
-
-    // Default exposure to "local".
-    const char *real_exposure = exposure ? exposure : "local";
-
-    CFCSymbol_init((CFCSymbol*)self, parcel, real_exposure, class_name,
-                   class_cnick, micro_sym);
-
-    // Assign type, inert.
-    self->type = (CFCType*)CFCBase_incref((CFCBase*)type);
-    self->inert = !!inert;
-
-    self->local_c   = NULL;
-    self->local_dec = NULL;
-    self->global_c  = NULL;
-
-    return self;
-}
-
-void
-CFCVariable_resolve_type(CFCVariable *self, struct CFCClass **classes) {
-    CFCType_resolve(self->type, classes);
-}
-
-void
-CFCVariable_destroy(CFCVariable *self) {
-    CFCBase_decref((CFCBase*)self->type);
-    FREEMEM(self->local_c);
-    FREEMEM(self->global_c);
-    FREEMEM(self->local_dec);
-    CFCSymbol_destroy((CFCSymbol*)self);
-}
-
-int
-CFCVariable_equals(CFCVariable *self, CFCVariable *other) {
-    if (!CFCType_equals(self->type, other->type)) { return false; }
-    return CFCSymbol_equals((CFCSymbol*)self, (CFCSymbol*)other);
-}
-
-// Cache various C string representations.
-static void
-S_generate_c_strings(CFCVariable *self) {
-    const char *type_str = CFCType_to_c(self->type);
-    const char *postfix  = "";
-    if (CFCType_is_composite(self->type)
-        && CFCType_get_array(self->type) != NULL
-       ) {
-        postfix = CFCType_get_array(self->type);
-    }
-    const char *micro_sym = CFCVariable_micro_sym(self);
-    self->local_c = CFCUtil_sprintf("%s %s%s", type_str, micro_sym, postfix);
-    self->local_dec = CFCUtil_sprintf("%s;", self->local_c);
-    const char *full_sym = CFCVariable_full_sym(self);
-    self->global_c = CFCUtil_sprintf("%s %s%s", type_str, full_sym, postfix);
-}
-
-CFCType*
-CFCVariable_get_type(CFCVariable *self) {
-    return self->type;
-}
-
-int
-CFCVariable_inert(CFCVariable *self) {
-    return self->inert;
-}
-
-const char*
-CFCVariable_local_c(CFCVariable *self) {
-    if (!self->local_c) { S_generate_c_strings(self); }
-    return self->local_c;
-}
-
-const char*
-CFCVariable_global_c(CFCVariable *self) {
-    if (!self->global_c) { S_generate_c_strings(self); }
-    return self->global_c;
-}
-
-const char*
-CFCVariable_local_declaration(CFCVariable *self) {
-    if (!self->local_dec) { S_generate_c_strings(self); }
-    return self->local_dec;
-}
-
-const char*
-CFCVariable_micro_sym(CFCVariable *self) {
-    return CFCSymbol_micro_sym((CFCSymbol*)self);
-}
-
-const char*
-CFCVariable_short_sym(CFCVariable *self) {
-    return CFCSymbol_short_sym((CFCSymbol*)self);
-}
-
-const char*
-CFCVariable_full_sym(CFCVariable *self) {
-    return CFCSymbol_full_sym((CFCSymbol*)self);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCVariable.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCVariable.h b/clownfish/compiler/src/CFCVariable.h
deleted file mode 100644
index 7263de7..0000000
--- a/clownfish/compiler/src/CFCVariable.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCVARIABLE
-#define H_CFCVARIABLE
-
-/** Clownfish::CFC::Model::Variable - A Clownfish variable.
- *
- * A variable, having a L<Type|Clownfish::CFC::Model::Type>, a micro_sym (i.e.
- * name), an exposure, and optionally, a location in the global namespace
- * hierarchy.
- *
- * Variable objects which exist only within a local scope, e.g. those within
- * parameter lists, do not need to know about class.  In contrast, inert class
- * vars, for example, need to know class information so that they can declare
- * themselves properly.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCVariable CFCVariable;
-struct CFCClass;
-struct CFCParcel;
-struct CFCType;
-
-/**
- * @param type A Clownfish::CFC::Model::Type.
- * @param micro_sym The variable's name, without any namespacing prefixes.
- * @param exposure See Clownfish::CFC::Model::Symbol.
- * @param class_name See Clownfish::CFC::Model::Symbol.
- * @param class_cnick See Clownfish::CFC::Model::Symbol.
- */
-CFCVariable*
-CFCVariable_new(struct CFCParcel *parcel, const char *exposure,
-                const char *class_name, const char *class_cnick,
-                const char *micro_sym, struct CFCType *type, int inert);
-
-CFCVariable*
-CFCVariable_init(CFCVariable *self, struct CFCParcel *parcel,
-                 const char *exposure, const char *class_name,
-                 const char *class_cnick, const char *micro_sym,
-                 struct CFCType *type, int inert);
-
-void
-CFCVariable_resolve_type(CFCVariable *self, struct CFCClass **classes);
-
-void
-CFCVariable_destroy(CFCVariable *self);
-
-int
-CFCVariable_equals(CFCVariable *self, CFCVariable *other);
-
-struct CFCType*
-CFCVariable_get_type(CFCVariable *self);
-
-int
-CFCVariable_inert(CFCVariable *self);
-
-
-/** Returns a string with the Variable's C type and its
- * <code>micro_sym</code>. For instance:
- *
- *     int32_t average_lifespan
- */
-const char*
-CFCVariable_local_c(CFCVariable *self);
-
-/** Returns a string with the Variable's C type and its fully qualified name
- * within the global namespace.  For example:
- *
- *     int32_t crust_Lobster_average_lifespan
- */
-const char*
-CFCVariable_global_c(CFCVariable *self);
-
-/** Returns C code appropriate for declaring the variable in a local scope,
- * such as within a struct definition, or as an automatic variable within a C
- * function.  For example:
- *
- *     int32_t average_lifespan;
- */
-const char*
-CFCVariable_local_declaration(CFCVariable *self);
-
-const char*
-CFCVariable_micro_sym(CFCVariable *self);
-
-const char*
-CFCVariable_short_sym(CFCVariable *self);
-
-const char*
-CFCVariable_full_sym(CFCVariable *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCVARIABLE */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCVersion.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCVersion.c b/clownfish/compiler/src/CFCVersion.c
deleted file mode 100644
index 671ff36..0000000
--- a/clownfish/compiler/src/CFCVersion.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <ctype.h>
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCVersion.h"
-#include "CFCUtil.h"
-
-struct CFCVersion {
-    CFCBase base;
-    uint32_t *numbers;
-    size_t num_numbers;
-    char *vstring;
-};
-
-static const CFCMeta CFCVERSION_META = {
-    "Clownfish::CFC::Model::Version",
-    sizeof(CFCVersion),
-    (CFCBase_destroy_t)CFCVersion_destroy
-};
-
-CFCVersion*
-CFCVersion_new(const char *vstring) {
-    CFCVersion *self = (CFCVersion*)CFCBase_allocate(&CFCVERSION_META);
-    return CFCVersion_init(self, vstring);
-}
-
-CFCVersion*
-CFCVersion_init(CFCVersion *self, const char *vstring) {
-    CFCUTIL_NULL_CHECK(vstring);
-    if (*vstring != 'v' || !isdigit(vstring[1])) {
-        CFCBase_decref((CFCBase*)self);
-        CFCUtil_die("Bad version string: '%s'", vstring);
-    }
-    self->vstring = CFCUtil_strdup(vstring);
-    vstring++;
-    uint32_t num = 0;
-    self->num_numbers = 0;
-    self->numbers = (uint32_t*)CALLOCATE(1, sizeof(uint32_t));
-    while (1) {
-        if (isdigit(*vstring)) {
-            num = num * 10 + *vstring - '0';
-        }
-        else {
-            if (*vstring != 0 && *vstring != '.') {
-                CFCBase_decref((CFCBase*)self);
-                CFCUtil_die("Bad version string: '%s'", self->vstring);
-            }
-            size_t size = (self->num_numbers + 1) * sizeof(uint32_t);
-            self->numbers = (uint32_t*)REALLOCATE(self->numbers, size);
-            self->numbers[self->num_numbers++] = num;
-            if (*vstring == 0) {
-                break;
-            }
-            num = 0;
-        }
-        vstring++;
-    }
-
-    return self;
-}
-
-void
-CFCVersion_destroy(CFCVersion *self) {
-    FREEMEM(self->numbers);
-    FREEMEM(self->vstring);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-int
-CFCVersion_compare_to(CFCVersion *self, CFCVersion *other) {
-    for (size_t i = 0;
-         i < self->num_numbers || i < other->num_numbers;
-         i++
-        ) {
-        uint32_t my_number = i >= self->num_numbers
-                             ? 0
-                             : self->numbers[i];
-        uint32_t other_number = i >= other->num_numbers
-                                ? 0
-                                : other->numbers[i];
-        if (my_number > other_number) {
-            return 1;
-        }
-        else if (other_number > my_number) {
-            return -1;
-        }
-    }
-    return 0;
-}
-
-uint32_t
-CFCVersion_get_major(CFCVersion *self) {
-    return self->numbers[0];
-}
-
-const char*
-CFCVersion_get_vstring(CFCVersion *self) {
-    return self->vstring;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCVersion.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCVersion.h b/clownfish/compiler/src/CFCVersion.h
deleted file mode 100644
index e81a012..0000000
--- a/clownfish/compiler/src/CFCVersion.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/** Clownfish::CFC::Model::Version - Version number.
- *
- * A version number, comprised of one or more unsigned integers.  Digits
- * beyond the first are treated as implicit zeros for the purposes of
- * comparision, so that v1.2 and v1.2.0 are equivalent.
- */
-#ifndef H_CFCVERSION
-#define H_CFCVERSION
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "charmony.h"
-
-typedef struct CFCVersion CFCVersion;
-
-/**
- * @param vstring - A version string consisting of a lower-case 'v' followed
- * by one or more unsigned integers separated by dots.
-*/
-CFCVersion*
-CFCVersion_new(const char *vstring);
-
-CFCVersion*
-CFCVersion_init(CFCVersion *self, const char *vstring);
-
-void
-CFCVersion_destroy(CFCVersion *self);
-
-int
-CFCVersion_compare_to(CFCVersion *self, CFCVersion *other);
-
-const char*
-CFCVersion_get_vstring(CFCVersion *self);
-
-uint32_t
-CFCVersion_get_major(CFCVersion *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCVERSION */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/devel/benchmarks/method_dispatch/.gitignore
----------------------------------------------------------------------
diff --git a/clownfish/devel/benchmarks/method_dispatch/.gitignore b/clownfish/devel/benchmarks/method_dispatch/.gitignore
deleted file mode 100644
index a82daf4..0000000
--- a/clownfish/devel/benchmarks/method_dispatch/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-dso.dylib
-dso.so
-exe

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/devel/benchmarks/method_dispatch/Makefile.darwin
----------------------------------------------------------------------
diff --git a/clownfish/devel/benchmarks/method_dispatch/Makefile.darwin b/clownfish/devel/benchmarks/method_dispatch/Makefile.darwin
deleted file mode 100644
index f49451c..0000000
--- a/clownfish/devel/benchmarks/method_dispatch/Makefile.darwin
+++ /dev/null
@@ -1,31 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-CFLAGS = -std=gnu99 -Wextra -O2 -fomit-frame-pointer -DHAS_ALIAS
-
-all : bench
-
-dso.dylib : dso.c dso.h oo.h
-		gcc $(CFLAGS) -Wl,-alias,_thunk3,_Obj_Hello_THUNK -shared dso.c -o $@
-
-exe : exe.c dso.h oo.h dso.dylib
-		gcc $(CFLAGS) exe.c dso.dylib -o $@
-
-bench : exe
-		./exe
-
-clean :
-		rm -f dso.dylib exe
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/devel/benchmarks/method_dispatch/Makefile.linux
----------------------------------------------------------------------
diff --git a/clownfish/devel/benchmarks/method_dispatch/Makefile.linux b/clownfish/devel/benchmarks/method_dispatch/Makefile.linux
deleted file mode 100644
index 80d2c8f..0000000
--- a/clownfish/devel/benchmarks/method_dispatch/Makefile.linux
+++ /dev/null
@@ -1,31 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-CFLAGS = -std=gnu99 -Wextra -O2 -fomit-frame-pointer
-
-all : bench
-
-dso.so : dso.c dso.h oo.h
-	gcc $(CFLAGS) -shared -fPIC dso.c -o $@
-
-exe : exe.c dso.h oo.h dso.so
-	gcc $(CFLAGS) -fPIE exe.c dso.so -o $@
-
-bench : exe
-	LD_LIBRARY_PATH=. ./exe
-
-clean :
-	rm -f dso.so exe
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/devel/benchmarks/method_dispatch/dso.c
----------------------------------------------------------------------
diff --git a/clownfish/devel/benchmarks/method_dispatch/dso.c b/clownfish/devel/benchmarks/method_dispatch/dso.c
deleted file mode 100644
index 28a30e2..0000000
--- a/clownfish/devel/benchmarks/method_dispatch/dso.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "dso.h"
-
-static void Obj_hello(obj_t *obj);
-
-void thunk3(obj_t *obj);
-
-class_t *OBJ;
-size_t Obj_Hello_OFFSET;
-method_t Obj_Hello_THUNK_PTR;
-
-void
-bootstrap() {
-    size_t method_idx = 3;
-    size_t class_size = offsetof(class_t, vtable)
-                        + (method_idx + 1) * sizeof(method_t);
-
-    OBJ = (class_t*)calloc(1, class_size);
-
-    OBJ->name       = "Obj";
-    OBJ->class_size = class_size;
-
-    Obj_Hello_OFFSET = offsetof(class_t, vtable)
-                       + method_idx * sizeof(method_t);
-    OBJ->vtable[method_idx] = Obj_hello;
-    Obj_Hello_THUNK_PTR = thunk3;
-}
-
-obj_t*
-Obj_new() {
-    obj_t *self = (obj_t *)malloc(sizeof(obj_t));
-
-    self->refcount = 1;
-    self->klass    = OBJ;
-    self->value    = 0;
-
-    return self;
-}
-
-static void
-Obj_hello(obj_t *obj) {
-    ++obj->value;
-}
-
-void
-thunk3(obj_t *obj) {
-    obj->klass->vtable[3](obj);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/devel/benchmarks/method_dispatch/dso.h
----------------------------------------------------------------------
diff --git a/clownfish/devel/benchmarks/method_dispatch/dso.h b/clownfish/devel/benchmarks/method_dispatch/dso.h
deleted file mode 100644
index fe1a07f..0000000
--- a/clownfish/devel/benchmarks/method_dispatch/dso.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef DSO_H
-#define DSO_H
-
-#include "oo.h"
-
-extern class_t *OBJ;
-extern size_t Obj_Hello_OFFSET;
-extern method_t Obj_Hello_THUNK_PTR;
-#define Obj_Hello_FIXED_OFFSET (5 * sizeof(void*))
-
-void bootstrap();
-
-obj_t *Obj_new(void);
-
-void Obj_Hello_THUNK(obj_t *obj);
-
-#endif /* DSO_H */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/devel/benchmarks/method_dispatch/exe.c
----------------------------------------------------------------------
diff --git a/clownfish/devel/benchmarks/method_dispatch/exe.c b/clownfish/devel/benchmarks/method_dispatch/exe.c
deleted file mode 100644
index 1747386..0000000
--- a/clownfish/devel/benchmarks/method_dispatch/exe.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <inttypes.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/time.h>
-
-#include "dso.h"
-
-#define CPUFREQ    UINT64_C(2800000000)
-#define NOINLINE   __attribute__ ((noinline))
-uint64_t iterations;
-#define ITERATIONS iterations
-
-static inline method_t
-Obj_Hello_PTR(obj_t *obj) {
-    class_t *klass = obj->klass;
-    return *(method_t*)((char*)klass + Obj_Hello_OFFSET);
-}
-
-static inline void
-Obj_Hello(obj_t *obj) {
-    class_t *klass = obj->klass;
-    method_t method = *(method_t*)((char*)klass + Obj_Hello_OFFSET);
-    method(obj);
-}
-
-static inline void
-Obj_Hello_FIXED(obj_t *obj) {
-    class_t *klass = obj->klass;
-    method_t method = *(method_t*)((char*)klass + Obj_Hello_FIXED_OFFSET);
-    method(obj);
-}
-
-void
-loop_with_method_ptr(obj_t *obj) {
-    method_t method = Obj_Hello_PTR(obj);
-
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        method(obj);
-    }
-}
-
-void
-loop_with_wrapper(obj_t *obj) {
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        Obj_Hello(obj);
-    }
-}
-
-void
-loop_with_fixed_offset_wrapper(obj_t *obj) {
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        Obj_Hello_FIXED(obj);
-    }
-}
-
-#ifdef HAS_ALIAS
-void
-loop_with_thunk(obj_t *obj) {
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        Obj_Hello_THUNK(obj);
-    }
-}
-
-void
-loop_with_thunk_ptr(obj_t *obj) {
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        Obj_Hello_THUNK_PTR(obj);
-    }
-}
-#endif
-
-NOINLINE void
-single_call_with_wrapper(obj_t *obj) {
-    Obj_Hello(obj);
-}
-
-void
-call_with_wrapper(obj_t *obj) {
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        single_call_with_wrapper(obj);
-    }
-}
-
-#ifdef HAS_ALIAS
-NOINLINE void
-single_call_with_thunk(obj_t *obj) {
-    Obj_Hello_THUNK(obj);
-}
-
-void
-call_with_thunk_ptr(obj_t *obj) {
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        single_call_with_thunk(obj);
-    }
-}
-
-NOINLINE void
-single_call_with_thunk_ptr(obj_t *obj) {
-    Obj_Hello_THUNK_PTR(obj);
-}
-
-void
-call_with_thunk(obj_t *obj) {
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        single_call_with_thunk(obj);
-    }
-}
-#endif
-
-void
-loop_with_simulated_inline(obj_t *obj) {
-    for (uint64_t i = 0; i < ITERATIONS; ++i) {
-        obj->value++;
-    }
-}
-
-static void
-bench(method_t fn, const char *name) {
-    obj_t *obj = Obj_new();
-
-    struct timeval t0;
-    gettimeofday(&t0, NULL);
-
-    fn(obj);
-
-    struct timeval t1;
-    gettimeofday(&t1, NULL);
-
-    if (obj->value != ITERATIONS) {
-        fprintf(stderr, "Unexpected obj->value: %" PRIu64 "\n", obj->value);
-        abort();
-    }
-
-    uint64_t usec = (uint64_t)(t1.tv_sec - t0.tv_sec) * 1000000
-                    + (t1.tv_usec - t0.tv_usec);
-    printf("cycles/call with %s: %f\n", name,
-           ((double)usec * CPUFREQ) / (1000000.0 * ITERATIONS));
-}
-
-int
-main(int argc, char **argv) {
-    if (argc > 1) {
-        iterations = strtoll(argv[1], NULL, 10);
-    }
-    else {
-        iterations = UINT64_C(1000000000);
-    }
-    bootstrap();
-
-    bench(loop_with_method_ptr, "method ptr loop");
-    bench(loop_with_wrapper, "wrapper loop");
-    bench(loop_with_fixed_offset_wrapper, "fixed offset wrapper loop");
-#ifdef HAS_ALIAS
-    bench(loop_with_thunk, "thunk loop");
-    bench(loop_with_thunk_ptr, "thunk ptr loop");
-#endif
-    bench(call_with_wrapper, "wrapper");
-#ifdef HAS_ALIAS
-    bench(call_with_thunk, "thunk");
-    bench(call_with_thunk_ptr, "thunk ptr");
-#endif
-    bench(loop_with_simulated_inline, "simulated inline");
-
-    return 0;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/devel/benchmarks/method_dispatch/oo.h
----------------------------------------------------------------------
diff --git a/clownfish/devel/benchmarks/method_dispatch/oo.h b/clownfish/devel/benchmarks/method_dispatch/oo.h
deleted file mode 100644
index d2d0190..0000000
--- a/clownfish/devel/benchmarks/method_dispatch/oo.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef OO_H
-#define OO_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-typedef struct class_t class_t;
-
-typedef struct obj_t {
-    size_t    refcount;
-    class_t  *klass;
-    uint64_t  value;
-} obj_t;
-
-typedef void (*method_t)(obj_t *obj);
-
-struct class_t {
-    char     *name;
-    size_t    class_size;
-    method_t  vtable[1];
-};
-
-#endif /* OO_H */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/.gitignore
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/.gitignore b/clownfish/runtime/c/.gitignore
deleted file mode 100644
index d75d0aa..0000000
--- a/clownfish/runtime/c/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-/Makefile
-/autogen/
-/charmonizer
-/charmony.h
-/libcfish.*.dylib
-/libcfish.dylib
-/libcfish.so
-/libcfish.so.*
-/t/test_cfish

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/INSTALL
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/INSTALL b/clownfish/runtime/c/INSTALL
deleted file mode 100644
index 5566b50..0000000
--- a/clownfish/runtime/c/INSTALL
+++ /dev/null
@@ -1,46 +0,0 @@
-Build instructions for the Clownfish C library
-==============================================
-
-Building under UNIX and derivatives or Cygwin
----------------------------------------------
-
-    $ ./configure
-    $ make
-    $ make test
-
-Building under Windows
-----------------------
-
-You need MSVC or gcc as C compiler and nmake or mingw32-make as make utility.
-
-When using cmd.exe configure with:
-
-    $ configure.bat
-
-When using the MSYS shell configure with:
-
-    $ ./configure
-
-When building with nmake run:
-
-    $ nmake
-    $ nmake test
-
-When building with mingw32-make run:
-
-    $ mingw32-make
-    $ mingw32-make test
-
-Configuration
--------------
-
-    ./configure [ options ] [ -- cflags ]
-
-Options include
-
-    --enable-coverage
-        Enable code coverage. Create HTML pages with coverage data using
-        lcov by running "make coverage".
-    --disable-threads
-        Disable thread support.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/cfc_header
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/cfc_header b/clownfish/runtime/c/cfc_header
deleted file mode 100644
index d982cf9..0000000
--- a/clownfish/runtime/c/cfc_header
+++ /dev/null
@@ -1,23 +0,0 @@
-/***********************************************
-
- !!!! DO NOT EDIT !!!!
-
- This file was auto-generated by cfc.
-
- ***********************************************/
-
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/configure
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/configure b/clownfish/runtime/c/configure
deleted file mode 100755
index ae1f4f9..0000000
--- a/clownfish/runtime/c/configure
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-(cd ../../compiler/c && ./configure "$@") || exit
-echo
-
-echo Configuring Clownfish runtime...
-
-probe_clang() { clang -v; }
-probe_gcc()   { gcc -v; }
-
-if [ -z "$CC" ]; then
-    case $(uname) in
-        Darwin*) compilers="clang gcc";;
-        *)       compilers="gcc clang";;
-    esac
-
-    for compiler in $compilers; do
-        if probe_$compiler >/dev/null 2>&1; then
-            CC=$compiler
-            break
-        fi
-    done
-
-    if [ -z "$CC" ]; then
-        CC=cc
-    fi
-fi
-
-echo "Using C compiler '$CC'"
-
-command="$CC ../common/charmonizer.c -o charmonizer"
-echo $command
-$command || exit
-
-echo Running charmonizer
-./charmonizer --cc=$CC --enable-c --enable-makefile "$@"
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/configure.bat
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/configure.bat b/clownfish/runtime/c/configure.bat
deleted file mode 100644
index 07a3d1a..0000000
--- a/clownfish/runtime/c/configure.bat
+++ /dev/null
@@ -1,50 +0,0 @@
-@echo off
-
-rem Licensed to the Apache Software Foundation (ASF) under one or more
-rem contributor license agreements.  See the NOTICE file distributed with
-rem this work for additional information regarding copyright ownership.
-rem The ASF licenses this file to You under the Apache License, Version 2.0
-rem (the "License"); you may not use this file except in compliance with
-rem the License.  You may obtain a copy of the License at
-rem
-rem     http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-cd ..\..\compiler\c
-call configure.bat
-cd ..\..\..\c
-echo.
-
-echo Configuring Clownfish runtime...
-
-cl >nul 2>nul
-if not errorlevel 1 goto found_cl
-
-gcc -v >nul 2>nul
-if not errorlevel 1 goto found_gcc
-
-echo No C compiler found
-exit /b 1
-
-:found_cl
-echo Using C compiler 'cl'
-echo cl /nologo ..\common\charmonizer.c
-cl /nologo ..\common\charmonizer.c
-if errorlevel 1 exit /b 1
-echo Running charmonizer
-charmonizer.exe --cc=cl --enable-c --enable-makefile %*
-exit /b
-
-:found_gcc
-echo Using C compiler 'gcc'
-echo gcc ..\common\charmonizer.c -o charmonizer.exe
-gcc ..\common\charmonizer.c -o charmonizer.exe
-if errorlevel 1 exit /b 1
-echo Running charmonizer
-charmonizer.exe --cc=gcc --enable-c --enable-makefile %*
-exit /b

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/install.sh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/install.sh b/clownfish/runtime/c/install.sh
deleted file mode 100755
index 31d5a53..0000000
--- a/clownfish/runtime/c/install.sh
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-set -e
-
-version=0.3.0
-major_version=0.3
-
-usage()
-{
-    echo "Usage: install.sh --prefix path"
-}
-
-while [ -n "${1+set}" ]; do
-    case "$1" in
-        -h|--help|-\?)
-            usage
-            exit
-            ;;
-        --prefix)
-            if [ -z "${2+set}" ]; then
-                echo "--prefix requires an argument."
-                exit 1
-            fi
-            prefix=$2
-            shift 2
-            ;;
-        *)
-            echo "Invalid option: '$1'" 1>&2
-            usage
-            exit 1
-            ;;
-    esac
-done
-
-if [ -z "$prefix" ]; then
-    echo "No prefix specified."
-    usage
-    exit 1
-fi
-
-case $(uname) in
-    Darwin*)
-        lib_file=libcfish.$version.dylib
-        if [ ! -f $lib_file ]; then
-            echo "$lib_file not found. Did you run make?"
-            exit 1
-        fi
-        mkdir -p $prefix/lib
-        cp $lib_file $prefix/lib
-        install_name=$prefix/lib/libcfish.$major_version.dylib
-        ln -sf $lib_file $install_name
-        ln -sf $lib_file $prefix/lib/libcfish.dylib
-        install_name_tool -id $install_name $prefix/lib/$lib_file
-        ;;
-    *)
-        lib_file=libcfish.so.$version
-        if [ ! -f $lib_file ]; then
-            echo "$lib_file not found. Did you run make?"
-            exit 1
-        fi
-        mkdir -p $prefix/lib
-        cp $lib_file $prefix/lib
-        soname=libcfish.so.$major_version
-        ln -sf $lib_file $prefix/lib/$soname
-        ln -sf $soname $prefix/lib/libcfish.so
-        ;;
-esac
-
-mkdir -p $prefix/include
-cp autogen/include/cfish_hostdefs.h $prefix/include
-cp autogen/include/cfish_parcel.h $prefix/include
-cp autogen/include/cfish_platform.h $prefix/include
-cp -R autogen/include/Clownfish $prefix/include
-
-cp -R autogen/man $prefix
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/src/Clownfish/Err.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/src/Clownfish/Err.c b/clownfish/runtime/c/src/Clownfish/Err.c
deleted file mode 100644
index 112a9b1..0000000
--- a/clownfish/runtime/c/src/Clownfish/Err.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define C_CFISH_ERR
-
-#include "charmony.h"
-
-#include <setjmp.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "Clownfish/Err.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/VTable.h"
-
-/* TODO: Thread safety */
-static Err *current_error;
-static Err *thrown_error;
-static jmp_buf  *current_env;
-
-void
-Err_init_class(void) {
-}
-
-Err*
-Err_get_error() {
-    return current_error;
-}
-
-void
-Err_set_error(Err *error) {
-    if (current_error) {
-        DECREF(current_error);
-    }
-    current_error = error;
-}
-
-void
-Err_do_throw(Err *error) {
-    if (current_env) {
-        thrown_error = error;
-        longjmp(*current_env, 1);
-    }
-    else {
-        String *message = Err_Get_Mess(error);
-        char *utf8 = Str_To_Utf8(message);
-        fprintf(stderr, "%s", utf8);
-        FREEMEM(utf8);
-        exit(EXIT_FAILURE);
-    }
-}
-
-void*
-Err_To_Host_IMP(Err *self) {
-    UNUSED_VAR(self);
-    THROW(ERR, "TODO");
-    UNREACHABLE_RETURN(void*);
-}
-
-void
-Err_throw_mess(VTable *vtable, String *message) {
-    UNUSED_VAR(vtable);
-    Err *err = Err_new(message);
-    Err_do_throw(err);
-}
-
-void
-Err_warn_mess(String *message) {
-    char *utf8 = Str_To_Utf8(message);
-    fprintf(stderr, "%s", utf8);
-    FREEMEM(utf8);
-    DECREF(message);
-}
-
-Err*
-Err_trap(Err_Attempt_t routine, void *context) {
-    jmp_buf  env;
-    jmp_buf *prev_env = current_env;
-    current_env = &env;
-
-    if (!setjmp(env)) {
-        routine(context);
-    }
-
-    current_env = prev_env;
-
-    Err *error = thrown_error;
-    thrown_error = NULL;
-    return error;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c b/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c
deleted file mode 100644
index 23efef1..0000000
--- a/clownfish/runtime/c/src/Clownfish/LockFreeRegistry.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_LOCKFREEREGISTRY
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/LockFreeRegistry.h"
-#include "Clownfish/Err.h"
-
-void*
-LFReg_To_Host_IMP(LockFreeRegistry *self) {
-    UNUSED_VAR(self);
-    THROW(ERR, "TODO");
-    UNREACHABLE_RETURN(void*);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/src/Clownfish/Obj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/src/Clownfish/Obj.c b/clownfish/runtime/c/src/Clownfish/Obj.c
deleted file mode 100644
index 6616747..0000000
--- a/clownfish/runtime/c/src/Clownfish/Obj.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_OBJ
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Obj.h"
-#include "Clownfish/Err.h"
-
-uint32_t
-Obj_Get_RefCount_IMP(Obj *self) {
-    return self->refcount;
-}
-
-Obj*
-Obj_Inc_RefCount_IMP(Obj *self) {
-    self->refcount++;
-    return self;
-}
-
-uint32_t
-Obj_Dec_RefCount_IMP(Obj *self) {
-    uint32_t modified_refcount = INT32_MAX;
-    switch (self->refcount) {
-        case 0:
-            THROW(ERR, "Illegal refcount of 0");
-            break; // useless
-        case 1:
-            modified_refcount = 0;
-            Obj_Destroy(self);
-            break;
-        default:
-            modified_refcount = --self->refcount;
-            break;
-    }
-    return modified_refcount;
-}
-
-void*
-Obj_To_Host_IMP(Obj *self) {
-    UNUSED_VAR(self);
-    THROW(ERR, "TODO");
-    UNREACHABLE_RETURN(void*);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/src/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/src/Clownfish/VTable.c b/clownfish/runtime/c/src/Clownfish/VTable.c
deleted file mode 100644
index 5617900..0000000
--- a/clownfish/runtime/c/src/Clownfish/VTable.c
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define C_CFISH_OBJ
-#define C_CFISH_VTABLE
-
-#include "charmony.h"
-
-#include "Clownfish/VTable.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/VArray.h"
-
-Obj*
-VTable_Make_Obj_IMP(VTable *self) {
-    Obj *obj = (Obj*)Memory_wrapped_calloc(self->obj_alloc_size, 1);
-    obj->vtable = self;
-    obj->refcount = 1;
-    return obj;
-}
-
-Obj*
-VTable_Init_Obj_IMP(VTable *self, void *allocation) {
-    Obj *obj = (Obj*)allocation;
-    obj->vtable = self;
-    obj->refcount = 1;
-    return obj;
-}
-
-Obj*
-VTable_Foster_Obj_IMP(VTable *self, void *host_obj) {
-    UNUSED_VAR(self);
-    UNUSED_VAR(host_obj);
-    THROW(ERR, "TODO");
-    UNREACHABLE_RETURN(Obj*);
-}
-
-void
-VTable_register_with_host(VTable *singleton, VTable *parent) {
-    UNUSED_VAR(singleton);
-    UNUSED_VAR(parent);
-}
-
-VArray*
-VTable_fresh_host_methods(String *class_name) {
-    UNUSED_VAR(class_name);
-    return VA_new(0);
-}
-
-String*
-VTable_find_parent_class(String *class_name) {
-    UNUSED_VAR(class_name);
-    THROW(ERR, "TODO");
-    UNREACHABLE_RETURN(String*);
-}
-
-void*
-VTable_To_Host_IMP(VTable *self) {
-    UNUSED_VAR(self);
-    THROW(ERR, "TODO");
-    UNREACHABLE_RETURN(void*);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/c/t/test_cfish.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/c/t/test_cfish.c b/clownfish/runtime/c/t/test_cfish.c
deleted file mode 100644
index 0e3152d..0000000
--- a/clownfish/runtime/c/t/test_cfish.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-
-#include "Clownfish/TestHarness/TestFormatter.h"
-#include "Clownfish/TestHarness/TestSuite.h"
-#include "Clownfish/Test.h"
-
-int
-main() {
-    cfish_TestFormatter *formatter;
-    cfish_TestSuite     *suite;
-    bool success;
-
-    testcfish_bootstrap_parcel();
-
-    formatter = (cfish_TestFormatter*)cfish_TestFormatterCF_new();
-    suite     = testcfish_Test_create_test_suite();
-    success   = CFISH_TestSuite_Run_All_Batches(suite, formatter);
-
-    CFISH_DECREF(formatter);
-    CFISH_DECREF(suite);
-    return success ? EXIT_SUCCESS : EXIT_FAILURE;
-}
-


[lucy-commits] [31/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Switch to Module::Build->depends_on

Posted by ma...@apache.org.
Switch to Module::Build->depends_on

According to the Module::Build documentation, 'depends_on' is preferred
over 'dispatch' when calling actions from inside another action.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/340d6910
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/340d6910
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/340d6910

Branch: refs/heads/sortex_ptr_only
Commit: 340d6910e55f56c9c3bc6f7ea68e6ca1827eb668
Parents: f333df0
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Aug 17 16:54:49 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 22 21:28:58 2014 +0200

----------------------------------------------------------------------
 perl/buildlib/Lucy/Build.pm | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/340d6910/perl/buildlib/Lucy/Build.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build.pm b/perl/buildlib/Lucy/Build.pm
index cf82aa1..1118474 100644
--- a/perl/buildlib/Lucy/Build.pm
+++ b/perl/buildlib/Lucy/Build.pm
@@ -85,7 +85,7 @@ sub ACTION_lemon {
 sub ACTION_copy_clownfish_includes {
     my $self = shift;
 
-    $self->dispatch('charmony');
+    $self->depends_on('charmony');
 
     $self->SUPER::ACTION_copy_clownfish_includes;
 
@@ -95,7 +95,7 @@ sub ACTION_copy_clownfish_includes {
 sub ACTION_clownfish {
     my $self = shift;
 
-    $self->dispatch('charmony');
+    $self->depends_on('charmony');
 
     $self->SUPER::ACTION_clownfish;
 }
@@ -162,8 +162,7 @@ sub ACTION_test_valgrind {
     if ( !$ENV{LUCY_VALGRIND} ) {
         warn "\$ENV{LUCY_VALGRIND} not true -- possible false positives";
     }
-    $self->dispatch('code');
-    $self->dispatch('suppressions');
+    $self->depends_on(qw( code suppressions ));
 
     # Unbuffer STDOUT, grab test file names and suppressions files.
     $|++;
@@ -218,7 +217,7 @@ sub ACTION_test_valgrind {
 # Run all .y files through lemon.
 sub ACTION_parsers {
     my $self = shift;
-    $self->dispatch('lemon');
+    $self->depends_on('lemon');
     my $y_files = $self->rscan_dir( $CORE_SOURCE_DIR, qr/\.y$/ );
     for my $y_file (@$y_files) {
         my $c_file = $y_file;
@@ -234,7 +233,7 @@ sub ACTION_parsers {
 sub ACTION_compile_custom_xs {
     my $self = shift;
 
-    $self->dispatch('parsers');
+    $self->depends_on('parsers');
 
     $self->SUPER::ACTION_compile_custom_xs;
 }
@@ -285,7 +284,7 @@ sub ACTION_dist {
     _check_module_build_for_dist;
 
     # Create POD but make sure not to include build artifacts.
-    $self->dispatch('pod');
+    $self->depends_on('pod');
     _clean_prereq_builds($self);
 
     # We build our Perl release tarball from $REPOS_ROOT/perl, rather than
@@ -312,7 +311,7 @@ sub ACTION_dist {
         system("cp -R ../$item $item");
     }
 
-    $self->dispatch('manifest');
+    $self->depends_on('manifest');
     my $no_index = $self->_gen_pause_exclusion_list;
     my $meta_add = $self->meta_add || {};
     $meta_add->{no_index} = $no_index;


[lucy-commits] [08/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/common/charmonizer.c b/clownfish/runtime/common/charmonizer.c
deleted file mode 100644
index 02634b5..0000000
--- a/clownfish/runtime/common/charmonizer.c
+++ /dev/null
@@ -1,7427 +0,0 @@
-/* This is an auto-generated file -- do not edit directly. */
-
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/Defines.h"
-/* Charmonizer/Core/Defines.h -- Universal definitions.
- */
-#ifndef H_CHAZ_DEFINES
-#define H_CHAZ_DEFINES 1
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-#define CHAZ_QUOTE(x) #x "\n"
-
-#endif /* H_CHAZ_DEFINES */
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/SharedLibrary.h"
-/* Charmonizer/Core/SharedLibrary.h
- */
-
-#ifndef H_CHAZ_SHARED_LIB
-#define H_CHAZ_SHARED_LIB
-
-typedef struct chaz_SharedLib chaz_SharedLib;
-
-chaz_SharedLib*
-chaz_SharedLib_new(const char *name, const char *version,
-                   const char *major_version);
-
-void
-chaz_SharedLib_destroy(chaz_SharedLib *flags);
-
-const char*
-chaz_SharedLib_get_name(chaz_SharedLib *lib);
-
-const char*
-chaz_SharedLib_get_version(chaz_SharedLib *lib);
-
-const char*
-chaz_SharedLib_get_major_version(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_filename(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_major_version_filename(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_no_version_filename(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_implib_filename(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_export_filename(chaz_SharedLib *lib);
-
-#endif /* H_CHAZ_SHARED_LIB */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/CFlags.h"
-/* Charmonizer/Core/CFlags.h
- */
-
-#ifndef H_CHAZ_CFLAGS
-#define H_CHAZ_CFLAGS
-
-#define CHAZ_CFLAGS_STYLE_POSIX  1
-#define CHAZ_CFLAGS_STYLE_GNU    2
-#define CHAZ_CFLAGS_STYLE_MSVC   3
-
-typedef struct chaz_CFlags chaz_CFlags;
-
-chaz_CFlags*
-chaz_CFlags_new(int style);
-
-void
-chaz_CFlags_destroy(chaz_CFlags *flags);
-
-const char*
-chaz_CFlags_get_string(chaz_CFlags *flags);
-
-void
-chaz_CFlags_append(chaz_CFlags *flags, const char *string);
-
-void
-chaz_CFlags_clear(chaz_CFlags *flags);
-
-void
-chaz_CFlags_set_output_obj(chaz_CFlags *flags, const char *filename);
-
-void
-chaz_CFlags_set_output_exe(chaz_CFlags *flags, const char *filename);
-
-void
-chaz_CFlags_add_define(chaz_CFlags *flags, const char *name,
-                       const char *value);
-
-void
-chaz_CFlags_add_include_dir(chaz_CFlags *flags, const char *dir);
-
-void
-chaz_CFlags_enable_optimization(chaz_CFlags *flags);
-
-void
-chaz_CFlags_disable_strict_aliasing(chaz_CFlags *flags);
-
-void
-chaz_CFlags_set_warnings_as_errors(chaz_CFlags *flags);
-
-void
-chaz_CFlags_compile_shared_library(chaz_CFlags *flags);
-
-void
-chaz_CFlags_hide_symbols(chaz_CFlags *flags);
-
-void
-chaz_CFlags_link_shared_library(chaz_CFlags *flags);
-
-void
-chaz_CFlags_set_shared_library_version(chaz_CFlags *flags,
-                                       chaz_SharedLib *lib);
-
-void
-chaz_CFlags_set_link_output(chaz_CFlags *flags, const char *filename);
-
-void
-chaz_CFlags_add_library_path(chaz_CFlags *flags, const char *directory);
-
-void
-chaz_CFlags_add_library(chaz_CFlags *flags, chaz_SharedLib *lib);
-
-void
-chaz_CFlags_add_external_library(chaz_CFlags *flags, const char *library);
-
-void
-chaz_CFlags_enable_code_coverage(chaz_CFlags *flags);
-
-#endif /* H_CHAZ_CFLAGS */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/Compiler.h"
-/* Charmonizer/Core/Compiler.h
- */
-
-#ifndef H_CHAZ_COMPILER
-#define H_CHAZ_COMPILER
-
-#include <stddef.h>
-/* #include "Charmonizer/Core/Defines.h" */
-/* #include "Charmonizer/Core/CFlags.h" */
-
-/* Attempt to compile and link an executable.  Return true if the executable
- * file exists after the attempt.
- */
-int
-chaz_CC_compile_exe(const char *source_path, const char *exe_path,
-                    const char *code);
-
-/* Attempt to compile an object file.  Return true if the object file
- * exists after the attempt.
- */
-int
-chaz_CC_compile_obj(const char *source_path, const char *obj_path,
-                    const char *code);
-
-/* Attempt to compile the supplied source code and return true if the
- * effort succeeds.
- */
-int
-chaz_CC_test_compile(const char *source);
-
-/* Attempt to compile the supplied source code.  If successful, capture the
- * output of the program and return a pointer to a newly allocated buffer.
- * If the compilation fails, return NULL.  The length of the captured
- * output will be placed into the integer pointed to by [output_len].
- */
-char*
-chaz_CC_capture_output(const char *source, size_t *output_len);
-
-/** Initialize the compiler environment.
- */
-void
-chaz_CC_init(const char *cc_command, const char *cflags);
-
-/* Clean up the environment.
- */
-void
-chaz_CC_clean_up(void);
-
-/* Accessor for the compiler executable's string representation.
- */
-const char*
-chaz_CC_get_cc(void);
-
-/* Accessor for `cflags`.
- */
-const char*
-chaz_CC_get_cflags(void);
-
-/* Accessor for `extra_cflags`.
- */
-chaz_CFlags*
-chaz_CC_get_extra_cflags(void);
-
-/* Accessor for `temp_cflags`.
- */
-chaz_CFlags*
-chaz_CC_get_temp_cflags(void);
-
-/* Return a new CFlags object.
- */
-chaz_CFlags*
-chaz_CC_new_cflags(void);
-
-/* Return the extension for a compiled object.
- */
-const char*
-chaz_CC_obj_ext(void);
-
-int
-chaz_CC_gcc_version_num(void);
-
-const char*
-chaz_CC_gcc_version(void);
-
-int
-chaz_CC_msvc_version_num(void);
-
-const char*
-chaz_CC_link_command(void);
-
-#endif /* H_CHAZ_COMPILER */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriter.h"
-/* Charmonizer/Core/ConfWriter.h -- Write to a config file.
- */
-
-#ifndef H_CHAZ_CONFWRITER
-#define H_CHAZ_CONFWRITER 1
-
-#include <stddef.h>
-#include <stdarg.h>
-/* #include "Charmonizer/Core/Defines.h" */
-
-struct chaz_ConfWriter;
-
-/* Initialize elements needed by ConfWriter.  Must be called before anything
- * else, but after os and compiler are initialized.
- */
-void
-chaz_ConfWriter_init(void);
-
-/* Close the include guard on charmony.h, then close the file.  Delete temp
- * files and perform any other needed cleanup.
- */
-void
-chaz_ConfWriter_clean_up(void);
-
-/* Print output to charmony.h.
- */
-void
-chaz_ConfWriter_append_conf(const char *fmt, ...);
-
-/* Add a pound-define.
- */
-void
-chaz_ConfWriter_add_def(const char *sym, const char *value);
-
-/* Add a globally scoped pound-define.
- */
-void
-chaz_ConfWriter_add_global_def(const char *sym, const char *value);
-
-/* Add a typedef.
- */
-void
-chaz_ConfWriter_add_typedef(const char *type, const char *alias);
-
-/* Add a globally scoped typedef.
- */
-void
-chaz_ConfWriter_add_global_typedef(const char *type, const char *alias);
-
-/* Pound-include a system header (within angle brackets).
- */
-void
-chaz_ConfWriter_add_sys_include(const char *header);
-
-/* Pound-include a locally created header (within quotes).
- */
-void
-chaz_ConfWriter_add_local_include(const char *header);
-
-/* Print a "chapter heading" comment in the conf file when starting a module.
- */
-void
-chaz_ConfWriter_start_module(const char *module_name);
-
-/* Leave a little whitespace at the end of each module.
- */
-void
-chaz_ConfWriter_end_module(void);
-
-void
-chaz_ConfWriter_add_writer(struct chaz_ConfWriter *writer);
-
-typedef void
-(*chaz_ConfWriter_clean_up_t)(void);
-typedef void
-(*chaz_ConfWriter_vappend_conf_t)(const char *fmt, va_list args); 
-typedef void
-(*chaz_ConfWriter_add_def_t)(const char *sym, const char *value);
-typedef void
-(*chaz_ConfWriter_add_global_def_t)(const char *sym, const char *value);
-typedef void
-(*chaz_ConfWriter_add_typedef_t)(const char *type, const char *alias);
-typedef void
-(*chaz_ConfWriter_add_global_typedef_t)(const char *type, const char *alias);
-typedef void
-(*chaz_ConfWriter_add_sys_include_t)(const char *header);
-typedef void
-(*chaz_ConfWriter_add_local_include_t)(const char *header);
-typedef void
-(*chaz_ConfWriter_start_module_t)(const char *module_name);
-typedef void
-(*chaz_ConfWriter_end_module_t)(void);
-typedef struct chaz_ConfWriter {
-    chaz_ConfWriter_clean_up_t           clean_up;
-    chaz_ConfWriter_vappend_conf_t       vappend_conf;
-    chaz_ConfWriter_add_def_t            add_def;
-    chaz_ConfWriter_add_global_def_t     add_global_def;
-    chaz_ConfWriter_add_typedef_t        add_typedef;
-    chaz_ConfWriter_add_global_typedef_t add_global_typedef;
-    chaz_ConfWriter_add_sys_include_t    add_sys_include;
-    chaz_ConfWriter_add_local_include_t  add_local_include;
-    chaz_ConfWriter_start_module_t       start_module;
-    chaz_ConfWriter_end_module_t         end_module;
-} chaz_ConfWriter;
-
-#endif /* H_CHAZ_CONFWRITER */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriterC.h"
-/* Charmonizer/Core/ConfWriterC.h -- Write to a C header file.
- */
-
-#ifndef H_CHAZ_CONFWRITERC
-#define H_CHAZ_CONFWRITERC 1
-
-/* Enable writing config to a C header file.
- */
-void
-chaz_ConfWriterC_enable(void);
-
-#endif /* H_CHAZ_CONFWRITERC */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriterPerl.h"
-/* Charmonizer/Core/ConfWriterPerl.h -- Write to a Perl module file.
- */
-
-#ifndef H_CHAZ_CONFWRITERPERL
-#define H_CHAZ_CONFWRITERPERL 1
-
-/* Enable writing config to a Perl module file.
- */
-void
-chaz_ConfWriterPerl_enable(void);
-
-#endif /* H_CHAZ_CONFWRITERPERL */
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriterPython.h"
-/* Charmonizer/Core/ConfWriterPython.h -- Write to a Python module file.
- */
-
-#ifndef H_CHAZ_CONFWRITERPYTHON
-#define H_CHAZ_CONFWRITERPYTHON 1
-
-/* Enable writing config to a Python module file.
- */
-void
-chaz_ConfWriterPython_enable(void);
-
-#endif /* H_CHAZ_CONFWRITERPYTHON */
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriterRuby.h"
-/* Charmonizer/Core/ConfWriterRuby.h -- Write to a Ruby module file.
- */
-
-#ifndef H_CHAZ_CONFWRITERRUBY
-#define H_CHAZ_CONFWRITERRUBY 1
-
-/* Enable writing config to a Ruby module file.
- */
-void
-chaz_ConfWriterRuby_enable(void);
-
-#endif /* H_CHAZ_CONFWRITERRUBY */
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/HeaderChecker.h"
-/* Charmonizer/Probe/HeaderChecker.h
- */
-
-#ifndef H_CHAZ_HEAD_CHECK
-#define H_CHAZ_HEAD_CHECK
-
-/* #include "Charmonizer/Core/Defines.h" */
-
-/* Bootstrap the HeadCheck.  Call this before anything else.
- */
-void
-chaz_HeadCheck_init(void);
-
-/* Check for a particular header and return true if it's available.  The
- * test-compile is only run the first time a given request is made.
- */
-int
-chaz_HeadCheck_check_header(const char *header_name);
-
-/* Attempt to compile a file which pulls in all the headers specified by name
- * in a null-terminated array.  If the compile succeeds, add them all to the
- * internal register and return true.
- */
-int
-chaz_HeadCheck_check_many_headers(const char **header_names);
-
-/* Return true if the member is present in the struct. */
-int
-chaz_HeadCheck_contains_member(const char *struct_name, const char *member,
-                               const char *includes);
-
-#endif /* H_CHAZ_HEAD_CHECK */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/Make.h"
-/* Charmonizer/Core/Make.h
- */
-
-#ifndef H_CHAZ_MAKE
-#define H_CHAZ_MAKE
-
-/* #include "Charmonizer/Core/CFlags.h" */
-/* #include "Charmonizer/Core/SharedLib.h" */
-
-typedef struct chaz_MakeFile chaz_MakeFile;
-typedef struct chaz_MakeVar chaz_MakeVar;
-typedef struct chaz_MakeRule chaz_MakeRule;
-
-typedef void (*chaz_Make_list_files_callback_t)(const char *dir, char *file,
-                                                void *context);
-
-/** Initialize the environment.
- */
-void
-chaz_Make_init(void);
-
-/** Clean up the environment.
- */
-void
-chaz_Make_clean_up(void);
-
-/** Return the name of the detected 'make' executable.
- */
-const char*
-chaz_Make_get_make(void);
-
-/** Return the type of shell used by the detected 'make' executable.
- */
-int
-chaz_Make_shell_type(void);
-
-/** Recursively list files in a directory. For every file a callback is called
- * with the filename and a context variable.
- *
- * @param dir Directory to search in.
- * @param ext File extension to search for.
- * @param callback Callback to call for every matching file.
- * @param context Context variable to pass to callback.
- */
-void
-chaz_Make_list_files(const char *dir, const char *ext,
-                     chaz_Make_list_files_callback_t callback, void *context);
-
-/** MakeFile constructor.
- */
-chaz_MakeFile*
-chaz_MakeFile_new();
-
-/** MakeFile destructor.
- */
-void
-chaz_MakeFile_destroy(chaz_MakeFile *makefile);
-
-/** Add a variable to a makefile.
- *
- * @param makefile The makefile.
- * @param name Name of the variable.
- * @param value Value of the variable. Can be NULL if you want add content
- * later.
- * @return a MakeVar.
- */
-chaz_MakeVar*
-chaz_MakeFile_add_var(chaz_MakeFile *makefile, const char *name,
-                      const char *value);
-
-/** Add a rule to a makefile.
- *
- * @param makefile The makefile.
- * @param target The first target of the rule. Can be NULL if you want to add
- * targets later.
- * @param prereq The first prerequisite of the rule. Can be NULL if you want to
- * add prerequisites later.
- * @return a MakeRule.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_rule(chaz_MakeFile *makefile, const char *target,
-                       const char *prereq);
-
-/** Return the rule for the 'clean' target.
- *
- * @param makefile The makefile.
- */
-chaz_MakeRule*
-chaz_MakeFile_clean_rule(chaz_MakeFile *makefile);
-
-/** Return the rule for the 'distclean' target.
- *
- * @param makefile The makefile.
- */
-chaz_MakeRule*
-chaz_MakeFile_distclean_rule(chaz_MakeFile *makefile);
-
-/** Add a rule to link an executable. The executable will also be added to the
- * list of files to clean.
- *
- * @param makefile The makefile.
- * @param exe The name of the executable.
- * @param sources The list of source files.
- * @param link_flags Additional link flags.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe,
-                      const char *sources, chaz_CFlags *link_flags);
-
-/** Add a rule to compile and link an executable. The executable will also be
- * added to the list of files to clean.
- *
- * @param makefile The makefile.
- * @param exe The name of the executable.
- * @param sources The list of source files.
- * @param cflags Additional compiler flags.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_compiled_exe(chaz_MakeFile *makefile, const char *exe,
-                               const char *sources, chaz_CFlags *cflags);
-
-/** Add a rule to link a shared library. The shared library will also be added
- * to the list of files to clean.
- *
- * @param makefile The makefile.
- * @param lib The shared library.
- * @param sources The list of source files.
- * @param link_flags Additional link flags.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, chaz_SharedLib *lib,
-                             const char *sources, chaz_CFlags *link_flags);
-
-/** Add a rule to build the lemon parser generator.
- *
- * @param makefile The makefile.
- * @param dir The lemon directory.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_lemon_exe(chaz_MakeFile *makefile, const char *dir);
-
-/** Add a rule for a lemon grammar.
- *
- * @param makefile The makefile.
- * @param base_name The filename of the grammar without extension.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_lemon_grammar(chaz_MakeFile *makefile,
-                                const char *base_name);
-
-/** Write the makefile to a file named 'Makefile' in the current directory.
- *
- * @param makefile The makefile.
- */
-void
-chaz_MakeFile_write(chaz_MakeFile *makefile);
-
-/** Append content to a makefile variable. The new content will be separated
- * from the existing content with whitespace.
- *
- * @param var The variable.
- * @param element The additional content.
- */
-void
-chaz_MakeVar_append(chaz_MakeVar *var, const char *element);
-
-/** Add another target to a makefile rule.
- *
- * @param rule The rule.
- * @param target The additional rule.
- */
-void
-chaz_MakeRule_add_target(chaz_MakeRule *rule, const char *target);
-
-/** Add another prerequisite to a makefile rule.
- *
- * @param rule The rule.
- * @param prereq The additional prerequisite.
- */
-void
-chaz_MakeRule_add_prereq(chaz_MakeRule *rule, const char *prereq);
-
-/** Add a command to a rule.
- *
- * @param rule The rule.
- * @param command The additional command.
- */
-void
-chaz_MakeRule_add_command(chaz_MakeRule *rule, const char *command);
-
-/** Add a command to remove one or more files.
- *
- * @param rule The rule.
- * @param files The list of files.
- */
-void
-chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files);
-
-/** Add a command to remove one or more directories.
- *
- * @param rule The rule.
- * @param dirs The list of directories.
- */
-void
-chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char *dirs);
-
-/** Add one or more commands to call another makefile recursively.
- *
- * @param rule The rule.
- * @param dir The directory in which to call the makefile.
- * @param target The target to call. Pass NULL for the default target.
- */
-void
-chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
-                               const char *target);
-
-#endif /* H_CHAZ_MAKE */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/OperatingSystem.h"
-/* Charmonizer/Core/OperatingSystem.h - abstract an operating system down to a few
- * variables.
- */
-
-#ifndef H_CHAZ_OPER_SYS
-#define H_CHAZ_OPER_SYS
-
-#define CHAZ_OS_POSIX    1
-#define CHAZ_OS_CMD_EXE  2
-
-/* Safely remove a file named [name]. Needed because of Windows quirks.
- * Returns true on success, false on failure.
- */
-int
-chaz_OS_remove(const char *name);
-
-/* Invoke a command and attempt to suppress output from both stdout and stderr
- * (as if they had been sent to /dev/null).  If it's not possible to run the
- * command quietly, run it anyway.
- */
-int
-chaz_OS_run_quietly(const char *command);
-
-/* Capture both stdout and stderr for a command to the supplied filepath.
- */
-int
-chaz_OS_run_redirected(const char *command, const char *path);
-
-/* Run a command beginning with the name of an executable in the current
- * working directory and capture both stdout and stderr to the supplied
- * filepath.
- */
-int
-chaz_OS_run_local_redirected(const char *command, const char *path);
-
-/* Run a command and return the output from stdout.
- */
-char*
-chaz_OS_run_and_capture(const char *command, size_t *output_len);
-
-/* Attempt to create a directory.
- */
-void
-chaz_OS_mkdir(const char *filepath);
-
-/* Attempt to remove a directory, which must be empty.
- */
-void
-chaz_OS_rmdir(const char *filepath);
-
-/* Return the operating system name.
- */
-const char*
-chaz_OS_name(void);
-
-int
-chaz_OS_is_darwin(void);
-
-int
-chaz_OS_is_cygwin(void);
-
-/* Return the extension for an executable on this system.
- */
-const char*
-chaz_OS_exe_ext(void);
-
-/* Return the extension for a shared object on this system.
- */
-const char*
-chaz_OS_shared_lib_ext(void);
-
-/* Return the equivalent of /dev/null on this system.
- */
-const char*
-chaz_OS_dev_null(void);
-
-/* Return the directory separator on this system.
- */
-const char*
-chaz_OS_dir_sep(void);
-
-/* Return the shell type of this system.
- */
-int
-chaz_OS_shell_type(void);
-
-/* Initialize the Charmonizer/Core/OperatingSystem module.
- */
-void
-chaz_OS_init(void);
-
-#endif /* H_CHAZ_COMPILER */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/Util.h"
-/* Chaz/Core/Util.h -- miscellaneous utilities.
- */
-
-#ifndef H_CHAZ_UTIL
-#define H_CHAZ_UTIL 1
-
-#include <stdio.h>
-#include <stddef.h>
-#include <stdarg.h>
-
-extern int chaz_Util_verbosity;
-
-/* Open a file (truncating if necessary) and write [content] to it.  Util_die() if
- * an error occurs.
- */
-void
-chaz_Util_write_file(const char *filename, const char *content);
-
-/* Read an entire file into memory.
- */
-char*
-chaz_Util_slurp_file(const char *file_path, size_t *len_ptr);
-
-/* Return a newly allocated copy of a NULL-terminated string.
- */
-char*
-chaz_Util_strdup(const char *string);
-
-/* Join a NULL-terminated list of strings using a separator.
- */
-char*
-chaz_Util_join(const char *sep, ...);
-
-/* Get the length of a file (may overshoot on text files under DOS).
- */
-long
-chaz_Util_flength(void *file);
-
-/* Print an error message to stderr and exit.
- */
-void
-chaz_Util_die(const char *format, ...);
-
-/* Print an error message to stderr.
- */
-void
-chaz_Util_warn(const char *format, ...);
-
-/* Attept to delete a file.  Return true if the file is gone, whether or not
- * it was there to begin with.  Issue a warning and return false if the file
- * still exists.
- */
-int
-chaz_Util_remove_and_verify(const char *file_path);
-
-/* Attempt to open a file for reading, then close it immediately.
- */
-int
-chaz_Util_can_open_file(const char *file_path);
-
-#endif /* H_CHAZ_UTIL */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe.h"
-#ifndef H_CHAZ
-#define H_CHAZ 1
-
-#include <stddef.h>
-#include <stdio.h>
-
-#define CHAZ_PROBE_MAX_CC_LEN 100
-#define CHAZ_PROBE_MAX_CFLAGS_LEN 2000
-
-struct chaz_CLIArgs {
-    char cc[CHAZ_PROBE_MAX_CC_LEN + 1];
-    char cflags[CHAZ_PROBE_MAX_CFLAGS_LEN + 1];
-    int  charmony_h;
-    int  charmony_pm;
-    int  charmony_py;
-    int  charmony_rb;
-    int  verbosity;
-    int  write_makefile;
-    int  code_coverage;
-};
-
-/* Parse command line arguments, initializing and filling in the supplied
- * `args` struct.
- *
- *     APP_NAME --cc=CC_COMMAND
- *              [--enable-c]
- *              [--enable-perl]
- *              [--enable-python]
- *              [--enable-ruby]
- *              [-- [CFLAGS]]
- *
- * @return true if argument parsing proceeds without incident, false if
- * unexpected arguments are encountered or values are missing or invalid.
- */
-int
-chaz_Probe_parse_cli_args(int argc, const char *argv[],
-                          struct chaz_CLIArgs *args);
-
-/* Exit after printing usage instructions to stderr.
- */
-void
-chaz_Probe_die_usage(void);
-
-/* Set up the Charmonizer environment.
- *
- * If the environment variable CHARM_VERBOSITY has been set, it will be
- * processed at this time:
- *
- *      0 - silent
- *      1 - normal
- *      2 - debugging
- */
-void
-chaz_Probe_init(struct chaz_CLIArgs *args);
-
-/* Clean up the Charmonizer environment -- deleting tempfiles, etc.  This
- * should be called only after everything else finishes.
- */
-void
-chaz_Probe_clean_up(void);
-
-/* Return an integer version of the GCC version number which is
- * (10000 * __GNU_C__ + 100 * __GNUC_MINOR__ + __GNUC_PATCHLEVEL__).
- */
-int
-chaz_Probe_gcc_version_num(void);
-
-/* If the compiler is GCC (or claims compatibility), return an X.Y.Z string
- * version of the GCC version; otherwise, return NULL.
- */
-const char*
-chaz_Probe_gcc_version(void);
-
-/* Return the integer version of MSVC defined by _MSC_VER
- */
-int
-chaz_Probe_msvc_version_num(void);
-
-#endif /* Include guard. */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/AtomicOps.h"
-/* Charmonizer/Probe/AtomicOps.h
- */
-
-#ifndef H_CHAZ_ATOMICOPS
-#define H_CHAZ_ATOMICOPS
-
-#include <stdio.h>
-
-/* Run the AtomicOps module.
- *
- * These following symbols will be defined if the associated headers are
- * available:
- *
- * HAS_LIBKERN_OSATOMIC_H  <libkern/OSAtomic.h> (Mac OS X)
- * HAS_SYS_ATOMIC_H        <sys/atomic.h>       (Solaris)
- * HAS_INTRIN_H            <intrin.h>           (Windows)
- *
- * This symbol is defined if OSAtomicCompareAndSwapPtr is available:
- *
- * HAS_OSATOMIC_CAS_PTR
- */
-void chaz_AtomicOps_run(void);
-
-#endif /* H_CHAZ_ATOMICOPS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Booleans.h"
-/* Charmonizer/Probe/Booleans.h -- bool type.
- *
- * If stdbool.h is is available, it will be pound-included in the configuration
- * header.  If it is not, the following typedef will be defined:
- *
- * bool
- *
- * These symbols will be defined if they are not already:
- *
- * true
- * false
- */
-
-#ifndef H_CHAZ_BOOLEANS
-#define H_CHAZ_BOOLEANS
-
-#include <stdio.h>
-
-/* Run the Booleans module.
- */
-void chaz_Booleans_run(void);
-
-#endif /* H_CHAZ_BOOLEANS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/BuildEnv.h"
-/* Charmonizer/Probe/BuildEnv.h -- Build environment.
- *
- * Capture various information about the build environment, including the C
- * compiler's interface, the shell, the operating system, etc.
- *
- * The following symbols will be defined:
- *
- * CC - String representation of the C compiler executable.
- * CFLAGS - C compiler flags.
- * EXTRA_CFLAGS - Extra C compiler flags.
- */
-
-#ifndef H_CHAZ_BUILDENV
-#define H_CHAZ_BUILDENV
-
-#include <stdio.h>
-
-/* Run the BuildEnv module.
- */
-void chaz_BuildEnv_run(void);
-
-#endif /* H_CHAZ_BUILDENV */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/DirManip.h"
-/* Charmonizer/Probe/DirManip.h
- */
-
-#ifndef H_CHAZ_DIRMANIP
-#define H_CHAZ_DIRMANIP
-
-/* The DirManip module exports or aliases symbols related to directory and file
- * manipulation.
- *
- * Defined if the header files dirent.h and direct.h are available, respectively:
- *
- * HAS_DIRENT_H
- * HAS_DIRECT_H
- *
- * Defined if struct dirent has these members.
- *
- * HAS_DIRENT_D_NAMLEN
- * HAS_DIRENT_D_TYPE
- *
- * The "makedir" macro will be aliased to the POSIX-specified two-argument
- * "mkdir" interface:
- *
- * makedir
- *
- * On some systems, the second argument to makedir will be ignored, in which
- * case this symbol will be true; otherwise, it will be false: (TODO: This
- * isn't verified and may sometimes be incorrect.)
- *
- * MAKEDIR_MODE_IGNORED
- *
- * String representing the system's directory separator:
- *
- * DIR_SEP
- *
- * True if the remove() function removes directories, false otherwise:
- *
- * REMOVE_ZAPS_DIRS
- */
-void chaz_DirManip_run(void);
-
-#endif /* H_CHAZ_DIR_SEP */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Floats.h"
-/* Charmonizer/Probe/Floats.h -- floating point types.
- *
- * The following symbols will be created if the platform supports IEEE 754
- * floating point types:
- *
- * F32_NAN
- * F32_INF
- * F32_NEGINF
- * F64_NAN
- * F64_INF
- * F64_NEGINF
- *
- * TODO: Actually test to see whether IEEE 754 is supported, rather than just
- * lying about it.
- */
-
-#ifndef H_CHAZ_FLOATS
-#define H_CHAZ_FLOATS
-
-/* Run the Floats module.
- */
-void
-chaz_Floats_run(void);
-
-/* Return the name of the math library to link against or NULL.
- */
-const char*
-chaz_Floats_math_library(void);
-
-#endif /* H_CHAZ_FLOATS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/FuncMacro.h"
-/* Charmonizer/Probe/FuncMacro.h
- */
-
-#ifndef H_CHAZ_FUNC_MACRO
-#define H_CHAZ_FUNC_MACRO
-
-#include <stdio.h>
-
-/* Run the FuncMacro module.
- *
- * If __func__ successfully resolves, this will be defined:
- *
- * HAS_ISO_FUNC_MACRO
- *
- * If __FUNCTION__ successfully resolves, this will be defined:
- *
- * HAS_GNUC_FUNC_MACRO
- *
- * If one or the other succeeds, these will be defined:
- *
- * HAS_FUNC_MACRO
- * FUNC_MACRO
- *
- * The "inline" keyword will also be probed for.  If it is available, the
- * following macro will be defined to "inline", otherwise it will be defined
- * to nothing.
- *
- * INLINE
- */
-void chaz_FuncMacro_run(void);
-
-#endif /* H_CHAZ_FUNC_MACRO */
-
-
-
-
-/***************************************************************************/
-
-#line 20 "src/Charmonizer/Probe/Headers.h"
-/* Charmonizer/Probe/Headers.h
- */
-
-#ifndef H_CHAZ_HEADERS
-#define H_CHAZ_HEADERS
-
-#include <stdio.h>
-/* #include "Charmonizer/Core/Defines.h" */
-
-/* Check whether a particular header file is available.  The test-compile is
- * only run the first time a given request is made.
- */
-int
-chaz_Headers_check(const char *header_name);
-
-/* Run the Headers module.
- *
- * Exported symbols:
- *
- * If HAS_C89 is declared, this system has all the header files described in
- * Ansi C 1989.  HAS_C90 is a synonym.  (It would be surprising if they are
- * not defined, because Charmonizer itself assumes C89.)
- *
- * HAS_C89
- * HAS_C90
- *
- * One symbol is exported for each C89 header file:
- *
- * HAS_ASSERT_H
- * HAS_CTYPE_H
- * HAS_ERRNO_H
- * HAS_FLOAT_H
- * HAS_LIMITS_H
- * HAS_LOCALE_H
- * HAS_MATH_H
- * HAS_SETJMP_H
- * HAS_SIGNAL_H
- * HAS_STDARG_H
- * HAS_STDDEF_H
- * HAS_STDIO_H
- * HAS_STDLIB_H
- * HAS_STRING_H
- * HAS_TIME_H
- *
- * One symbol is exported for every POSIX header present, and HAS_POSIX is
- * exported if they're all there.
- *
- * HAS_POSIX
- *
- * HAS_CPIO_H
- * HAS_DIRENT_H
- * HAS_FCNTL_H
- * HAS_GRP_H
- * HAS_PWD_H
- * HAS_SYS_STAT_H
- * HAS_SYS_TIMES_H
- * HAS_SYS_TYPES_H
- * HAS_SYS_UTSNAME_H
- * HAS_WAIT_H
- * HAS_TAR_H
- * HAS_TERMIOS_H
- * HAS_UNISTD_H
- * HAS_UTIME_H
- *
- * If pthread.h is available, this will be exported:
- *
- * HAS_PTHREAD_H
- */
-void
-chaz_Headers_run(void);
-
-#endif /* H_CHAZ_HEADERS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Integers.h"
-/* Charmonizer/Probe/Integers.h -- info about integer types and sizes.
- *
- * One or the other of these will be defined, depending on whether the
- * processor is big-endian or little-endian.
- *
- * BIG_END
- * LITTLE_END
- *
- * These will always be defined:
- *
- * SIZEOF_CHAR
- * SIZEOF_SHORT
- * SIZEOF_INT
- * SIZEOF_LONG
- * SIZEOF_PTR
- *
- * If long longs are available these symbols will be defined:
- *
- * HAS_LONG_LONG
- * SIZEOF_LONG_LONG
- *
- * Similarly, with the __int64 type (the sizeof is included for completeness):
- *
- * HAS___INT64
- * SIZEOF___INT64
- *
- * If the inttypes.h or stdint.h header files are available, these may be
- * defined:
- *
- * HAS_INTTYPES_H
- * HAS_STDINT_H
- *
- * If stdint.h is is available, it will be pound-included in the configuration
- * header.  If it is not, the following typedefs and macros will be defined if
- * possible:
- *
- * int8_t
- * int16_t
- * int32_t
- * int64_t
- * uint8_t
- * uint16_t
- * uint32_t
- * uint64_t
- * INT8_MAX
- * INT16_MAX
- * INT32_MAX
- * INT64_MAX
- * INT8_MIN
- * INT16_MIN
- * INT32_MIN
- * INT64_MIN
- * UINT8_MAX
- * UINT16_MAX
- * UINT32_MAX
- * UINT64_MAX
- * SIZE_MAX
- * INT32_C
- * INT64_C
- * UINT32_C
- * UINT64_C
- *
- * If inttypes.h is is available, it will be pound-included in the
- * configuration header.  If it is not, the following macros will be defined if
- * possible:
- *
- * PRId64
- * PRIu64
- *
- * Availability of integer types is indicated by which of these are defined:
- *
- * HAS_INT8_T
- * HAS_INT16_T
- * HAS_INT32_T
- * HAS_INT64_T
- *
- * If 64-bit integers are available, this macro will promote pointers to i64_t
- * safely.
- *
- * PTR_TO_I64(ptr)
- */
-
-#ifndef H_CHAZ_INTEGERS
-#define H_CHAZ_INTEGERS
-
-#include <stdio.h>
-
-/* Run the Integers module.
- */
-void chaz_Integers_run(void);
-
-#endif /* H_CHAZ_INTEGERS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/LargeFiles.h"
-/* Charmonizer/Probe/LargeFiles.h
- */
-
-#ifndef H_CHAZ_LARGE_FILES
-#define H_CHAZ_LARGE_FILES
-
-#include <stdio.h>
-
-/* The LargeFiles module attempts to detect these symbols or alias them to
- * synonyms:
- *
- * off64_t
- * fopen64
- * ftello64
- * fseeko64
- * lseek64
- * pread64
- *
- * If off64_t or its equivalent is available, this will be defined:
- *
- * HAS_64BIT_OFFSET_TYPE
- *
- * If 64-bit variants of fopen, ftell, and fseek are available, this will be
- * defined:
- *
- * HAS_64BIT_STDIO
- *
- * If 64-bit variants of pread and lseek are available, then corresponding
- * symbols will be defined:
- *
- * HAS_64BIT_PREAD
- * HAS_64BIT_LSEEK
- *
- * Use of the off64_t symbol may require sys/types.h.
- */
-void chaz_LargeFiles_run(void);
-
-#endif /* H_CHAZ_LARGE_FILES */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Memory.h"
-/* Charmonizer/Probe/Memory.h
- */
-
-#ifndef H_CHAZ_MEMORY
-#define H_CHAZ_MEMORY
-
-/* The Memory module attempts to detect these symbols or alias them to
- * synonyms:
- *
- * alloca
- *
- * These following symbols will be defined if the associated headers are
- * available:
- *
- * HAS_SYS_MMAN_H          <sys/mman.h>
- * HAS_ALLOCA_H            <alloca.h>
- * HAS_MALLOC_H            <malloc.h>
- *
- * Defined if alloca() is available via stdlib.h:
- *
- * ALLOCA_IN_STDLIB_H
- */
-void chaz_Memory_run(void);
-
-#endif /* H_CHAZ_MEMORY */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/RegularExpressions.h"
-/* Charmonizer/Probe/RegularExpressions.h -- regular expressions.
- */
-
-#ifndef H_CHAZ_REGULAREXPRESSIONS
-#define H_CHAZ_REGULAREXPRESSIONS
-
-/* Run the RegularExpressions module.
- */
-void chaz_RegularExpressions_run(void);
-
-#endif /* H_CHAZ_REGULAREXPRESSIONS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Strings.h"
-/* Charmonizer/Probe/Strings.h
- */
-
-#ifndef H_CHAZ_STRINGS
-#define H_CHAZ_STRINGS
-
-/* The Strings module attempts to detect whether snprintf works as specified
- * by the C99 standard. It also looks for system-specific functions which can
- * be used to emulate snprintf.
- */
-void chaz_Strings_run(void);
-
-#endif /* H_CHAZ_STRINGS */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/SymbolVisibility.h"
-/* Charmonizer/Probe/SymbolVisibility.h
- */
-
-#ifndef H_CHAZ_SYMBOLVISIBILITY
-#define H_CHAZ_SYMBOLVISIBILITY
-
-void chaz_SymbolVisibility_run(void);
-
-#endif /* H_CHAZ_SYMBOLVISIBILITY */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/UnusedVars.h"
-/* Charmonizer/Probe/UnusedVars.h
- */
-
-#ifndef H_CHAZ_UNUSED_VARS
-#define H_CHAZ_UNUSED_VARS
-
-#include <stdio.h>
-
-/* Run the UnusedVars module.
- *
- * These symbols are exported:
- *
- * UNUSED_VAR(var)
- * UNREACHABLE_RETURN(type)
- *
- */
-void chaz_UnusedVars_run(void);
-
-#endif /* H_CHAZ_UNUSED_VARS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/VariadicMacros.h"
-/* Charmonizer/Probe/VariadicMacros.h
- */
-
-#ifndef H_CHAZ_VARIADIC_MACROS
-#define H_CHAZ_VARIADIC_MACROS
-
-#include <stdio.h>
-
-/* Run the VariadicMacros module.
- *
- * If your compiler supports ISO-style variadic macros, this will be defined:
- *
- * HAS_ISO_VARIADIC_MACROS
- *
- * If your compiler supports GNU-style variadic macros, this will be defined:
- *
- * HAS_GNUC_VARIADIC_MACROS
- *
- * If you have at least one of the above, this will be defined:
- *
- * HAS_VARIADIC_MACROS
- */
-void chaz_VariadicMacros_run(void);
-
-#endif /* H_CHAZ_VARIADIC_MACROS */
-
-
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/SharedLibrary.c"
-#include <string.h>
-#include <stdlib.h>
-/* #include "Charmonizer/Core/SharedLib.h" */
-/* #include "Charmonizer/Core/Compiler.h" */
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/OperatingSystem.h" */
-
-struct chaz_SharedLib {
-    char *name;
-    char *version;
-    char *major_version;
-};
-
-static char*
-S_build_filename(chaz_SharedLib *lib, const char *version, const char *ext);
-
-static const char*
-S_get_prefix(void);
-
-chaz_SharedLib*
-chaz_SharedLib_new(const char *name, const char *version,
-                   const char *major_version) {
-    chaz_SharedLib *lib = (chaz_SharedLib*)malloc(sizeof(chaz_SharedLib));
-    lib->name          = chaz_Util_strdup(name);
-    lib->version       = chaz_Util_strdup(version);
-    lib->major_version = chaz_Util_strdup(major_version);
-    return lib;
-}
-
-void
-chaz_SharedLib_destroy(chaz_SharedLib *lib) {
-    free(lib->name);
-    free(lib->version);
-    free(lib->major_version);
-    free(lib);
-}
-
-const char*
-chaz_SharedLib_get_name(chaz_SharedLib *lib) {
-    return lib->name;
-}
-
-const char*
-chaz_SharedLib_get_version(chaz_SharedLib *lib) {
-    return lib->version;
-}
-
-const char*
-chaz_SharedLib_get_major_version(chaz_SharedLib *lib) {
-    return lib->major_version;
-}
-
-char*
-chaz_SharedLib_filename(chaz_SharedLib *lib) {
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-
-    if (strcmp(shlib_ext, ".dll") == 0) {
-        return S_build_filename(lib, lib->major_version, shlib_ext);
-    }
-    else {
-        return S_build_filename(lib, lib->version, shlib_ext);
-    }
-}
-
-char*
-chaz_SharedLib_major_version_filename(chaz_SharedLib *lib) {
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-
-    return S_build_filename(lib, lib->major_version, shlib_ext);
-}
-
-char*
-chaz_SharedLib_no_version_filename(chaz_SharedLib *lib) {
-    const char *prefix    = S_get_prefix();
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-
-    return chaz_Util_join("", prefix, lib->name, shlib_ext, NULL);
-}
-
-char*
-chaz_SharedLib_implib_filename(chaz_SharedLib *lib) {
-    return S_build_filename(lib, lib->major_version, ".lib");
-}
-
-char*
-chaz_SharedLib_export_filename(chaz_SharedLib *lib) {
-    return S_build_filename(lib, lib->major_version, ".exp");
-}
-
-static char*
-S_build_filename(chaz_SharedLib *lib, const char *version, const char *ext) {
-    const char *prefix    = S_get_prefix();
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-
-    if (strcmp(shlib_ext, ".dll") == 0) {
-        return chaz_Util_join("", prefix, lib->name, "-", version, ext, NULL);
-    }
-    else if (strcmp(shlib_ext, ".dylib") == 0) {
-        return chaz_Util_join("", prefix, lib->name, ".", version, ext, NULL);
-    }
-    else {
-        return chaz_Util_join("", prefix, lib->name, ext, ".", version, NULL);
-    }
-}
-
-static const char*
-S_get_prefix() {
-    if (chaz_CC_msvc_version_num()) {
-        return "";
-    }
-    else if (chaz_OS_is_cygwin()) {
-        return "cyg";
-    }
-    else {
-        return "lib";
-    }
-}
-
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/CFlags.c"
-#include <string.h>
-#include <stdlib.h>
-/* #include "Charmonizer/Core/CFlags.h" */
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/OperatingSystem.h" */
-/* #include "Charmonizer/Core/SharedLibrary.h" */
-
-struct chaz_CFlags {
-    int   style;
-    char *string;
-};
-
-chaz_CFlags*
-chaz_CFlags_new(int style) {
-    chaz_CFlags *flags = (chaz_CFlags*)malloc(sizeof(chaz_CFlags));
-    flags->style  = style;
-    flags->string = chaz_Util_strdup("");
-    return flags;
-}
-
-void
-chaz_CFlags_destroy(chaz_CFlags *flags) {
-    free(flags->string);
-    free(flags);
-}
-
-const char*
-chaz_CFlags_get_string(chaz_CFlags *flags) {
-    return flags->string;
-}
-
-void
-chaz_CFlags_append(chaz_CFlags *flags, const char *string) {
-    char *new_string;
-    if (flags->string[0] == '\0') {
-        new_string = chaz_Util_strdup(string);
-    }
-    else {
-        new_string = chaz_Util_join(" ", flags->string, string, NULL);
-    }
-    free(flags->string);
-    flags->string = new_string;
-}
-
-void
-chaz_CFlags_clear(chaz_CFlags *flags) {
-    if (flags->string[0] != '\0') {
-        free(flags->string);
-        flags->string = chaz_Util_strdup("");
-    }
-}
-
-void
-chaz_CFlags_set_output_obj(chaz_CFlags *flags, const char *filename) {
-    const char *output;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        output = "/c /Fo";
-    }
-    else {
-        /* POSIX */
-        output = "-c -o ";
-    }
-    string = chaz_Util_join("", output, filename, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_set_output_exe(chaz_CFlags *flags, const char *filename) {
-    const char *output;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        output = "/Fe";
-    }
-    else {
-        /* POSIX */
-        output = "-o ";
-    }
-    string = chaz_Util_join("", output, filename, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_add_define(chaz_CFlags *flags, const char *name,
-                       const char *value) {
-    const char *define;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        define = "/D";
-    }
-    else {
-        /* POSIX */
-        define = "-D ";
-    }
-    if (value) {
-        string = chaz_Util_join("", define, name, "=", value, NULL);
-    }
-    else {
-        string = chaz_Util_join("", define, name, NULL);
-    }
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_add_include_dir(chaz_CFlags *flags, const char *dir) {
-    const char *include;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC)  {
-        include = "/I ";
-    }
-    else {
-        /* POSIX */
-        include = "-I ";
-    }
-    string = chaz_Util_join("", include, dir, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_enable_optimization(chaz_CFlags *flags) {
-    const char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = "/O2";
-    }
-    else if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        string = "-O2";
-    }
-    else {
-        /* POSIX */
-        string = "-O 1";
-    }
-    chaz_CFlags_append(flags, string);
-}
-
-void
-chaz_CFlags_enable_debugging(chaz_CFlags *flags) {
-    if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        chaz_CFlags_append(flags, "-g");
-    }
-}
-
-void
-chaz_CFlags_disable_strict_aliasing(chaz_CFlags *flags) {
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        return;
-    }
-    else if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        chaz_CFlags_append(flags, "-fno-strict-aliasing");
-    }
-    else {
-        chaz_Util_die("Don't know how to disable strict aliasing with '%s'",
-                      chaz_CC_get_cc());
-    }
-}
-
-void
-chaz_CFlags_set_warnings_as_errors(chaz_CFlags *flags) {
-    const char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = "/WX";
-    }
-    else if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        string = "-Werror";
-    }
-    else {
-        chaz_Util_die("Don't know how to set warnings as errors with '%s'",
-                      chaz_CC_get_cc());
-    }
-    chaz_CFlags_append(flags, string);
-}
-
-void
-chaz_CFlags_compile_shared_library(chaz_CFlags *flags) {
-    const char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = "/MD";
-    }
-    else if (flags->style != CHAZ_CFLAGS_STYLE_GNU) {
-        const char *shlib_ext = chaz_OS_shared_lib_ext();
-        if (strcmp(shlib_ext, ".dylib") == 0) {
-            string = "-fno-common";
-        }
-        else if (strcmp(shlib_ext, ".so") == 0) {
-            string = "-fPIC";
-        }
-    }
-    else {
-        return;
-    }
-    chaz_CFlags_append(flags, string);
-}
-
-void
-chaz_CFlags_hide_symbols(chaz_CFlags *flags) {
-    if (flags->style == CHAZ_CFLAGS_STYLE_GNU
-        && strcmp(chaz_OS_shared_lib_ext(), ".dll") != 0) {
-        chaz_CFlags_append(flags, "-fvisibility=hidden");
-    }
-}
-
-void
-chaz_CFlags_link_shared_library(chaz_CFlags *flags) {
-    const char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = "/DLL";
-    }
-    else if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        if (strcmp(chaz_OS_shared_lib_ext(), ".dylib") == 0) {
-            string = "-dynamiclib";
-        }
-        else {
-            string = "-shared";
-        }
-    }
-    else {
-        chaz_Util_die("Don't know how to link a shared library with '%s'",
-                      chaz_CC_get_cc());
-    }
-    chaz_CFlags_append(flags, string);
-}
-
-void
-chaz_CFlags_set_shared_library_version(chaz_CFlags *flags,
-                                       chaz_SharedLib *lib) {
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-    char       *string;
-
-    if (flags->style != CHAZ_CFLAGS_STYLE_GNU
-        || strcmp(shlib_ext, ".dll") == 0) {
-        return;
-    }
-
-    if (strcmp(chaz_OS_shared_lib_ext(), ".dylib") == 0) {
-        const char *version = chaz_SharedLib_get_version(lib);
-        string = chaz_Util_join(" ", "-current_version", version, NULL);
-    }
-    else {
-        char *soname = chaz_SharedLib_major_version_filename(lib);
-        string = chaz_Util_join("", "-Wl,-soname,", soname, NULL);
-        free(soname);
-    }
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_set_link_output(chaz_CFlags *flags, const char *filename) {
-    const char *output;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        output = "/OUT:";
-    }
-    else {
-        output = "-o ";
-    }
-    string = chaz_Util_join("", output, filename, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_add_library_path(chaz_CFlags *flags, const char *directory) {
-    const char *lib_path;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        if (strcmp(directory, ".") == 0) {
-            /* The MS linker searches the current directory by default. */
-            return;
-        }
-        else {
-            lib_path = "/LIBPATH:";
-        }
-    }
-    else {
-        lib_path = "-L ";
-    }
-    string = chaz_Util_join("", lib_path, directory, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_add_library(chaz_CFlags *flags, chaz_SharedLib *lib) {
-    char *filename;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        filename = chaz_SharedLib_implib_filename(lib);
-    }
-    else {
-        filename = chaz_SharedLib_filename(lib);
-    }
-    chaz_CFlags_append(flags, filename);
-    free(filename);
-}
-
-void
-chaz_CFlags_add_external_library(chaz_CFlags *flags, const char *library) {
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = chaz_Util_join("", library, ".lib", NULL);
-    }
-    else {
-        string = chaz_Util_join(" ", "-l", library, NULL);
-    }
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_enable_code_coverage(chaz_CFlags *flags) {
-    if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        chaz_CFlags_append(flags, "--coverage");
-    }
-    else {
-        chaz_Util_die("Don't know how to enable code coverage with '%s'",
-                      chaz_CC_get_cc());
-    }
-}
-
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/Compiler.c"
-#include <string.h>
-#include <stdlib.h>
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/Compiler.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-/* #include "Charmonizer/Core/OperatingSystem.h" */
-
-/* Detect macros which may help to identify some compilers.
- */
-static void
-chaz_CC_detect_known_compilers(void);
-
-/* Temporary files. */
-#define CHAZ_CC_TRY_SOURCE_PATH  "_charmonizer_try.c"
-#define CHAZ_CC_TRY_BASENAME     "_charmonizer_try"
-#define CHAZ_CC_TARGET_PATH      "_charmonizer_target"
-
-/* Static vars. */
-static struct {
-    char     *cc_command;
-    char     *cflags;
-    char     *try_exe_name;
-    char      obj_ext[10];
-    char      gcc_version_str[30];
-    int       cflags_style;
-    int       intval___GNUC__;
-    int       intval___GNUC_MINOR__;
-    int       intval___GNUC_PATCHLEVEL__;
-    int       intval__MSC_VER;
-    int       intval___clang__;
-    chaz_CFlags *extra_cflags;
-    chaz_CFlags *temp_cflags;
-} chaz_CC = {
-    NULL, NULL, NULL,
-    "", "",
-    0, 0, 0, 0, 0, 0,
-    NULL, NULL
-};
-
-void
-chaz_CC_init(const char *compiler_command, const char *compiler_flags) {
-    const char *code = "int main() { return 0; }\n";
-    int compile_succeeded = 0;
-
-    if (chaz_Util_verbosity) { printf("Creating compiler object...\n"); }
-
-    /* Assign, init. */
-    chaz_CC.cc_command   = chaz_Util_strdup(compiler_command);
-    chaz_CC.cflags       = chaz_Util_strdup(compiler_flags);
-    chaz_CC.extra_cflags = NULL;
-    chaz_CC.temp_cflags  = NULL;
-
-    /* Set names for the targets which we "try" to compile. */
-    chaz_CC.try_exe_name
-        = chaz_Util_join("", CHAZ_CC_TRY_BASENAME, chaz_OS_exe_ext(), NULL);
-
-    /* If we can't compile anything, game over. */
-    if (chaz_Util_verbosity) {
-        printf("Trying to compile a small test file...\n");
-    }
-    /* Try MSVC argument style. */
-    strcpy(chaz_CC.obj_ext, ".obj");
-    chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_MSVC;
-    compile_succeeded = chaz_CC_test_compile(code);
-    if (!compile_succeeded) {
-        /* Try POSIX argument style. */
-        strcpy(chaz_CC.obj_ext, ".o");
-        chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_POSIX;
-        compile_succeeded = chaz_CC_test_compile(code);
-    }
-    if (!compile_succeeded) {
-        chaz_Util_die("Failed to compile a small test file");
-    }
-
-    chaz_CC_detect_known_compilers();
-
-    if (chaz_CC.intval___GNUC__) {
-        chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_GNU;
-    }
-    else if (chaz_CC.intval__MSC_VER) {
-        chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_MSVC;
-    }
-    else {
-        chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_POSIX;
-    }
-    chaz_CC.extra_cflags = chaz_CFlags_new(chaz_CC.cflags_style);
-    chaz_CC.temp_cflags  = chaz_CFlags_new(chaz_CC.cflags_style);
-}
-
-static const char chaz_CC_detect_macro_code[] =
-    CHAZ_QUOTE(  #include <stdio.h>             )
-    CHAZ_QUOTE(  int main() {                   )
-    CHAZ_QUOTE(  #ifndef %s                     )
-    CHAZ_QUOTE(  #error "nope"                  )
-    CHAZ_QUOTE(  #endif                         )
-    CHAZ_QUOTE(      printf("%%d", %s);         )
-    CHAZ_QUOTE(      return 0;                  )
-    CHAZ_QUOTE(  }                              );
-
-static int
-chaz_CC_detect_macro(const char *macro) {
-    size_t size = sizeof(chaz_CC_detect_macro_code)
-                  + (strlen(macro) * 2)
-                  + 20;
-    char *code = (char*)malloc(size);
-    int retval = 0;
-    char *output;
-    size_t len;
-    sprintf(code, chaz_CC_detect_macro_code, macro, macro);
-    output = chaz_CC_capture_output(code, &len);
-    if (output) {
-        retval = atoi(output);
-        free(output);
-    }
-    free(code);
-    return retval;
-}
-
-static void
-chaz_CC_detect_known_compilers(void) {
-    chaz_CC.intval___GNUC__  = chaz_CC_detect_macro("__GNUC__");
-    if (chaz_CC.intval___GNUC__) {
-        chaz_CC.intval___GNUC_MINOR__
-            = chaz_CC_detect_macro("__GNUC_MINOR__");
-        chaz_CC.intval___GNUC_PATCHLEVEL__
-            = chaz_CC_detect_macro("__GNUC_PATCHLEVEL__");
-        sprintf(chaz_CC.gcc_version_str, "%d.%d.%d", chaz_CC.intval___GNUC__,
-                chaz_CC.intval___GNUC_MINOR__,
-                chaz_CC.intval___GNUC_PATCHLEVEL__);
-    }
-    chaz_CC.intval__MSC_VER  = chaz_CC_detect_macro("_MSC_VER");
-    chaz_CC.intval___clang__ = chaz_CC_detect_macro("__clang__");
-}
-
-void
-chaz_CC_clean_up(void) {
-    free(chaz_CC.cc_command);
-    free(chaz_CC.cflags);
-    free(chaz_CC.try_exe_name);
-    chaz_CFlags_destroy(chaz_CC.extra_cflags);
-    chaz_CFlags_destroy(chaz_CC.temp_cflags);
-}
-
-int
-chaz_CC_compile_exe(const char *source_path, const char *exe_name,
-                    const char *code) {
-    chaz_CFlags *local_cflags = chaz_CFlags_new(chaz_CC.cflags_style);
-    const char *extra_cflags_string = "";
-    const char *temp_cflags_string  = "";
-    const char *local_cflags_string;
-    char *exe_file = chaz_Util_join("", exe_name, chaz_OS_exe_ext(), NULL);
-    char *command;
-    int result;
-
-    /* Write the source file. */
-    chaz_Util_write_file(source_path, code);
-
-    /* Prepare and run the compiler command. */
-    if (chaz_CC.extra_cflags) {
-        extra_cflags_string = chaz_CFlags_get_string(chaz_CC.extra_cflags);
-    }
-    if (chaz_CC.temp_cflags) {
-        temp_cflags_string = chaz_CFlags_get_string(chaz_CC.temp_cflags);
-    }
-    chaz_CFlags_set_output_exe(local_cflags, exe_file);
-    local_cflags_string = chaz_CFlags_get_string(local_cflags);
-    command = chaz_Util_join(" ", chaz_CC.cc_command, chaz_CC.cflags,
-                             source_path, extra_cflags_string,
-                             temp_cflags_string, local_cflags_string, NULL);
-    if (chaz_Util_verbosity < 2) {
-        chaz_OS_run_quietly(command);
-    }
-    else {
-        system(command);
-    }
-
-    if (chaz_CC.intval__MSC_VER) {
-        /* Zap MSVC junk. */
-        size_t  junk_buf_size = strlen(exe_file) + 4;
-        char   *junk          = (char*)malloc(junk_buf_size);
-        sprintf(junk, "%s.obj", exe_name);
-        chaz_Util_remove_and_verify(junk);
-        sprintf(junk, "%s.ilk", exe_name);
-        chaz_Util_remove_and_verify(junk);
-        sprintf(junk, "%s.pdb", exe_name);
-        chaz_Util_remove_and_verify(junk);
-        free(junk);
-    }
-
-    /* See if compilation was successful.  Remove the source file. */
-    result = chaz_Util_can_open_file(exe_file);
-    if (!chaz_Util_remove_and_verify(source_path)) {
-        chaz_Util_die("Failed to remove '%s'", source_path);
-    }
-
-    chaz_CFlags_destroy(local_cflags);
-    free(command);
-    free(exe_file);
-    return result;
-}
-
-int
-chaz_CC_compile_obj(const char *source_path, const char *obj_name,
-                    const char *code) {
-    chaz_CFlags *local_cflags = chaz_CFlags_new(chaz_CC.cflags_style);
-    const char *extra_cflags_string = "";
-    const char *temp_cflags_string  = "";
-    const char *local_cflags_string;
-    char *obj_file = chaz_Util_join("", obj_name, chaz_CC.obj_ext, NULL);
-    char *command;
-    int result;
-
-    /* Write the source file. */
-    chaz_Util_write_file(source_path, code);
-
-    /* Prepare and run the compiler command. */
-    if (chaz_CC.extra_cflags) {
-        extra_cflags_string = chaz_CFlags_get_string(chaz_CC.extra_cflags);
-    }
-    if (chaz_CC.temp_cflags) {
-        temp_cflags_string = chaz_CFlags_get_string(chaz_CC.temp_cflags);
-    }
-    chaz_CFlags_set_output_obj(local_cflags, obj_file);
-    local_cflags_string = chaz_CFlags_get_string(local_cflags);
-    command = chaz_Util_join(" ", chaz_CC.cc_command, chaz_CC.cflags,
-                             source_path, extra_cflags_string,
-                             temp_cflags_string, local_cflags_string, NULL);
-    if (chaz_Util_verbosity < 2) {
-        chaz_OS_run_quietly(command);
-    }
-    else {
-        system(command);
-    }
-
-    /* See if compilation was successful.  Remove the source file. */
-    result = chaz_Util_can_open_file(obj_file);
-    if (!chaz_Util_remove_and_verify(source_path)) {
-        chaz_Util_die("Failed to remove '%s'", source_path);
-    }
-
-    chaz_CFlags_destroy(local_cflags);
-    free(command);
-    free(obj_file);
-    return result;
-}
-
-int
-chaz_CC_test_compile(const char *source) {
-    int compile_succeeded;
-    char *try_obj_name
-        = chaz_Util_join("", CHAZ_CC_TRY_BASENAME, chaz_CC.obj_ext, NULL);
-    if (!chaz_Util_remove_and_verify(try_obj_name)) {
-        chaz_Util_die("Failed to delete file '%s'", try_obj_name);
-    }
-    compile_succeeded = chaz_CC_compile_obj(CHAZ_CC_TRY_SOURCE_PATH,
-                                            CHAZ_CC_TRY_BASENAME, source);
-    chaz_Util_remove_and_verify(try_obj_name);
-    free(try_obj_name);
-    return compile_succeeded;
-}
-
-char*
-chaz_CC_capture_output(const char *source, size_t *output_len) {
-    char *captured_output = NULL;
-    int compile_succeeded;
-
-    /* Clear out previous versions and test to make sure removal worked. */
-    if (!chaz_Util_remove_and_verify(chaz_CC.try_exe_name)) {
-        chaz_Util_die("Failed to delete file '%s'", chaz_CC.try_exe_name);
-    }
-    if (!chaz_Util_remove_and_verify(CHAZ_CC_TARGET_PATH)) {
-        chaz_Util_die("Failed to delete file '%s'", CHAZ_CC_TARGET_PATH);
-    }
-
-    /* Attempt compilation; if successful, run app and slurp output. */
-    compile_succeeded = chaz_CC_compile_exe(CHAZ_CC_TRY_SOURCE_PATH,
-                                            CHAZ_CC_TRY_BASENAME, source);
-    if (compile_succeeded) {
-        chaz_OS_run_local_redirected(chaz_CC.try_exe_name,
-                                     CHAZ_CC_TARGET_PATH);
-        captured_output = chaz_Util_slurp_file(CHAZ_CC_TARGET_PATH,
-                                               output_len);
-    }
-    else {
-        *output_len = 0;
-    }
-
-    /* Remove all the files we just created. */
-    chaz_Util_remove_and_verify(CHAZ_CC_TRY_SOURCE_PATH);
-    chaz_Util_remove_and_verify(chaz_CC.try_exe_name);
-    chaz_Util_remove_and_verify(CHAZ_CC_TARGET_PATH);
-
-    return captured_output;
-}
-
-const char*
-chaz_CC_get_cc(void) {
-    return chaz_CC.cc_command;
-}
-
-const char*
-chaz_CC_get_cflags(void) {
-    return chaz_CC.cflags;
-}
-
-chaz_CFlags*
-chaz_CC_get_extra_cflags(void) {
-    return chaz_CC.extra_cflags;
-}
-
-chaz_CFlags*
-chaz_CC_get_temp_cflags(void) {
-    return chaz_CC.temp_cflags;
-}
-
-chaz_CFlags*
-chaz_CC_new_cflags(void) {
-    return chaz_CFlags_new(chaz_CC.cflags_style);
-}
-
-const char*
-chaz_CC_obj_ext(void) {
-    return chaz_CC.obj_ext;
-}
-
-int
-chaz_CC_gcc_version_num(void) {
-    return 10000 * chaz_CC.intval___GNUC__
-           + 100 * chaz_CC.intval___GNUC_MINOR__
-           + chaz_CC.intval___GNUC_PATCHLEVEL__;
-}
-
-const char*
-chaz_CC_gcc_version(void) {
-    return chaz_CC.intval___GNUC__ ? chaz_CC.gcc_version_str : NULL;
-}
-
-int
-chaz_CC_msvc_version_num(void) {
-    return chaz_CC.intval__MSC_VER;
-}
-
-const char*
-chaz_CC_link_command() {
-    if (chaz_CC.intval__MSC_VER) {
-        return "link";
-    }
-    else {
-        return chaz_CC.cc_command;
-    }
-}
-
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/ConfWriter.c"
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-#include <stdarg.h>
-#include <stdio.h>
-
-#define CW_MAX_WRITERS 10
-static struct {
-    chaz_ConfWriter *writers[CW_MAX_WRITERS];
-    size_t num_writers;
-} chaz_CW;
-
-void
-chaz_ConfWriter_init(void) {
-    chaz_CW.num_writers = 0;
-    return;
-}
-
-void
-chaz_ConfWriter_clean_up(void) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->clean_up();
-    }
-}
-
-void
-chaz_ConfWriter_append_conf(const char *fmt, ...) {
-    va_list args;
-    size_t i;
-    
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        va_start(args, fmt);
-        chaz_CW.writers[i]->vappend_conf(fmt, args);
-        va_end(args);
-    }
-}
-
-void
-chaz_ConfWriter_add_def(const char *sym, const char *value) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_def(sym, value);
-    }
-}
-
-void
-chaz_ConfWriter_add_global_def(const char *sym, const char *value) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_global_def(sym, value);
-    }
-}
-
-void
-chaz_ConfWriter_add_typedef(const char *type, const char *alias) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_typedef(type, alias);
-    }
-}
-
-void
-chaz_ConfWriter_add_global_typedef(const char *type, const char *alias) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_global_typedef(type, alias);
-    }
-}
-
-void
-chaz_ConfWriter_add_sys_include(const char *header) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_sys_include(header);
-    }
-}
-
-void
-chaz_ConfWriter_add_local_include(const char *header) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_local_include(header);
-    }
-}
-
-void
-chaz_ConfWriter_start_module(const char *module_name) {
-    size_t i;
-    if (chaz_Util_verbosity > 0) {
-        printf("Running %s module...\n", module_name);
-    }
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->start_module(module_name);
-    }
-}
-
-void
-chaz_ConfWriter_end_module(void) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->end_module();
-    }
-}
-
-void
-chaz_ConfWriter_add_writer(chaz_ConfWriter *writer) {
-    chaz_CW.writers[chaz_CW.num_writers] = writer;
-    chaz_CW.num_writers++;
-}
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/ConfWriterC.c"
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-/* #include "Charmonizer/Core/ConfWriterC.h" */
-/* #include "Charmonizer/Core/OperatingSystem.h" */
-/* #include "Charmonizer/Core/Compiler.h" */
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef enum chaz_ConfElemType {
-    CHAZ_CONFELEM_DEF,
-    CHAZ_CONFELEM_GLOBAL_DEF,
-    CHAZ_CONFELEM_TYPEDEF,
-    CHAZ_CONFELEM_GLOBAL_TYPEDEF,
-    CHAZ_CONFELEM_SYS_INCLUDE,
-    CHAZ_CONFELEM_LOCAL_INCLUDE
-} chaz_ConfElemType;
-
-typedef struct chaz_ConfElem {
-    char *str1;
-    char *str2;
-    chaz_ConfElemType type;
-} chaz_ConfElem;
-
-/* Static vars. */
-static struct {
-    FILE          *fh;
-    char          *MODULE_NAME;
-    chaz_ConfElem *defs;
-    size_t         def_cap;
-    size_t         def_count;
-} chaz_ConfWriterC = { NULL, NULL, 0, 0 };
-static chaz_ConfWriter CWC_conf_writer;
-
-/* Open the charmony.h file handle.  Print supplied text to it, if non-null.
- * Print an explanatory comment and open the include guard.
- */
-static void
-chaz_ConfWriterC_open_charmony_h(const char *charmony_start);
-
-/* Push a new elem onto the def list. */
-static void
-chaz_ConfWriterC_push_def_list_item(const char *str1, const char *str2,
-                     chaz_ConfElemType type);
-
-/* Free the def list. */
-static void
-chaz_ConfWriterC_clear_def_list(void);
-
-static void
-chaz_ConfWriterC_clean_up(void);
-static void
-chaz_ConfWriterC_vappend_conf(const char *fmt, va_list args);
-static void
-chaz_ConfWriterC_add_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterC_add_global_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterC_add_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterC_add_global_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterC_add_sys_include(const char *header);
-static void
-chaz_ConfWriterC_add_local_include(const char *header);
-static void
-chaz_ConfWriterC_start_module(const char *module_name);
-static void
-chaz_ConfWriterC_end_module(void);
-
-void
-chaz_ConfWriterC_enable(void) {
-    CWC_conf_writer.clean_up           = chaz_ConfWriterC_clean_up;
-    CWC_conf_writer.vappend_conf       = chaz_ConfWriterC_vappend_conf;
-    CWC_conf_writer.add_def            = chaz_ConfWriterC_add_def;
-    CWC_conf_writer.add_global_def     = chaz_ConfWriterC_add_global_def;
-    CWC_conf_writer.add_typedef        = chaz_ConfWriterC_add_typedef;
-    CWC_conf_writer.add_global_typedef = chaz_ConfWriterC_add_global_typedef;
-    CWC_conf_writer.add_sys_include    = chaz_ConfWriterC_add_sys_include;
-    CWC_conf_writer.add_local_include  = chaz_ConfWriterC_add_local_include;
-    CWC_conf_writer.start_module       = chaz_ConfWriterC_start_module;
-    CWC_conf_writer.end_module         = chaz_ConfWriterC_end_module;
-    chaz_ConfWriterC_open_charmony_h(NULL);
-    chaz_ConfWriter_add_writer(&CWC_conf_writer);
-    return;
-}
-
-static void
-chaz_ConfWriterC_open_charmony_h(const char *charmony_start) {
-    /* Open the filehandle. */
-    chaz_ConfWriterC.fh = fopen("charmony.h", "w+");
-    if (chaz_ConfWriterC.fh == NULL) {
-        chaz_Util_die("Can't open 'charmony.h': %s", strerror(errno));
-    }
-
-    /* Print supplied text (if any) along with warning, open include guard. */
-    if (charmony_start != NULL) {
-        fwrite(charmony_start, sizeof(char), strlen(charmony_start),
-               chaz_ConfWriterC.fh);
-    }
-    fprintf(chaz_ConfWriterC.fh,
-            "/* Header file auto-generated by Charmonizer. \n"
-            " * DO NOT EDIT THIS FILE!!\n"
-            " */\n\n"
-            "#ifndef H_CHARMONY\n"
-            "#define H_CHARMONY 1\n\n"
-           );
-}
-
-static void
-chaz_ConfWriterC_clean_up(void) {
-    /* Write the last bit of charmony.h and close. */
-    fprintf(chaz_ConfWriterC.fh, "#endif /* H_CHARMONY */\n\n");
-    if (fclose(chaz_ConfWriterC.fh)) {
-        chaz_Util_die("Couldn't close 'charmony.h': %s", strerror(errno));
-    }
-}
-
-static void
-chaz_ConfWriterC_vappend_conf(const char *fmt, va_list args) {
-    vfprintf(chaz_ConfWriterC.fh, fmt, args);
-}
-
-static int
-chaz_ConfWriterC_sym_is_uppercase(const char *sym) {
-    return isupper(sym[0]);
-}
-
-static char*
-chaz_ConfWriterC_uppercase_string(const char *src) {
-    char *retval = chaz_Util_strdup(src);
-    size_t i;
-    for (i = 0; retval[i]; ++i) {
-        retval[i] = toupper(retval[i]);
-    }
-    return retval;
-}
-
-static void
-chaz_ConfWriterC_add_def(const char *sym, const char *value) {
-    chaz_ConfWriterC_push_def_list_item(sym, value, CHAZ_CONFELEM_DEF);
-}
-
-static void
-chaz_ConfWriterC_append_def_to_conf(const char *sym, const char *value) {
-    if (value) {
-        if (chaz_ConfWriterC_sym_is_uppercase(sym)) {
-            fprintf(chaz_ConfWriterC.fh, "#define CHY_%s %s\n", sym, value);
-        }
-        else {
-            fprintf(chaz_ConfWriterC.fh, "#define chy_%s %s\n", sym, value);
-        }
-    }
-    else {
-        if (chaz_ConfWriterC_sym_is_uppercase(sym)) {
-            fprintf(chaz_ConfWriterC.fh, "#define CHY_%s\n", sym);
-        }
-        else {
-            fprintf(chaz_ConfWriterC.fh, "#define chy_%s\n", sym);
-        }
-    }
-}
-
-static void
-chaz_ConfWriterC_add_global_def(const char *sym, const char *value) {
-    chaz_ConfWriterC_push_def_list_item(sym, value, CHAZ_CONFELEM_GLOBAL_DEF);
-}
-
-static void
-chaz_ConfWriterC_append_global_def_to_conf(const char *sym,
-                                           const char *value) {
-    char *name_end = strchr(sym, '(');
-    if (name_end == NULL) {
-        if (strcmp(sym, value) == 0) { return; }
-        fprintf(chaz_ConfWriterC.fh, "#ifndef %s\n", sym);
-    }
-    else {
-        size_t  name_len = (size_t)(name_end - sym);
-        char   *name     = chaz_Util_strdup(sym);
-        name[name_len] = '\0';
-        fprintf(chaz_ConfWriterC.fh, "#ifndef %s\n", name);
-        free(name);
-    }
-    if (value) {
-        fprintf(chaz_ConfWriterC.fh, "  #define %s %s\n", sym, value);
-    }
-    else {
-        fprintf(chaz_ConfWriterC.fh, "  #define %s\n", sym);
-    }
-    fprintf(chaz_ConfWriterC.fh, "#endif\n");
-}
-
-static void
-chaz_ConfWriterC_add_typedef(const char *type, const char *alias) {
-    chaz_ConfWriterC_push_def_list_item(alias, type, CHAZ_CONFELEM_TYPEDEF);
-}
-
-static void
-chaz_ConfWriterC_append_typedef_to_conf(const char *type, const char *alias) {
-    if (chaz_ConfWriterC_sym_is_uppercase(alias)) {
-        fprintf(chaz_ConfWriterC.fh, "typedef %s CHY_%s;\n", type, alias);
-    }
-    else {
-        fprintf(chaz_ConfWriterC.fh, "typedef %s chy_%s;\n", type, alias);
-    }
-}
-
-static void
-chaz_ConfWriterC_add_global_typedef(const char *type, const char *alias) {
-    chaz_ConfWriterC_push_def_list_item(alias, type,
-            CHAZ_CONFELEM_GLOBAL_TYPEDEF);
-}
-
-static void
-chaz_ConfWriterC_append_global_typedef_to_conf(const char *type,
-                                               const char *alias) {
-    if (strcmp(type, alias) == 0) { return; }
-    fprintf(chaz_ConfWriterC.fh, "typedef %s %s;\n", type, alias);
-}
-
-static void
-chaz_ConfWriterC_add_sys_include(const char *header) {
-    chaz_ConfWriterC_push_def_list_item(header, NULL,
-                                        CHAZ_CONFELEM_SYS_INCLUDE);
-}
-
-static void
-chaz_ConfWriterC_append_sys_include_to_conf(const char *header) {
-    fprintf(chaz_ConfWriterC.fh, "#include <%s>\n", header);
-}
-
-static void
-chaz_ConfWriterC_add_local_include(const char *header) {
-    chaz_ConfWriterC_push_def_list_item(header, NULL,
-                                        CHAZ_CONFELEM_LOCAL_INCLUDE);
-}
-
-static void
-chaz_ConfWriterC_append_local_include_to_conf(const char *header) {
-    fprintf(chaz_ConfWriterC.fh, "#include \"%s\"\n", header);
-}
-
-static void
-chaz_ConfWriterC_start_module(const char *module_name) {
-    fprintf(chaz_ConfWriterC.fh, "\n/* %s */\n", module_name);
-    chaz_ConfWriterC.MODULE_NAME
-        = chaz_ConfWriterC_uppercase_string(module_name);
-}
-
-static void
-chaz_ConfWriterC_end_module(void) {
-    size_t num_globals = 0;
-    size_t i;
-    chaz_ConfElem *defs = chaz_ConfWriterC.defs;
-    for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-        switch (defs[i].type) {
-            case CHAZ_CONFELEM_GLOBAL_DEF:
-                ++num_globals;
-            /* fall through */
-            case CHAZ_CONFELEM_DEF:
-                chaz_ConfWriterC_append_def_to_conf(defs[i].str1,
-                                                    defs[i].str2);
-                break;
-            case CHAZ_CONFELEM_GLOBAL_TYPEDEF: {
-                char *sym = chaz_ConfWriterC_uppercase_string(defs[i].str1);
-                chaz_ConfWriterC_append_def_to_conf(sym, defs[i].str2);
-                free(sym);
-                ++num_globals;
-            }
-            /* fall through */
-            case CHAZ_CONFELEM_TYPEDEF:
-                chaz_ConfWriterC_append_typedef_to_conf(defs[i].str2,
-                                                        defs[i].str1);
-                break;
-            case CHAZ_CONFELEM_SYS_INCLUDE:
-                ++num_globals;
-                break;
-            case CHAZ_CONFELEM_LOCAL_INCLUDE:
-                chaz_ConfWriterC_append_local_include_to_conf(defs[i].str1);
-                break;
-            default:
-                chaz_Util_die("Internal error: bad element type %d",
-                              (int)defs[i].type);
-        }
-    }
-
-    /* Write out short names. */
-    fprintf(chaz_ConfWriterC.fh,
-        "\n#if defined(CHY_USE_SHORT_NAMES) "
-        "|| defined(CHAZ_USE_SHORT_NAMES)\n"
-    );
-    for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-        switch (defs[i].type) {
-            case CHAZ_CONFELEM_DEF:
-            case CHAZ_CONFELEM_TYPEDEF:
-                {
-                    const char *sym = defs[i].str1;
-                    const char *value = defs[i].str2;
-                    if (!value || strcmp(sym, value) != 0) {
-                        const char *prefix
-                            = chaz_ConfWriterC_sym_is_uppercase(sym)
-                              ? "CHY_" : "chy_";
-                        fprintf(chaz_ConfWriterC.fh, "  #define %s %s%s\n",
-                                sym, prefix, sym);
-                    }
-                }
-                break;
-            case CHAZ_CONFELEM_GLOBAL_DEF:
-            case CHAZ_CONFELEM_GLOBAL_TYPEDEF:
-            case CHAZ_CONFELEM_SYS_INCLUDE:
-            case CHAZ_CONFELEM_LOCAL_INCLUDE:
-                /* no-op */
-                break;
-            default:
-                chaz_Util_die("Internal error: bad element type %d",
-                              (int)defs[i].type);
-        }
-    }
-
-    fprintf(chaz_ConfWriterC.fh, "#endif /* USE_SHORT_NAMES */\n");
-
-    /* Write out global definitions and system includes. */
-    if (num_globals) {
-        fprintf(chaz_ConfWriterC.fh, "\n#ifdef CHY_EMPLOY_%s\n\n",
-                chaz_ConfWriterC.MODULE_NAME);
-        for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-            switch (defs[i].type) {
-                case CHAZ_CONFELEM_GLOBAL_DEF:
-                    chaz_ConfWriterC_append_global_def_to_conf(defs[i].str1,
-                                                               defs[i].str2);
-                    break;
-                case CHAZ_CONFELEM_GLOBAL_TYPEDEF:
-                    chaz_ConfWriterC_append_global_typedef_to_conf(
-                            defs[i].str2, defs[i].str1);
-                    break;
-                case CHAZ_CONFELEM_SYS_INCLUDE:
-                    chaz_ConfWriterC_append_sys_include_to_conf(defs[i].str1);
-                    break;
-                case CHAZ_CONFELEM_DEF:
-                case CHAZ_CONFELEM_TYPEDEF:
-                case CHAZ_CONFELEM_LOCAL_INCLUDE:
-                    /* no-op */
-                    break;
-                default:
-                    chaz_Util_die("Internal error: bad element type %d",
-                                  (int)defs[i].type);
-            }
-        }
-        fprintf(chaz_ConfWriterC.fh, "\n#endif /* EMPLOY_%s */\n",
-                chaz_ConfWriterC.MODULE_NAME);
-    }
-
-    fprintf(chaz_ConfWriterC.fh, "\n");
-
-    free(chaz_ConfWriterC.MODULE_NAME);
-    chaz_ConfWriterC_clear_def_list();
-}
-
-static void
-chaz_ConfWriterC_push_def_list_item(const char *str1, const char *str2,
-                     chaz_ConfElemType type) {
-    if (chaz_ConfWriterC.def_count >= chaz_ConfWriterC.def_cap) { 
-        size_t amount;
-        chaz_ConfWriterC.def_cap += 10;
-        amount = chaz_ConfWriterC.def_cap * sizeof(chaz_ConfElem);
-        chaz_ConfWriterC.defs
-            = (chaz_ConfElem*)realloc(chaz_ConfWriterC.defs, amount);
-    }
-    chaz_ConfWriterC.defs[chaz_ConfWriterC.def_count].str1
-        = str1 ? chaz_Util_strdup(str1) : NULL;
-    chaz_ConfWriterC.defs[chaz_ConfWriterC.def_count].str2
-        = str2 ? chaz_Util_strdup(str2) : NULL;
-    chaz_ConfWriterC.defs[chaz_ConfWriterC.def_count].type = type;
-    chaz_ConfWriterC.def_count++;
-}
-
-static void
-chaz_ConfWriterC_clear_def_list(void) {
-    size_t i;
-    for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-        free(chaz_ConfWriterC.defs[i].str1);
-        free(chaz_ConfWriterC.defs[i].str2);
-    }
-    free(chaz_ConfWriterC.defs);
-    chaz_ConfWriterC.defs      = NULL;
-    chaz_ConfWriterC.def_cap   = 0;
-    chaz_ConfWriterC.def_count = 0;
-}
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/ConfWriterPerl.c"
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-/* #include "Charmonizer/Core/ConfWriterPerl.h" */
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Static vars. */
-static struct {
-    FILE *fh;
-} chaz_CWPerl = { NULL };
-static chaz_ConfWriter CWPerl_conf_writer;
-
-/* Open the Charmony.pm file handle.
- */
-static void
-chaz_ConfWriterPerl_open_config_pm(void);
-
-static void
-chaz_ConfWriterPerl_clean_up(void);
-static void
-chaz_ConfWriterPerl_vappend_conf(const char *fmt, va_list args);
-static void
-chaz_ConfWriterPerl_add_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterPerl_add_global_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterPerl_add_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterPerl_add_global_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterPerl_add_sys_include(const char *header);
-static void
-chaz_ConfWriterPerl_add_local_include(const char *header);
-static void
-chaz_ConfWriterPerl_start_module(const char *module_name);
-static void
-chaz_ConfWriterPerl_end_module(void);
-
-void
-chaz_ConfWriterPerl_enable(void) {
-    CWPerl_conf_writer.clean_up           = chaz_ConfWriterPerl_clean_up;
-    CWPerl_conf_writer.vappend_conf       = chaz_ConfWriterPerl_vappend_conf;
-    CWPerl_conf_writer.add_def            = chaz_ConfWriterPerl_add_def;
-    CWPerl_conf_writer.add_global_def     = chaz_ConfWriterPerl_add_global_def;
-    CWPerl_conf_writer.add_typedef        = chaz_ConfWriterPerl_add_typedef;
-    CWPerl_conf_writer.add_global_typedef = chaz_ConfWriterPerl_add_global_typedef;
-    CWPerl_conf_writer.add_sys_include    = chaz_ConfWriterPerl_add_sys_include;
-    CWPerl_conf_writer.add_local_include  = chaz_ConfWriterPerl_add_local_include;
-    CWPerl_conf_writer.start_module       = chaz_ConfWriterPerl_start_module;
-    CWPerl_conf_writer.end_module         = chaz_ConfWriterPerl_end_module;
-    chaz_ConfWriterPerl_open_config_pm();
-    chaz_ConfWriter_add_writer(&CWPerl_conf_writer);
-    return;
-}
-
-static void
-chaz_ConfWriterPerl_open_config_pm(void) {
-    /* Open the filehandle. */
-    chaz_CWPerl.fh = fopen("Charmony.pm", "w+");
-    if (chaz_CWPerl.fh == NULL) {
-        chaz_Util_die("Can't open 'Charmony.pm': %s", strerror(errno));
-    }
-
-    /* Start the module. */
-    fprintf(chaz_CWPerl.fh,
-            "# Auto-generated by Charmonizer. \n"
-            "# DO NOT EDIT THIS FILE!!\n"
-            "\n"
-            "package Charmony;\n"
-            "use strict;\n"
-            "use warnings;\n"
-            "\n"
-            "my %%defs;\n"
-            "\n"
-            "sub config { \\%%defs }\n"
-            "\n"
-           );
-}
-
-static void
-chaz_ConfWriterPerl_clean_up(void) {
-    /* Write the last bit of Charmony.pm and close. */
-    fprintf(chaz_CWPerl.fh, "\n1;\n\n");
-    if (fclose(chaz_CWPerl.fh)) {
-        chaz_Util_die("Couldn't close 'Charmony.pm': %s", strerror(errno));
-    }
-}
-
-static void
-chaz_ConfWriterPerl_vappend_conf(const char *fmt, va_list args) {
-    (void)fmt;
-    (void)args;
-}
-
-static char*
-chaz_ConfWriterPerl_quotify(const char *string, char *buf, size_t buf_size) {
-    char *quoted = buf;
-
-    /* Don't bother with undef values here. */
-    if (!string) {
-        return NULL;
-    }
-
-    /* Allocate memory if necessary. */
-    {
-        const char *ptr;
-        size_t space = 3; /* Quotes plus NUL termination. */
-        for (ptr = string; *ptr; ptr++) {
-            if (*ptr == '\'' || *ptr == '\\') {
-                space += 2;
-            }
-            else {
-                space += 1;
-            }
-        }
-        if (space > buf_size) {
-            quoted = (char*)malloc(space);
-        }
-    }
-
-    /* Perform copying and escaping */
-    {
-        const char *ptr;
-        size_t pos = 0;
-        quoted[pos++] = '\'';
-        for (ptr = string; *ptr; ptr++) {
-            if (*ptr == '\'' || *ptr == '\\') {
-                quoted[pos++] = '\\';
-            }
-            quoted[pos++] = *ptr;
-        }
-        quoted[pos++] = '\'';
-        quoted[pos++] = '\0';
-    }
-
-    return quoted;
-}
-
-#define CFPERL_MAX_BUF 100
-static void
-chaz_ConfWriterPerl_add_def(const char *sym, const char *value) {
-    char sym_buf[CFPERL_MAX_BUF + 1];
-    char value_buf[CFPERL_MAX_BUF + 1];
-    char *quoted_sym;
-    char *quoted_value;
-
-    /* Quote key. */
-    if (!sym) {
-        chaz_Util_die("Can't handle NULL key");
-    }
-    quoted_sym = chaz_ConfWriterPerl_quotify(sym, sym_buf, CFPERL_MAX_BUF);
-
-    /* Quote value or use "undef". */
-    if (!value) {
-        strcpy(value_buf, "undef");
-        quoted_value = value_buf;
-    }
-    else {
-        quoted_value = chaz_ConfWriterPerl_quotify(value, value_buf,
-                                                CFPERL_MAX_BUF);
-    }
-
-    fprintf(chaz_CWPerl.fh, "$defs{%s} = %s;\n", quoted_sym, quoted_value);
-
-    if (quoted_sym   != sym_buf)   { free(quoted_sym);   }
-    if (quoted_value != value_buf) { free(quoted_value); }
-}
-
-static void
-chaz_ConfWriterPerl_add_global_def(const char *sym, const char *value) {
-    (void)sym;
-    (void)value;
-}
-
-static void
-chaz_ConfWriterPerl_add_typedef(const char *type, const char *alias) {
-    (void)type;
-    (void)alias;
-}
-
-static void
-chaz_ConfWriterPerl_add_global_typedef(const char *type, const char *alias) {
-    (void)type;
-    (void)alias;
-}
-
-static void
-chaz_ConfWriterPerl_add_sys_include(const char *header) {
-    (void)header;
-}
-
-static void
-chaz_ConfWriterPerl_add_local_include(const char *header) {
-    (void)header;
-}
-
-static void
-chaz_ConfWriterPerl_start_module(const char *module_name) {
-    fprintf(chaz_CWPerl.fh, "# %s\n", module_name);
-}
-
-static void
-chaz_ConfWriterPerl_end_module(void) {
-    fprintf(chaz_CWPerl.fh, "\n");
-}
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/ConfWriterPython.c"
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-/* #include "Charmonizer/Core/ConfWriterPython.h" */
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Static vars. */
-static struct {
-    FILE *fh;
-} chaz_CWPython = { NULL };
-static chaz_ConfWriter CWPython_conf_writer;
-
-/* Open the charmony.py file handle.
- */
-static void
-chaz_ConfWriterPython_open_config_py(void);
-
-static void
-chaz_ConfWriterPython_clean_up(void);
-static void
-chaz_ConfWriterPython_vappend_conf(const char *fmt, va_list args);
-static void
-chaz_ConfWriterPython_add_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterPython_add_global_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterPython_add_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterPython_add_global_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterPython_add_sys_include(const char *header);
-static void
-chaz_ConfWriterPython_add_local_include(const char *header);
-static void
-chaz_ConfWriterPython_start_module(const char *module_name);
-static void
-chaz_ConfWriterPython_end_module(void);
-
-void
-chaz_ConfWriterPython_enable(void) {
-    CWPython_conf_writer.clean_up           = chaz_ConfWriterPython_clean_up;
-    CWPython_conf_writer.vappend_conf       = chaz_ConfWriterPython_vappend_conf;
-    CWPython_conf_writer.add_def            = chaz_ConfWriterPython_add_def;
-    CWPython_conf_writer.add_global_def     = chaz_ConfWriterPython_add_global_def;
-    CWPython_conf_writer.add_typedef        = chaz_ConfWriterPython_add_typedef;
-    CWPython_conf_writer.add_global_typedef = chaz_ConfWriterPython_add_global_typedef;
-    CWPython_conf_writer.add_sys_include    = chaz_ConfWriterPython_add_sys_include;
-    CWPython_conf_writer.add_local_include  = chaz_ConfWriterPython_add_local_include;
-    CWPython_conf_writer.start_module       = chaz_ConfWriterPython_start_module;
-    CWPython_conf_writer.end_module         = chaz_ConfWriterPython_end_module;
-    chaz_ConfWriterPython_open_config_py();
-    chaz_ConfWriter_add_writer(&CWPython_conf_writer);
-    return;
-}
-
-static void
-chaz_ConfWriterPython_open_config_py(void) {
-    /* Open the filehandle. */
-    chaz_CWPython.fh = fopen("charmony.py", "w+");
-    if (chaz_CWPython.fh == NULL) {
-        chaz_Util_die("Can't open 'charmony.py': %s", strerror(errno));
-    }
-
-    /* Start the module. */
-    fprintf(chaz_CWPython.fh,
-            "# Auto-generated by Charmonizer. \n"
-            "# DO NOT EDIT THIS FILE!!\n"
-            "\n"
-            "class Charmony(object):\n"
-            "    @classmethod\n"
-            "    def config(cls):\n"
-            "        return cls.defs\n"
-            "\n"
-            "    defs = {}\n"
-            "\n"
-           );
-}
-
-static void
-chaz_ConfWriterPython_clean_up(void) {
-    /* No more code necessary to finish charmony.py, so just close. */
-    if (fclose(chaz_CWPython.fh)) {
-        chaz_Util_die("Couldn't close 'charmony.py': %s", strerror(errno));
-    }
-}
-
-static void
-chaz_ConfWriterPython_vappend_conf(const char *fmt, va_list args) {
-    (void)fmt;
-    (void)args;
-}
-
-static char*
-chaz_ConfWriterPython_quotify(const char *string, char *buf, size_t buf_size) {
-    char *quoted = buf;
-
-    /* Don't bother with NULL values here. */
-    if (!string) {
-        return NULL;
-    }
-
-    /* Allocate memory if necessary. */
-    {
-        const char *ptr;
-        size_t space = 3; /* Quotes plus NUL termination. */
-        for (ptr = string; *ptr; ptr++) {
-            if (*ptr == '\'' || *ptr == '\\') {
-                space += 2;
-            }
-            else {
-                space += 1;
-            }
-        }
-        if (space > buf_size) {
-            quoted = (char*)malloc(space);
-        }
-    }
-
-    /* Perform copying and escaping */
-    {
-        const char *ptr;
-        size_t pos = 0;
-        quoted[pos++] = '\'';
-        for (ptr = string; *ptr; ptr++) {
-            if (*ptr == '\'' || *ptr == '\\') {
-                quoted[pos++] = '\\';
-            }
-            quoted[pos++] = *ptr;
-        }
-        quoted[pos++] = '\'';
-        quoted[pos++] = '\0';
-    }
-
-    return quoted;
-}
-
-#define CFPYTHON_MAX_BUF 100
-static void
-chaz_ConfWriterPython_add_def(const char *sym, const char *value) {
-    char sym_buf[CFPYTHON_MAX_BUF + 1];
-    char value_buf[CFPYTHON_MAX_BUF + 1];
-    char *quoted_sym;
-    char *quoted_value;
-
-    /* Quote key. */
-    if (!sym) {
-        chaz_Util_die("Can't handle NULL key");
-    }
-    quoted_sym = chaz_ConfWriterPython_quotify(sym, sym_buf, CFPYTHON_MAX_BUF);
-
-    /* Quote value or use "None". */
-    if (!value) {
-        strcpy(value_buf, "None");
-        quoted_value = value_buf;
-    }
-    else {
-        quoted_value = chaz_ConfWriterPython_quotify(value, value_buf,
-                                                     CFPYTHON_MAX_BUF);
-    }
-
-    fprintf(chaz_CWPython.fh, "    defs[%s] = %s\n", quoted_sym, quoted_value);
-
-    if (quoted_sym   != sym_buf)   { free(quoted_sym);   }
-    if (quoted_value != value_buf) { free(quoted_value); }
-}
-
-static void
-chaz_ConfWriterPython_add_global_def(const char *sym, const char *value) {
-    (void)sym;
-    (void)value;
-}
-
-static void
-chaz_ConfWriterPython_add_typedef(const char *type, const char *alias) {
-    (void)type;
-    (void)alias;
-}
-
-static void
-chaz_ConfWriterPython_add_global_typedef(const char *type, const char *alias) {
-    (void)type;
-    (void)alias;
-}
-
-static void
-chaz_ConfWriterPython_add_sys_include(const char *header) {
-    (void)header;
-}
-
-static void
-chaz_ConfWriterPython_add_local_include(const char *header) {
-    (void)header;
-}
-
-static void
-chaz_ConfWrite

<TRUNCATED>

[lucy-commits] [03/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh b/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh
deleted file mode 100644
index b57a104..0000000
--- a/clownfish/runtime/core/Clownfish/Util/NumberUtils.cfh
+++ /dev/null
@@ -1,474 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Provide various number-related utilies.
- *
- * Provide utilities for dealing with endian issues, sub-byte-width arrays,
- * compressed integers, and so on.
- */
-inert class Clownfish::Util::NumberUtils cnick NumUtil {
-
-    inert const uint8_t[8] u1masks;
-    inert const uint8_t[4] u2masks;
-    inert const uint8_t[4] u2shifts;
-    inert const uint8_t[2] u4masks;
-    inert const uint8_t[2] u4shifts;
-
-    /** Encode an unsigned 16-bit integer as 2 bytes in the buffer provided,
-     * using big-endian byte order.
-     */
-    inert inline void
-    encode_bigend_u16(uint16_t value, void *dest);
-
-    /** Encode an unsigned 32-bit integer as 4 bytes in the buffer provided,
-     * using big-endian byte order.
-     */
-    inert inline void
-    encode_bigend_u32(uint32_t value, void *dest);
-
-    /** Encode an unsigned 64-bit integer as 8 bytes in the buffer provided,
-     * using big-endian byte order.
-     */
-    inert inline void
-    encode_bigend_u64(uint64_t value, void *dest);
-
-    /** Interpret a sequence of bytes as a big-endian unsigned 16-bit int.
-     */
-    inert inline uint16_t
-    decode_bigend_u16(void *source);
-
-    /** Interpret a sequence of bytes as a big-endian unsigned 32-bit int.
-     */
-    inert inline uint32_t
-    decode_bigend_u32(void *source);
-
-    /** Interpret a sequence of bytes as a big-endian unsigned 64-bit int.
-     */
-    inert inline uint64_t
-    decode_bigend_u64(void *source);
-
-    /** Encode a 32-bit floating point number as 4 bytes in the buffer
-     * provided, using big-endian byte order.
-     */
-    inert inline void
-    encode_bigend_f32(float value, void *dest);
-
-    /** Encode a 64-bit floating point number as 8 bytes in the buffer
-     * provided, using big-endian byte order.
-     */
-    inert inline void
-    encode_bigend_f64(double value, void *dest);
-
-    /** Interpret a sequence of bytes as a 32-bit float stored in big-endian
-     * byte order.
-     */
-    inert inline float
-    decode_bigend_f32(void *source);
-
-    /** Interpret a sequence of bytes as a 64-bit float stored in big-endian
-     * byte order.
-     */
-    inert inline double
-    decode_bigend_f64(void *source);
-
-    /** Encode a C32 at the space pointed to by <code>dest</code>. As a side
-     * effect, <code>dest</code> will be advanced to immediately after the end
-     * of the C32.
-     */
-    inert inline void
-    encode_c32(uint32_t value, char **dest);
-
-    /** Encode a C32 at the space pointed to by <code>dest</code>, but add
-     * "leading zeroes" so that the space consumed will always be 5 bytes.  As
-     * a side effect, <code>dest</code> will be advanced to immediately after
-     * the end of the C32.
-     */
-    inert inline void
-    encode_padded_c32(uint32_t value, char **dest);
-
-    /** Encode a C64 at the space pointed to by <code>dest</code>. As a side
-     * effect, <code>dest</code> will be advanced to immediately after the end
-     * of the C64.
-     */
-    inert inline void
-    encode_c64(uint64_t value, char **dest);
-
-    /** Read a C32 from the buffer pointed to by <code>source</code>.  As a
-     * side effect, advance the pointer, consuming the bytes occupied by the
-     * C32.
-     */
-    inert inline uint32_t
-    decode_c32(char **source);
-
-    /** Read a C64 from the buffer pointed to by <code>source</code>.  As a
-     * side effect, advance the pointer, consuming the bytes occupied by the
-     * C64.
-     */
-    inert inline uint64_t
-    decode_c64(char **source);
-
-    /** Advance <code>source</code> past one encoded C32 or C64.
-     */
-    inert inline void
-    skip_cint(char **source);
-
-    /** Interpret <code>array</code> as an array of bits; return true if the
-     * bit at <code>tick</code> is set, false otherwise.
-     */
-    inert inline bool
-    u1get(void *array, uint32_t tick);
-
-    /** Interpret <code>array</code> as an array of bits; set the bit at
-     * <code>tick</code>.
-     */
-    inert inline void
-    u1set(void *array, uint32_t tick);
-
-    /** Interpret <code>array</code> as an array of bits; clear the bit at
-     * <code>tick</code>.
-     */
-    inert inline void
-    u1clear(void *array, uint32_t tick);
-
-    /** Interpret <code>array</code> as an array of bits; flip the bit at
-     * <code>tick</code>.
-     */
-    inert inline void
-    u1flip(void *array, uint32_t tick);
-
-    /** Interpret <code>array</code> as an array of two-bit integers; return
-     * the value at <code>tick</code>.
-     */
-    inert inline uint8_t
-    u2get(void *array, uint32_t tick);
-
-    /** Interpret <code>array</code> as an array of two-bit integers; set the
-     * element at <code>tick</code> to <code>value</code>.
-     */
-    inert inline void
-    u2set(void *array, uint32_t tick, uint8_t value);
-
-    /** Interpret <code>array</code> as an array of four-bit integers; return
-     * the value at <code>tick</code>.
-     */
-    inert inline uint8_t
-    u4get(void *array, uint32_t tick);
-
-    /** Interpret <code>array</code> as an array of four-bit integers; set the
-     * element at <code>tick</code> to <code>value</code>.
-     */
-    inert inline void
-    u4set(void *array, uint32_t tick, uint8_t value);
-}
-
-__C__
-
-#include <string.h>
-
-static CFISH_INLINE void
-cfish_NumUtil_encode_bigend_u16(uint16_t value, void *dest_ptr) {
-    uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CFISH_BIG_END
-    memcpy(dest, &value, sizeof(uint16_t));
-#else // little endian
-    uint8_t *source = (uint8_t*)&value;
-    dest[0] = source[1];
-    dest[1] = source[0];
-#endif // CFISH_BIG_END (and little endian)
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_encode_bigend_u32(uint32_t value, void *dest_ptr) {
-    uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CFISH_BIG_END
-    memcpy(dest, &value, sizeof(uint32_t));
-#else // little endian
-    uint8_t *source = (uint8_t*)&value;
-    dest[0] = source[3];
-    dest[1] = source[2];
-    dest[2] = source[1];
-    dest[3] = source[0];
-#endif // CFISH_BIG_END (and little endian)
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_encode_bigend_u64(uint64_t value, void *dest_ptr) {
-    uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CFISH_BIG_END
-    memcpy(dest, &value, sizeof(uint64_t));
-#else // little endian
-    uint8_t *source = (uint8_t*)&value;
-    dest[0] = source[7];
-    dest[1] = source[6];
-    dest[2] = source[5];
-    dest[3] = source[4];
-    dest[4] = source[3];
-    dest[5] = source[2];
-    dest[6] = source[1];
-    dest[7] = source[0];
-#endif // CFISH_BIG_END (and little endian)
-}
-
-static CFISH_INLINE uint16_t
-cfish_NumUtil_decode_bigend_u16(void *source) {
-    uint8_t *const buf = (uint8_t*)source;
-    return  ((uint16_t)buf[0] << 8) |
-            ((uint16_t)buf[1]);
-}
-
-static CFISH_INLINE uint32_t
-cfish_NumUtil_decode_bigend_u32(void *source) {
-    uint8_t *const buf = (uint8_t*)source;
-    return  ((uint32_t)buf[0]  << 24) |
-            ((uint32_t)buf[1]  << 16) |
-            ((uint32_t)buf[2]  << 8)  |
-            ((uint32_t)buf[3]);
-}
-
-static CFISH_INLINE uint64_t
-cfish_NumUtil_decode_bigend_u64(void *source) {
-    uint8_t *const buf = (uint8_t*)source;
-    uint64_t high_bits = ((uint32_t)buf[0]  << 24) |
-                         ((uint32_t)buf[1]  << 16) |
-                         ((uint32_t)buf[2]  << 8)  |
-                         ((uint32_t)buf[3]);
-    uint32_t low_bits  = ((uint32_t)buf[4]  << 24) |
-                         ((uint32_t)buf[5]  << 16) |
-                         ((uint32_t)buf[6]  << 8)  |
-                         ((uint32_t)buf[7]);
-    uint64_t retval = high_bits << 32;
-    retval |= low_bits;
-    return retval;
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_encode_bigend_f32(float value, void *dest_ptr) {
-    uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CFISH_BIG_END
-    memcpy(dest, &value, sizeof(float));
-#else
-    union { float f; uint32_t u32; } duo;
-    duo.f = value;
-    cfish_NumUtil_encode_bigend_u32(duo.u32, &dest);
-#endif
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_encode_bigend_f64(double value, void *dest_ptr) {
-    uint8_t *dest = *(uint8_t**)dest_ptr;
-#ifdef CFISH_BIG_END
-    memcpy(dest, &value, sizeof(double));
-#else
-    union { double d; uint64_t u64; } duo;
-    duo.d = value;
-    cfish_NumUtil_encode_bigend_u64(duo.u64, &dest);
-#endif
-}
-
-static CFISH_INLINE float
-cfish_NumUtil_decode_bigend_f32(void *source) {
-    union { float f; uint32_t u32; } duo;
-    memcpy(&duo, source, sizeof(float));
-#ifdef CFISH_LITTLE_END
-    duo.u32 = cfish_NumUtil_decode_bigend_u32(&duo.u32);
-#endif
-    return duo.f;
-}
-
-static CFISH_INLINE double
-cfish_NumUtil_decode_bigend_f64(void *source) {
-    union { double d; uint64_t u64; } duo;
-    memcpy(&duo, source, sizeof(double));
-#ifdef CFISH_LITTLE_END
-    duo.u64 = cfish_NumUtil_decode_bigend_u64(&duo.u64);
-#endif
-    return duo.d;
-}
-
-#define CFISH_NUMUTIL_C32_MAX_BYTES  ((sizeof(uint32_t) * 8 / 7) + 1) // 5
-#define CFISH_NUMUTIL_C64_MAX_BYTES ((sizeof(uint64_t) * 8 / 7) + 1)  // 10
-
-static CFISH_INLINE void
-cfish_NumUtil_encode_c32(uint32_t value, char **out_buf) {
-    uint8_t   buf[CFISH_NUMUTIL_C32_MAX_BYTES];
-    uint8_t  *const limit = buf + sizeof(buf);
-    uint8_t  *ptr         = limit - 1;
-    int       num_bytes;
-    // Write last byte first, which has no continue bit.
-    *ptr = value & 0x7f;
-    value >>= 7;
-    while (value) {
-        // Work backwards, writing bytes with continue bits set.
-        *--ptr = ((value & 0x7f) | 0x80);
-        value >>= 7;
-    }
-    num_bytes = limit - ptr;
-    memcpy(*out_buf, ptr, num_bytes);
-    *out_buf += num_bytes;
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_encode_c64(uint64_t value, char **out_buf) {
-    uint8_t   buf[CFISH_NUMUTIL_C64_MAX_BYTES];
-    uint8_t  *const limit = buf + sizeof(buf);
-    uint8_t  *ptr         = limit - 1;
-    int       num_bytes;
-    // Write last byte first, which has no continue bit.
-    *ptr = value & 0x7f;
-    value >>= 7;
-    while (value) {
-        // Work backwards, writing bytes with continue bits set.
-        *--ptr = ((value & 0x7f) | 0x80);
-        value >>= 7;
-    }
-    num_bytes = limit - ptr;
-    memcpy(*out_buf, ptr, num_bytes);
-    *out_buf += num_bytes;
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_encode_padded_c32(uint32_t value, char **out_buf) {
-    uint8_t buf[CFISH_NUMUTIL_C32_MAX_BYTES]
-        = { 0x80, 0x80, 0x80, 0x80, 0x80 };
-    uint8_t *const limit = buf + sizeof(buf);
-    uint8_t *ptr         = limit - 1;
-    // Write last byte first, which has no continue bit.
-    *ptr = value & 0x7f;
-    value >>= 7;
-    while (value) {
-        // Work backwards, writing bytes with continue bits set.
-        *--ptr = ((value & 0x7f) | 0x80);
-        value >>= 7;
-    }
-    memcpy(*out_buf, buf, CFISH_NUMUTIL_C32_MAX_BYTES);
-    *out_buf += sizeof(buf);
-}
-
-// Decode a compressed integer up to size of 'var', advancing 'source'
-#define CFISH_NUMUTIL_DECODE_CINT(var, source) \
-    do { \
-        var = (*source & 0x7f); \
-        while (*source++ & 0x80) { \
-            var = (*source & 0x7f) | (var << 7); \
-        }  \
-    } while (0)
-
-static CFISH_INLINE uint32_t
-cfish_NumUtil_decode_c32(char **source_ptr) {
-    char *source = *source_ptr;
-    uint32_t decoded;
-    CFISH_NUMUTIL_DECODE_CINT(decoded, source);
-    *source_ptr = source;
-    return decoded;
-}
-
-static CFISH_INLINE uint64_t
-cfish_NumUtil_decode_c64(char **source_ptr) {
-    char *source = *source_ptr;
-    uint64_t decoded;
-    CFISH_NUMUTIL_DECODE_CINT(decoded, source);
-    *source_ptr = source;
-    return decoded;
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_skip_cint(char **source_ptr) {
-    uint8_t *ptr = *(uint8_t**)source_ptr;
-    while ((*ptr++ & 0x80) != 0) { }
-    *source_ptr = (char*)ptr;
-}
-
-static CFISH_INLINE bool
-cfish_NumUtil_u1get(void *array, uint32_t tick) {
-    uint8_t *const u8bits      = (uint8_t*)array;
-    const uint32_t byte_offset = tick >> 3;
-    const uint8_t  mask        = cfish_NumUtil_u1masks[tick & 0x7];
-    return !((u8bits[byte_offset] & mask) == 0);
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_u1set(void *array, uint32_t tick) {
-    uint8_t *const u8bits      = (uint8_t*)array;
-    const uint32_t byte_offset = tick >> 3;
-    const uint8_t  mask        = cfish_NumUtil_u1masks[tick & 0x7];
-    u8bits[byte_offset] |= mask;
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_u1clear(void *array, uint32_t tick) {
-    uint8_t *const u8bits      = (uint8_t*)array;
-    const uint32_t byte_offset = tick >> 3;
-    const uint8_t  mask        = cfish_NumUtil_u1masks[tick & 0x7];
-    u8bits[byte_offset] &= ~mask;
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_u1flip(void *array, uint32_t tick) {
-    uint8_t *const u8bits      = (uint8_t*)array;
-    const uint32_t byte_offset = tick >> 3;
-    const uint8_t  mask        = cfish_NumUtil_u1masks[tick & 0x7];
-    u8bits[byte_offset] ^= mask;
-}
-
-static CFISH_INLINE uint8_t
-cfish_NumUtil_u2get(void *array, uint32_t tick) {
-    uint8_t *ints  = (uint8_t*)array;
-    uint8_t  byte  = ints[(tick >> 2)];
-    int      shift = cfish_NumUtil_u2shifts[tick & 0x3];
-    return (byte >> shift) & 0x3;
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_u2set(void *array, uint32_t tick, uint8_t value) {
-    uint8_t *ints     = (uint8_t*)array;
-    unsigned sub_tick = tick & 0x3;
-    int      shift    = cfish_NumUtil_u2shifts[sub_tick];
-    uint8_t  mask     = cfish_NumUtil_u2masks[sub_tick];
-    uint8_t  new_val  = value & 0x3;
-    uint8_t  new_bits = new_val << shift;
-    ints[(tick >> 2)]  = (ints[(tick >> 2)] & ~mask) | new_bits;
-}
-
-
-static CFISH_INLINE uint8_t
-cfish_NumUtil_u4get(void *array, uint32_t tick) {
-    uint8_t *ints  = (uint8_t*)array;
-    uint8_t  byte  = ints[(tick >> 1)];
-    int      shift = cfish_NumUtil_u4shifts[(tick & 1)];
-    return (byte >> shift) & 0xF;
-}
-
-static CFISH_INLINE void
-cfish_NumUtil_u4set(void *array, uint32_t tick, uint8_t value) {
-    uint8_t  *ints     = (uint8_t*)array;
-    unsigned  sub_tick = tick & 0x1;
-    int       shift    = cfish_NumUtil_u4shifts[sub_tick];
-    uint8_t   mask     = cfish_NumUtil_u4masks[sub_tick];
-    uint8_t   new_val  = value & 0xF;
-    uint8_t   new_bits = new_val << shift;
-    ints[(tick >> 1)]  = (ints[(tick >> 1)] & ~mask) | new_bits;
-}
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define C32_MAX_BYTES                CFISH_NUMUTIL_C32_MAX_BYTES
-  #define C64_MAX_BYTES                CFISH_NUMUTIL_C64_MAX_BYTES
-#endif
-
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/SortUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/SortUtils.c b/clownfish/runtime/core/Clownfish/Util/SortUtils.c
deleted file mode 100644
index a778122..0000000
--- a/clownfish/runtime/core/Clownfish/Util/SortUtils.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_SORTUTILS
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include <string.h>
-#include "Clownfish/Util/SortUtils.h"
-#include "Clownfish/Err.h"
-
-// Define four-byte and eight-byte types so that we can dereference void
-// pointers like integer pointers.  The only significance of using int32_t and
-// int64_t is that they are 4 and 8 bytes.
-#define FOUR_BYTE_TYPE  int32_t
-#define EIGHT_BYTE_TYPE int64_t
-
-/***************************** mergesort ************************************/
-
-// Recursive merge sorting functions.
-static void
-S_msort4(void *velems, void *vscratch, uint32_t left, uint32_t right,
-         CFISH_Sort_Compare_t compare, void *context);
-static void
-S_msort8(void *velems, void *vscratch, uint32_t left, uint32_t right,
-         CFISH_Sort_Compare_t compare, void *context);
-static void
-S_msort_any(void *velems, void *vscratch, uint32_t left, uint32_t right,
-            CFISH_Sort_Compare_t compare, void *context, size_t width);
-
-static CFISH_INLINE void
-SI_merge(void *left_vptr,  uint32_t left_size,
-         void *right_vptr, uint32_t right_size,
-         void *vdest, size_t width, CFISH_Sort_Compare_t compare, void *context);
-
-void
-Sort_mergesort(void *elems, void *scratch, uint32_t num_elems, uint32_t width,
-               CFISH_Sort_Compare_t compare, void *context) {
-    // Arrays of 0 or 1 items are already sorted.
-    if (num_elems < 2) { return; }
-
-    // Validate.
-    if (num_elems >= INT32_MAX) {
-        THROW(ERR, "Provided %u64 elems, but can't handle more than %i32",
-              (uint64_t)num_elems, INT32_MAX);
-    }
-
-    // Dispatch by element size.
-    switch (width) {
-        case 0:
-            THROW(ERR, "Parameter 'width' cannot be 0");
-            break;
-        case 4:
-            S_msort4(elems, scratch, 0, num_elems - 1, compare, context);
-            break;
-        case 8:
-            S_msort8(elems, scratch, 0, num_elems - 1, compare, context);
-            break;
-        default:
-            S_msort_any(elems, scratch, 0, num_elems - 1, compare,
-                        context, width);
-            break;
-    }
-}
-
-void
-Sort_merge(void *left_ptr,  uint32_t left_size,
-           void *right_ptr, uint32_t right_size,
-           void *dest, size_t width, CFISH_Sort_Compare_t compare,
-           void *context) {
-    switch (width) {
-        case 0:
-            THROW(ERR, "Parameter 'width' cannot be 0");
-            break;
-        case 4:
-            SI_merge(left_ptr, left_size, right_ptr, right_size,
-                     dest, 4, compare, context);
-            break;
-        case 8:
-            SI_merge(left_ptr, left_size, right_ptr, right_size,
-                     dest, 8, compare, context);
-            break;
-        default:
-            SI_merge(left_ptr, left_size, right_ptr, right_size,
-                     dest, width, compare, context);
-            break;
-    }
-}
-
-#define WIDTH 4
-static void
-S_msort4(void *velems, void *vscratch, uint32_t left, uint32_t right,
-         CFISH_Sort_Compare_t compare, void *context) {
-    uint8_t *elems   = (uint8_t*)velems;
-    uint8_t *scratch = (uint8_t*)vscratch;
-    if (right > left) {
-        const uint32_t mid = ((right + left) / 2) + 1;
-        S_msort4(elems, scratch, left, mid - 1, compare, context);
-        S_msort4(elems, scratch, mid,  right, compare, context);
-        SI_merge((elems + left * WIDTH), (mid - left),
-                 (elems + mid * WIDTH), (right - mid + 1),
-                 scratch, WIDTH, compare, context);
-        memcpy((elems + left * WIDTH), scratch, ((right - left + 1) * WIDTH));
-    }
-}
-
-#undef WIDTH
-#define WIDTH 8
-static void
-S_msort8(void *velems, void *vscratch, uint32_t left, uint32_t right,
-         CFISH_Sort_Compare_t compare, void *context) {
-    uint8_t *elems   = (uint8_t*)velems;
-    uint8_t *scratch = (uint8_t*)vscratch;
-    if (right > left) {
-        const uint32_t mid = ((right + left) / 2) + 1;
-        S_msort8(elems, scratch, left, mid - 1, compare, context);
-        S_msort8(elems, scratch, mid,  right, compare, context);
-        SI_merge((elems + left * WIDTH), (mid - left),
-                 (elems + mid * WIDTH), (right - mid + 1),
-                 scratch, WIDTH, compare, context);
-        memcpy((elems + left * WIDTH), scratch, ((right - left + 1) * WIDTH));
-    }
-}
-
-#undef WIDTH
-static void
-S_msort_any(void *velems, void *vscratch, uint32_t left, uint32_t right,
-            CFISH_Sort_Compare_t compare, void *context, size_t width) {
-    uint8_t *elems   = (uint8_t*)velems;
-    uint8_t *scratch = (uint8_t*)vscratch;
-    if (right > left) {
-        const uint32_t mid = ((right + left) / 2) + 1;
-        S_msort_any(elems, scratch, left, mid - 1, compare, context, width);
-        S_msort_any(elems, scratch, mid,  right,   compare, context, width);
-        SI_merge((elems + left * width), (mid - left),
-                 (elems + mid * width), (right - mid + 1),
-                 scratch, width, compare, context);
-        memcpy((elems + left * width), scratch, ((right - left + 1) * width));
-    }
-}
-
-static CFISH_INLINE void
-SI_merge(void *left_vptr,  uint32_t left_size,
-         void *right_vptr, uint32_t right_size,
-         void *vdest, size_t width, CFISH_Sort_Compare_t compare,
-         void *context) {
-    uint8_t *left_ptr    = (uint8_t*)left_vptr;
-    uint8_t *right_ptr   = (uint8_t*)right_vptr;
-    uint8_t *left_limit  = left_ptr + left_size * width;
-    uint8_t *right_limit = right_ptr + right_size * width;
-    uint8_t *dest        = (uint8_t*)vdest;
-
-    while (left_ptr < left_limit && right_ptr < right_limit) {
-        if (compare(context, left_ptr, right_ptr) < 1) {
-            memcpy(dest, left_ptr, width);
-            dest += width;
-            left_ptr += width;
-        }
-        else {
-            memcpy(dest, right_ptr, width);
-            dest += width;
-            right_ptr += width;
-        }
-    }
-
-    const size_t left_remaining = left_limit - left_ptr;
-    memcpy(dest, left_ptr, left_remaining);
-    dest += left_remaining;
-    const size_t right_remaining = right_limit - right_ptr;
-    memcpy(dest, right_ptr, right_remaining);
-}
-
-/***************************** quicksort ************************************/
-
-// Quicksort implementations optimized for four-byte and eight-byte elements.
-static void
-S_qsort4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
-         CFISH_Sort_Compare_t compare, void *context);
-static void
-S_qsort8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
-         CFISH_Sort_Compare_t compare, void *context);
-
-// Swap two elements.
-static CFISH_INLINE void
-SI_exchange4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right);
-static CFISH_INLINE void
-SI_exchange8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right);
-
-/* Select a pivot by choosing the median of three values, guarding against
- * the worst-case behavior of quicksort.  Place the pivot in the rightmost
- * slot.
- *
- * Possible states:
- *
- *   abc => abc => abc => acb
- *   acb => acb => acb => acb
- *   bac => abc => abc => acb
- *   bca => bca => acb => acb
- *   cba => bca => acb => acb
- *   cab => acb => acb => acb
- *   aab => aab => aab => aba
- *   aba => aba => aba => aba
- *   baa => aba => aba => aba
- *   bba => bba => abb => abb
- *   bab => abb => abb => abb
- *   abb => abb => abb => abb
- *   aaa => aaa => aaa => aaa
- */
-static CFISH_INLINE FOUR_BYTE_TYPE*
-SI_choose_pivot4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
-                 CFISH_Sort_Compare_t compare, void *context);
-static CFISH_INLINE EIGHT_BYTE_TYPE*
-SI_choose_pivot8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
-                 CFISH_Sort_Compare_t compare, void *context);
-
-void
-Sort_quicksort(void *elems, size_t num_elems, size_t width,
-               CFISH_Sort_Compare_t compare, void *context) {
-    // Arrays of 0 or 1 items are already sorted.
-    if (num_elems < 2) { return; }
-
-    // Validate.
-    if (num_elems >= INT32_MAX) {
-        THROW(ERR, "Provided %u64 elems, but can't handle more than %i32",
-              (uint64_t)num_elems, INT32_MAX);
-    }
-
-    if (width == 4) {
-        S_qsort4((FOUR_BYTE_TYPE*)elems, 0, num_elems - 1, compare, context);
-    }
-    else if (width == 8) {
-        S_qsort8((EIGHT_BYTE_TYPE*)elems, 0, num_elems - 1, compare, context);
-    }
-    else {
-        THROW(ERR, "Unsupported width: %i64", (int64_t)width);
-    }
-}
-
-/************************* quicksort 4 byte *********************************/
-
-static CFISH_INLINE void
-SI_exchange4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right) {
-    FOUR_BYTE_TYPE saved = elems[left];
-    elems[left]  = elems[right];
-    elems[right] = saved;
-}
-
-static CFISH_INLINE FOUR_BYTE_TYPE*
-SI_choose_pivot4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
-                 CFISH_Sort_Compare_t compare, void *context) {
-    if (right - left > 1) {
-        int32_t mid = left + (right - left) / 2;
-        if (compare(context, elems + left, elems + mid) > 0) {
-            SI_exchange4(elems, left, mid);
-        }
-        if (compare(context, elems + left, elems + right) > 0) {
-            SI_exchange4(elems, left, right);
-        }
-        if (compare(context, elems + right, elems + mid) > 0) {
-            SI_exchange4(elems, right, mid);
-        }
-    }
-    return elems + right;
-}
-
-static void
-S_qsort4(FOUR_BYTE_TYPE *elems, int32_t left, int32_t right,
-         CFISH_Sort_Compare_t compare, void *context) {
-    FOUR_BYTE_TYPE *const pivot
-        = SI_choose_pivot4(elems, left, right, compare, context);
-    int32_t i = left - 1;
-    int32_t j = right;
-    int32_t p = left - 1;
-    int32_t q = right;
-
-    if (right <= left) { return; }
-
-    /* TODO: A standard optimization for quicksort is to fall back to an
-     * insertion sort when the the number of elements to be sorted becomes
-     * small enough. */
-
-    while (1) {
-        int comparison1;
-        int comparison2;
-
-        // Find an element from the left that is greater than or equal to the
-        // pivot (i.e. that should move to the right).
-        while (1) {
-            i++;
-            comparison1 = compare(context, elems + i, pivot);
-            if (comparison1 >= 0) { break; }
-            if (i == right)       { break; }
-        }
-
-        // Find an element from the right that is less than or equal to the
-        // pivot (i.e. that should move to the left).
-        while (1) {
-            j--;
-            comparison2 = compare(context, elems + j, pivot);
-            if (comparison2 <= 0) { break; }
-            if (j == left)        { break; }
-        }
-
-        // Bail out of loop when we meet in the middle.
-        if (i >= j) { break; }
-
-        // Swap the elements we found, so the lesser element moves left and
-        // the greater element moves right.
-        SI_exchange4(elems, i, j);
-
-        // Move any elements which test as "equal" to the pivot to the outside
-        // edges of the array.
-        if (comparison2 == 0) {
-            p++;
-            SI_exchange4(elems, p, i);
-        }
-        if (comparison1 == 0) {
-            q--;
-            SI_exchange4(elems, j, q);
-        }
-    }
-
-    /* Move "equal" elements from the outside edges to the center.
-     *
-     * Before:
-     *
-     *    equal  |  less_than  |  greater_than  |  equal
-     *
-     * After:
-     *
-     *    less_than  |       equal       |  greater_than
-     */
-    SI_exchange4(elems, i, right);
-    j = i - 1;
-    i++;
-    for (int32_t k = left; k < p; k++, j--)      { SI_exchange4(elems, k, j); }
-    for (int32_t k = right - 1; k > q; k--, i++) { SI_exchange4(elems, i, k); }
-
-    // Recurse.
-    S_qsort4(elems, left, j, compare, context);   // Sort less_than.
-    S_qsort4(elems, i, right, compare, context);  // Sort greater_than.
-}
-
-/************************* quicksort 8 byte *********************************/
-
-static CFISH_INLINE void
-SI_exchange8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right) {
-    EIGHT_BYTE_TYPE saved = elems[left];
-    elems[left]  = elems[right];
-    elems[right] = saved;
-}
-
-static CFISH_INLINE EIGHT_BYTE_TYPE*
-SI_choose_pivot8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
-                 CFISH_Sort_Compare_t compare, void *context) {
-    if (right - left > 1) {
-        int32_t mid = left + (right - left) / 2;
-        if (compare(context, elems + left, elems + mid) > 0) {
-            SI_exchange8(elems, left, mid);
-        }
-        if (compare(context, elems + left, elems + right) > 0) {
-            SI_exchange8(elems, left, right);
-        }
-        if (compare(context, elems + right, elems + mid) > 0) {
-            SI_exchange8(elems, right, mid);
-        }
-    }
-    return elems + right;
-}
-
-static void
-S_qsort8(EIGHT_BYTE_TYPE *elems, int32_t left, int32_t right,
-         CFISH_Sort_Compare_t compare, void *context) {
-    EIGHT_BYTE_TYPE *const pivot
-        = SI_choose_pivot8(elems, left, right, compare, context);
-    int32_t i = left - 1;
-    int32_t j = right;
-    int32_t p = left - 1;
-    int32_t q = right;
-
-    if (right <= left) { return; }
-
-    /* TODO: A standard optimization for quicksort is to fall back to an
-     * insertion sort when the the number of elements to be sorted becomes
-     * small enough. */
-
-    while (1) {
-        int comparison1;
-        int comparison2;
-
-        // Find an element from the left that is greater than or equal to the
-        // pivot (i.e. that should move to the right).
-        while (1) {
-            i++;
-            comparison1 = compare(context, elems + i, pivot);
-            if (comparison1 >= 0) { break; }
-            if (i == right)       { break; }
-        }
-
-        // Find an element from the right that is less than or equal to the
-        // pivot (i.e. that should move to the left).
-        while (1) {
-            j--;
-            comparison2 = compare(context, elems + j, pivot);
-            if (comparison2 <= 0) { break; }
-            if (j == left)        { break; }
-        }
-
-        // Bail out of loop when we meet in the middle.
-        if (i >= j) { break; }
-
-        // Swap the elements we found, so the lesser element moves left and
-        // the greater element moves right.
-        SI_exchange8(elems, i, j);
-
-        // Move any elements which test as "equal" to the pivot to the outside
-        // edges of the array.
-        if (comparison2 == 0) {
-            p++;
-            SI_exchange8(elems, p, i);
-        }
-        if (comparison1 == 0) {
-            q--;
-            SI_exchange8(elems, j, q);
-        }
-    }
-
-    /* Move "equal" elements from the outside edges to the center.
-     *
-     * Before:
-     *
-     *    equal  |  less_than  |  greater_than  |  equal
-     *
-     * After:
-     *
-     *    less_than  |       equal       |  greater_than
-     */
-    SI_exchange8(elems, i, right);
-    j = i - 1;
-    i++;
-    for (int32_t k = left; k < p; k++, j--)      { SI_exchange8(elems, k, j); }
-    for (int32_t k = right - 1; k > q; k--, i++) { SI_exchange8(elems, i, k); }
-
-    // Recurse.
-    S_qsort8(elems, left, j, compare, context);   // Sort less_than.
-    S_qsort8(elems, i, right, compare, context);  // Sort greater_than.
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/SortUtils.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/SortUtils.cfh b/clownfish/runtime/core/Clownfish/Util/SortUtils.cfh
deleted file mode 100644
index a238163..0000000
--- a/clownfish/runtime/core/Clownfish/Util/SortUtils.cfh
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-__C__
-typedef int
-(*CFISH_Sort_Compare_t)(void *context, const void *va, const void *vb);
-__END_C__
-
-/** Specialized sorting routines.
- *
- * SortUtils provides a merge sort algorithm which allows access to its
- * internals, enabling specialized functions to jump in and only execute part
- * of the sort.
- *
- * SortUtils also provides a quicksort with an additional context argument.
- */
-inert class Clownfish::Util::SortUtils cnick Sort {
-
-    /** Perform a mergesort.  In addition to providing a contiguous array of
-     * elements to be sorted and their count, the caller must also provide a
-     * scratch buffer with room for at least as many elements as are to be
-     * sorted.
-     */
-    inert void
-    mergesort(void *elems, void *scratch, uint32_t num_elems, uint32_t width,
-              CFISH_Sort_Compare_t compare, void *context);
-
-    /** Merge two source arrays together using the classic mergesort merge
-     * algorithm, storing the result in <code>dest</code>.
-     *
-     * Most merge functions operate on a single contiguous array and copy the
-     * merged results results back into the source array before returning.
-     * These two differ in that it is possible to operate on two discontiguous
-     * source arrays.  Copying the results back into the source array is the
-     * responsibility of the caller.
-     *
-     * Lucy's external sort takes advantage of this when it is reading
-     * back pre-sorted runs from disk and merging the streams into a
-     * consolidated buffer.
-     */
-    inert void
-    merge(void *left_ptr,  uint32_t left_num_elems,
-          void *right_ptr, uint32_t right_num_elems,
-          void *dest, size_t width, CFISH_Sort_Compare_t compare, void *context);
-
-    /** Quicksort.
-     */
-    inert void
-    quicksort(void *elems, size_t num_elems, size_t width,
-              CFISH_Sort_Compare_t compare, void *context);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/StringHelper.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/StringHelper.c b/clownfish/runtime/core/Clownfish/Util/StringHelper.c
deleted file mode 100644
index ba117c5..0000000
--- a/clownfish/runtime/core/Clownfish/Util/StringHelper.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_STRINGHELPER
-#include <string.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Util/StringHelper.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Util/Memory.h"
-
-const uint8_t cfish_StrHelp_UTF8_COUNT[] = {
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
-    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
-    4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-int32_t
-StrHelp_overlap(const char *a, const char *b, size_t a_len,  size_t b_len) {
-    size_t i;
-    const size_t len = a_len <= b_len ? a_len : b_len;
-
-    for (i = 0; i < len; i++) {
-        if (*a++ != *b++) { break; }
-    }
-    return i;
-}
-
-static const char base36_chars[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-
-uint32_t
-StrHelp_to_base36(uint64_t num, void *buffer) {
-    char  my_buf[StrHelp_MAX_BASE36_BYTES];
-    char *buf = my_buf + StrHelp_MAX_BASE36_BYTES - 1;
-    char *end = buf;
-
-    // Null terminate.
-    *buf = '\0';
-
-    // Convert to base 36 characters.
-    do {
-        *(--buf) = base36_chars[num % 36];
-        num /= 36;
-    } while (num > 0);
-
-    uint32_t size = end - buf;
-    memcpy(buffer, buf, size + 1);
-    return size;
-}
-
-bool
-StrHelp_utf8_valid(const char *ptr, size_t size) {
-    const uint8_t *string    = (const uint8_t*)ptr;
-    const uint8_t *const end = string + size;
-    while (string < end) {
-        const uint8_t header_byte = *string++;
-        int count = StrHelp_UTF8_COUNT[header_byte] & 0x7;
-        switch (count & 0x7) {
-            case 1:
-                // ASCII
-                break;
-            case 2:
-                if (string == end)              { return false; }
-                // Disallow non-shortest-form ASCII.
-                if (!(header_byte & 0x1E))      { return false; }
-                if ((*string++ & 0xC0) != 0x80) { return false; }
-                break;
-            case 3:
-                if (end - string < 2)           { return false; }
-                if (header_byte == 0xED) {
-                    if (*string < 0x80 || *string > 0x9F) {
-                        return false;
-                    }
-                }
-                else if (!(header_byte & 0x0F)) {
-                    if (!(*string & 0x20)) {
-                        return false;
-                    }
-                }
-                if ((*string++ & 0xC0) != 0x80) { return false; }
-                if ((*string++ & 0xC0) != 0x80) { return false; }
-                break;
-            case 4:
-                if (end - string < 3)           { return false; }
-                if (!(header_byte & 0x07)) {
-                    if (!(*string & 0x30)) {
-                        return false;
-                    }
-                }
-                if ((*string++ & 0xC0) != 0x80) { return false; }
-                if ((*string++ & 0xC0) != 0x80) { return false; }
-                if ((*string++ & 0xC0) != 0x80) { return false; }
-                break;
-            default:
-                return false;
-        }
-    }
-
-    return true;
-}
-
-bool
-StrHelp_is_whitespace(int32_t code_point) {
-    switch (code_point) {
-            // <control-0009>..<control-000D>
-        case 0x0009: case 0x000A: case 0x000B: case 0x000C: case 0x000D:
-        case 0x0020: // SPACE
-        case 0x0085: // <control-0085>
-        case 0x00A0: // NO-BREAK SPACE
-        case 0x1680: // OGHAM SPACE MARK
-        case 0x180E: // MONGOLIAN VOWEL SEPARATOR
-            // EN QUAD..HAIR SPACE
-        case 0x2000: case 0x2001: case 0x2002: case 0x2003: case 0x2004:
-        case 0x2005: case 0x2006: case 0x2007: case 0x2008: case 0x2009:
-        case 0x200A:
-        case 0x2028: // LINE SEPARATOR
-        case 0x2029: // PARAGRAPH SEPARATOR
-        case 0x202F: // NARROW NO-BREAK SPACE
-        case 0x205F: // MEDIUM MATHEMATICAL SPACE
-        case 0x3000: // IDEOGRAPHIC SPACE
-            return true;
-
-        default:
-            return false;
-    }
-}
-
-uint32_t
-StrHelp_encode_utf8_char(int32_t code_point, void *buffer) {
-    uint8_t *buf = (uint8_t*)buffer;
-    if (code_point <= 0x7F) { // ASCII
-        buf[0] = (uint8_t)code_point;
-        return 1;
-    }
-    else if (code_point <= 0x07FF) { // 2 byte range
-        buf[0] = (uint8_t)(0xC0 | (code_point >> 6));
-        buf[1] = (uint8_t)(0x80 | (code_point & 0x3f));
-        return 2;
-    }
-    else if (code_point <= 0xFFFF) { // 3 byte range
-        buf[0] = (uint8_t)(0xE0 | (code_point  >> 12));
-        buf[1] = (uint8_t)(0x80 | ((code_point >> 6) & 0x3F));
-        buf[2] = (uint8_t)(0x80 | (code_point        & 0x3f));
-        return 3;
-    }
-    else if (code_point <= 0x10FFFF) { // 4 byte range
-        buf[0] = (uint8_t)(0xF0 | (code_point  >> 18));
-        buf[1] = (uint8_t)(0x80 | ((code_point >> 12) & 0x3F));
-        buf[2] = (uint8_t)(0x80 | ((code_point >> 6)  & 0x3F));
-        buf[3] = (uint8_t)(0x80 | (code_point         & 0x3f));
-        return 4;
-    }
-    else {
-        THROW(ERR, "Illegal Unicode code point: %u32", code_point);
-        UNREACHABLE_RETURN(uint32_t);
-    }
-}
-
-int32_t
-StrHelp_decode_utf8_char(const char *ptr) {
-    const uint8_t *const string = (const uint8_t*)ptr;
-    int32_t retval = *string;
-    int bytes = StrHelp_UTF8_COUNT[retval];
-
-    switch (bytes & 0x7) {
-        case 1:
-            break;
-
-        case 2:
-            retval = ((retval     & 0x1F) << 6)
-                     | (string[1] & 0x3F);
-            break;
-
-        case 3:
-            retval = ((retval      & 0x0F) << 12)
-                     | ((string[1] & 0x3F) << 6)
-                     | (string[2]  & 0x3F);
-            break;
-
-        case 4:
-            retval = ((retval      & 0x07) << 18)
-                     | ((string[1] & 0x3F) << 12)
-                     | ((string[2] & 0x3F) << 6)
-                     | (string[3]  & 0x3F);
-            break;
-
-        default:
-            THROW(ERR, "Invalid UTF-8 header byte: %x32", retval);
-    }
-
-    return retval;
-}
-
-const char*
-StrHelp_back_utf8_char(const char *ptr, const char *start) {
-    while (--ptr >= start) {
-        if ((*ptr & 0xC0) != 0x80) { return ptr; }
-    }
-    return NULL;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/StringHelper.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/StringHelper.cfh b/clownfish/runtime/core/Clownfish/Util/StringHelper.cfh
deleted file mode 100644
index 1cbb46a..0000000
--- a/clownfish/runtime/core/Clownfish/Util/StringHelper.cfh
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-inert class Clownfish::Util::StringHelper cnick StrHelp {
-
-    /* A table where the values indicate the number of bytes in a UTF-8
-     * sequence implied by the leading utf8 byte.
-     */
-    inert const uint8_t[] UTF8_COUNT;
-
-    /** Return the number of bytes that two strings have in common.
-     */
-    inert int32_t
-    overlap(const char *a, const char *b, size_t a_len,  size_t b_len);
-
-    /** Encode a NULL-terminated string representation of a value in base 36
-     * into <code>buffer</code>.
-     *
-     * @param value The number to be encoded.
-     * @param buffer A buffer at least MAX_BASE36_BYTES bytes long.
-     * @return the number of digits encoded (not including the terminating
-     * NULL).
-     */
-    inert uint32_t
-    to_base36(uint64_t value, void *buffer);
-
-    /** Return true if the string is valid UTF-8, false otherwise.
-     */
-    inert bool
-    utf8_valid(const char *ptr, size_t len);
-
-    /** Returns true if the code point qualifies as Unicode whitespace.
-     */
-    inert bool
-    is_whitespace(int32_t code_point);
-
-    /** Encode a Unicode code point to a UTF-8 sequence.
-     *
-     * @param code_point A legal unicode code point.
-     * @param buffer Write buffer which must hold at least 4 bytes (the
-     * maximum legal length for a UTF-8 char).
-     */
-    inert uint32_t
-    encode_utf8_char(int32_t code_point, void *buffer);
-
-    /** Decode a UTF-8 sequence to a Unicode code point.  Assumes valid UTF-8.
-     */
-    inert int32_t
-    decode_utf8_char(const char *utf8);
-
-    /** Return the first non-continuation byte before the supplied pointer.
-     * If backtracking progresses beyond the supplied start, return NULL.
-     */
-    inert nullable const char*
-    back_utf8_char(const char *utf8, const char *start);
-}
-
-__C__
-/** The maximum number of bytes encoded by to_base36(), including the
- * terminating NULL.
- */
-#define cfish_StrHelp_MAX_BASE36_BYTES 14
-#ifdef CFISH_USE_SHORT_NAMES
-  #define StrHelp_MAX_BASE36_BYTES cfish_StrHelp_MAX_BASE36_BYTES
-#endif
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/VArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VArray.c b/clownfish/runtime/core/Clownfish/VArray.c
deleted file mode 100644
index e3d49d3..0000000
--- a/clownfish/runtime/core/Clownfish/VArray.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_VARRAY
-#include <string.h>
-#include <stdlib.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/VTable.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/Util/SortUtils.h"
-
-VArray*
-VA_new(uint32_t capacity) {
-    VArray *self = (VArray*)VTable_Make_Obj(VARRAY);
-    VA_init(self, capacity);
-    return self;
-}
-
-VArray*
-VA_init(VArray *self, uint32_t capacity) {
-    // Init.
-    self->size = 0;
-
-    // Assign.
-    self->cap = capacity;
-
-    // Derive.
-    self->elems = (Obj**)CALLOCATE(capacity, sizeof(Obj*));
-
-    return self;
-}
-
-void
-VA_Destroy_IMP(VArray *self) {
-    if (self->elems) {
-        Obj **elems        = self->elems;
-        Obj **const limit  = elems + self->size;
-        for (; elems < limit; elems++) {
-            DECREF(*elems);
-        }
-        FREEMEM(self->elems);
-    }
-    SUPER_DESTROY(self, VARRAY);
-}
-
-VArray*
-VA_Clone_IMP(VArray *self) {
-    VArray *twin = VA_new(self->size);
-
-    // Clone each element.
-    for (uint32_t i = 0; i < self->size; i++) {
-        Obj *elem = self->elems[i];
-        if (elem) {
-            twin->elems[i] = Obj_Clone(elem);
-        }
-    }
-
-    // Ensure that size is the same if NULL elems at end.
-    twin->size = self->size;
-
-    return twin;
-}
-
-VArray*
-VA_Shallow_Copy_IMP(VArray *self) {
-    // Dupe, then increment refcounts.
-    VArray *twin = VA_new(self->size);
-    Obj **elems = twin->elems;
-    memcpy(elems, self->elems, self->size * sizeof(Obj*));
-    twin->size = self->size;
-    for (uint32_t i = 0; i < self->size; i++) {
-        if (elems[i] != NULL) {
-            (void)INCREF(elems[i]);
-        }
-    }
-
-    return twin;
-}
-
-void
-VA_Push_IMP(VArray *self, Obj *element) {
-    if (self->size == self->cap) {
-        VA_Grow(self, Memory_oversize(self->size + 1, sizeof(Obj*)));
-    }
-    self->elems[self->size] = element;
-    self->size++;
-}
-
-void
-VA_Push_VArray_IMP(VArray *self, VArray *other) {
-    uint32_t tick = self->size;
-    uint32_t new_size = self->size + other->size;
-    if (new_size > self->cap) {
-        VA_Grow(self, Memory_oversize(new_size, sizeof(Obj*)));
-    }
-    for (uint32_t i = 0; i < other->size; i++, tick++) {
-        Obj *elem = VA_Fetch(other, i);
-        if (elem != NULL) {
-            self->elems[tick] = INCREF(elem);
-        }
-    }
-    self->size = new_size;
-}
-
-Obj*
-VA_Pop_IMP(VArray *self) {
-    if (!self->size) {
-        return NULL;
-    }
-    self->size--;
-    return  self->elems[self->size];
-}
-
-void
-VA_Unshift_IMP(VArray *self, Obj *elem) {
-    if (self->size == self->cap) {
-        VA_Grow(self, Memory_oversize(self->size + 1, sizeof(Obj*)));
-    }
-    memmove(self->elems + 1, self->elems, self->size * sizeof(Obj*));
-    self->elems[0] = elem;
-    self->size++;
-}
-
-Obj*
-VA_Shift_IMP(VArray *self) {
-    if (!self->size) {
-        return NULL;
-    }
-    else {
-        Obj *const return_val = self->elems[0];
-        self->size--;
-        if (self->size > 0) {
-            memmove(self->elems, self->elems + 1,
-                    self->size * sizeof(Obj*));
-        }
-        return return_val;
-    }
-}
-
-Obj*
-VA_Fetch_IMP(VArray *self, uint32_t num) {
-    if (num >= self->size) {
-        return NULL;
-    }
-
-    return self->elems[num];
-}
-
-void
-VA_Store_IMP(VArray *self, uint32_t tick, Obj *elem) {
-    if (tick >= self->cap) {
-        VA_Grow(self, Memory_oversize(tick + 1, sizeof(Obj*)));
-    }
-    if (tick < self->size) { DECREF(self->elems[tick]); }
-    else                   { self->size = tick + 1; }
-    self->elems[tick] = elem;
-}
-
-void
-VA_Grow_IMP(VArray *self, uint32_t capacity) {
-    if (capacity > self->cap) {
-        self->elems = (Obj**)REALLOCATE(self->elems, capacity * sizeof(Obj*));
-        self->cap   = capacity;
-        memset(self->elems + self->size, 0,
-               (capacity - self->size) * sizeof(Obj*));
-    }
-}
-
-Obj*
-VA_Delete_IMP(VArray *self, uint32_t num) {
-    Obj *elem = NULL;
-    if (num < self->size) {
-        elem = self->elems[num];
-        self->elems[num] = NULL;
-    }
-    return elem;
-}
-
-void
-VA_Excise_IMP(VArray *self, uint32_t offset, uint32_t length) {
-    if (self->size <= offset)              { return; }
-    else if (self->size < offset + length) { length = self->size - offset; }
-
-    for (uint32_t i = 0; i < length; i++) {
-        DECREF(self->elems[offset + i]);
-    }
-
-    uint32_t num_to_move = self->size - (offset + length);
-    memmove(self->elems + offset, self->elems + offset + length,
-            num_to_move * sizeof(Obj*));
-    self->size -= length;
-}
-
-void
-VA_Clear_IMP(VArray *self) {
-    VA_Excise_IMP(self, 0, self->size);
-}
-
-void
-VA_Resize_IMP(VArray *self, uint32_t size) {
-    if (size < self->size) {
-        VA_Excise(self, size, self->size - size);
-    }
-    else if (size > self->size) {
-        VA_Grow(self, size);
-    }
-    self->size = size;
-}
-
-uint32_t
-VA_Get_Size_IMP(VArray *self) {
-    return self->size;
-}
-
-uint32_t
-VA_Get_Capacity_IMP(VArray *self) {
-    return self->cap;
-}
-
-static int
-S_default_compare(void *context, const void *va, const void *vb) {
-    Obj *a = *(Obj**)va;
-    Obj *b = *(Obj**)vb;
-    UNUSED_VAR(context);
-    if (a != NULL && b != NULL)      { return Obj_Compare_To(a, b); }
-    else if (a == NULL && b == NULL) { return 0;  }
-    else if (a == NULL)              { return 1;  } // NULL to the back
-    else  /* b == NULL */            { return -1; } // NULL to the back
-}
-
-void
-VA_Sort_IMP(VArray *self, CFISH_Sort_Compare_t compare, void *context) {
-    if (!compare) { compare = S_default_compare; }
-    Sort_quicksort(self->elems, self->size, sizeof(void*), compare, context);
-}
-
-bool
-VA_Equals_IMP(VArray *self, Obj *other) {
-    VArray *twin = (VArray*)other;
-    if (twin == self)             { return true; }
-    if (!Obj_Is_A(other, VARRAY)) { return false; }
-    if (twin->size != self->size) {
-        return false;
-    }
-    else {
-        for (uint32_t i = 0, max = self->size; i < max; i++) {
-            Obj *val       = self->elems[i];
-            Obj *other_val = twin->elems[i];
-            if ((val && !other_val) || (other_val && !val)) { return false; }
-            if (val && !Obj_Equals(val, other_val))         { return false; }
-        }
-    }
-    return true;
-}
-
-VArray*
-VA_Gather_IMP(VArray *self, VA_Gather_Test_t test, void *data) {
-    VArray *gathered = VA_new(self->size);
-    for (uint32_t i = 0, max = self->size; i < max; i++) {
-        if (test(self, i, data)) {
-            Obj *elem = self->elems[i];
-            VA_Push(gathered, elem ? INCREF(elem) : NULL);
-        }
-    }
-    return gathered;
-}
-
-VArray*
-VA_Slice_IMP(VArray *self, uint32_t offset, uint32_t length) {
-    // Adjust ranges if necessary.
-    if (offset >= self->size) {
-        offset = 0;
-        length = 0;
-    }
-    else if (length > UINT32_MAX - offset
-             || offset + length > self->size
-            ) {
-        length = self->size - offset;
-    }
-
-    // Copy elements.
-    VArray *slice = VA_new(length);
-    slice->size = length;
-    Obj **slice_elems = slice->elems;
-    Obj **my_elems    = self->elems;
-    for (uint32_t i = 0; i < length; i++) {
-        slice_elems[i] = INCREF(my_elems[offset + i]);
-    }
-
-    return slice;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/VArray.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VArray.cfh b/clownfish/runtime/core/Clownfish/VArray.cfh
deleted file mode 100644
index 6776b57..0000000
--- a/clownfish/runtime/core/Clownfish/VArray.cfh
+++ /dev/null
@@ -1,169 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-__C__
-#include "Clownfish/Util/SortUtils.h"
-
-typedef bool
-(*CFISH_VA_Gather_Test_t)(cfish_VArray *self, uint32_t tick, void *data);
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define VA_Gather_Test_t CFISH_VA_Gather_Test_t
-#endif
-__END_C__
-
-/** Variable-sized array.
- */
-class Clownfish::VArray cnick VA inherits Clownfish::Obj {
-
-    Obj      **elems;
-    uint32_t   size;
-    uint32_t   cap;
-
-    inert incremented VArray*
-    new(uint32_t capacity = 0);
-
-    /**
-     * @param capacity Initial number of elements that the object will be able
-     * to hold before reallocation.
-     */
-    inert VArray*
-    init(VArray *self, uint32_t capacity = 0);
-
-    /** Push an item onto the end of a VArray.
-     */
-    void
-    Push(VArray *self, decremented Obj *element = NULL);
-
-    /** Push all the elements of another VArray onto the end of this one.
-     */
-    void
-    Push_VArray(VArray *self, VArray *other);
-
-    /** Pop an item off of the end of a VArray.
-     */
-    incremented nullable Obj*
-    Pop(VArray *self);
-
-    /** Unshift an item onto the front of a VArray.
-     */
-    void
-    Unshift(VArray *self, decremented Obj *element = NULL);
-
-    /** Shift an item off of the front of a VArray.
-     */
-    incremented nullable Obj*
-    Shift(VArray *self);
-
-    /** Ensure that the VArray has room for at least <code>capacity</code>
-     * elements.
-     */
-    void
-    Grow(VArray *self, uint32_t capacity);
-
-    /** Fetch the element at <code>tick</tick>.
-     */
-    nullable Obj*
-    Fetch(VArray *self, uint32_t tick);
-
-    /** Store an element at index <code>tick</code>, possibly displacing an
-     * existing element.
-     */
-    void
-    Store(VArray *self, uint32_t tick, decremented Obj *elem = NULL);
-
-    /** Replace an element in the VArray with NULL and return it.
-     *
-     * @return whatever was stored at <code>tick</code>.
-     */
-    incremented nullable Obj*
-    Delete(VArray *self, uint32_t tick);
-
-    /** Remove <code>length</code> elements from the array, starting at
-     * <code>offset</code>. Move elements over to fill in the gap.
-     */
-    void
-    Excise(VArray *self, uint32_t offset, uint32_t length);
-
-    /** Clone the VArray but merely increment the refcounts of its elements
-     * rather than clone them.
-     */
-    incremented VArray*
-    Shallow_Copy(VArray *self);
-
-    /** Dupe the VArray, cloning each internal element.
-     */
-    public incremented VArray*
-    Clone(VArray *self);
-
-    /** Quicksort the VArry using the supplied comparison routine.  Safety
-     * checks are the responsibility of the caller.
-     *
-     * @param compare Comparison routine.  The default uses Obj_Compare_To and
-     * sorts NULL elements towards the end.
-     * @param context Argument supplied to the comparison routine.
-     */
-    void
-    Sort(VArray *self, CFISH_Sort_Compare_t compare = NULL,
-         void *context = NULL);
-
-    /** Set the size for the VArray.  If the new size is larger than the
-     * current size, grow the object to accommodate NULL elements; if smaller
-     * than the current size, decrement and discard truncated elements.
-     */
-    void
-    Resize(VArray *self, uint32_t size);
-
-    /** Empty the VArray.
-     */
-    void
-    Clear(VArray *self);
-
-    /** Accessor for <code>size</code> member.
-     */
-    public uint32_t
-    Get_Size(VArray *self);
-
-    /** Accessor for <code>capacity</code> member.
-     */
-    uint32_t
-    Get_Capacity(VArray *self);
-
-    /** Return all elements for which <code>test</code> returns true.
-     */
-    public incremented VArray*
-    Gather(VArray *self, CFISH_VA_Gather_Test_t test, void *data);
-
-    /** Return a new array consisting of elements from a contiguous slice.  If
-     * the specified range is out of bounds, return an array with fewer
-     * elements -- potentially none.
-     *
-     * @param offset The index of the element to start at.
-     * @param length The maximum number of elements to slice.
-     */
-    public incremented VArray*
-    Slice(VArray *self, uint32_t offset, uint32_t length);
-
-    public bool
-    Equals(VArray *self, Obj *other);
-
-    public void
-    Destroy(VArray *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/VTable.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VTable.c b/clownfish/runtime/core/Clownfish/VTable.c
deleted file mode 100644
index fe6d718..0000000
--- a/clownfish/runtime/core/Clownfish/VTable.c
+++ /dev/null
@@ -1,446 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_VTABLE
-#define C_CFISH_OBJ
-#define C_CFISH_STRING
-#define C_CFISH_METHOD
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "Clownfish/VTable.h"
-#include "Clownfish/String.h"
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/LockFreeRegistry.h"
-#include "Clownfish/Method.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/Util/Atomic.h"
-#include "Clownfish/Util/Memory.h"
-
-size_t VTable_offset_of_parent = offsetof(VTable, parent);
-
-// Remove spaces and underscores, convert to lower case.
-static String*
-S_scrunch_string(String *source);
-
-static Method*
-S_find_method(VTable *self, const char *meth_name);
-
-static int32_t
-S_claim_parcel_id(void);
-
-LockFreeRegistry *VTable_registry = NULL;
-
-void
-VTable_bootstrap(const VTableSpec *specs, size_t num_specs)
-{
-    int32_t parcel_id = S_claim_parcel_id();
-
-    /* Pass 1:
-     * - Initialize IVARS_OFFSET.
-     * - Allocate memory.
-     * - Initialize parent, flags, obj_alloc_size, vt_alloc_size.
-     * - Assign parcel_id.
-     * - Initialize method pointers.
-     */
-    for (size_t i = 0; i < num_specs; ++i) {
-        const VTableSpec *spec = &specs[i];
-        VTable *parent = spec->parent ? *spec->parent : NULL;
-
-        size_t ivars_offset = 0;
-        if (spec->ivars_offset_ptr != NULL) {
-            if (parent) {
-                VTable *ancestor = parent;
-                while (ancestor && ancestor->parcel_id == parcel_id) {
-                    ancestor = ancestor->parent;
-                }
-                ivars_offset = ancestor ? ancestor->obj_alloc_size : 0;
-                *spec->ivars_offset_ptr = ivars_offset;
-            }
-            else {
-                *spec->ivars_offset_ptr = 0;
-            }
-        }
-
-        size_t novel_offset = parent
-                              ? parent->vt_alloc_size
-                              : offsetof(VTable, method_ptrs);
-        size_t vt_alloc_size = novel_offset
-                               + spec->num_novel_meths
-                                 * sizeof(cfish_method_t);
-        VTable *vtable = (VTable*)Memory_wrapped_calloc(vt_alloc_size, 1);
-
-        vtable->parent         = parent;
-        vtable->parcel_id      = parcel_id;
-        vtable->flags          = 0;
-        vtable->obj_alloc_size = ivars_offset + spec->ivars_size;
-        vtable->vt_alloc_size  = vt_alloc_size;
-
-        if (parent) {
-            size_t parent_ptrs_size = parent->vt_alloc_size
-                                      - offsetof(VTable, method_ptrs);
-            memcpy(vtable->method_ptrs, parent->method_ptrs, parent_ptrs_size);
-        }
-
-        for (size_t i = 0; i < spec->num_inherited_meths; ++i) {
-            const InheritedMethSpec *mspec = &spec->inherited_meth_specs[i];
-            *mspec->offset = *mspec->parent_offset;
-        }
-
-        for (size_t i = 0; i < spec->num_overridden_meths; ++i) {
-            const OverriddenMethSpec *mspec = &spec->overridden_meth_specs[i];
-            *mspec->offset = *mspec->parent_offset;
-            VTable_Override_IMP(vtable, mspec->func, *mspec->offset);
-        }
-
-        for (size_t i = 0; i < spec->num_novel_meths; ++i) {
-            const NovelMethSpec *mspec = &spec->novel_meth_specs[i];
-            *mspec->offset = novel_offset;
-            novel_offset += sizeof(cfish_method_t);
-            VTable_Override_IMP(vtable, mspec->func, *mspec->offset);
-        }
-
-        *spec->vtable = vtable;
-    }
-
-    /* Pass 2:
-     * - Initialize 'vtable' instance variable.
-     * - Initialize refcount.
-     */
-    for (size_t i = 0; i < num_specs; ++i) {
-        const VTableSpec *spec = &specs[i];
-        VTable *vtable = *spec->vtable;
-
-        VTable_Init_Obj_IMP(VTABLE, vtable);
-    }
-
-    /* Now it's safe to call methods.
-     *
-     * Pass 3:
-     * - Inititalize name and method array.
-     * - Register vtable.
-     */
-    for (size_t i = 0; i < num_specs; ++i) {
-        const VTableSpec *spec = &specs[i];
-        VTable *vtable = *spec->vtable;
-
-        vtable->name    = Str_newf("%s", spec->name);
-        vtable->methods = VA_new(0);
-
-        for (size_t i = 0; i < spec->num_novel_meths; ++i) {
-            const NovelMethSpec *mspec = &spec->novel_meth_specs[i];
-            String *name = Str_newf("%s", mspec->name);
-            Method *method = Method_new(name, mspec->callback_func,
-                                        *mspec->offset);
-            VA_Push(vtable->methods, (Obj*)method);
-            DECREF(name);
-        }
-
-        VTable_add_to_registry(vtable);
-    }
-}
-
-void
-VTable_Destroy_IMP(VTable *self) {
-    THROW(ERR, "Insane attempt to destroy VTable for class '%o'", self->name);
-}
-
-VTable*
-VTable_Clone_IMP(VTable *self) {
-    VTable *twin
-        = (VTable*)Memory_wrapped_calloc(self->vt_alloc_size, 1);
-
-    memcpy(twin, self, self->vt_alloc_size);
-    VTable_Init_Obj(self->vtable, twin); // Set refcount.
-    twin->name = Str_Clone(self->name);
-
-    return twin;
-}
-
-Obj*
-VTable_Inc_RefCount_IMP(VTable *self) {
-    return (Obj*)self;
-}
-
-uint32_t
-VTable_Dec_RefCount_IMP(VTable *self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
-uint32_t
-VTable_Get_RefCount_IMP(VTable *self) {
-    UNUSED_VAR(self);
-    /* VTable_Get_RefCount() lies to other Clownfish code about the refcount
-     * because we don't want to have to synchronize access to the cached host
-     * object to which we have delegated responsibility for keeping refcounts.
-     * It always returns 1 because 1 is a positive number, and thus other
-     * Clownfish code will be fooled into believing it never needs to take
-     * action such as initiating a destructor.
-     *
-     * It's possible that the host has in fact increased the refcount of the
-     * cached host object if there are multiple refs to it on the other side
-     * of the Clownfish/host border, but returning 1 is good enough to fool
-     * Clownfish code.
-     */
-    return 1;
-}
-
-void
-VTable_Override_IMP(VTable *self, cfish_method_t method, size_t offset) {
-    union { char *char_ptr; cfish_method_t *func_ptr; } pointer;
-    pointer.char_ptr = ((char*)self) + offset;
-    pointer.func_ptr[0] = method;
-}
-
-String*
-VTable_Get_Name_IMP(VTable *self) {
-    return self->name;
-}
-
-VTable*
-VTable_Get_Parent_IMP(VTable *self) {
-    return self->parent;
-}
-
-size_t
-VTable_Get_Obj_Alloc_Size_IMP(VTable *self) {
-    return self->obj_alloc_size;
-}
-
-VArray*
-VTable_Get_Methods_IMP(VTable *self) {
-    return self->methods;
-}
-
-void
-VTable_init_registry() {
-    LockFreeRegistry *reg = LFReg_new(256);
-    if (Atomic_cas_ptr((void*volatile*)&VTable_registry, NULL, reg)) {
-        return;
-    }
-    else {
-        DECREF(reg);
-    }
-}
-
-VTable*
-VTable_singleton(String *class_name, VTable *parent) {
-    if (VTable_registry == NULL) {
-        VTable_init_registry();
-    }
-
-    VTable *singleton = (VTable*)LFReg_Fetch(VTable_registry, (Obj*)class_name);
-    if (singleton == NULL) {
-        VArray *fresh_host_methods;
-        uint32_t num_fresh;
-
-        if (parent == NULL) {
-            String *parent_class = VTable_find_parent_class(class_name);
-            if (parent_class == NULL) {
-                THROW(ERR, "Class '%o' doesn't descend from %o", class_name,
-                      OBJ->name);
-            }
-            else {
-                parent = VTable_singleton(parent_class, NULL);
-                DECREF(parent_class);
-            }
-        }
-
-        // Copy source vtable.
-        singleton = VTable_Clone(parent);
-
-        // Turn clone into child.
-        singleton->parent = parent;
-        DECREF(singleton->name);
-        singleton->name = Str_Clone(class_name);
-
-        // Allow host methods to override.
-        fresh_host_methods = VTable_fresh_host_methods(class_name);
-        num_fresh = VA_Get_Size(fresh_host_methods);
-        if (num_fresh) {
-            Hash *meths = Hash_new(num_fresh);
-            for (uint32_t i = 0; i < num_fresh; i++) {
-                String *meth = (String*)VA_Fetch(fresh_host_methods, i);
-                String *scrunched = S_scrunch_string(meth);
-                Hash_Store(meths, (Obj*)scrunched, (Obj*)CFISH_TRUE);
-                DECREF(scrunched);
-            }
-            for (VTable *vtable = parent; vtable; vtable = vtable->parent) {
-                uint32_t max = VA_Get_Size(vtable->methods);
-                for (uint32_t i = 0; i < max; i++) {
-                    Method *method = (Method*)VA_Fetch(vtable->methods, i);
-                    if (method->callback_func) {
-                        String *scrunched = S_scrunch_string(method->name);
-                        if (Hash_Fetch(meths, (Obj*)scrunched)) {
-                            VTable_Override(singleton, method->callback_func,
-                                            method->offset);
-                        }
-                        DECREF(scrunched);
-                    }
-                }
-            }
-            DECREF(meths);
-        }
-        DECREF(fresh_host_methods);
-
-        // Register the new class, both locally and with host.
-        if (VTable_add_to_registry(singleton)) {
-            // Doing this after registering is racy, but hard to fix. :(
-            VTable_register_with_host(singleton, parent);
-        }
-        else {
-            DECREF(singleton);
-            singleton = (VTable*)LFReg_Fetch(VTable_registry, (Obj*)class_name);
-            if (!singleton) {
-                THROW(ERR, "Failed to either insert or fetch VTable for '%o'",
-                      class_name);
-            }
-        }
-    }
-
-    return singleton;
-}
-
-static String*
-S_scrunch_string(String *source) {
-    CharBuf *buf = CB_new(Str_Get_Size(source));
-    StringIterator *iter = Str_Top(source);
-    int32_t code_point;
-    while (STRITER_DONE != (code_point = StrIter_Next(iter))) {
-        if (code_point > 127) {
-            THROW(ERR, "Can't fold case for %o", source);
-        }
-        else if (code_point != '_') {
-            CB_Cat_Char(buf, tolower(code_point));
-        }
-    }
-    String *retval = CB_Yield_String(buf);
-    DECREF(iter);
-    DECREF(buf);
-    return retval;
-}
-
-bool
-VTable_add_to_registry(VTable *vtable) {
-    if (VTable_registry == NULL) {
-        VTable_init_registry();
-    }
-    if (LFReg_Fetch(VTable_registry, (Obj*)vtable->name)) {
-        return false;
-    }
-    else {
-        String *klass = Str_Clone(vtable->name);
-        bool retval
-            = LFReg_Register(VTable_registry, (Obj*)klass, (Obj*)vtable);
-        DECREF(klass);
-        return retval;
-    }
-}
-
-bool
-VTable_add_alias_to_registry(VTable *vtable, const char *alias_ptr,
-                             size_t alias_len) {
-    if (VTable_registry == NULL) {
-        VTable_init_registry();
-    }
-    StackString *alias = SSTR_WRAP_UTF8(alias_ptr, alias_len);
-    if (LFReg_Fetch(VTable_registry, (Obj*)alias)) {
-        return false;
-    }
-    else {
-        String *klass = SStr_Clone(alias);
-        bool retval
-            = LFReg_Register(VTable_registry, (Obj*)klass, (Obj*)vtable);
-        DECREF(klass);
-        return retval;
-    }
-}
-
-VTable*
-VTable_fetch_vtable(String *class_name) {
-    VTable *vtable = NULL;
-    if (VTable_registry != NULL) {
-        vtable = (VTable*)LFReg_Fetch(VTable_registry, (Obj*)class_name);
-    }
-    return vtable;
-}
-
-void
-VTable_Add_Host_Method_Alias_IMP(VTable *self, const char *alias,
-                             const char *meth_name) {
-    Method *method = S_find_method(self, meth_name);
-    if (!method) {
-        fprintf(stderr, "Method %s not found\n", meth_name);
-        abort();
-    }
-    method->host_alias = Str_newf("%s", alias);
-}
-
-void
-VTable_Exclude_Host_Method_IMP(VTable *self, const char *meth_name) {
-    Method *method = S_find_method(self, meth_name);
-    if (!method) {
-        fprintf(stderr, "Method %s not found\n", meth_name);
-        abort();
-    }
-    method->is_excluded = true;
-}
-
-static Method*
-S_find_method(VTable *self, const char *name) {
-    size_t   name_len = strlen(name);
-    uint32_t size     = VA_Get_Size(self->methods);
-
-    for (uint32_t i = 0; i < size; i++) {
-        Method *method = (Method*)VA_Fetch(self->methods, i);
-        if (Str_Equals_Utf8(method->name, name, name_len)) {
-            return method;
-        }
-    }
-
-    return NULL;
-}
-
-static size_t parcel_count;
-
-static int32_t
-S_claim_parcel_id(void) {
-    // TODO: use ordinary cas rather than cas_ptr.
-    union { size_t num; void *ptr; } old_value;
-    union { size_t num; void *ptr; } new_value;
-
-    bool succeeded = false;
-    do {
-        old_value.num = parcel_count;
-        new_value.num = old_value.num + 1;
-        succeeded = Atomic_cas_ptr((void*volatile*)&parcel_count,
-                                   old_value.ptr, new_value.ptr);
-    } while (!succeeded);
-
-    return new_value.num;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/VTable.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/VTable.cfh b/clownfish/runtime/core/Clownfish/VTable.cfh
deleted file mode 100644
index 97e5cf6..0000000
--- a/clownfish/runtime/core/Clownfish/VTable.cfh
+++ /dev/null
@@ -1,155 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Virtual method dispatch table.
- *
- * VTables, which are the first element in any Clownfish object, are actually
- * objects themselves.  (Their first element is a VTable which describes the
- * behavior of VTables.)
- */
-
-class Clownfish::VTable inherits Clownfish::Obj {
-
-    VTable            *parent;
-    String            *name;
-    uint32_t           flags;
-    int32_t            parcel_id;
-    size_t             obj_alloc_size;
-    size_t             vt_alloc_size;
-    VArray            *methods;
-    cfish_method_t[1]  method_ptrs; /* flexible array */
-
-    inert LockFreeRegistry *registry;
-    inert size_t offset_of_parent;
-
-    inert void
-    bootstrap(const cfish_VTableSpec *specs, size_t num_specs);
-
-    /** Return a singleton.  If a VTable can be found in the registry based on
-     * the supplied class name, it will be returned.  Otherwise, a new VTable
-     * will be created using [parent] as a base.
-     *
-     * If [parent] is NULL, an attempt will be made to find it using
-     * VTable_find_parent_class().  If the attempt fails, an error will
-     * result.
-     */
-    inert VTable*
-    singleton(String *class_name, VTable *parent);
-
-    /** Register a vtable, so that it can be retrieved by class name.
-     *
-     * TODO: Move this functionality to some kind of class loader.
-     *
-     * @return true on success, false if the class was already registered.
-     */
-    inert bool
-    add_to_registry(VTable *vtable);
-
-    inert bool
-    add_alias_to_registry(VTable *vtable, const char *alias_ptr,
-                          size_t alias_len);
-
-    /** Initialize the registry.
-     */
-    inert void
-    init_registry();
-
-    /** Tell the host about the new class.
-     */
-    inert void
-    register_with_host(VTable *vtable, VTable *parent);
-
-    /** Find a registered class and return its vtable.  May return NULL if the
-     * class is not registered.
-     */
-    inert nullable VTable*
-    fetch_vtable(String *class_name);
-
-    /** Given a class name, return the name of a parent class which descends
-     * from Clownfish::Obj, or NULL if such a class can't be found.
-     */
-    inert nullable String*
-    find_parent_class(String *class_name);
-
-    /** List all of the methods defined directly within a host subclass.
-     */
-    inert incremented VArray*
-    fresh_host_methods(String *class_name);
-
-    /** Replace a function pointer in the VTable.
-     */
-    void
-    Override(VTable *self, cfish_method_t method_ptr, size_t offset);
-
-    /** Create an empty object of the type defined by the VTable: allocate,
-     * assign its vtable and give it an initial refcount of 1.  The caller is
-     * responsible for initialization.
-     */
-    Obj*
-    Make_Obj(VTable *self);
-
-    /** Take a raw memory allocation which is presumed to be of adequate size,
-     * assign its vtable and give it an initial refcount of 1.
-     */
-    Obj*
-    Init_Obj(VTable *self, void *allocation);
-
-    /** Create a new object to go with the supplied host object.
-     */
-    Obj*
-    Foster_Obj(VTable *self, void *host_obj);
-
-    void
-    Add_Host_Method_Alias(VTable *self, const char *alias,
-                          const char *meth_name);
-
-    void
-    Exclude_Host_Method(VTable *self, const char *meth_name);
-
-    String*
-    Get_Name(VTable *self);
-
-    VTable*
-    Get_Parent(VTable *self);
-
-    size_t
-    Get_Obj_Alloc_Size(VTable *self);
-
-    VArray*
-    Get_Methods(VTable *self);
-
-    public incremented VTable*
-    Clone(VTable *self);
-
-    incremented Obj*
-    Inc_RefCount(VTable *self);
-
-    uint32_t
-    Dec_RefCount(VTable *self);
-
-    uint32_t
-    Get_RefCount(VTable *self);
-
-    void*
-    To_Host(VTable *self);
-
-    public void
-    Destroy(VTable *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/TestClownfish.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/TestClownfish.c b/clownfish/runtime/core/TestClownfish.c
deleted file mode 100644
index a946163..0000000
--- a/clownfish/runtime/core/TestClownfish.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-void
-testcfish_init_parcel() {
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/TestClownfish.cfp
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/TestClownfish.cfp b/clownfish/runtime/core/TestClownfish.cfp
deleted file mode 100644
index f1c9411..0000000
--- a/clownfish/runtime/core/TestClownfish.cfp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "name": "TestClownfish",
-    "nickname": "TestCfish",
-    "version": "v0.3.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/.gitignore
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/.gitignore b/clownfish/runtime/perl/.gitignore
deleted file mode 100644
index 09876c2..0000000
--- a/clownfish/runtime/perl/.gitignore
+++ /dev/null
@@ -1,16 +0,0 @@
-*.pod
-/Build
-/Charmony.pm
-/MYMETA.json
-/MYMETA.yml
-/_build/
-/autogen/
-/blib/
-/charmonizer
-/charmonize.c
-/charmony.h
-/lib/Clownfish.c
-/lib/Clownfish.xs
-/ppport.h
-/typemap
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/Build.PL
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/Build.PL b/clownfish/runtime/perl/Build.PL
deleted file mode 100644
index c449d2a..0000000
--- a/clownfish/runtime/perl/Build.PL
+++ /dev/null
@@ -1,73 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use 5.008003;
-use strict;
-use warnings;
-use lib 'buildlib';
-use File::Spec::Functions qw( catdir );
-use Clownfish::Build;
-
-my @BASE_PATH        = Clownfish::Build->cf_base_path;
-my $CORE_SOURCE_DIR  = catdir( @BASE_PATH, 'core' );
-my $XS_SOURCE_DIR    = 'xs';
-
-my $builder = Clownfish::Build->new(
-    module_name => 'Clownfish',
-    license     => 'apache',
-    dist_author =>
-        'The Apache Lucy Project <dev at lucy dot apache dot org>',
-    dist_version       => '0.3.0',
-    dist_abstract      => 'Clownfish Runtime',
-    requires           => { 'perl' => '5.8.3', },
-    configure_requires => { 'Module::Build' => 0.280801 },
-    build_requires     => {
-        'Module::Build'      => 0.280801,
-        'ExtUtils::CBuilder' => 0.21,
-        'ExtUtils::ParseXS'  => 2.18,
-        'Devel::PPPort'      => 3.13,
-    },
-    meta_merge => { keywords => [qw( clownfish )], },
-    meta_add   => {
-        resources => {
-            homepage   => 'http://lucy.apache.org',
-            repository => 'http://git-wip-us.apache.org/repos/asf/lucy.git',
-            bugtracker => 'https://issues.apache.org/jira/browse/LUCY',
-        },
-    },
-    include_dirs => [
-        $XS_SOURCE_DIR,
-    ],
-    clownfish_params => {
-        source => [
-            $CORE_SOURCE_DIR,
-            $XS_SOURCE_DIR,
-        ],
-    },
-    extra_compiler_flags => '-DCFP_CFISH -DCFP_TESTCFISH',
-    add_to_cleanup => [
-        qw(
-            Clownfish-*
-            MANIFEST.bak
-            perltidy.ERR
-            *.pdb
-            *.manifest
-            ),
-    ],
-);
-
-$builder->create_build_script();
-
-__END__

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/INSTALL
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/INSTALL b/clownfish/runtime/perl/INSTALL
deleted file mode 100644
index 60185e0..0000000
--- a/clownfish/runtime/perl/INSTALL
+++ /dev/null
@@ -1,15 +0,0 @@
-Installing the Clownfish runtime with Perl bindings
-===================================================
-
-To install the Clownfish runtime as a suite of Perl modules, run the following
-commands:
-
-    perl Build.PL
-    perl Build
-    perl Build test
-    perl Build install
-
-Module::Build is required.  Since Perl 5.10.0, Module::Build has been bundled
-with the Perl core, but on older systems it may be necessary to install it
-from CPAN first.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/MANIFEST
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/MANIFEST b/clownfish/runtime/perl/MANIFEST
deleted file mode 100644
index b156cfa..0000000
--- a/clownfish/runtime/perl/MANIFEST
+++ /dev/null
@@ -1,7 +0,0 @@
-# If you opened this file because "./Build distclean" spawned numerous
-# about files not present in MANIFEST, the solution is to run "./Build
-# realclean" instead.
-#
-# We do not maintain MANIFEST during development; if necessary, it will be
-# autogenerated when we build the CPAN tarball.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/MANIFEST.SKIP
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/MANIFEST.SKIP b/clownfish/runtime/perl/MANIFEST.SKIP
deleted file mode 100644
index 5aedf98..0000000
--- a/clownfish/runtime/perl/MANIFEST.SKIP
+++ /dev/null
@@ -1,64 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# cvs files and directories
-\bCVS\b
-,v$
-
-# all object files
-\.o
-
-# Module::Build generated files and dirs.
-^Build$
-^blib/
-^_build
-^MYMETA.yml$
-
-# autogenerated by custom Build.PL
-Clownfish\.xs$
-^typemap$
-
-# Don't ship developer-only tests.
-038-lock_free_registry\.t
-801-pod_checker\.t
-
-# Makemaker generated files and dirs.
-^MANIFEST\.
-^Makefile$
-^Makefile\.old$
-^MakeMaker-\d
-pm_to_blib
-
-# hidden files
-^\.
-/\.
-
-# Apple window status files
-\.DS_Store
-
-# vim swap files
-\.swp$
-
-# log files
-\.log$
-
-# various detritus
-^helper
-^_Inline
-\.gz$
-\.ERR$
-
-^MYMETA.yml$
-^MYMETA\.json$


[lucy-commits] [54/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Update SortExternal docs.

Posted by ma...@apache.org.
Update SortExternal docs.

Modify summary to reflect the fact that SortExternal now only sorts
objects rather than arbitrary data.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/c1590935
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/c1590935
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/c1590935

Branch: refs/heads/sortex_ptr_only
Commit: c15909359dcb1cce9ea1f5b2ba0f0e10f0114784
Parents: 00181bd
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jan 22 14:06:43 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 16:06:30 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Util/SortExternal.cfh | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/c1590935/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index 5ffb44c..7e8439b 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -18,22 +18,22 @@ parcel Lucy;
 
 /** Abstract external sorter.
  *
- * SortExternal objects are sort pools which allow you to sort large amounts
- * of data.  To achieve this, you Feed() all values into the SortExternal
- * object, Flip() the object from write mode to read mode, then Fetch() the
- * values one at a time in sorted order.
+ * SortExternal objects are sort pools which allow you to sort huge
+ * collections of elements.  To achieve this, you Feed() all items into the
+ * SortExternal object, Flip() it from write mode to read mode, then Fetch()
+ * the elements one at a time in sorted order.
  *
- * It's expected that the total memory footprint of the sortable objects will
- * eventually exceed a specified threshold; at that point, the SortExternal
- * object will call the abstract method Flush().  It's expected that Flush()
- * implementations will empty out the current sort buffer, write a sorted "run"
- * to external storage, and add a new child SortExternal object to the top
- * level object's "runs" array to represent the flushed content.
+ * It's expected that the total memory footprint of the buffered sortable
+ * items will eventually exceed a specified threshold; at that point, the
+ * SortExternal object will call the abstract method Flush().  It's expected
+ * that Flush() implementations will empty out the current buffer, write a
+ * sorted "run" to external storage, and add a new child SortExternal object
+ * to the top level object's "runs" array to represent the flushed content.
  *
- * During the read phase, the child objects retrieve values from external
- * storage by calling the abstract method Refill().  The top-level
+ * During the read phase, the child sortex objects retrieve elements from
+ * external storage by calling the abstract method Refill().  The top-level
  * SortExternal object then interleaves multiple sorted streams to produce a
- * single unified stream of sorted values.
+ * single unified stream of sorted items.
  */
 abstract class Lucy::Util::SortExternal nickname SortEx
     inherits Clownfish::Obj {
@@ -63,7 +63,7 @@ abstract class Lucy::Util::SortExternal nickname SortEx
      *
      * Presumably this entails sorting everything, writing the sorted elements
      * to disk, spawning a child object to represent those elements, and
-     * adding that child to the top level object via Add_Run().
+     * adding that child to the top-level object via Add_Run().
      */
     abstract void
     Flush(SortExternal *self);
@@ -100,8 +100,8 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     void
     Shrink(SortExternal *self);
 
-    /** Refill the buffer of a run.  Will only be called on child objects, not
-     * the main object.
+    /** Refill the buffer of a run.  Will only be called on child sortex
+     * objects, not the main object.
      */
     abstract uint32_t
     Refill(SortExternal *self);


[lucy-commits] [34/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Set -fvisibility flag via charmonizer

Posted by ma...@apache.org.
Set -fvisibility flag via charmonizer


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/87581caf
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/87581caf
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/87581caf

Branch: refs/heads/sortex_ptr_only
Commit: 87581caf5ab389700f9366c5af05a1fc245046ab
Parents: f24561f
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Aug 17 17:54:16 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 22 23:05:37 2014 +0200

----------------------------------------------------------------------
 common/charmonizer.c    | 3 ++-
 common/charmonizer.main | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/87581caf/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/common/charmonizer.c b/common/charmonizer.c
index 773b578..2be5f43 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -7084,6 +7084,8 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) {
 
     chaz_CFlags_add_define(extra_cflags, "CFP_LUCY", NULL);
     chaz_CFlags_add_define(extra_cflags, "CFP_TESTLUCY", NULL);
+
+    chaz_CFlags_hide_symbols(extra_cflags);
 }
 
 static int
@@ -7202,7 +7204,6 @@ S_write_makefile(struct chaz_CLIArgs *chaz_args,
     chaz_CFlags_enable_debugging(makefile_cflags);
     chaz_CFlags_disable_strict_aliasing(makefile_cflags);
     chaz_CFlags_compile_shared_library(makefile_cflags);
-    chaz_CFlags_hide_symbols(makefile_cflags);
     if (chaz_args->code_coverage) {
         chaz_CFlags_enable_code_coverage(makefile_cflags);
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/87581caf/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index f698987..1263de0 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -86,6 +86,8 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) {
 
     chaz_CFlags_add_define(extra_cflags, "CFP_LUCY", NULL);
     chaz_CFlags_add_define(extra_cflags, "CFP_TESTLUCY", NULL);
+
+    chaz_CFlags_hide_symbols(extra_cflags);
 }
 
 static int
@@ -204,7 +206,6 @@ S_write_makefile(struct chaz_CLIArgs *chaz_args,
     chaz_CFlags_enable_debugging(makefile_cflags);
     chaz_CFlags_disable_strict_aliasing(makefile_cflags);
     chaz_CFlags_compile_shared_library(makefile_cflags);
-    chaz_CFlags_hide_symbols(makefile_cflags);
     if (chaz_args->code_coverage) {
         chaz_CFlags_enable_code_coverage(makefile_cflags);
     }


[lucy-commits] [21/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC.xs
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC.xs b/clownfish/compiler/perl/lib/Clownfish/CFC.xs
deleted file mode 100644
index 410658d..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC.xs
+++ /dev/null
@@ -1,2556 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#include "CFC.h"
-
-/* Rather than provide an XSUB for each accessor, we can use one multipath
- * accessor function per class, with several Perl-space aliases.  All set
- * functions have odd-numbered aliases, and all get functions have
- * even-numbered aliases.  These two macros serve as bookends for the switch
- * function.
- */
-#define START_SET_OR_GET_SWITCH \
-    SV *retval = &PL_sv_undef; \
-    /* If called as a setter, make sure the extra arg is there. */ \
-    if (ix % 2 == 1) { \
-        if (items != 2) { croak("usage: $object->set_xxxxxx($val)"); } \
-    } \
-    else { \
-        if (items != 1) { croak("usage: $object->get_xxxxx()"); } \
-    } \
-    switch (ix) {
-
-#define END_SET_OR_GET_SWITCH \
-        default: croak("Internal error. ix: %d", (int)ix); \
-    } \
-    if (ix % 2 == 0) { \
-        XPUSHs(sv_2mortal(retval)); \
-        XSRETURN(1); \
-    } \
-    else { \
-        XSRETURN(0); \
-    }
-
-static SV*
-S_cfcbase_to_perlref(void *thing) {
-    SV *ref = newSV(0);
-    if (thing) {
-        const char *klass = CFCBase_get_cfc_class((CFCBase*)thing);
-        CFCBase_incref((CFCBase*)thing);
-        sv_setref_pv(ref, klass, (void*)thing);
-    }
-    return ref;
-}
-
-// Transform a NULL-terminated array of char* into a Perl arrayref.
-static SV*
-S_string_array_to_av(const char **strings) {
-    AV *av = newAV();
-    for (size_t i = 0; strings[i] != NULL; i++) {
-        SV *val = newSVpvn(strings[i], strlen(strings[i]));
-        av_store(av, i, val);
-    }
-    SV *retval = newRV_noinc((SV*)av);
-    return retval;
-}
-
-// Transform a NULL-terminated array of CFCBase* into a Perl arrayref.
-static SV*
-S_array_of_cfcbase_to_av(CFCBase **things) {
-    AV *av = newAV();
-    for (size_t i = 0; things[i] != NULL; i++) {
-        SV *val = S_cfcbase_to_perlref(things[i]);
-        av_store(av, i, val);
-    }
-    SV *retval = newRV((SV*)av);
-    SvREFCNT_dec(av);
-    return retval;
-}
-
-// Transform a Perl arrayref into a NULL-terminated array of CFCBase*.
-static CFCBase**
-S_av_to_array_of_cfcbase(SV *ref, const char *class_name) {
-    if (!SvROK(ref)) { croak("Not an arrayref"); }
-    SV *sv = SvRV(ref);
-    if (SvTYPE(sv) != SVt_PVAV) { croak("Not an arrayref"); }
-    AV *av = (AV*)sv;
-    size_t size = av_len(av) + 1;
-    CFCBase **retval = (CFCBase**)CALLOCATE(size + 1, sizeof(CFCBase*));
-    for (size_t i = 0; i < size; i++) {
-        SV **elem = av_fetch(av, i, 0);
-        if (!*elem || !sv_derived_from(*elem, class_name)) {
-            croak("Array element not of type %s", class_name);
-        }
-        IV objint = SvIV((SV*)SvRV(*elem));
-        retval[i] = INT2PTR(CFCBase*, objint);
-    }
-    return retval;
-}
-
-static SV*
-S_sv_eat_c_string(char *string) {
-    if (string) {
-        SV *sv = newSVpvn(string, strlen(string));
-        FREEMEM(string);
-        return sv;
-    }
-    else {
-        return newSV(0);
-    }
-}
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Base
-
-void
-DESTROY(self)
-    CFCBase *self;
-PPCODE:
-    CFCBase_decref((CFCBase*)self);
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::CBlock
-
-SV*
-_new(contents)
-    const char *contents;
-CODE:
-    CFCCBlock *self = CFCCBlock_new(contents);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCCBlock *self;
-ALIAS:
-    get_contents = 2
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *contents = CFCCBlock_get_contents(self);
-                retval = newSVpvn(contents, strlen(contents));
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Class
-
-SV*
-_create(parcel, exposure_sv, class_name_sv, cnick_sv, micro_sym_sv, docucomment, file_spec, parent_class_name_sv, is_final, is_inert)
-    CFCParcel *parcel;
-    SV *exposure_sv;
-    SV *class_name_sv;
-    SV *cnick_sv;
-    SV *micro_sym_sv;
-    CFCDocuComment *docucomment;
-    CFCFileSpec *file_spec;
-    SV *parent_class_name_sv;
-    bool is_final;
-    bool is_inert;
-CODE:
-    const char *exposure =
-        SvOK(exposure_sv) ? SvPV_nolen(exposure_sv) : NULL;
-    const char *class_name =
-        SvOK(class_name_sv) ? SvPV_nolen(class_name_sv) : NULL;
-    const char *cnick =
-        SvOK(cnick_sv) ? SvPV_nolen(cnick_sv) : NULL;
-    const char *micro_sym =
-        SvOK(micro_sym_sv) ? SvPV_nolen(micro_sym_sv) : NULL;
-    const char *parent_class_name =
-        SvOK(parent_class_name_sv) ? SvPV_nolen(parent_class_name_sv) : NULL;
-    CFCClass *self = CFCClass_create(parcel, exposure, class_name, cnick,
-                                     micro_sym, docucomment, file_spec,
-                                     parent_class_name, is_final, is_inert);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_fetch_singleton(parcel, class_name)
-    CFCParcel *parcel;
-    const char *class_name;
-CODE:
-    CFCClass *klass = CFCClass_fetch_singleton(parcel, class_name);
-    RETVAL = S_cfcbase_to_perlref(klass);
-OUTPUT: RETVAL
-
-void
-_clear_registry(...)
-PPCODE:
-    CHY_UNUSED_VAR(items);
-    CFCClass_clear_registry();
-
-void
-add_child(self, child)
-    CFCClass *self;
-    CFCClass *child;
-PPCODE:
-    CFCClass_add_child(self, child);
-
-void
-add_member_var(self, var)
-    CFCClass *self;
-    CFCVariable *var;
-PPCODE:
-    CFCClass_add_member_var(self, var);
-
-void
-add_function(self, func)
-    CFCClass *self;
-    CFCFunction *func;
-PPCODE:
-    CFCClass_add_function(self, func);
-
-void
-add_method(self, method)
-    CFCClass *self;
-    CFCMethod *method;
-PPCODE:
-    CFCClass_add_method(self, method);
-
-void
-grow_tree(self)
-    CFCClass *self;
-PPCODE:
-    CFCClass_grow_tree(self);
-
-void
-add_inert_var(self, var)
-    CFCClass *self;
-    CFCVariable *var;
-PPCODE:
-    CFCClass_add_inert_var(self, var);
-
-SV*
-function(self, sym)
-    CFCClass *self;
-    const char *sym;
-CODE:
-    CFCFunction *func = CFCClass_function(self, sym);
-    RETVAL = S_cfcbase_to_perlref(func);
-OUTPUT: RETVAL
-
-SV*
-method(self, sym)
-    CFCClass *self;
-    const char *sym;
-CODE:
-    CFCMethod *method = CFCClass_method(self, sym);
-    RETVAL = S_cfcbase_to_perlref(method);
-OUTPUT: RETVAL
-
-SV*
-fresh_method(self, sym)
-    CFCClass *self;
-    const char *sym;
-CODE:
-    CFCMethod *method = CFCClass_fresh_method(self, sym);
-    RETVAL = S_cfcbase_to_perlref(method);
-OUTPUT: RETVAL
-
-void
-resolve_types(self, classes_sv)
-    CFCClass *self;
-    SV *classes_sv;
-PPCODE:
-    CFCClass **classes
-        = (CFCClass**)S_av_to_array_of_cfcbase(classes_sv,
-                                               "Clownfish::CFC::Model::Class");
-    CFCClass_resolve_types(self, classes);
-    FREEMEM(classes);
-
-void
-_set_or_get(self, ...)
-    CFCClass *self;
-ALIAS:
-    get_cnick             = 2
-    set_parent            = 5
-    get_parent            = 6
-    get_path_part         = 10
-    get_parent_class_name = 12
-    final                 = 14
-    inert                 = 16
-    get_struct_sym        = 18
-    full_struct_sym       = 20
-    short_vtable_var      = 22
-    full_vtable_var       = 24
-    include_h             = 28
-    get_docucomment       = 30
-    children              = 32
-    functions             = 34
-    methods               = 36
-    member_vars           = 38
-    inert_vars            = 40
-    tree_to_ladder        = 42
-    fresh_methods         = 44
-    fresh_member_vars     = 46
-    privacy_symbol        = 48
-    included              = 50
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *value = CFCClass_get_cnick(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 5: {
-                CFCClass *parent = NULL;
-                if (SvOK(ST(1))
-                    && sv_derived_from(ST(1), "Clownfish::CFC::Model::Class")
-                   ) {
-                    IV objint = SvIV((SV*)SvRV(ST(1)));
-                    parent = INT2PTR(CFCClass*, objint);
-                }
-                CFCClass_set_parent(self, parent);
-                break;
-            }
-        case 6: {
-                CFCClass *parent = CFCClass_get_parent(self);
-                retval = S_cfcbase_to_perlref(parent);
-                break;
-            }
-        case 10: {
-                const char *value = CFCClass_get_path_part(self);
-                retval = value ? newSVpvn(value, strlen(value)) : newSV(0);
-            }
-            break;
-        case 12: {
-                const char *value = CFCClass_get_parent_class_name(self);
-                retval = value ? newSVpvn(value, strlen(value)) : newSV(0);
-            }
-            break;
-        case 14:
-            retval = newSViv(CFCClass_final(self));
-            break;
-        case 16:
-            retval = newSViv(CFCClass_inert(self));
-            break;
-        case 18: {
-                const char *value = CFCClass_get_struct_sym(self);
-                retval = value ? newSVpvn(value, strlen(value)) : newSV(0);
-            }
-            break;
-        case 20: {
-                const char *value = CFCClass_full_struct_sym(self);
-                retval = value ? newSVpvn(value, strlen(value)) : newSV(0);
-            }
-            break;
-        case 22: {
-                const char *value = CFCClass_short_vtable_var(self);
-                retval = value ? newSVpvn(value, strlen(value)) : newSV(0);
-            }
-            break;
-        case 24: {
-                const char *value = CFCClass_full_vtable_var(self);
-                retval = value ? newSVpvn(value, strlen(value)) : newSV(0);
-            }
-            break;
-        case 28: {
-                const char *value = CFCClass_include_h(self);
-                retval = value ? newSVpvn(value, strlen(value)) : newSV(0);
-            }
-            break;
-        case 30: {
-                CFCDocuComment *docucomment = CFCClass_get_docucomment(self);
-                retval = S_cfcbase_to_perlref(docucomment);
-            }
-            break;
-        case 32:
-            retval = S_array_of_cfcbase_to_av(
-                (CFCBase**)CFCClass_children(self));
-            break;
-        case 34:
-            retval = S_array_of_cfcbase_to_av((CFCBase**)CFCClass_functions(self));
-            break;
-        case 36:
-            retval = S_array_of_cfcbase_to_av((CFCBase**)CFCClass_methods(self));
-            break;
-        case 38:
-            retval = S_array_of_cfcbase_to_av((CFCBase**)CFCClass_member_vars(self));
-            break;
-        case 40:
-            retval = S_array_of_cfcbase_to_av((CFCBase**)CFCClass_inert_vars(self));
-            break;
-        case 42: {
-                CFCClass **ladder = CFCClass_tree_to_ladder(self);
-                retval = S_array_of_cfcbase_to_av((CFCBase**)ladder);
-                FREEMEM(ladder);
-                break;
-            }
-        case 44: {
-                CFCMethod **fresh = CFCClass_fresh_methods(self);
-                retval = S_array_of_cfcbase_to_av((CFCBase**)fresh);
-                FREEMEM(fresh);
-                break;
-            }
-        case 46: {
-                CFCVariable **fresh = CFCClass_fresh_member_vars(self);
-                retval = S_array_of_cfcbase_to_av((CFCBase**)fresh);
-                FREEMEM(fresh);
-                break;
-            }
-        case 48: {
-                const char *value = CFCClass_privacy_symbol(self);
-                retval = value ? newSVpvn(value, strlen(value)) : newSV(0);
-            }
-            break;
-        case 50:
-            retval = newSViv(CFCClass_included(self));
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::DocuComment
-
-SV*
-parse(klass, text)
-    const char *klass;
-    const char *text;
-CODE:
-    if (strcmp(klass, "Clownfish::CFC::Model::DocuComment")) {
-        croak("No subclassing allowed");
-    }
-    CFCDocuComment *self = CFCDocuComment_parse(text);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCDocuComment *self;
-ALIAS:
-    get_description = 2
-    get_brief       = 4
-    get_long        = 6
-    get_param_names = 8
-    get_param_docs  = 10
-    get_retval      = 12
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *description = CFCDocuComment_get_description(self);
-                retval = newSVpvn(description, strlen(description));
-            }
-            break;
-        case 4: {
-                const char *brief = CFCDocuComment_get_brief(self);
-                retval = newSVpvn(brief, strlen(brief));
-            }
-            break;
-        case 6: {
-                const char *long_description = CFCDocuComment_get_long(self);
-                retval = newSVpvn(long_description, strlen(long_description));
-            }
-            break;
-        case 8: {
-                const char **names = CFCDocuComment_get_param_names(self);
-                retval = S_string_array_to_av(names);
-            }
-            break;
-        case 10: {
-                const char **docs = CFCDocuComment_get_param_docs(self);
-                retval = S_string_array_to_av(docs);
-            }
-            break;
-        case 12: {
-                const char *rv = CFCDocuComment_get_retval(self);
-                retval = rv ? newSVpvn(rv, strlen(rv)) : newSV(0);
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::File
-
-SV*
-_new(spec)
-    CFCFileSpec *spec;
-CODE:
-    CFCFile *self = CFCFile_new(spec);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-add_block(self, block)
-    CFCFile *self;
-    CFCBase *block;
-PPCODE:
-    CFCFile_add_block(self, block);
-
-void
-_set_or_get(self, ...)
-    CFCFile *self;
-ALIAS:
-    set_modified       = 1
-    get_modified       = 2
-    get_path_part      = 4
-    guard_name         = 6
-    guard_start        = 8
-    guard_close        = 10
-    blocks             = 12
-    classes            = 14
-    get_source_dir     = 16
-    included           = 18
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 1:
-            CFCFile_set_modified(self, !!SvTRUE(ST(1)));
-            break;
-        case 2:
-            retval = newSViv(CFCFile_get_modified(self));
-            break;
-        case 4: {
-                const char *value = CFCFile_get_path_part(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 6: {
-                const char *value = CFCFile_guard_name(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 8: {
-                const char *value = CFCFile_guard_start(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 10: {
-                const char *value = CFCFile_guard_close(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 12:
-            retval = S_array_of_cfcbase_to_av(CFCFile_blocks(self));
-            break;
-        case 14:
-            retval = S_array_of_cfcbase_to_av(
-                         (CFCBase**)CFCFile_classes(self));
-            break;
-        case 16: {
-                const char *value = CFCFile_get_source_dir(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 18:
-            retval = newSViv(CFCFile_included(self));
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-SV*
-_gen_path(self, base_dir = NULL)
-    CFCFile *self;
-    const char *base_dir;
-ALIAS:
-    c_path       = 1
-    h_path       = 2
-    cfh_path     = 3
-CODE:
-{
-    char *buf;
-    switch (ix) {
-        case 1:
-            buf = CFCFile_c_path(self, base_dir);
-            break;
-        case 2:
-            buf = CFCFile_h_path(self, base_dir);
-            break;
-        case 3:
-            buf = CFCFile_cfh_path(self, base_dir);
-            break;
-        default:
-            croak("unexpected ix value: %d", (int)ix);
-    }
-    RETVAL = newSVpvn(buf, strlen(buf));
-    FREEMEM(buf);
-}
-OUTPUT: RETVAL
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::FileSpec
-
-SV*
-_new(source_dir, path_part, is_included)
-    const char *source_dir;
-    const char *path_part;
-    bool is_included;
-CODE:
-    CFCFileSpec *self = CFCFileSpec_new(source_dir, path_part, is_included);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCFileSpec *self;
-ALIAS:
-    get_source_dir     = 2
-    get_path_part      = 4
-    included           = 6
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *value = CFCFileSpec_get_source_dir(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 4: {
-                const char *value = CFCFileSpec_get_path_part(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 6:
-            retval = newSViv(CFCFileSpec_included(self));
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Function
-
-SV*
-_new(parcel, exposure_sv, class_name_sv, class_cnick_sv, micro_sym_sv, return_type, param_list, docucomment, is_inline)
-    CFCParcel *parcel;
-    SV *exposure_sv;
-    SV *class_name_sv;
-    SV *class_cnick_sv;
-    SV *micro_sym_sv;
-    CFCType *return_type;
-    CFCParamList *param_list;
-    CFCDocuComment *docucomment;
-    int is_inline;
-CODE:
-    const char *exposure =
-        SvOK(exposure_sv) ? SvPV_nolen(exposure_sv) : NULL;
-    const char *class_name =
-        SvOK(class_name_sv) ? SvPV_nolen(class_name_sv) : NULL;
-    const char *class_cnick =
-        SvOK(class_cnick_sv) ? SvPV_nolen(class_cnick_sv) : NULL;
-    const char *micro_sym =
-        SvOK(micro_sym_sv) ? SvPV_nolen(micro_sym_sv) : NULL;
-    CFCFunction *self = CFCFunction_new(parcel, exposure, class_name,
-                                        class_cnick, micro_sym, return_type,
-                                        param_list, docucomment, is_inline);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-resolve_types(self, classes_sv)
-    CFCFunction *self;
-    SV *classes_sv;
-PPCODE:
-    CFCClass **classes
-        = (CFCClass**)S_av_to_array_of_cfcbase(classes_sv,
-                                               "Clownfish::CFC::Model::Class");
-    CFCFunction_resolve_types(self, classes);
-    FREEMEM(classes);
-
-void
-_set_or_get(self, ...)
-    CFCFunction *self;
-ALIAS:
-    get_return_type    = 2
-    get_param_list     = 4
-    get_docucomment    = 6
-    inline             = 8
-    void               = 10
-    full_func_sym      = 12
-    short_func_sym     = 14
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                CFCType *type = CFCFunction_get_return_type(self);
-                retval = S_cfcbase_to_perlref(type);
-            }
-            break;
-        case 4: {
-                CFCParamList *param_list = CFCFunction_get_param_list(self);
-                retval = S_cfcbase_to_perlref(param_list);
-            }
-            break;
-        case 6: {
-                CFCDocuComment *docucomment
-                    = CFCFunction_get_docucomment(self);
-                retval = S_cfcbase_to_perlref(docucomment);
-            }
-            break;
-        case 8:
-            retval = newSViv(CFCFunction_inline(self));
-            break;
-        case 10:
-            retval = newSViv(CFCFunction_void(self));
-            break;
-        case 12: {
-                const char *full_sym = CFCFunction_full_func_sym(self);
-                retval = newSVpv(full_sym, strlen(full_sym));
-            }
-            break;
-        case 14: {
-                const char *short_sym = CFCFunction_short_func_sym(self);
-                retval = newSVpv(short_sym, strlen(short_sym));
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Hierarchy
-
-SV*
-_new(dest)
-    const char *dest;
-CODE:
-    CFCHierarchy *self = CFCHierarchy_new(dest);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-add_source_dir(self, source_dir)
-    CFCHierarchy *self;
-    const char *source_dir;
-PPCODE:
-    CFCHierarchy_add_source_dir(self, source_dir);
-
-void
-add_include_dir(self, include_dir)
-    CFCHierarchy *self;
-    const char *include_dir;
-PPCODE:
-    CFCHierarchy_add_include_dir(self, include_dir);
-
-void
-build(self)
-    CFCHierarchy *self;
-PPCODE:
-    CFCHierarchy_build(self);
-
-int
-propagate_modified(self, ...)
-    CFCHierarchy *self;
-CODE:
-    int modified = items > 1 ? !!SvTRUE(ST(1)) : 0;
-    RETVAL = CFCHierarchy_propagate_modified(self, modified);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCHierarchy *self;
-ALIAS:
-    get_dest          = 2
-    get_include_dest  = 4
-    get_source_dest   = 6
-    files             = 8
-    ordered_classes   = 10
-    get_source_dirs   = 12
-    get_include_dirs  = 14
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *value = CFCHierarchy_get_dest(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 4: {
-                const char *value = CFCHierarchy_get_include_dest(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 6: {
-                const char *value = CFCHierarchy_get_source_dest(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 8:
-            retval = S_array_of_cfcbase_to_av(
-                (CFCBase**)CFCHierarchy_files(self));
-            break;
-        case 10: {
-                CFCClass **ladder = CFCHierarchy_ordered_classes(self);
-                retval = S_array_of_cfcbase_to_av((CFCBase**)ladder);
-                FREEMEM(ladder);
-            }
-            break;
-        case 12: {
-                const char **source_dirs = CFCHierarchy_get_source_dirs(self);
-                retval = S_string_array_to_av(source_dirs);
-            }
-            break;
-        case 14: {
-                const char **include_dirs = CFCHierarchy_get_include_dirs(self);
-                retval = S_string_array_to_av(include_dirs);
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Method
-
-SV*
-_new(parcel, exposure_sv, class_name_sv, class_cnick_sv, macro_sym, return_type, param_list, docucomment, is_final, is_abstract)
-    CFCParcel *parcel;
-    SV *exposure_sv;
-    SV *class_name_sv;
-    SV *class_cnick_sv;
-    const char *macro_sym;
-    CFCType *return_type;
-    CFCParamList *param_list;
-    CFCDocuComment *docucomment;
-    int is_final;
-    int is_abstract;
-CODE:
-    const char *exposure =
-        SvOK(exposure_sv) ? SvPV_nolen(exposure_sv) : NULL;
-    const char *class_name =
-        SvOK(class_name_sv) ? SvPV_nolen(class_name_sv) : NULL;
-    const char *class_cnick =
-        SvOK(class_cnick_sv) ? SvPV_nolen(class_cnick_sv) : NULL;
-    CFCMethod *self = CFCMethod_new(parcel, exposure, class_name, class_cnick,
-                                    macro_sym, return_type, param_list,
-                                    docucomment, is_final, is_abstract);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-int
-compatible(self, other)
-    CFCMethod *self;
-    CFCMethod *other;
-CODE:
-    RETVAL = CFCMethod_compatible(self, other);
-OUTPUT: RETVAL
-
-void
-override(self, other)
-    CFCMethod *self;
-    CFCMethod *other;
-PPCODE:
-    CFCMethod_override(self, other);
-
-SV*
-finalize(self)
-    CFCMethod *self;
-CODE:
-    CFCMethod *finalized = CFCMethod_finalize(self);
-    RETVAL = S_cfcbase_to_perlref(finalized);
-    CFCBase_decref((CFCBase*)finalized);
-OUTPUT: RETVAL
-
-void
-resolve_types(self, classes_sv)
-    CFCMethod *self;
-    SV *classes_sv;
-PPCODE:
-    CFCClass **classes
-        = (CFCClass**)S_av_to_array_of_cfcbase(classes_sv,
-                                               "Clownfish::CFC::Model::Class");
-    CFCMethod_resolve_types(self, classes);
-    FREEMEM(classes);
-
-void
-exclude_from_host(self)
-    CFCMethod *self;
-PPCODE:
-    CFCMethod_exclude_from_host(self);
-
-SV*
-_various_method_syms(self, invoker)
-    CFCMethod *self;
-    CFCClass  *invoker;
-ALIAS:
-    short_method_sym  = 1
-    full_method_sym   = 2
-    full_offset_sym   = 3
-    short_typedef     = 4
-    full_typedef      = 5
-CODE:
-    char *buf;
-    switch (ix) {
-        case 1:
-            buf = CFCMethod_short_method_sym(self, invoker);
-            break;
-        case 2:
-            buf = CFCMethod_full_method_sym(self, invoker);
-            break;
-        case 3:
-            buf = CFCMethod_full_offset_sym(self, invoker);
-            break;
-        case 4:
-            buf = CFCMethod_short_typedef(self, invoker);
-            break;
-        case 5:
-            buf = CFCMethod_full_typedef(self, invoker);
-            break;
-        default: croak("Unexpected ix: %d", (int)ix);
-    }
-    RETVAL = newSVpvn(buf, strlen(buf));
-    FREEMEM(buf);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCMethod *self;
-ALIAS:
-    get_macro_sym      = 2
-    full_override_sym  = 10
-    abstract           = 12
-    novel              = 14
-    final              = 16
-    self_type          = 18
-    set_host_alias     = 19
-    get_host_alias     = 20
-    excluded_from_host = 22
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *macro_sym = CFCMethod_get_macro_sym(self);
-                retval = newSVpvn(macro_sym, strlen(macro_sym));
-            }
-            break;
-        case 10: {
-                const char *value = CFCMethod_full_override_sym(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 12:
-            retval = newSViv(CFCMethod_abstract(self));
-            break;
-        case 14:
-            retval = newSViv(CFCMethod_novel(self));
-            break;
-        case 16:
-            retval = newSViv(CFCMethod_final(self));
-            break;
-        case 18: {
-                CFCType *type = CFCMethod_self_type(self);
-                retval = S_cfcbase_to_perlref(type);
-            }
-            break;
-        case 19: {
-                const char *value = SvOK(ST(1)) ? SvPVutf8_nolen(ST(1)) : NULL;
-                CFCMethod_set_host_alias(self, value);
-            }
-            break;
-        case 20: {
-                const char *value = CFCMethod_get_host_alias(self);
-                if (value) {
-                    retval = newSVpvn(value, strlen(value));
-                }
-            }
-            break;
-        case 22:
-            retval = newSViv(CFCMethod_excluded_from_host(self));
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::ParamList
-
-SV*
-_new(klass, variadic)
-    int variadic;
-CODE:
-    CFCParamList *self = CFCParamList_new(variadic);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-add_param(self, variable, value_sv)
-    CFCParamList *self;
-    CFCVariable  *variable;
-    SV *value_sv;
-PPCODE:
-    const char *value = SvOK(value_sv) ? SvPV_nolen(value_sv) : NULL;
-    CFCParamList_add_param(self, variable, value);
-
-void
-resolve_types(self, classes_sv)
-    CFCParamList *self;
-    SV *classes_sv;
-PPCODE:
-    CFCClass **classes
-        = (CFCClass**)S_av_to_array_of_cfcbase(classes_sv,
-                                               "Clownfish::CFC::Model::Class");
-    CFCParamList_resolve_types(self, classes);
-    FREEMEM(classes);
-
-void
-_set_or_get(self, ...)
-    CFCParamList *self;
-ALIAS:
-    get_variables      = 2
-    get_initial_values = 4
-    variadic           = 6
-    num_vars           = 8
-    to_c               = 10
-    name_list          = 12
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                AV *av = newAV();
-                CFCVariable **vars = CFCParamList_get_variables(self);
-                size_t num_vars = CFCParamList_num_vars(self);
-                for (size_t i = 0; i < num_vars; i++) {
-                    SV *ref = S_cfcbase_to_perlref(vars[i]);
-                    av_store(av, i, ref);
-                }
-                retval = newRV((SV*)av);
-                SvREFCNT_dec(av);
-                break;
-            }
-        case 4: {
-                AV *av = newAV();
-                const char **values = CFCParamList_get_initial_values(self);
-                size_t num_vars = CFCParamList_num_vars(self);
-                for (size_t i = 0; i < num_vars; i++) {
-                    if (values[i] != NULL) {
-                        SV *val_sv = newSVpvn(values[i], strlen(values[i]));
-                        av_store(av, i, val_sv);
-                    }
-                    else {
-                        av_store(av, i, newSV(0));
-                    }
-                }
-                retval = newRV((SV*)av);
-                SvREFCNT_dec(av);
-                break;
-            }
-        case 6:
-            retval = newSViv(CFCParamList_variadic(self));
-            break;
-        case 8:
-            retval = newSViv(CFCParamList_num_vars(self));
-            break;
-        case 10: {
-                const char *value = CFCParamList_to_c(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-        case 12: {
-                const char *value = CFCParamList_name_list(self);
-                retval = newSVpv(value, strlen(value));
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Parcel
-
-SV*
-_new(name_sv, cnick_sv, version, is_included)
-    SV *name_sv;
-    SV *cnick_sv;
-    CFCVersion *version;
-    bool is_included;
-CODE:
-    const char *name  = SvOK(name_sv)  ? SvPV_nolen(name_sv)  : NULL;
-    const char *cnick = SvOK(cnick_sv) ? SvPV_nolen(cnick_sv) : NULL;
-    CFCParcel *self = CFCParcel_new(name, cnick, version, is_included);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_from_file(path, is_included)
-    const char *path;
-    bool is_included;
-CODE:
-    CFCParcel *self = CFCParcel_new_from_file(path, is_included);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_from_json(json, is_included)
-    const char *json;
-    bool is_included;
-CODE:
-    CFCParcel *self = CFCParcel_new_from_json(json, is_included);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-fetch(unused, name_sv)
-    SV *unused;
-    SV *name_sv;
-CODE:
-    CHY_UNUSED_VAR(unused);
-    const char *name  = SvOK(name_sv)  ? SvPV_nolen(name_sv)  : NULL;
-    CFCParcel *self = CFCParcel_fetch(name);
-    RETVAL = S_cfcbase_to_perlref(self);
-OUTPUT: RETVAL
-
-
-void
-register(self)
-    CFCParcel *self;
-PPCODE:
-    CFCParcel_register(self);
-
-int
-equals(self, other)
-    CFCParcel *self;
-    CFCParcel *other;
-CODE:
-    RETVAL = CFCParcel_equals(self, other);
-OUTPUT: RETVAL
-
-SV*
-default_parcel(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    CFCParcel *default_parcel = CFCParcel_default_parcel();
-    RETVAL = S_cfcbase_to_perlref(default_parcel);
-OUTPUT: RETVAL
-
-SV*
-all_parcels(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    CFCParcel **all_parcels = CFCParcel_all_parcels();
-    RETVAL = S_array_of_cfcbase_to_av((CFCBase**)all_parcels);
-    FREEMEM(all_parcels);
-OUTPUT: RETVAL
-
-void
-add_dependent_parcel(self, dependent)
-    CFCParcel *self;
-    CFCParcel *dependent;
-PPCODE:
-    CFCParcel_add_dependent_parcel(self, dependent);
-
-void
-add_inherited_parcel(self, inherited)
-    CFCParcel *self;
-    CFCParcel *inherited;
-PPCODE:
-    CFCParcel_add_inherited_parcel(self, inherited);
-
-void
-reap_singletons(...)
-PPCODE:
-    CHY_UNUSED_VAR(items);
-    CFCParcel_reap_singletons();
-
-void
-_set_or_get(self, ...)
-    CFCParcel *self;
-ALIAS:
-    get_name   = 2
-    get_cnick  = 4
-    get_prefix = 6
-    get_Prefix = 8
-    get_PREFIX = 10
-    get_version = 12
-    included    = 14
-    dependent_parcels = 16
-    inherited_parcels = 18
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *name = CFCParcel_get_name(self);
-                retval = newSVpvn(name, strlen(name));
-            }
-            break;
-        case 4: {
-                const char *cnick = CFCParcel_get_cnick(self);
-                retval = newSVpvn(cnick, strlen(cnick));
-            }
-            break;
-        case 6: {
-                const char *value = CFCParcel_get_prefix(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 8: {
-                const char *value = CFCParcel_get_Prefix(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 10: {
-                const char *value = CFCParcel_get_PREFIX(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 12: {
-                CFCVersion *value = CFCParcel_get_version(self);
-                retval = S_cfcbase_to_perlref(value);
-            }
-            break;
-        case 14:
-            retval = newSViv(CFCParcel_included(self));
-            break;
-        case 16: {
-                CFCParcel **parcels = CFCParcel_dependent_parcels(self);
-                retval = S_array_of_cfcbase_to_av((CFCBase**)parcels);
-                FREEMEM(parcels);
-            }
-            break;
-        case 18: {
-                CFCParcel **parcels = CFCParcel_inherited_parcels(self);
-                retval = S_array_of_cfcbase_to_av((CFCBase**)parcels);
-                FREEMEM(parcels);
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Symbol
-
-SV*
-_new(parcel, exposure, class_name_sv, class_cnick_sv, micro_sym_sv)
-    CFCParcel *parcel;
-    const char *exposure;
-    SV *class_name_sv;
-    SV *class_cnick_sv;
-    SV *micro_sym_sv;
-CODE:
-    const char *class_name  = SvOK(class_name_sv)
-                              ? SvPV_nolen(class_name_sv)
-                              : NULL;
-    const char *class_cnick = SvOK(class_cnick_sv)
-                              ? SvPV_nolen(class_cnick_sv)
-                              : NULL;
-    const char *micro_sym   = SvOK(micro_sym_sv)
-                              ? SvPV_nolen(micro_sym_sv)
-                              : NULL;
-    CFCSymbol *self = CFCSymbol_new(parcel, exposure, class_name, class_cnick,
-                                    micro_sym);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-int
-equals(self, other)
-    CFCSymbol *self;
-    CFCSymbol *other;
-CODE:
-    RETVAL = CFCSymbol_equals(self, other);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCSymbol *self;
-ALIAS:
-    get_parcel      = 2
-    get_class_name  = 4
-    get_class_cnick = 6
-    get_exposure    = 8
-    micro_sym       = 10
-    get_prefix      = 12
-    get_Prefix      = 14
-    get_PREFIX      = 16
-    public          = 18
-    private         = 20
-    parcel          = 22
-    local           = 24
-    short_sym       = 26
-    full_sym        = 28
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                struct CFCParcel *parcel = CFCSymbol_get_parcel(self);
-                retval = S_cfcbase_to_perlref(parcel);
-            }
-            break;
-        case 4: {
-                const char *class_name = CFCSymbol_get_class_name(self);
-                retval = class_name
-                         ? newSVpvn(class_name, strlen(class_name))
-                         : newSV(0);
-            }
-            break;
-        case 6: {
-                const char *class_cnick = CFCSymbol_get_class_cnick(self);
-                retval = class_cnick
-                         ? newSVpvn(class_cnick, strlen(class_cnick))
-                         : newSV(0);
-            }
-            break;
-        case 8: {
-                const char *exposure = CFCSymbol_get_exposure(self);
-                retval = newSVpvn(exposure, strlen(exposure));
-            }
-            break;
-        case 10: {
-                const char *micro_sym = CFCSymbol_micro_sym(self);
-                retval = newSVpvn(micro_sym, strlen(micro_sym));
-            }
-            break;
-        case 12: {
-                const char *value = CFCSymbol_get_prefix(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 14: {
-                const char *value = CFCSymbol_get_Prefix(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 16: {
-                const char *value = CFCSymbol_get_PREFIX(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 18:
-            retval = newSViv(CFCSymbol_public(self));
-            break;
-        case 20:
-            retval = newSViv(CFCSymbol_private(self));
-            break;
-        case 22:
-            retval = newSViv(CFCSymbol_parcel(self));
-            break;
-        case 24:
-            retval = newSViv(CFCSymbol_local(self));
-            break;
-        case 26: {
-                const char *short_sym = CFCSymbol_short_sym(self);
-                retval = newSVpvn(short_sym, strlen(short_sym));
-            }
-            break;
-        case 28: {
-                const char *full_sym = CFCSymbol_full_sym(self);
-                retval = newSVpvn(full_sym, strlen(full_sym));
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Model::Type
-
-SV*
-_new(flags, parcel, specifier, indirection)
-    int flags;
-    CFCParcel *parcel;
-    const char *specifier;
-    int indirection;
-CODE:
-    CFCType *self = CFCType_new(flags, parcel, specifier, indirection);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_integer(flags, specifier)
-    int flags;
-    const char *specifier;
-CODE:
-    CFCType *self = CFCType_new_integer(flags, specifier);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_float(flags, specifier)
-    int flags;
-    const char *specifier;
-CODE:
-    CFCType *self = CFCType_new_float(flags, specifier);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_object(flags, parcel, specifier, indirection)
-    int flags;
-    CFCParcel *parcel;
-    const char *specifier;
-    int indirection;
-CODE:
-    CFCType *self = CFCType_new_object(flags, parcel, specifier, indirection);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_composite(flags, child_sv, indirection, array)
-    int flags;
-    SV *child_sv;
-    int indirection;
-    const char *array;
-CODE:
-    CFCType *child = NULL;
-    if (SvOK(child_sv) && sv_derived_from(child_sv, "Clownfish::CFC::Model::Type")) {
-        IV objint = SvIV((SV*)SvRV(child_sv));
-        child = INT2PTR(CFCType*, objint);
-    }
-    else {
-        croak("Param 'child' not a Clownfish::CFC::Model::Type");
-    }
-    CFCType *self = CFCType_new_composite(flags, child, indirection, array);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_void(is_const)
-    int is_const;
-CODE:
-    CFCType *self = CFCType_new_void(is_const);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_va_list()
-CODE:
-    CFCType *self = CFCType_new_va_list();
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-_new_arbitrary(parcel, specifier)
-    CFCParcel *parcel;
-    const char *specifier;
-CODE:
-    CFCType *self = CFCType_new_arbitrary(parcel, specifier);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-int
-equals(self, other)
-    CFCType *self;
-    CFCType *other;
-CODE:
-    RETVAL = CFCType_equals(self, other);
-OUTPUT: RETVAL
-
-int
-similar(self, other)
-    CFCType *self;
-    CFCType *other;
-CODE:
-    RETVAL = CFCType_similar(self, other);
-OUTPUT: RETVAL
-
-unsigned
-CONST(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_CONST;
-OUTPUT: RETVAL
-
-unsigned
-NULLABLE(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_NULLABLE;
-OUTPUT: RETVAL
-
-unsigned
-INCREMENTED(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_INCREMENTED;
-OUTPUT: RETVAL
-
-unsigned
-DECREMENTED(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_DECREMENTED;
-OUTPUT: RETVAL
-
-unsigned
-VOID(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_VOID;
-OUTPUT: RETVAL
-
-unsigned
-OBJECT(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_OBJECT;
-OUTPUT: RETVAL
-
-unsigned
-PRIMITIVE(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_PRIMITIVE;
-OUTPUT: RETVAL
-
-unsigned
-INTEGER(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_INTEGER;
-OUTPUT: RETVAL
-
-unsigned
-FLOATING(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_FLOATING;
-OUTPUT: RETVAL
-
-unsigned
-STRING_TYPE(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_STRING_TYPE;
-OUTPUT: RETVAL
-
-unsigned
-VA_LIST(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_VA_LIST;
-OUTPUT: RETVAL
-
-unsigned
-ARBITRARY(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_ARBITRARY;
-OUTPUT: RETVAL
-
-unsigned
-COMPOSITE(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = CFCTYPE_COMPOSITE;
-OUTPUT: RETVAL
-
-void
-resolve(self, classes_sv)
-    CFCType *self;
-    SV *classes_sv;
-PPCODE:
-    CFCClass **classes
-        = (CFCClass**)S_av_to_array_of_cfcbase(classes_sv,
-                                               "Clownfish::CFC::Model::Class");
-    CFCType_resolve(self, classes);
-    FREEMEM(classes);
-
-void
-_set_or_get(self, ...)
-    CFCType *self;
-ALIAS:
-    set_specifier   = 1
-    get_specifier   = 2
-    get_parcel      = 4
-    get_indirection = 6
-    to_c            = 8
-    const           = 10
-    set_nullable    = 11
-    nullable        = 12
-    is_void         = 14
-    is_object       = 16
-    is_primitive    = 18
-    is_integer      = 20
-    is_floating     = 22
-    is_string_type  = 24
-    is_va_list      = 26
-    is_arbitrary    = 28
-    is_composite    = 30
-    get_width       = 32
-    incremented     = 34
-    decremented     = 36
-    get_array       = 38
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 1:
-            CFCType_set_specifier(self, SvPV_nolen(ST(1)));
-            break;
-        case 2: {
-                const char *specifier = CFCType_get_specifier(self);
-                retval = newSVpvn(specifier, strlen(specifier));
-            }
-            break;
-        case 4: {
-                CFCParcel *parcel = CFCType_get_parcel(self);
-                retval = S_cfcbase_to_perlref(parcel);
-            }
-            break;
-        case 6:
-            retval = newSViv(CFCType_get_indirection(self));
-            break;
-        case 8: {
-                const char *c_string = CFCType_to_c(self);
-                retval = newSVpvn(c_string, strlen(c_string));
-            }
-            break;
-        case 10:
-            retval = newSViv(CFCType_const(self));
-            break;
-        case 11:
-            CFCType_set_nullable(self, !!SvTRUE(ST(1)));
-            break;
-        case 12:
-            retval = newSViv(CFCType_nullable(self));
-            break;
-        case 14:
-            retval = newSViv(CFCType_is_void(self));
-            break;
-        case 16:
-            retval = newSViv(CFCType_is_object(self));
-            break;
-        case 18:
-            retval = newSViv(CFCType_is_primitive(self));
-            break;
-        case 20:
-            retval = newSViv(CFCType_is_integer(self));
-            break;
-        case 22:
-            retval = newSViv(CFCType_is_floating(self));
-            break;
-        case 24:
-            retval = newSViv(CFCType_is_string_type(self));
-            break;
-        case 26:
-            retval = newSViv(CFCType_is_va_list(self));
-            break;
-        case 28:
-            retval = newSViv(CFCType_is_arbitrary(self));
-            break;
-        case 30:
-            retval = newSViv(CFCType_is_composite(self));
-            break;
-        case 32:
-            retval = newSVuv(CFCType_get_width(self));
-            break;
-        case 34:
-            retval = newSVuv(CFCType_incremented(self));
-            break;
-        case 36:
-            retval = newSVuv(CFCType_decremented(self));
-            break;
-        case 38: {
-                const char *array = CFCType_get_array(self);
-                retval = array
-                         ? newSVpvn(array, strlen(array))
-                         : newSV(0);
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Util
-
-SV*
-trim_whitespace(text)
-    SV *text;
-CODE:
-    RETVAL = newSVsv(text);
-    STRLEN len;
-    char *ptr = SvPV(RETVAL, len);
-    CFCUtil_trim_whitespace(ptr);
-    SvCUR_set(RETVAL, strlen(ptr));
-OUTPUT: RETVAL
-
-SV*
-slurp_text(path)
-    const char *path;
-CODE:
-    size_t len;
-    char *contents = CFCUtil_slurp_text(path, &len);
-    RETVAL = newSVpvn(contents, len);
-    FREEMEM(contents);
-OUTPUT: RETVAL
-
-int
-current(orig, dest)
-    const char *orig;
-    const char *dest;
-CODE:
-    RETVAL = CFCUtil_current(orig, dest);
-OUTPUT: RETVAL
-
-void
-write_if_changed(path, content_sv)
-    const char *path;
-    SV *content_sv;
-PPCODE:
-    STRLEN len;
-    char *content = SvPV(content_sv, len);
-    CFCUtil_write_if_changed(path, content, len);
-
-int
-is_dir(path)
-    const char *path;
-CODE:
-    RETVAL = CFCUtil_is_dir(path);
-OUTPUT: RETVAL
-
-int
-make_dir(dir)
-    const char *dir;
-CODE:
-    RETVAL = CFCUtil_make_dir(dir);
-OUTPUT: RETVAL
-
-int
-make_path(path)
-    const char *path;
-CODE:
-    RETVAL = CFCUtil_make_path(path);
-OUTPUT: RETVAL
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Model::Variable
-
-SV*
-_new(parcel, exposure, class_name_sv, class_cnick_sv, micro_sym_sv, type_sv, inert_sv)
-    CFCParcel *parcel;
-    const char *exposure;
-    SV *class_name_sv;
-    SV *class_cnick_sv;
-    SV *micro_sym_sv;
-    SV *type_sv;
-    SV *inert_sv;
-CODE:
-    const char *class_name  = SvOK(class_name_sv)
-                              ? SvPV_nolen(class_name_sv)
-                              : NULL;
-    const char *class_cnick = SvOK(class_cnick_sv)
-                              ? SvPV_nolen(class_cnick_sv)
-                              : NULL;
-    const char *micro_sym   = SvOK(micro_sym_sv)
-                              ? SvPV_nolen(micro_sym_sv)
-                              : NULL;
-    int inert               = SvOK(inert_sv)
-                              ? !!SvTRUE(inert_sv) : 0;
-    CFCType *type = NULL;
-    if (SvOK(type_sv) && sv_derived_from(type_sv, "Clownfish::CFC::Model::Type")) {
-        IV objint = SvIV((SV*)SvRV(type_sv));
-        type = INT2PTR(CFCType*, objint);
-    }
-    else {
-        croak("Param 'type' is not a Clownfish::CFC::Model::Type");
-    }
-    CFCVariable *self = CFCVariable_new(parcel, exposure, class_name,
-                                        class_cnick, micro_sym, type, inert);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-int
-equals(self, other)
-    CFCVariable *self;
-    CFCVariable *other;
-CODE:
-    RETVAL = CFCVariable_equals(self, other);
-OUTPUT: RETVAL
-
-void
-resolve_type(self, classes_sv)
-    CFCVariable *self;
-    SV *classes_sv;
-PPCODE:
-    CFCClass **classes
-        = (CFCClass**)S_av_to_array_of_cfcbase(classes_sv,
-                                               "Clownfish::CFC::Model::Class");
-    CFCVariable_resolve_type(self, classes);
-    FREEMEM(classes);
-
-void
-_set_or_get(self, ...)
-    CFCVariable *self;
-ALIAS:
-    get_type          = 2
-    local_c           = 4
-    global_c          = 6
-    local_declaration = 8
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                CFCType *type = CFCVariable_get_type(self);
-                retval = S_cfcbase_to_perlref(type);
-            }
-            break;
-        case 4: {
-                const char *local_c = CFCVariable_local_c(self);
-                retval = newSVpvn(local_c, strlen(local_c));
-            }
-            break;
-        case 6: {
-                const char *global_c = CFCVariable_global_c(self);
-                retval = newSVpvn(global_c, strlen(global_c));
-            }
-            break;
-        case 8: {
-                const char *local_dec = CFCVariable_local_declaration(self);
-                retval = newSVpvn(local_dec, strlen(local_dec));
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Model::Version
-
-SV*
-_new(vstring)
-    const char *vstring;
-CODE:
-    CFCVersion *self = CFCVersion_new(vstring);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCVersion *self;
-ALIAS:
-    get_major         = 2
-    get_vstring       = 4
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: 
-            retval = newSVuv(CFCVersion_get_major(self));
-            break;
-        case 4: {
-                const char *value = CFCVersion_get_vstring(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-int
-compare_to(self, other)
-    CFCVersion *self;
-    CFCVersion *other;
-CODE:
-    RETVAL = CFCVersion_compare_to(self, other);
-OUTPUT: RETVAL
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Binding::Core
-
-SV*
-_new(hierarchy, header, footer)
-    CFCHierarchy *hierarchy;
-    const char   *header;
-    const char   *footer;
-CODE:
-    CFCBindCore *self = CFCBindCore_new(hierarchy, header, footer);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-int
-write_all_modified(self, ...)
-    CFCBindCore *self;
-CODE:
-{
-    int modified = 0;
-    if (items > 1 && SvOK(ST(1))) {
-        modified = !!SvIV(ST(1));
-    }
-    RETVAL = CFCBindCore_write_all_modified(self, modified);
-}
-OUTPUT: RETVAL
-
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Binding::Core::Function
-
-SV*
-func_declaration(unused, func)
-    SV *unused;
-    CFCFunction *func;
-CODE:
-    CHY_UNUSED_VAR(unused);
-    RETVAL = S_sv_eat_c_string(CFCBindFunc_func_declaration(func));
-OUTPUT: RETVAL
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Binding::Core::Method
-
-SV*
-abstract_method_def(unused, meth)
-    SV *unused;
-    CFCMethod *meth;
-CODE:
-    CHY_UNUSED_VAR(unused);
-    RETVAL = S_sv_eat_c_string(CFCBindMeth_abstract_method_def(meth));
-OUTPUT: RETVAL
-
-SV*
-_method_def(meth, klass)
-    CFCMethod *meth;
-    CFCClass  *klass;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCBindMeth_method_def(meth, klass));
-OUTPUT: RETVAL
-
-SV*
-_novel_spec_def(meth)
-    CFCMethod *meth;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCBindMeth_novel_spec_def(meth));
-OUTPUT: RETVAL
-
-SV*
-_overridden_spec_def(meth, klass)
-    CFCMethod *meth;
-    CFCClass  *klass;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCBindMeth_overridden_spec_def(meth, klass));
-OUTPUT: RETVAL
-
-SV*
-_inherited_spec_def(meth, klass)
-    CFCMethod *meth;
-    CFCClass  *klass;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCBindMeth_inherited_spec_def(meth, klass));
-OUTPUT: RETVAL
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Binding::Core::Aliases
-
-SV*
-c_aliases(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    RETVAL = S_sv_eat_c_string(CFCBindAliases_c_aliases());
-OUTPUT: RETVAL
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Binding::Core::Class
-
-SV*
-_new(client)
-    CFCClass *client;
-CODE:
-    CFCBindClass *self = CFCBindClass_new(client);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-to_c_data(self)
-    CFCBindClass *self;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCBindClass_to_c_data(self));
-OUTPUT: RETVAL
-
-SV*
-to_c_header(self)
-    CFCBindClass *self;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCBindClass_to_c_header(self));
-OUTPUT: RETVAL
-
-MODULE = Clownfish::CFC  PACKAGE = Clownfish::CFC::Binding::Core::File
-
-void
-_write_h(file, dest, header, footer)
-    CFCFile *file;
-    const char *dest;
-    const char *header;
-    const char *footer;
-PPCODE:
-    CFCBindFile_write_h(file, dest, header, footer);
-
-MODULE = Clownfish   PACKAGE = Clownfish::CFC::Binding::Perl
-
-SV*
-_new(hierarchy, lib_dir, boot_class, header, footer)
-    CFCHierarchy *hierarchy;
-    const char *lib_dir;
-    const char *boot_class;
-    const char *header;
-    const char *footer;
-CODE:
-    CFCPerl *self = CFCPerl_new(hierarchy, lib_dir, boot_class, header,
-                                footer);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-write_pod(self)
-    CFCPerl *self;
-CODE:
-    char **written = CFCPerl_write_pod(self);
-    AV *modified = newAV();
-    for (size_t i = 0; written[i] != NULL; i++) {
-        SV *path = S_sv_eat_c_string(written[i]);
-        av_push(modified, path);
-    }
-    FREEMEM(written);
-    RETVAL = newRV_noinc((SV*)modified);
-OUTPUT: RETVAL
-
-void
-write_boot(self)
-    CFCPerl *self;
-PPCODE:
-    CFCPerl_write_boot(self);
-
-void
-write_hostdefs(self)
-    CFCPerl *self;
-PPCODE:
-    CFCPerl_write_hostdefs(self);
-
-void
-write_bindings(self)
-    CFCPerl *self;
-PPCODE:
-    CFCPerl_write_bindings(self);
-
-void
-write_callbacks(self)
-    CFCPerl *self;
-PPCODE:
-    CFCPerl_write_callbacks(self);
-
-void
-write_xs_typemap(self)
-    CFCPerl *self;
-PPCODE:
-    CFCPerl_write_xs_typemap(self);
-
-
-MODULE = Clownfish   PACKAGE = Clownfish::CFC::Binding::Perl::Subroutine
-
-void
-_set_or_get(self, ...)
-    CFCPerlSub *self;
-ALIAS:
-    get_class_name     = 2
-    use_labeled_params = 4
-    perl_name          = 6
-    get_param_list     = 8
-    c_name             = 10
-    c_name_list        = 12
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *value = CFCPerlSub_get_class_name(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 4:
-            retval = newSViv(CFCPerlSub_use_labeled_params(self));
-            break;
-        case 6: {
-                const char *value = CFCPerlSub_perl_name(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 8: {
-                CFCParamList *value = CFCPerlSub_get_param_list(self);
-                retval = S_cfcbase_to_perlref(value);
-            }
-            break;
-        case 10: {
-                const char *value = CFCPerlSub_c_name(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 12: {
-                const char *value = CFCPerlSub_c_name_list(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-SV*
-params_hash_def(self)
-    CFCPerlSub *self;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCPerlSub_params_hash_def(self));
-OUTPUT: RETVAL
-
-SV*
-build_allot_params(self)
-    CFCPerlSub *self;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCPerlSub_build_allot_params(self));
-OUTPUT: RETVAL
-
-
-MODULE = Clownfish   PACKAGE = Clownfish::CFC::Binding::Perl::Method
-
-SV*
-_new(method, alias)
-    CFCMethod *method;
-    const char *alias;
-CODE:
-    CFCPerlMethod *self = CFCPerlMethod_new(method, alias);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-xsub_def(self)
-    CFCPerlMethod *self;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCPerlMethod_xsub_def(self));
-OUTPUT: RETVAL
-
-
-MODULE = Clownfish   PACKAGE = Clownfish::CFC::Binding::Perl::Constructor
-
-SV*
-_new(klass, alias, init_sv)
-    CFCClass *klass;
-    const char *alias;
-    SV *init_sv;
-CODE:
-    const char *init = SvOK(init_sv) ? SvPVutf8_nolen(init_sv) : NULL;
-    CFCPerlConstructor *self = CFCPerlConstructor_new(klass, alias, init);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-xsub_def(self)
-    CFCPerlConstructor *self;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCPerlConstructor_xsub_def(self));
-OUTPUT: RETVAL
-
-MODULE = Clownfish   PACKAGE = Clownfish::CFC::Binding::Perl::Class
-
-SV*
-_new(parcel, class_name)
-    CFCParcel  *parcel;
-    const char *class_name;
-CODE:
-    CFCPerlClass *self = CFCPerlClass_new(parcel, class_name);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-register(unused, binding)
-    SV *unused;
-    CFCPerlClass *binding;
-PPCODE:
-    CHY_UNUSED_VAR(unused);
-    CFCPerlClass_add_to_registry(binding);
-
-SV*
-singleton(unused_sv, class_name)
-    SV *unused_sv;
-    const char *class_name;
-CODE:
-    CHY_UNUSED_VAR(unused_sv);
-    CFCPerlClass *binding = CFCPerlClass_singleton(class_name);
-    RETVAL = S_cfcbase_to_perlref(binding);
-OUTPUT: RETVAL
-
-SV*
-registered(...)
-CODE:
-    CHY_UNUSED_VAR(items);
-    CFCPerlClass **registry = CFCPerlClass_registry();
-    RETVAL = S_array_of_cfcbase_to_av((CFCBase**)registry);
-OUTPUT: RETVAL
-
-void
-_clear_registry(...)
-PPCODE:
-    CHY_UNUSED_VAR(items);
-    CFCPerlClass_clear_registry();
-
-void
-_bind_method(self, alias_sv, meth_sv)
-    CFCPerlClass *self;
-    SV *alias_sv;
-    SV *meth_sv;
-PPCODE:
-    const char *alias = SvOK(alias_sv) ? SvPVutf8_nolen(alias_sv) : NULL;
-    const char *meth  = SvOK(meth_sv)  ? SvPVutf8_nolen(meth_sv)  : NULL;
-    CFCPerlClass_bind_method(self, alias, meth);
-
-void
-_bind_constructor(self, alias_sv, init_sv)
-    CFCPerlClass *self;
-    SV *alias_sv;
-    SV *init_sv;
-PPCODE:
-    const char *alias = SvOK(alias_sv) ? SvPVutf8_nolen(alias_sv) : NULL;
-    const char *init  = SvOK(init_sv)  ? SvPVutf8_nolen(init_sv)  : NULL;
-    CFCPerlClass_bind_constructor(self, alias, init);
-
-void
-exclude_method(self, method)
-    CFCPerlClass *self;
-    const char *method;
-PPCODE:
-    CFCPerlClass_exclude_method(self, method);
-
-void
-exclude_constructor(self)
-    CFCPerlClass *self;
-PPCODE:
-    CFCPerlClass_exclude_constructor(self);
-
-void
-append_xs(self, xs)
-    CFCPerlClass *self;
-    const char *xs;
-PPCODE:
-    CFCPerlClass_append_xs(self, xs);
-
-SV*
-method_bindings(unused, klass)
-    SV *unused;
-    CFCClass *klass;
-CODE:
-    CHY_UNUSED_VAR(unused);
-    CFCPerlMethod **bound = CFCPerlClass_method_bindings(klass);
-    RETVAL = S_array_of_cfcbase_to_av((CFCBase**)bound);
-    FREEMEM(bound);
-OUTPUT: RETVAL
-
-SV*
-constructor_bindings(unused, klass)
-    SV *unused;
-    CFCClass *klass;
-CODE:
-    CHY_UNUSED_VAR(unused);
-    CFCPerlConstructor **bound = CFCPerlClass_constructor_bindings(klass);
-    RETVAL = S_array_of_cfcbase_to_av((CFCBase**)bound);
-    FREEMEM(bound);
-OUTPUT: RETVAL
-
-SV*
-create_pod(self)
-    CFCPerlClass *self;
-CODE:
-    char *pod = CFCPerlClass_create_pod(self);
-    RETVAL = S_sv_eat_c_string(pod);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCPerlClass *self;
-ALIAS:
-    get_class_name     = 2
-    get_client         = 4
-    get_xs_code        = 6
-    set_pod_spec       = 7
-    get_pod_spec       = 8
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 2: {
-                const char *value = CFCPerlClass_get_class_name(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 4: {
-                CFCClass *value = CFCPerlClass_get_client(self);
-                retval = S_cfcbase_to_perlref(value);
-            }
-            break;
-        case 6: {
-                const char *value = CFCPerlClass_get_xs_code(self);
-                retval = value
-                         ? newSVpvn(value, strlen(value))
-                         : newSV(0);
-            }
-            break;
-        case 7: {
-                CFCPerlPod *pod_spec = NULL;
-                if (SvOK(ST(1))
-                    && sv_derived_from(ST(1), "Clownfish::CFC::Binding::Perl::Pod")
-                   ) {
-                    IV objint = SvIV((SV*)SvRV(ST(1)));
-                    pod_spec = INT2PTR(CFCPerlPod*, objint);
-                }
-                CFCPerlClass_set_pod_spec(self, pod_spec);
-                break;
-            }
-        case 8: {
-                CFCPerlPod *value = CFCPerlClass_get_pod_spec(self);
-                retval = S_cfcbase_to_perlref(value);
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-void
-add_class_alias(self, alias)
-    CFCPerlClass *self;
-    const char *alias;
-PPCODE:
-    CFCPerlClass_add_class_alias(self, alias);
-
-SV*
-get_class_aliases(self)
-    CFCPerlClass *self;
-CODE:
-    const char **aliases = CFCPerlClass_get_class_aliases(self);
-    RETVAL = S_string_array_to_av(aliases);
-OUTPUT: RETVAL
-
-
-MODULE = Clownfish   PACKAGE = Clownfish::CFC::Binding::Perl::Pod
-
-SV*
-new(unused)
-    SV *unused;
-CODE:
-    CHY_UNUSED_VAR(unused);
-    CFCPerlPod *self = CFCPerlPod_new();
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-void
-_add_method(self, alias, method_sv, sample_sv, pod_sv)
-    CFCPerlPod *self;
-    const char *alias;
-    SV *method_sv;
-    SV *sample_sv;
-    SV *pod_sv;
-PPCODE:
-    const char *method = SvPOK(method_sv) ? SvPVutf8_nolen(method_sv) : NULL;
-    const char *sample = SvPOK(sample_sv) ? SvPVutf8_nolen(sample_sv) : NULL;
-    const char *pod    = SvPOK(pod_sv)    ? SvPVutf8_nolen(pod_sv)    : NULL;
-    CFCPerlPod_add_method(self, alias, method, sample, pod);
-
-void
-_add_constructor(self, alias_sv, init_sv, sample_sv, pod_sv)
-    CFCPerlPod *self;
-    SV *alias_sv;
-    SV *init_sv;
-    SV *sample_sv;
-    SV *pod_sv;
-PPCODE:
-    const char *alias  = SvPOK(alias_sv)  ? SvPVutf8_nolen(alias_sv)  : NULL;
-    const char *init   = SvPOK(init_sv)   ? SvPVutf8_nolen(init_sv)   : NULL;
-    const char *sample = SvPOK(sample_sv) ? SvPVutf8_nolen(sample_sv) : NULL;
-    const char *pod    = SvPOK(pod_sv)    ? SvPVutf8_nolen(pod_sv)    : NULL;
-    CFCPerlPod_add_constructor(self, alias, init, sample, pod);
-
-SV*
-methods_pod(self, klass)
-    CFCPerlPod *self;
-    CFCClass   *klass;
-CODE:
-    char *methods_pod = CFCPerlPod_methods_pod(self, klass);
-    RETVAL = S_sv_eat_c_string(methods_pod);
-OUTPUT: RETVAL
-
-SV*
-constructors_pod(self, klass)
-    CFCPerlPod *self;
-    CFCClass   *klass;
-CODE:
-    char *constructors_pod = CFCPerlPod_constructors_pod(self, klass);
-    RETVAL = S_sv_eat_c_string(constructors_pod);
-OUTPUT: RETVAL
-
-void
-_set_or_get(self, ...)
-    CFCPerlPod *self;
-ALIAS:
-    set_synopsis       = 1
-    get_synopsis       = 2
-    set_description    = 3
-    get_description    = 4
-PPCODE:
-{
-    START_SET_OR_GET_SWITCH
-        case 1: {
-                const char *val = SvOK(ST(1)) ? SvPVutf8_nolen(ST(1)) : NULL;
-                CFCPerlPod_set_synopsis(self, val);
-            }
-            break;
-        case 2: {
-                const char *value = CFCPerlPod_get_synopsis(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-        case 3: {
-                const char *val = SvOK(ST(1)) ? SvPVutf8_nolen(ST(1)) : NULL;
-                CFCPerlPod_set_description(self, val);
-            }
-            break;
-        case 4: {
-                const char *value = CFCPerlPod_get_description(self);
-                retval = newSVpvn(value, strlen(value));
-            }
-            break;
-    END_SET_OR_GET_SWITCH
-}
-
-
-SV*
-_perlify_doc_text(self, source)
-    CFCPerlPod   *self;
-    const char   *source;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCPerlPod_perlify_doc_text(self, source));
-OUTPUT: RETVAL
-
-SV*
-_gen_subroutine_pod(self, func, alias, klass, code_sample, class_name, is_constructor)
-    CFCPerlPod *self;
-    CFCFunction *func;
-    const char *alias;
-    CFCClass *klass;
-    const char *code_sample;
-    const char *class_name;
-    int is_constructor;
-CODE:
-    char *value = CFCPerlPod_gen_subroutine_pod(self, func, alias, klass,
-                                                code_sample, class_name,
-                                                is_constructor);
-    RETVAL = S_sv_eat_c_string(value);
-OUTPUT: RETVAL
-
-
-MODULE = Clownfish   PACKAGE = Clownfish::CFC::Binding::Perl::TypeMap
-
-SV*
-from_perl(type, xs_var)
-    CFCType *type;
-    const char *xs_var;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCPerlTypeMap_from_perl(type, xs_var));
-OUTPUT: RETVAL
-
-SV*
-to_perl(type, cf_var)
-    CFCType *type;
-    const char *cf_var;
-CODE:
-    RETVAL = S_sv_eat_c_string(CFCPerlTypeMap_to_perl(type, cf_var));
-OUTPUT: RETVAL
-
-void
-_write_xs_typemap(hierarchy)
-    CFCHierarchy *hierarchy;
-PPCODE:
-    CFCPerlTypeMap_write_xs_typemap(hierarchy);
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Parser
-
-SV*
-new(klass)
-    const char *klass;
-CODE:
-    if (strcmp(klass, "Clownfish::CFC::Parser")) {
-        croak("No subclassing allowed");
-    }
-    CFCParser *self = CFCParser_new();
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-SV*
-parse(self, string)
-    CFCParser  *self;
-    const char *string;
-CODE:
-    CFCBase *got = CFCParser_parse(self, string);
-    RETVAL = S_cfcbase_to_perlref(got);
-    CFCBase_decref((CFCBase*)got);
-OUTPUT: RETVAL
-
-SV*
-_parse_file(self, string, file_spec)
-    CFCParser   *self;
-    const char  *string;
-    CFCFileSpec *file_spec;
-CODE:
-    CFCFile *got = CFCParser_parse_file(self, string, file_spec);
-    RETVAL = S_cfcbase_to_perlref(got);
-    CFCBase_decref((CFCBase*)got);
-OUTPUT: RETVAL
-
-void
-set_parcel(self, parcel)
-    CFCParser *self;
-    CFCParcel *parcel;
-PPCODE:
-    CFCParser_set_parcel(self, parcel);
-
-void
-set_class_name(self, class_name)
-    CFCParser  *self;
-    const char *class_name;
-PPCODE:
-    CFCParser_set_class_name(self, class_name);
-
-void
-set_class_cnick(self, class_cnick)
-    CFCParser  *self;
-    const char *class_cnick;
-PPCODE:
-    CFCParser_set_class_cnick(self, class_cnick);
-
-SV*
-get_parcel(self)
-    CFCParser *self;
-CODE:
-    CFCParcel *parcel = CFCParser_get_parcel(self);
-    RETVAL = S_cfcbase_to_perlref((CFCBase*)parcel);
-OUTPUT: RETVAL
-
-
-MODULE = Clownfish::CFC   PACKAGE = Clownfish::CFC::Test
-
-SV*
-_new(formatter_name)
-    const char *formatter_name;
-CODE:
-    CFCTest *self = CFCTest_new(formatter_name);
-    RETVAL = S_cfcbase_to_perlref(self);
-    CFCBase_decref((CFCBase*)self);
-OUTPUT: RETVAL
-
-int
-run_batch(self, klass)
-    CFCTest *self;
-    const char *klass;
-CODE:
-    RETVAL = CFCTest_run_batch(self, klass);
-OUTPUT: RETVAL
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Base.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Base.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Base.pm
deleted file mode 100644
index 3b5b067..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Base.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Base;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core.pm
deleted file mode 100644
index f65c546..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Core;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Aliases.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Aliases.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Aliases.pm
deleted file mode 100644
index af1ec73..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Aliases.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Core::Aliases;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Class.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Class.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Class.pm
deleted file mode 100644
index c4b4209..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Class.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Core::Class;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/File.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/File.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/File.pm
deleted file mode 100644
index bb88026..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/File.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Core::File;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Function.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Function.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Function.pm
deleted file mode 100644
index 2ec30aa..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Function.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Core::Function;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Method.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Method.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Method.pm
deleted file mode 100644
index ab9aa7c..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Core/Method.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Core::Method;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl.pm
deleted file mode 100644
index 8571595..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Perl;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm
deleted file mode 100644
index 4fc530f..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Class.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Perl::Class;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Constructor.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Constructor.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Constructor.pm
deleted file mode 100644
index 7598c7d..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Constructor.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Perl::Constructor;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Method.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Method.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Method.pm
deleted file mode 100644
index cf1369e..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Method.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Perl::Method;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Pod.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Pod.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Pod.pm
deleted file mode 100644
index ef36c1e..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Pod.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Perl::Pod;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Subroutine.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Subroutine.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Subroutine.pm
deleted file mode 100644
index a114115..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/Subroutine.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Perl::Subroutine;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/TypeMap.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/TypeMap.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/TypeMap.pm
deleted file mode 100644
index 1e9ba76..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Binding/Perl/TypeMap.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Binding::Perl::TypeMap;
-use Clownfish::CFC;
-
-1;
-


[lucy-commits] [30/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Define HAS_BOOL in source, not via compiler flags

Posted by ma...@apache.org.
Define HAS_BOOL in source, not via compiler flags


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/f333df05
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/f333df05
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/f333df05

Branch: refs/heads/sortex_ptr_only
Commit: f333df05a85660b77254a8445f4f16fec4228101
Parents: 9b9b8c2
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Jul 20 22:53:49 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 22 21:26:59 2014 +0200

----------------------------------------------------------------------
 common/charmonizer.c    | 10 ----------
 common/charmonizer.main | 10 ----------
 2 files changed, 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/f333df05/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/common/charmonizer.c b/common/charmonizer.c
index 31f0481..773b578 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -7082,16 +7082,6 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) {
         }
     }
 
-    /* When compiling for Perl bindings, define HAS_BOOL so that the Perl
-     * headers don't redefine 'bool' in conflict with C++.
-     *
-     * TODO: Compile all files that #include Perl headers separately and
-     * remove this directive.
-     */
-    if (args->charmony_pm) {
-        chaz_CFlags_add_define(extra_cflags, "HAS_BOOL", NULL);
-    }
-
     chaz_CFlags_add_define(extra_cflags, "CFP_LUCY", NULL);
     chaz_CFlags_add_define(extra_cflags, "CFP_TESTLUCY", NULL);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/f333df05/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index b01d3d6..f698987 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -84,16 +84,6 @@ S_add_compiler_flags(struct chaz_CLIArgs *args) {
         }
     }
 
-    /* When compiling for Perl bindings, define HAS_BOOL so that the Perl
-     * headers don't redefine 'bool' in conflict with C++.
-     *
-     * TODO: Compile all files that #include Perl headers separately and
-     * remove this directive.
-     */
-    if (args->charmony_pm) {
-        chaz_CFlags_add_define(extra_cflags, "HAS_BOOL", NULL);
-    }
-
     chaz_CFlags_add_define(extra_cflags, "CFP_LUCY", NULL);
     chaz_CFlags_add_define(extra_cflags, "CFP_TESTLUCY", NULL);
 }


[lucy-commits] [49/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Move Shrink() up from PostingPool to SortExternal.

Posted by ma...@apache.org.
Move Shrink() up from PostingPool to SortExternal.

Move the Shrink method up into the parent class and generalize it by
calling Shrink() on runs.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/7677ad4d
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/7677ad4d
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/7677ad4d

Branch: refs/heads/sortex_ptr_only
Commit: 7677ad4df614d0523571811dc4a9bf1f41e1df60
Parents: 88271ce
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jan 8 17:59:56 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 14:16:05 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/PostingPool.c   | 30 ------------------------------
 core/Lucy/Index/PostingPool.cfh |  5 -----
 core/Lucy/Util/SortExternal.c   | 32 ++++++++++++++++++++++++++++++++
 core/Lucy/Util/SortExternal.cfh |  5 +++++
 4 files changed, 37 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/7677ad4d/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 55eecc9..cc56c34 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -260,36 +260,6 @@ PostPool_Add_Segment_IMP(PostingPool *self, SegReader *reader,
 }
 
 void
-PostPool_Shrink_IMP(PostingPool *self) {
-    PostingPoolIVARS *const ivars = PostPool_IVARS(self);
-    if (ivars->cache_max - ivars->cache_tick > 0) {
-        size_t cache_count = PostPool_Cache_Count(self);
-        size_t size        = cache_count * sizeof(Obj*);
-        if (ivars->cache_tick > 0) {
-            Obj **start = ivars->cache + ivars->cache_tick;
-            memmove(ivars->cache, start, size);
-        }
-        ivars->cache      = (Obj**)REALLOCATE(ivars->cache, size);
-        ivars->cache_tick = 0;
-        ivars->cache_max  = cache_count;
-        ivars->cache_cap  = cache_count;
-    }
-    else {
-        FREEMEM(ivars->cache);
-        ivars->cache      = NULL;
-        ivars->cache_tick = 0;
-        ivars->cache_max  = 0;
-        ivars->cache_cap  = 0;
-    }
-    ivars->scratch_cap = 0;
-    FREEMEM(ivars->scratch);
-    ivars->scratch = NULL;
-
-    // It's not necessary to iterate over the runs, because they don't have
-    // any cache costs until Refill() gets called.
-}
-
-void
 PostPool_Flush_IMP(PostingPool *self) {
     PostingPoolIVARS *const ivars = PostPool_IVARS(self);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/7677ad4d/core/Lucy/Index/PostingPool.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.cfh b/core/Lucy/Index/PostingPool.cfh
index be1d26a..587955b 100644
--- a/core/Lucy/Index/PostingPool.cfh
+++ b/core/Lucy/Index/PostingPool.cfh
@@ -69,11 +69,6 @@ class Lucy::Index::PostingPool nickname PostPool
     Add_Inversion(PostingPool *self, Inversion *inversion, int32_t doc_id,
                   float doc_boost, float length_norm);
 
-    /** Reduce RAM footprint as much as possible.
-     */
-    void
-    Shrink(PostingPool *self);
-
     MemoryPool*
     Get_Mem_Pool(PostingPool *self);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/7677ad4d/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index c4d936e..f8a2690 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -165,6 +165,38 @@ SortEx_Add_Run_IMP(SortExternal *self, SortExternal *run) {
         = (Obj***)REALLOCATE(ivars->slice_starts, num_runs * sizeof(Obj**));
 }
 
+void
+SortEx_Shrink_IMP(SortExternal *self) {
+    SortExternalIVARS *const ivars = SortEx_IVARS(self);
+    if (ivars->cache_max - ivars->cache_tick > 0) {
+        size_t cache_count = SortEx_Cache_Count(self);
+        size_t size        = cache_count * sizeof(Obj*);
+        if (ivars->cache_tick > 0) {
+            Obj **start = ivars->cache + ivars->cache_tick;
+            memmove(ivars->cache, start, size);
+        }
+        ivars->cache      = (Obj**)REALLOCATE(ivars->cache, size);
+        ivars->cache_tick = 0;
+        ivars->cache_max  = cache_count;
+        ivars->cache_cap  = cache_count;
+    }
+    else {
+        FREEMEM(ivars->cache);
+        ivars->cache      = NULL;
+        ivars->cache_tick = 0;
+        ivars->cache_max  = 0;
+        ivars->cache_cap  = 0;
+    }
+    ivars->scratch_cap = 0;
+    FREEMEM(ivars->scratch);
+    ivars->scratch = NULL;
+
+    for (uint32_t i = 0, max = VA_Get_Size(ivars->runs); i < max; i++) {
+        SortExternal *run = (SortExternal*)VA_Fetch(ivars->runs, i);
+        SortEx_Shrink(run);
+    }
+}
+
 static void
 S_refill_cache(SortExternal *self, SortExternalIVARS *ivars) {
     // Reset cache vars.

http://git-wip-us.apache.org/repos/asf/lucy/blob/7677ad4d/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index 13d3009..cfc0591 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -106,6 +106,11 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     void
     Add_Run(SortExternal *self, decremented SortExternal *run);
 
+    /** Compact buffer sizes and minimize memory consumption.
+     */
+    void
+    Shrink(SortExternal *self);
+
     /** Refill the cache of a run.  Will only be called on child objects, not
      * the main object.
      */


[lucy-commits] [17/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindCore.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindCore.c b/clownfish/compiler/src/CFCBindCore.c
deleted file mode 100644
index 5ae8ac6..0000000
--- a/clownfish/compiler/src/CFCBindCore.c
+++ /dev/null
@@ -1,749 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCBindCore.h"
-#include "CFCBindClass.h"
-#include "CFCBindFile.h"
-#include "CFCClass.h"
-#include "CFCFile.h"
-#include "CFCHierarchy.h"
-#include "CFCParcel.h"
-#include "CFCUtil.h"
-
-#define STRING(s)  #s
-#define XSTRING(s) STRING(s)
-
-struct CFCBindCore {
-    CFCBase base;
-    CFCHierarchy *hierarchy;
-    char         *header;
-    char         *footer;
-};
-
-/* Write the "parcel.h" header file, which contains common symbols needed by
- * all classes, plus typedefs for all class structs.
- */
-static void
-S_write_parcel_h(CFCBindCore *self, CFCParcel *parcel);
-
-/* Write the "parcel.c" file containing autogenerated implementation code.
- */
-static void
-S_write_parcel_c(CFCBindCore *self, CFCParcel *parcel);
-
-/* Write the "cfish_platform.h" header file, which contains platform-specific
- * definitions.
- */
-static void
-S_write_platform_h(CFCBindCore *self);
-
-static char*
-S_charmony_feature_defines();
-
-static char*
-S_charmony_string_defines();
-
-static char*
-S_charmony_stdbool_defines();
-
-static char*
-S_charmony_stdint_defines();
-
-static char*
-S_charmony_alloca_defines();
-
-static const CFCMeta CFCBINDCORE_META = {
-    "Clownfish::CFC::Binding::Core",
-    sizeof(CFCBindCore),
-    (CFCBase_destroy_t)CFCBindCore_destroy
-};
-
-CFCBindCore*
-CFCBindCore_new(CFCHierarchy *hierarchy, const char *header,
-                const char *footer) {
-    CFCBindCore *self = (CFCBindCore*)CFCBase_allocate(&CFCBINDCORE_META);
-    return CFCBindCore_init(self, hierarchy, header, footer);
-}
-
-CFCBindCore*
-CFCBindCore_init(CFCBindCore *self, CFCHierarchy *hierarchy,
-                 const char *header, const char *footer) {
-    CFCUTIL_NULL_CHECK(hierarchy);
-    CFCUTIL_NULL_CHECK(header);
-    CFCUTIL_NULL_CHECK(footer);
-    self->hierarchy = (CFCHierarchy*)CFCBase_incref((CFCBase*)hierarchy);
-    self->header    = CFCUtil_strdup(header);
-    self->footer    = CFCUtil_strdup(footer);
-    return self;
-}
-
-void
-CFCBindCore_destroy(CFCBindCore *self) {
-    CFCBase_decref((CFCBase*)self->hierarchy);
-    FREEMEM(self->header);
-    FREEMEM(self->footer);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-int
-CFCBindCore_write_all_modified(CFCBindCore *self, int modified) {
-    CFCHierarchy *hierarchy = self->hierarchy;
-    const char   *header    = self->header;
-    const char   *footer    = self->footer;
-
-    // Discover whether files need to be regenerated.
-    modified = CFCHierarchy_propagate_modified(hierarchy, modified);
-
-    // Iterate over all File objects, writing out those which don't have
-    // up-to-date auto-generated files.
-    const char *inc_dest = CFCHierarchy_get_include_dest(hierarchy);
-    CFCFile **files = CFCHierarchy_files(hierarchy);
-    for (int i = 0; files[i] != NULL; i++) {
-        if (CFCFile_get_modified(files[i])) {
-            CFCBindFile_write_h(files[i], inc_dest, header, footer);
-        }
-    }
-
-    // If any class definition has changed, rewrite the parcel.h and parcel.c
-    // files.
-    if (modified) {
-        S_write_platform_h(self);
-
-        CFCParcel **parcels = CFCParcel_all_parcels();
-        for (size_t i = 0; parcels[i]; ++i) {
-            CFCParcel *parcel = parcels[i];
-            // TODO: Skip parcels the source parcels don't depend on.
-            S_write_parcel_h(self, parcel);
-            if (!CFCParcel_included(parcel)) {
-                S_write_parcel_c(self, parcel);
-            }
-        }
-        FREEMEM(parcels);
-    }
-
-    return modified;
-}
-
-/* Write the "parcel.h" header file, which contains common symbols needed by
- * all classes, plus typedefs for all class structs.
- */
-static void
-S_write_parcel_h(CFCBindCore *self, CFCParcel *parcel) {
-    CFCHierarchy *hierarchy   = self->hierarchy;
-    const char   *prefix      = CFCParcel_get_prefix(parcel);
-    const char   *PREFIX      = CFCParcel_get_PREFIX(parcel);
-    const char   *privacy_sym = CFCParcel_get_privacy_sym(parcel);
-
-    // Declare object structs for all instantiable classes.
-    char *typedefs = CFCUtil_strdup("");
-    CFCClass **ordered = CFCHierarchy_ordered_classes(hierarchy);
-    for (int i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        const char *class_prefix = CFCClass_get_prefix(klass);
-        if (strcmp(class_prefix, prefix) != 0) { continue; }
-
-        if (!CFCClass_inert(klass)) {
-            const char *full_struct = CFCClass_full_struct_sym(klass);
-            typedefs = CFCUtil_cat(typedefs, "typedef struct ", full_struct,
-                                   " ", full_struct, ";\n", NULL);
-        }
-    }
-    FREEMEM(ordered);
-
-    // Special includes and macros for Clownfish parcel.
-    const char *cfish_includes =
-        "#include <stdarg.h>\n"
-        "#include <stddef.h>\n"
-        "\n"
-        "#include \"cfish_platform.h\"\n"
-        "#include \"cfish_hostdefs.h\"\n";
-
-    // Special definitions for Clownfish parcel.
-    const char *cfish_defs =
-        "#define CFISH_UNUSED_VAR(var) ((void)var)\n"
-        "#define CFISH_UNREACHABLE_RETURN(type) return (type)0\n"
-        "\n"
-        "/* Generic method pointer.\n"
-        " */\n"
-        "typedef void\n"
-        "(*cfish_method_t)(const void *vself);\n"
-        "\n"
-        "/* Access the function pointer for a given method from the vtable.\n"
-        " */\n"
-        "#define CFISH_METHOD_PTR(_vtable, _full_meth) \\\n"
-        "     ((_full_meth ## _t)cfish_method(_vtable, _full_meth ## _OFFSET))\n"
-        "\n"
-        "static CFISH_INLINE cfish_method_t\n"
-        "cfish_method(const void *vtable, size_t offset) {\n"
-        "    union { char *cptr; cfish_method_t *fptr; } ptr;\n"
-        "    ptr.cptr = (char*)vtable + offset;\n"
-        "    return ptr.fptr[0];\n"
-        "}\n"
-        "\n"
-        "typedef struct cfish_Dummy {\n"
-        "   CFISH_OBJ_HEAD\n"
-        "   void *vtable;\n"
-        "} cfish_Dummy;\n"
-        "\n"
-        "/* Access the function pointer for a given method from the object.\n"
-        " */\n"
-        "static CFISH_INLINE cfish_method_t\n"
-        "cfish_obj_method(const void *object, size_t offset) {\n"
-        "    cfish_Dummy *dummy = (cfish_Dummy*)object;\n"
-        "    return cfish_method(dummy->vtable, offset);\n"
-        "}\n"
-        "\n"
-        "/* Access the function pointer for the given method in the superclass's\n"
-        " * vtable. */\n"
-        "#define CFISH_SUPER_METHOD_PTR(_vtable, _full_meth) \\\n"
-        "     ((_full_meth ## _t)cfish_super_method(_vtable, \\\n"
-        "                                           _full_meth ## _OFFSET))\n"
-        "\n"
-        "extern CFISH_VISIBLE size_t cfish_VTable_offset_of_parent;\n"
-        "static CFISH_INLINE cfish_method_t\n"
-        "cfish_super_method(const void *vtable, size_t offset) {\n"
-        "    char *vt_as_char = (char*)vtable;\n"
-        "    cfish_VTable **parent_ptr\n"
-        "        = (cfish_VTable**)(vt_as_char + cfish_VTable_offset_of_parent);\n"
-        "    return cfish_method(*parent_ptr, offset);\n"
-        "}\n"
-        "\n"
-        "/* Structs for VTable initialization.\n"
-        " */\n"
-        "\n"
-        "typedef struct cfish_NovelMethSpec {\n"
-        "    size_t         *offset;\n"
-        "    const char     *name;\n"
-        "    cfish_method_t  func;\n"
-        "    cfish_method_t  callback_func;\n"
-        "} cfish_NovelMethSpec;\n"
-        "\n"
-        "typedef struct cfish_OverriddenMethSpec {\n"
-        "    size_t         *offset;\n"
-        "    size_t         *parent_offset;\n"
-        "    cfish_method_t  func;\n"
-        "} cfish_OverriddenMethSpec;\n"
-        "\n"
-        "typedef struct cfish_InheritedMethSpec {\n"
-        "    size_t *offset;\n"
-        "    size_t *parent_offset;\n"
-        "} cfish_InheritedMethSpec;\n"
-        "\n"
-        "typedef struct cfish_VTableSpec {\n"
-        "    cfish_VTable **vtable;\n"
-        "    cfish_VTable **parent;\n"
-        "    const char    *name;\n"
-        "    size_t         ivars_size;\n"
-        "    size_t        *ivars_offset_ptr;\n"
-        "    uint32_t       num_novel_meths;\n"
-        "    uint32_t       num_overridden_meths;\n"
-        "    uint32_t       num_inherited_meths;\n"
-        "    const cfish_NovelMethSpec      *novel_meth_specs;\n"
-        "    const cfish_OverriddenMethSpec *overridden_meth_specs;\n"
-        "    const cfish_InheritedMethSpec  *inherited_meth_specs;\n"
-        "} cfish_VTableSpec;\n"
-        "\n"
-        "#ifdef CFISH_USE_SHORT_NAMES\n"
-        "  #define METHOD_PTR               CFISH_METHOD_PTR\n"
-        "  #define SUPER_METHOD_PTR         CFISH_SUPER_METHOD_PTR\n"
-        "  #define NovelMethSpec            cfish_NovelMethSpec\n"
-        "  #define OverriddenMethSpec       cfish_OverriddenMethSpec\n"
-        "  #define InheritedMethSpec        cfish_InheritedMethSpec\n"
-        "  #define VTableSpec               cfish_VTableSpec\n"
-        "#endif\n"
-        "\n";
-
-    const char *extra_defs;
-    char *extra_includes;
-    if (strcmp(prefix, "cfish_") == 0) {
-        extra_defs = cfish_defs;
-        extra_includes = CFCUtil_strdup(cfish_includes);
-    }
-    else {
-        extra_defs = "";
-        extra_includes = CFCUtil_strdup("");
-
-        // Include parcel.h of dependent parcels.
-        CFCParcel **dep_parcels = CFCParcel_dependent_parcels(parcel);
-        for (size_t i = 0; dep_parcels[i]; ++i) {
-            const char *dep_prefix = CFCParcel_get_prefix(dep_parcels[i]);
-            extra_includes = CFCUtil_cat(extra_includes, "#include <",
-                                         dep_prefix, "parcel.h>\n", NULL);
-        }
-        FREEMEM(dep_parcels);
-    }
-
-    const char pattern[] =
-        "%s\n"
-        "#ifndef CFISH_%sPARCEL_H\n"
-        "#define CFISH_%sPARCEL_H 1\n"
-        "\n"
-        "#ifdef __cplusplus\n"
-        "extern \"C\" {\n"
-        "#endif\n"
-        "\n"
-        "%s" // Extra includes.
-        "\n"
-        "#ifdef %s\n"
-        "  #define %sVISIBLE CFISH_EXPORT\n"
-        "#else\n"
-        "  #define %sVISIBLE CFISH_IMPORT\n"
-        "#endif\n"
-        "\n"
-        "%s" // Typedefs.
-        "\n"
-        "%s" // Extra definitions.
-        "%sVISIBLE void\n"
-        "%sbootstrap_inheritance();\n"
-        "\n"
-        "%sVISIBLE void\n"
-        "%sbootstrap_parcel();\n"
-        "\n"
-        "void\n"
-        "%sinit_parcel();\n"
-        "\n"
-        "#ifdef __cplusplus\n"
-        "}\n"
-        "#endif\n"
-        "\n"
-        "#endif /* CFISH_%sPARCEL_H */\n"
-        "\n"
-        "%s\n"
-        "\n";
-    char *file_content
-        = CFCUtil_sprintf(pattern, self->header, PREFIX, PREFIX,
-                          extra_includes, privacy_sym, PREFIX, PREFIX,
-                          typedefs, extra_defs, PREFIX, prefix, PREFIX, prefix,
-                          prefix, PREFIX, self->footer);
-
-    // Unlink then write file.
-    const char *inc_dest = CFCHierarchy_get_include_dest(hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "%sparcel.h", inc_dest,
-                                     prefix);
-    remove(filepath);
-    CFCUtil_write_file(filepath, file_content, strlen(file_content));
-    FREEMEM(filepath);
-
-    FREEMEM(typedefs);
-    FREEMEM(extra_includes);
-    FREEMEM(file_content);
-}
-
-static void
-S_write_parcel_c(CFCBindCore *self, CFCParcel *parcel) {
-    CFCHierarchy *hierarchy = self->hierarchy;
-    const char   *prefix    = CFCParcel_get_prefix(parcel);
-
-    // Aggregate C code for the parcel.
-    char *privacy_syms = CFCUtil_strdup("");
-    char *includes     = CFCUtil_strdup("");
-    char *c_data       = CFCUtil_strdup("");
-    char *vt_specs = CFCUtil_strdup(
-        "static const cfish_VTableSpec vtable_specs[] = {\n");
-    int num_specs = 0;
-    CFCClass **ordered  = CFCHierarchy_ordered_classes(hierarchy);
-    for (int i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        const char *class_prefix = CFCClass_get_prefix(klass);
-        if (strcmp(class_prefix, prefix) != 0) { continue; }
-
-        const char *include_h = CFCClass_include_h(klass);
-        includes = CFCUtil_cat(includes, "#include \"", include_h,
-                               "\"\n", NULL);
-
-        CFCBindClass *class_binding = CFCBindClass_new(klass);
-        char *class_c_data = CFCBindClass_to_c_data(class_binding);
-        c_data = CFCUtil_cat(c_data, class_c_data, "\n", NULL);
-        FREEMEM(class_c_data);
-        if (!CFCClass_inert(klass)) {
-            if (num_specs != 0) {
-                vt_specs = CFCUtil_cat(vt_specs, ",\n", NULL);
-            }
-            char *vt_spec = CFCBindClass_spec_def(class_binding);
-            vt_specs = CFCUtil_cat(vt_specs, vt_spec, NULL);
-            FREEMEM(vt_spec);
-            ++num_specs;
-        }
-        CFCBase_decref((CFCBase*)class_binding);
-        const char *privacy_sym = CFCClass_privacy_symbol(klass);
-        privacy_syms = CFCUtil_cat(privacy_syms, "#define ",
-                                   privacy_sym, "\n", NULL);
-    }
-    vt_specs = CFCUtil_cat(vt_specs, "\n};\n", NULL);
-    FREEMEM(ordered);
-
-    // Bootstrapping code for dependent parcels.
-    //
-    // bootstrap_inheritance() first calls bootstrap_inheritance() for all
-    // parcels from which classes are inherited. Then the VTables of the parcel
-    // are initialized. It aborts on recursive invocation.
-    //
-    // bootstrap_parcel() first calls bootstrap_inheritance() of its own
-    // parcel. Then it calls bootstrap_parcel() for all dependent parcels.
-    // Finally, it calls init_parcel(). Recursive invocation is allowed.
-
-    char *inh_bootstrap = CFCUtil_strdup("");
-    char *dep_bootstrap = CFCUtil_strdup("");
-    CFCParcel **inh_parcels = CFCParcel_inherited_parcels(parcel);
-    for (size_t i = 0; inh_parcels[i]; ++i) {
-        const char *inh_prefix = CFCParcel_get_prefix(inh_parcels[i]);
-        inh_bootstrap = CFCUtil_cat(inh_bootstrap, "    ", inh_prefix,
-                                    "bootstrap_inheritance();\n", NULL);
-    }
-    FREEMEM(inh_parcels);
-    CFCParcel **dep_parcels = CFCParcel_dependent_parcels(parcel);
-    for (size_t i = 0; dep_parcels[i]; ++i) {
-        const char *dep_prefix = CFCParcel_get_prefix(dep_parcels[i]);
-        dep_bootstrap = CFCUtil_cat(dep_bootstrap, "    ", dep_prefix,
-                                    "bootstrap_parcel();\n", NULL);
-    }
-    FREEMEM(dep_parcels);
-
-    char pattern[] =
-        "%s\n"
-        "\n"
-        "#define C_CFISH_VTABLE\n"          // Needed for abstract methods.
-        "#include <stdio.h>\n"
-        "#include <stdlib.h>\n"
-        "%s\n"
-        "#include \"%sparcel.h\"\n"
-        "#include \"callbacks.h\"\n"
-        "#include \"Clownfish/String.h\"\n"  // Needed for dump/load.
-        "#include \"Clownfish/Err.h\"\n"     // Needed for dump/load.
-        "#include \"Clownfish/Num.h\"\n"     // Needed for dump/load.
-        "#include \"Clownfish/VArray.h\"\n"  // Needed for dump/load.
-        "#include \"Clownfish/VTable.h\"\n"  // Needed for bootstrap.
-        "%s\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* VTableSpec structs for initialization.\n"
-        " */\n"
-        "%s\n"
-        "\n"
-        "static int bootstrap_state = 0;\n"
-        "\n"
-        "void\n"
-        "%sbootstrap_inheritance() {\n"
-        "    if (bootstrap_state == 1) {\n"
-        "        fprintf(stderr, \"Cycle in class inheritance between\"\n"
-        "                        \" parcels detected.\\n\");\n"
-        "        abort();\n"
-        "    }\n"
-        "    if (bootstrap_state >= 2) { return; }\n"
-        "    bootstrap_state = 1;\n"
-        "%s" // Bootstrap inherited parcels.
-        "    cfish_VTable_bootstrap(vtable_specs, %d);\n"
-        "    bootstrap_state = 2;\n"
-        "}\n"
-        "\n"
-        "void\n"
-        "%sbootstrap_parcel() {\n"
-        "    if (bootstrap_state >= 3) { return; }\n"
-        "    %sbootstrap_inheritance();\n"
-        "    bootstrap_state = 3;\n"
-        "%s" // Finish bootstrapping of all dependent parcels.
-        "    %sinit_parcel();\n"
-        "}\n"
-        "\n"
-        "%s\n";
-    char *file_content
-        = CFCUtil_sprintf(pattern, self->header, privacy_syms, prefix,
-                          includes, c_data, vt_specs, prefix, inh_bootstrap,
-                          num_specs, prefix, prefix, dep_bootstrap, prefix,
-                          self->footer);
-
-    // Unlink then open file.
-    const char *src_dest = CFCHierarchy_get_source_dest(hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "%sparcel.c", src_dest,
-                                     prefix);
-    remove(filepath);
-    CFCUtil_write_file(filepath, file_content, strlen(file_content));
-    FREEMEM(filepath);
-
-    FREEMEM(privacy_syms);
-    FREEMEM(includes);
-    FREEMEM(c_data);
-    FREEMEM(vt_specs);
-    FREEMEM(inh_bootstrap);
-    FREEMEM(dep_bootstrap);
-    FREEMEM(file_content);
-}
-
-/* Write the "callbacks.h" header file, which contains declarations of host
- * callbacks.
- */
-void
-CFCBindCore_write_callbacks_h(CFCBindCore *self) {
-    CFCHierarchy  *hierarchy   = self->hierarchy;
-    CFCClass     **ordered     = CFCHierarchy_ordered_classes(hierarchy);
-    char          *includes    = CFCUtil_strdup("");
-    char          *all_cb_decs = CFCUtil_strdup("");
-
-    for (int i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-
-        const char *include_h = CFCClass_include_h(klass);
-        includes = CFCUtil_cat(includes, "#include \"", include_h, "\"\n",
-                               NULL);
-
-        if (!CFCClass_included(klass)) {
-            CFCBindClass *class_binding = CFCBindClass_new(klass);
-            char *cb_decs = CFCBindClass_callback_decs(class_binding);
-            all_cb_decs = CFCUtil_cat(all_cb_decs, cb_decs, NULL);
-            FREEMEM(cb_decs);
-            CFCBase_decref((CFCBase*)class_binding);
-        }
-    }
-
-    FREEMEM(ordered);
-
-    const char pattern[] =
-        "%s\n"
-        "#ifndef CFCCALLBACKS_H\n"
-        "#define CFCCALLBACKS_H 1\n"
-        "\n"
-        "#ifdef __cplusplus\n"
-        "extern \"C\" {\n"
-        "#endif\n"
-        "\n"
-        "%s"
-        "\n"
-        "%s"
-        "\n"
-        "#ifdef __cplusplus\n"
-        "}\n"
-        "#endif\n"
-        "\n"
-        "#endif /* CFCCALLBACKS_H */\n"
-        "\n"
-        "%s\n"
-        "\n";
-    char *file_content
-        = CFCUtil_sprintf(pattern, self->header, includes, all_cb_decs,
-                          self->footer);
-
-    // Unlink then write file.
-    const char *inc_dest = CFCHierarchy_get_include_dest(hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "callbacks.h", inc_dest);
-    remove(filepath);
-    CFCUtil_write_file(filepath, file_content, strlen(file_content));
-    FREEMEM(filepath);
-
-    FREEMEM(includes);
-    FREEMEM(all_cb_decs);
-    FREEMEM(file_content);
-}
-
-/* Write the "cfish_platform.h" header file, which contains platform-specific
- * definitions.
- */
-static void
-S_write_platform_h(CFCBindCore *self) {
-    char *feature_defs = S_charmony_feature_defines();
-    char *string_defs  = S_charmony_string_defines();
-    char *stdbool_defs = S_charmony_stdbool_defines();
-    char *stdint_defs  = S_charmony_stdint_defines();
-    char *alloca_defs  = S_charmony_alloca_defines();
-
-    const char pattern[] =
-        "%s"
-        "\n"
-        "#ifndef CFISH_PLATFORM_H\n"
-        "#define CFISH_PLATFORM_H 1\n"
-        "\n"
-        "#ifdef __cplusplus\n"
-        "extern \"C\" {\n"
-        "#endif\n"
-        "\n"
-        "%s"
-        "%s"
-        "\n"
-        "%s"
-        "%s"
-        "\n"
-        "%s"
-        "\n"
-        "#ifdef __cplusplus\n"
-        "}\n"
-        "#endif\n"
-        "\n"
-        "#endif /* CFISH_PLATFORM_H */\n"
-        "\n"
-        "%s"
-        "\n";
-    char *file_content
-        = CFCUtil_sprintf(pattern, self->header, feature_defs, string_defs,
-                          stdbool_defs, stdint_defs, alloca_defs,
-                          self->footer);
-
-    // Unlink then write file.
-    const char *inc_dest = CFCHierarchy_get_include_dest(self->hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "cfish_platform.h",
-                                     inc_dest);
-    remove(filepath);
-    CFCUtil_write_file(filepath, file_content, strlen(file_content));
-    FREEMEM(filepath);
-
-    FREEMEM(feature_defs);
-    FREEMEM(string_defs);
-    FREEMEM(stdbool_defs);
-    FREEMEM(stdint_defs);
-    FREEMEM(alloca_defs);
-    FREEMEM(file_content);
-}
-
-static char*
-S_charmony_feature_defines() {
-    char *defines = CFCUtil_strdup("");
-
-#ifdef CHY_HAS_WINDOWS_H
-    defines = CFCUtil_cat(defines, "#define CFISH_HAS_WINDOWS_H\n", NULL);
-#endif
-#ifdef CHY_HAS_SYS_ATOMIC_H
-    defines = CFCUtil_cat(defines, "#define CFISH_HAS_SYS_ATOMIC_H\n", NULL);
-#endif
-#ifdef CHY_HAS_PTHREAD_H
-    defines = CFCUtil_cat(defines, "#define CFISH_HAS_PTHREAD_H\n", NULL);
-#endif
-#ifdef CHY_LITTLE_END
-    defines = CFCUtil_cat(defines, "#define CFISH_LITTLE_END\n", NULL);
-#endif
-#ifdef CHY_BIG_END
-    defines = CFCUtil_cat(defines, "#define CFISH_BIG_END\n", NULL);
-#endif
-#ifdef CHY_HAS_FUNC_MACRO
-    defines = CFCUtil_cat(defines, "#define CFISH_HAS_FUNC_MACRO\n", NULL);
-#endif
-#ifdef CHY_HAS_VARIADIC_MACROS
-    defines = CFCUtil_cat(defines, "#define CFISH_HAS_VARIADIC_MACROS\n",
-                          NULL);
-#endif
-#ifdef CHY_HAS_ISO_VARIADIC_MACROS
-    defines = CFCUtil_cat(defines, "#define CFISH_HAS_ISO_VARIADIC_MACROS\n",
-                          NULL);
-#endif
-#ifdef CHY_HAS_GNUC_VARIADIC_MACROS
-    defines = CFCUtil_cat(defines, "#define CFISH_HAS_GNUC_VARIADIC_MACROS\n",
-                          NULL);
-#endif
-#ifdef CHY_HAS_OSATOMIC_CAS_PTR
-    defines = CFCUtil_cat(defines, "#define CFISH_HAS_OSATOMIC_CAS_PTR\n",
-                          NULL);
-#endif
-
-    return defines;
-}
-
-static char*
-S_charmony_string_defines() {
-    const char *pattern =
-        "#define CFISH_INLINE %s\n"
-        "#define CFISH_EXPORT %s\n"
-        "#define CFISH_IMPORT %s\n"
-        "#define CFISH_SIZEOF_CHAR %s\n"
-        "#define CFISH_SIZEOF_SHORT %s\n"
-        "#define CFISH_SIZEOF_INT %s\n"
-        "#define CFISH_SIZEOF_LONG %s\n"
-        "#define CFISH_SIZEOF_SIZE_T %s\n"
-        "#define CFISH_FUNC_MACRO %s\n"
-        "#define CFISH_U64_TO_DOUBLE(x) %s\n";
-    char *defines
-        = CFCUtil_sprintf(pattern,
-                          XSTRING(CHY_INLINE),
-                          XSTRING(CHY_EXPORT),
-                          XSTRING(CHY_IMPORT),
-                          XSTRING(CHY_SIZEOF_CHAR),
-                          XSTRING(CHY_SIZEOF_SHORT),
-                          XSTRING(CHY_SIZEOF_INT),
-                          XSTRING(CHY_SIZEOF_LONG),
-                          XSTRING(CHY_SIZEOF_SIZE_T),
-                          XSTRING(CHY_FUNC_MACRO),
-                          XSTRING(CHY_U64_TO_DOUBLE(x)));
-
-    return defines;
-}
-
-static char*
-S_charmony_stdbool_defines() {
-#ifdef CHY_HAS_STDBOOL_H
-    const char *defines = "#include <stdbool.h>\n";
-#else
-    const char *defines =
-        "#if (!defined(__cplusplus) && !defined(CFISH_HAS_STDBOOL))\n"
-        "  typedef int bool;\n"
-        "  #ifndef true\n"
-        "    #define true 1\n"
-        "  #endif\n"
-        "  #ifndef false\n"
-        "    #define false 0\n"
-        "  #endif\n"
-        "#endif\n";
-#endif
-
-    return CFCUtil_strdup(defines);
-}
-
-static char*
-S_charmony_stdint_defines() {
-#ifdef CHY_HAS_STDINT_H
-    return CFCUtil_strdup("#include <stdint.h>\n");
-#else
-    const char *pattern =
-        "#ifndef CFISH_HAS_STDINT\n"
-        "  typedef %s int8_t;\n"
-        "  typedef %s uint8_t;\n"
-        "  typedef %s int16_t;\n"
-        "  typedef %s uint16_t;\n"
-        "  typedef %s int32_t;\n"
-        "  typedef %s uint32_t;\n"
-        "  typedef %s int64_t;\n"
-        "  typedef %s uint64_t;\n"
-        "#endif\n";
-    return CFCUtil_sprintf(pattern,
-                           XSTRING(CHY_INT8_T),  XSTRING(CHY_UINT8_T),
-                           XSTRING(CHY_INT16_T), XSTRING(CHY_UINT16_T),
-                           XSTRING(CHY_INT32_T), XSTRING(CHY_UINT32_T),
-                           XSTRING(CHY_INT64_T), XSTRING(CHY_UINT64_T));
-#endif
-}
-
-static char*
-S_charmony_alloca_defines() {
-    char *defines = CFCUtil_strdup("");
-
-#if defined(CHY_HAS_ALLOCA_H)
-    defines = CFCUtil_cat(defines, "#include <alloca.h>\n", NULL);
-#elif defined(CHY_HAS_MALLOC_H)
-    defines = CFCUtil_cat(defines, "#include <malloc.h>\n", NULL);
-#elif defined(CHY_ALLOCA_IN_STDLIB_H)
-    defines = CFCUtil_cat(defines, "#include <stdlib.h>\n", NULL);
-#endif
-
-    defines = CFCUtil_cat(defines, "#define cfish_alloca ",
-                          XSTRING(chy_alloca), "\n", NULL);
-
-    return defines;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindCore.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindCore.h b/clownfish/compiler/src/CFCBindCore.h
deleted file mode 100644
index 33fdd82..0000000
--- a/clownfish/compiler/src/CFCBindCore.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Binding::Core - Generate core C code for a
- * Clownfish::CFC::Model::Hierarchy.
- *
- * A Clownfish::CFC::Model::Hierarchy describes an abstract specifiction for a
- * class hierarchy; Clownfish::CFC::Binding::Core is responsible for
- * auto-generating C code which implements that specification.
- */
-#ifndef H_CFCBINDCORE
-#define H_CFCBINDCORE
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCBindCore CFCBindCore;
-struct CFCHierarchy;
-
-
-/**
- * @param hierarchy A L<Clownfish::CFC::Model::Hierarchy>.
- * @param header Text which will be prepended to each generated C file --
- * typically, an "autogenerated file" warning.
- * @param footer Text to be appended to the end of each generated C file --
- * typically copyright information.
- */
-CFCBindCore*
-CFCBindCore_new(struct CFCHierarchy *hierarchy, const char *header,
-                const char *footer);
-
-CFCBindCore*
-CFCBindCore_init(CFCBindCore *self, struct CFCHierarchy *hierarchy,
-                 const char *header, const char *footer);
-
-void
-CFCBindCore_destroy(CFCBindCore *self);
-
-/** Call <code>CFCHierarchy_propagate_modified</code>to establish which
- * classes do not have up-to-date generated .c and .h files, then traverse the
- * hierarchy writing all necessary files.
- */
-int
-CFCBindCore_write_all_modified(CFCBindCore *self, int modified);
-
-/** Write the "callbacks.h" header file, which contains declarations of host
- * callbacks.
- */
-void
-CFCBindCore_write_callbacks_h(CFCBindCore *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCBINDCORE */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindFile.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindFile.c b/clownfish/compiler/src/CFCBindFile.c
deleted file mode 100644
index 928254d..0000000
--- a/clownfish/compiler/src/CFCBindFile.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <stdio.h>
-#include <string.h>
-#include "CFCBindFile.h"
-#include "CFCBindClass.h"
-#include "CFCBase.h"
-#include "CFCFile.h"
-#include "CFCClass.h"
-#include "CFCCBlock.h"
-#include "CFCParcel.h"
-#include "CFCUtil.h"
-
-void
-CFCBindFile_write_h(CFCFile *file, const char *dest, const char *header,
-                    const char *footer) {
-    CFCUTIL_NULL_CHECK(file);
-    CFCUTIL_NULL_CHECK(dest);
-    CFCUTIL_NULL_CHECK(header);
-    CFCUTIL_NULL_CHECK(footer);
-
-    // Make directories.
-    char *h_path = CFCFile_h_path(file, dest);
-    char *h_dir  = CFCUtil_strdup(h_path);
-    for (size_t len = strlen(h_dir); len--;) {
-        if (h_dir[len] == CHY_DIR_SEP_CHAR) {
-            h_dir[len] = 0;
-            break;
-        }
-    }
-    if (!CFCUtil_is_dir(h_dir)) {
-        CFCUtil_make_path(h_dir);
-        if (!CFCUtil_is_dir(h_dir)) {
-            CFCUtil_die("Can't make path %s", h_dir);
-        }
-    }
-    FREEMEM(h_dir);
-
-    // Create the include-guard strings.
-    const char *include_guard_start = CFCFile_guard_start(file);
-    const char *include_guard_close = CFCFile_guard_close(file);
-
-    // Aggregate block content.
-    char *content = CFCUtil_strdup("");
-    CFCBase **blocks = CFCFile_blocks(file);
-    for (int i = 0; blocks[i] != NULL; i++) {
-        const char *cfc_class = CFCBase_get_cfc_class(blocks[i]);
-
-        if (strcmp(cfc_class, "Clownfish::CFC::Model::Parcel") == 0) {
-            CFCParcel *parcel = (CFCParcel*)blocks[i];
-            const char *prefix = CFCParcel_get_prefix(parcel);
-            content = CFCUtil_cat(content, "#include \"", prefix,
-                                  "parcel.h\"\n\n", NULL);
-        }
-        else if (strcmp(cfc_class, "Clownfish::CFC::Model::Class") == 0) {
-            CFCBindClass *class_binding
-                = CFCBindClass_new((CFCClass*)blocks[i]);
-            char *c_header = CFCBindClass_to_c_header(class_binding);
-            content = CFCUtil_cat(content, c_header, "\n", NULL);
-            FREEMEM(c_header);
-            CFCBase_decref((CFCBase*)class_binding);
-        }
-        else if (strcmp(cfc_class, "Clownfish::CFC::Model::CBlock") == 0) {
-            const char *block_contents 
-                = CFCCBlock_get_contents((CFCCBlock*)blocks[i]);
-            content = CFCUtil_cat(content, block_contents, "\n", NULL);
-        }
-        else {
-            CFCUtil_die("Unexpected class: %s", cfc_class);
-        }
-    }
-
-    char pattern[] =
-        "%s\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "#ifdef __cplusplus\n"
-        "extern \"C\" {\n"
-        "#endif\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "#ifdef __cplusplus\n"
-        "}\n"
-        "#endif\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "%s\n"
-        "\n";
-    char *file_content
-        = CFCUtil_sprintf(pattern, header, include_guard_start, content,
-                          include_guard_close, footer);
-
-    // Unlink then write file.
-    remove(h_path);
-    CFCUtil_write_file(h_path, file_content, strlen(file_content));
-
-    FREEMEM(content);
-    FREEMEM(file_content);
-    FREEMEM(h_path);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindFile.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindFile.h b/clownfish/compiler/src/CFCBindFile.h
deleted file mode 100644
index 4b24923..0000000
--- a/clownfish/compiler/src/CFCBindFile.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCBINDFILE
-#define H_CFCBINDFILE
-
-/** Clownfish::CFC::Binding::Core::File - Generate core C code for a Clownfish file.
- *
- * This module is the companion to Clownfish::CFC::Model::File, generating the
- * C code needed to implement the file's specification.
- *
- * There is a one-to-one mapping between Clownfish header files and
- * autogenerated .h and .c files.  If Foo.cfh includes both Foo and
- * Foo::FooJr, then it is necessary to pound-include "Foo.h" in order to get
- * FooJr's interface -- not "Foo/FooJr.h", which won't exist.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct CFCFile;
-
-/** Generate a C header file containing all class declarations and literal C
- * blocks.
- *
- * @param file A Clownfish::CFC::Model::File.
- * @param dest The directory under which autogenerated files are being
- * written.
- * @param header Text which will be prepended to each generated C file --
- * typically, an "autogenerated file" warning.
- * @param footer Text to be appended to the end of each generated C file --
- * typically copyright information.
- */
-void
-CFCBindFile_write_h(struct CFCFile *file, const char *dest,
-                    const char *header, const char *footer);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCBINDFILE */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindFunction.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindFunction.c b/clownfish/compiler/src/CFCBindFunction.c
deleted file mode 100644
index ae71d84..0000000
--- a/clownfish/compiler/src/CFCBindFunction.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "CFCBindFunction.h"
-#include "CFCUtil.h"
-#include "CFCFunction.h"
-#include "CFCParamList.h"
-#include "CFCType.h"
-
-char*
-CFCBindFunc_func_declaration(CFCFunction *func) {
-    CFCType      *return_type    = CFCFunction_get_return_type(func);
-    CFCParamList *param_list     = CFCFunction_get_param_list(func);
-    const char   *ret_type_str   = CFCType_to_c(return_type);
-    const char   *full_func_sym  = CFCFunction_full_func_sym(func);
-    const char   *param_list_str = CFCParamList_to_c(param_list);
-    const char   *inline_prop    = CFCFunction_inline(func)
-                                   ? "static CFISH_INLINE "
-                                   : "";
-    char *buf = CFCUtil_sprintf("%s%s\n%s(%s);", inline_prop, ret_type_str,
-                                full_func_sym, param_list_str);
-    return buf;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindFunction.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindFunction.h b/clownfish/compiler/src/CFCBindFunction.h
deleted file mode 100644
index 5297b01..0000000
--- a/clownfish/compiler/src/CFCBindFunction.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Binding::Core::Function - Generate core C code for a function.
- */
-
-#ifndef H_CFCBINDFUNCTION
-#define H_CFCBINDFUNCTION
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct CFCFunction;
-
-/** Return C code declaring the function's C implementation.
- */
-char*
-CFCBindFunc_func_declaration(struct CFCFunction *func);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCBINDFUNCTION */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindMethod.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindMethod.c b/clownfish/compiler/src/CFCBindMethod.c
deleted file mode 100644
index 3448e44..0000000
--- a/clownfish/compiler/src/CFCBindMethod.c
+++ /dev/null
@@ -1,309 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "CFCBindMethod.h"
-#include "CFCUtil.h"
-#include "CFCMethod.h"
-#include "CFCFunction.h"
-#include "CFCParamList.h"
-#include "CFCType.h"
-#include "CFCVariable.h"
-#include "CFCSymbol.h"
-#include "CFCClass.h"
-
-/* Create a macro definition that aliases to a function name directly, since
- * this method may not be overridden. */
-static char*
-S_final_method_def(CFCMethod *method, CFCClass *klass);
-
-static char*
-S_virtual_method_def(CFCMethod *method, CFCClass *klass);
-
-/* Take a NULL-terminated list of CFCVariables and build up a string of
- * directives like:
- *
- *     UNUSED_VAR(var1);
- *     UNUSED_VAR(var2);
- */
-static char*
-S_build_unused_vars(CFCVariable **vars);
-
-/* Create an unreachable return statement if necessary, in order to thwart
- * compiler warnings. */
-static char*
-S_maybe_unreachable(CFCType *return_type);
-
-char*
-CFCBindMeth_method_def(CFCMethod *method, CFCClass *klass) {
-    if (CFCMethod_final(method)) {
-        return S_final_method_def(method, klass);
-    }
-    else {
-        return S_virtual_method_def(method, klass);
-    }
-}
-
-/* Create a macro definition that aliases to a function name directly, since
- * this method may not be overridden. */
-static char*
-S_final_method_def(CFCMethod *method, CFCClass *klass) {
-    const char *self_type = CFCType_to_c(CFCMethod_self_type(method));
-    const char *full_func_sym = CFCMethod_imp_func(method);
-    const char *arg_names 
-        = CFCParamList_name_list(CFCMethod_get_param_list(method));
-
-    char *full_meth_sym   = CFCMethod_full_method_sym(method, klass);
-    char *full_offset_sym = CFCMethod_full_offset_sym(method, klass);
-
-    const char pattern[] =
-        "extern size_t %s;\n"
-        "#define %s(%s) \\\n"
-        "    %s((%s)%s)\n";
-    char *method_def
-        = CFCUtil_sprintf(pattern, full_offset_sym, full_meth_sym, arg_names,
-                          full_func_sym, self_type, arg_names);
-
-    FREEMEM(full_offset_sym);
-    FREEMEM(full_meth_sym);
-    return method_def;
-}
-
-static char*
-S_virtual_method_def(CFCMethod *method, CFCClass *klass) {
-    CFCParamList *param_list = CFCMethod_get_param_list(method);
-    const char *PREFIX         = CFCClass_get_PREFIX(klass);
-    const char *invoker_struct = CFCClass_full_struct_sym(klass);
-
-    char *full_meth_sym   = CFCMethod_full_method_sym(method, klass);
-    char *full_offset_sym = CFCMethod_full_offset_sym(method, klass);
-    char *full_typedef    = CFCMethod_full_typedef(method, klass);
-
-    // Prepare parameter lists, minus invoker.  The invoker gets forced to
-    // "self" later.
-    if (CFCParamList_variadic(param_list)) {
-        CFCUtil_die("Variadic methods not supported");
-    }
-    const char *arg_names_minus_invoker = CFCParamList_name_list(param_list);
-    const char *params_minus_invoker    = CFCParamList_to_c(param_list);
-    while (*arg_names_minus_invoker && *arg_names_minus_invoker != ',') {
-        arg_names_minus_invoker++;
-    }
-    while (*params_minus_invoker && *params_minus_invoker != ',') {
-        params_minus_invoker++;
-    }
-
-    // Prepare a return statement... or not.
-    CFCType *return_type = CFCMethod_get_return_type(method);
-    const char *ret_type_str = CFCType_to_c(return_type);
-    const char *maybe_return = CFCType_is_void(return_type) ? "" : "return ";
-
-    const char pattern[] =
-        "extern %sVISIBLE size_t %s;\n"
-        "static CFISH_INLINE %s\n"
-        "%s(%s *self%s) {\n"
-        "    const %s method = (%s)cfish_obj_method(self, %s);\n"
-        "    %smethod(self%s);\n"
-        "}\n";
-    char *method_def
-        = CFCUtil_sprintf(pattern, PREFIX, full_offset_sym, ret_type_str,
-                          full_meth_sym, invoker_struct, params_minus_invoker,
-                          full_typedef, full_typedef, full_offset_sym,
-                          maybe_return, arg_names_minus_invoker);
-
-    FREEMEM(full_offset_sym);
-    FREEMEM(full_meth_sym);
-    FREEMEM(full_typedef);
-    return method_def;
-}
-
-char*
-CFCBindMeth_typedef_dec(struct CFCMethod *method, CFCClass *klass) {
-    const char *params_minus_invoker
-        = CFCParamList_to_c(CFCMethod_get_param_list(method));
-    while (*params_minus_invoker && *params_minus_invoker != ',') {
-        params_minus_invoker++;
-    }
-    const char *self_struct = CFCClass_full_struct_sym(klass);
-    const char *ret_type = CFCType_to_c(CFCMethod_get_return_type(method));
-    char *full_typedef = CFCMethod_full_typedef(method, klass);
-    char *buf = CFCUtil_sprintf("typedef %s\n(*%s)(%s *self%s);\n", ret_type,
-                                full_typedef, self_struct,
-                                params_minus_invoker);
-    FREEMEM(full_typedef);
-    return buf;
-}
-
-char*
-CFCBindMeth_novel_spec_def(CFCMethod *method) {
-    const char *macro_sym = CFCMethod_get_macro_sym(method);
-    const char *imp_func  = CFCMethod_imp_func(method);
-
-    const char *full_override_sym = "NULL";
-    if (!CFCMethod_final(method)) {
-        full_override_sym = CFCMethod_full_override_sym(method);
-    }
-
-    char *full_offset_sym = CFCMethod_full_offset_sym(method, NULL);
-
-    char pattern[] =
-        "    {\n"
-        "        &%s, /* offset */\n"
-        "        \"%s\", /* name */\n"
-        "        (cfish_method_t)%s, /* func */\n"
-        "        (cfish_method_t)%s /* callback_func */\n"
-        "    }";
-    char *def
-        = CFCUtil_sprintf(pattern, full_offset_sym, macro_sym, imp_func,
-                          full_override_sym);
-
-    FREEMEM(full_offset_sym);
-    return def;
-}
-
-char*
-CFCBindMeth_overridden_spec_def(CFCMethod *method, CFCClass *klass) {
-    const char *imp_func  = CFCMethod_imp_func(method);
-
-    char *full_offset_sym = CFCMethod_full_offset_sym(method, NULL);
-
-    CFCClass *parent = CFCClass_get_parent(klass);
-    char *parent_offset_sym = CFCMethod_full_offset_sym(method, parent);
-
-    char pattern[] =
-        "    {\n"
-        "        &%s, /* offset */\n"
-        "        &%s, /* parent_offset */\n"
-        "        (cfish_method_t)%s /* func */\n"
-        "    }";
-    char *def
-        = CFCUtil_sprintf(pattern, full_offset_sym, parent_offset_sym,
-                          imp_func);
-
-    FREEMEM(full_offset_sym);
-    FREEMEM(parent_offset_sym);
-    return def;
-}
-
-char*
-CFCBindMeth_inherited_spec_def(CFCMethod *method, CFCClass *klass) {
-    char *full_offset_sym = CFCMethod_full_offset_sym(method, klass);
-
-    CFCClass *parent = CFCClass_get_parent(klass);
-    char *parent_offset_sym = CFCMethod_full_offset_sym(method, parent);
-
-    char pattern[] =
-        "    {\n"
-        "        &%s, /* offset */\n"
-        "        &%s /* parent_offset */\n"
-        "    }";
-    char *def = CFCUtil_sprintf(pattern, full_offset_sym, parent_offset_sym);
-
-    FREEMEM(full_offset_sym);
-    FREEMEM(parent_offset_sym);
-    return def;
-}
-
-static char*
-S_build_unused_vars(CFCVariable **vars) {
-    char *unused = CFCUtil_strdup("");
-
-    for (int i = 0; vars[i] != NULL; i++) {
-        const char *var_name = CFCVariable_micro_sym(vars[i]);
-        size_t size = strlen(unused) + strlen(var_name) + 80;
-        unused = (char*)REALLOCATE(unused, size);
-        strcat(unused, "\n    CFISH_UNUSED_VAR(");
-        strcat(unused, var_name);
-        strcat(unused, ");");
-    }
-
-    return unused;
-}
-
-static char*
-S_maybe_unreachable(CFCType *return_type) {
-    char *return_statement;
-    if (CFCType_is_void(return_type)) {
-        return_statement = CFCUtil_strdup("");
-    }
-    else {
-        const char *ret_type_str = CFCType_to_c(return_type);
-        char pattern[] = "\n    CFISH_UNREACHABLE_RETURN(%s);";
-        return_statement = CFCUtil_sprintf(pattern, ret_type_str);
-    }
-    return return_statement;
-}
-
-char*
-CFCBindMeth_abstract_method_def(CFCMethod *method) {
-    CFCParamList *param_list = CFCMethod_get_param_list(method);
-    const char *params = CFCParamList_to_c(param_list);
-    const char *full_func_sym = CFCMethod_imp_func(method);
-    const char *vtable_var
-        = CFCType_get_vtable_var(CFCMethod_self_type(method));
-    CFCType    *return_type  = CFCMethod_get_return_type(method);
-    const char *ret_type_str = CFCType_to_c(return_type);
-    const char *macro_sym    = CFCMethod_get_macro_sym(method);
-
-    // Thwart compiler warnings.
-    CFCVariable **param_vars = CFCParamList_get_variables(param_list);
-    char *unused = S_build_unused_vars(param_vars + 1);
-    char *return_statement = S_maybe_unreachable(return_type);
-
-    char pattern[] =
-        "%s\n"
-        "%s(%s) {\n"
-        "    cfish_String *klass = self ? CFISH_Obj_Get_Class_Name((cfish_Obj*)self) : %s->name;%s\n"
-        "    CFISH_THROW(CFISH_ERR, \"Abstract method '%s' not defined by %%o\", klass);%s\n"
-        "}\n";
-    char *abstract_def
-        = CFCUtil_sprintf(pattern, ret_type_str, full_func_sym, params,
-                          vtable_var, unused, macro_sym, return_statement);
-
-    FREEMEM(unused);
-    FREEMEM(return_statement);
-    return abstract_def;
-}
-
-char*
-CFCBindMeth_callback_dec(CFCMethod *method) {
-    CFCType *return_type = CFCMethod_get_return_type(method);
-    const char *ret_type_str = CFCType_to_c(return_type);
-    const char *override_sym = CFCMethod_full_override_sym(method);
-    const char *params = CFCParamList_to_c(CFCMethod_get_param_list(method));
-
-    char pattern[] =
-        "%s\n"
-        "%s(%s);\n";
-    char *callback_dec
-        = CFCUtil_sprintf(pattern, ret_type_str, override_sym, params);
-
-    return callback_dec;
-}
-
-char*
-CFCBindMeth_imp_declaration(CFCMethod *method) {
-    CFCType      *return_type    = CFCMethod_get_return_type(method);
-    CFCParamList *param_list     = CFCMethod_get_param_list(method);
-    const char   *ret_type_str   = CFCType_to_c(return_type);
-    const char   *full_imp_sym   = CFCMethod_imp_func(method);
-    const char   *param_list_str = CFCParamList_to_c(param_list);
-    char *buf = CFCUtil_sprintf("%s\n%s(%s);", ret_type_str,
-                                full_imp_sym, param_list_str);
-    return buf;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindMethod.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindMethod.h b/clownfish/compiler/src/CFCBindMethod.h
deleted file mode 100644
index 45bbb31..0000000
--- a/clownfish/compiler/src/CFCBindMethod.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Binding::Core::Method - Generate core C code for a method.
- *
- * Clownfish::CFC::Model::Method is an abstract specification; this class
- * generates C code which implements the specification.
- */
-
-#ifndef H_CFCBINDMETHOD
-#define H_CFCBINDMETHOD
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct CFCMethod;
-struct CFCClass;
-
-/** Return C code for the static inline vtable method invocation function.
- * @param method A L<Clownfish::CFC::Model::Method>.
- * @param class The L<Clownfish::CFC::Model::Class> which will be invoking the
- * method.  (LobsterClaw needs its own method invocation function even if the
- * method was defined in Claw.)
- */
-char*
-CFCBindMeth_method_def(struct CFCMethod *method, struct CFCClass *klass);
-
-/** Return C code expressing a typedef declaration for the method.
- */
-char*
-CFCBindMeth_typedef_dec(struct CFCMethod *method, struct CFCClass *klass);
-
-/** Return C code defining the MethSpec object for a novel method, which
- * is used during VTable initialization.
- */
-char*
-CFCBindMeth_novel_spec_def(struct CFCMethod *method);
-
-/** Return C code defining the MethSpec object for an overridden method,
- * which is used during VTable initialization.
- */
-char*
-CFCBindMeth_overridden_spec_def(struct CFCMethod *method,
-                                struct CFCClass *klass);
-
-/** Return C code defining the MethSpec object for an inherited method,
- * which is used during VTable initialization.
- */
-char*
-CFCBindMeth_inherited_spec_def(struct CFCMethod *method,
-                               struct CFCClass *klass);
-
-/** Return C code implementing a version of the method which throws an
- * "abstract method" error at runtime, for methods which are declared as
- * "abstract" in a Clownfish header file.
- */
-char*
-CFCBindMeth_abstract_method_def(struct CFCMethod *method);
-
-/** Return C code declaring a callback to the Host for this method.
- */
-char*
-CFCBindMeth_callback_dec(struct CFCMethod *method);
-
-/** Return C code declaring the function which implements a method.
- */
-char*
-CFCBindMeth_imp_declaration(struct CFCMethod *method);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCBINDMETHOD */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCC.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCC.c b/clownfish/compiler/src/CFCC.c
deleted file mode 100644
index 3f21a0d..0000000
--- a/clownfish/compiler/src/CFCC.c
+++ /dev/null
@@ -1,198 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCC.h"
-#include "CFCCClass.h"
-#include "CFCClass.h"
-#include "CFCHierarchy.h"
-#include "CFCUtil.h"
-
-struct CFCC {
-    CFCBase base;
-    CFCHierarchy *hierarchy;
-    char         *header;
-    char         *footer;
-};
-
-static const CFCMeta CFCC_META = {
-    "Clownfish::CFC::Binding::C",
-    sizeof(CFCC),
-    (CFCBase_destroy_t)CFCC_destroy
-};
-
-CFCC*
-CFCC_new(CFCHierarchy *hierarchy, const char *header, const char *footer) {
-    CFCC *self = (CFCC*)CFCBase_allocate(&CFCC_META);
-    return CFCC_init(self, hierarchy, header, footer);
-}
-
-CFCC*
-CFCC_init(CFCC *self, CFCHierarchy *hierarchy, const char *header,
-          const char *footer) {
-    CFCUTIL_NULL_CHECK(hierarchy);
-    CFCUTIL_NULL_CHECK(header);
-    CFCUTIL_NULL_CHECK(footer);
-    self->hierarchy = (CFCHierarchy*)CFCBase_incref((CFCBase*)hierarchy);
-    self->header    = CFCUtil_strdup(header);
-    self->footer    = CFCUtil_strdup(footer);
-    return self;
-}
-
-void
-CFCC_destroy(CFCC *self) {
-    CFCBase_decref((CFCBase*)self->hierarchy);
-    FREEMEM(self->header);
-    FREEMEM(self->footer);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-/* Write "callbacks.h" with NULL callbacks.
- */
-void
-CFCC_write_callbacks(CFCC *self) {
-    CFCHierarchy  *hierarchy   = self->hierarchy;
-    CFCClass     **ordered     = CFCHierarchy_ordered_classes(hierarchy);
-    char          *all_cb_decs = CFCUtil_strdup("");
-
-    for (int i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-
-        if (!CFCClass_included(klass)) {
-            char *cb_decs = CFCCClass_callback_decs(klass);
-            all_cb_decs = CFCUtil_cat(all_cb_decs, cb_decs, NULL);
-            FREEMEM(cb_decs);
-        }
-    }
-
-    FREEMEM(ordered);
-
-    const char pattern[] =
-        "%s\n"
-        "#ifndef CFCCALLBACKS_H\n"
-        "#define CFCCALLBACKS_H 1\n"
-        "\n"
-        "#include <stddef.h>\n"
-        "\n"
-        "%s"
-        "\n"
-        "#endif /* CFCCALLBACKS_H */\n"
-        "\n"
-        "%s\n"
-        "\n";
-    char *file_content = CFCUtil_sprintf(pattern, self->header, all_cb_decs,
-                                         self->footer);
-
-    // Unlink then write file.
-    const char *inc_dest = CFCHierarchy_get_include_dest(hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "callbacks.h", inc_dest);
-    remove(filepath);
-    CFCUtil_write_file(filepath, file_content, strlen(file_content));
-    FREEMEM(filepath);
-
-    FREEMEM(all_cb_decs);
-    FREEMEM(file_content);
-}
-
-void
-CFCC_write_man_pages(CFCC *self) {
-    CFCHierarchy  *hierarchy = self->hierarchy;
-    CFCClass     **ordered   = CFCHierarchy_ordered_classes(hierarchy);
-
-    size_t num_classes = 0;
-    for (size_t i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        if (!CFCClass_included(klass)) { ++num_classes; }
-    }
-    char **man_pages = (char**)CALLOCATE(num_classes, sizeof(char*));
-
-    // Generate man pages, but don't write.  That way, if there's an error
-    // while generating the pages, we leak memory but don't clutter up the file 
-    // system.
-    for (size_t i = 0, j = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        if (CFCClass_included(klass)) { continue; }
-
-        char *man_page = CFCCClass_create_man_page(klass);
-        man_pages[j++] = man_page;
-    }
-
-    const char *dest = CFCHierarchy_get_dest(hierarchy);
-    char *man3_path
-        = CFCUtil_sprintf("%s" CHY_DIR_SEP "man" CHY_DIR_SEP "man3", dest);
-    if (!CFCUtil_is_dir(man3_path)) {
-        CFCUtil_make_path(man3_path);
-        if (!CFCUtil_is_dir(man3_path)) {
-            CFCUtil_die("Can't make path %s", man3_path);
-        }
-    }
-
-    // Write out any man pages that have changed.
-    for (size_t i = 0, j = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        if (CFCClass_included(klass)) { continue; }
-
-        char *man_page = man_pages[j++];
-        if (!man_page) { continue; }
-
-        const char *full_struct_sym = CFCClass_full_struct_sym(klass);
-        char *filename = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s.3", man3_path,
-                                         full_struct_sym);
-        CFCUtil_write_if_changed(filename, man_page, strlen(man_page));
-        FREEMEM(filename);
-        FREEMEM(man_page);
-    }
-
-    FREEMEM(man3_path);
-    FREEMEM(man_pages);
-    FREEMEM(ordered);
-}
-
-void
-CFCC_write_hostdefs(CFCC *self) {
-    const char pattern[] =
-        "%s\n"
-        "\n"
-        "#ifndef H_CFISH_HOSTDEFS\n"
-        "#define H_CFISH_HOSTDEFS 1\n"
-        "\n"
-        "#define CFISH_OBJ_HEAD \\\n"
-        "    size_t refcount;\n"
-        "\n"
-        "#endif /* H_CFISH_HOSTDEFS */\n"
-        "\n"
-        "%s\n";
-    char *content
-        = CFCUtil_sprintf(pattern, self->header, self->footer);
-
-    // Unlink then write file.
-    const char *inc_dest = CFCHierarchy_get_include_dest(self->hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "cfish_hostdefs.h",
-                                     inc_dest);
-    remove(filepath);
-    CFCUtil_write_file(filepath, content, strlen(content));
-    FREEMEM(filepath);
-
-    FREEMEM(content);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCC.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCC.h b/clownfish/compiler/src/CFCC.h
deleted file mode 100644
index 6f665ed..0000000
--- a/clownfish/compiler/src/CFCC.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Binding::C - Generate code for C bindings.
- */
-#ifndef H_CFCC
-#define H_CFCC
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCC CFCC;
-struct CFCHierarchy;
-
-/**
- * @param hierarchy A L<Clownfish::CFC::Model::Hierarchy>.
- * @param header Text which will be prepended to each generated C file --
- * typically, an "autogenerated file" warning.
- * @param footer Text to be appended to the end of each generated C file --
- * typically copyright information.
- */
-CFCC*
-CFCC_new(struct CFCHierarchy *hierarchy, const char *header,
-         const char *footer);
-
-CFCC*
-CFCC_init(CFCC *self, struct CFCHierarchy *hierarchy, const char *header,
-          const char *footer);
-
-void
-CFCC_destroy(CFCC *self);
-
-/** Write the "callbacks.h" header file with dummy callbacks.
- */
-void
-CFCC_write_callbacks(CFCC *self);
-
-/** Write the "cfish_hostdefs.h" header file.
- */
-void
-CFCC_write_hostdefs(CFCC *self);
-
-/** Write all man pages.
- */
-void
-CFCC_write_man_pages(CFCC *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCC */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCCBlock.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCCBlock.c b/clownfish/compiler/src/CFCCBlock.c
deleted file mode 100644
index 0231877..0000000
--- a/clownfish/compiler/src/CFCCBlock.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCCBlock.h"
-#include "CFCUtil.h"
-
-struct CFCCBlock {
-    CFCBase base;
-    char *contents;
-};
-
-static const CFCMeta CFCCBLOCK_META = {
-    "Clownfish::CFC::Model::CBlock",
-    sizeof(CFCCBlock),
-    (CFCBase_destroy_t)CFCCBlock_destroy
-};
-
-CFCCBlock*
-CFCCBlock_new(const char *contents) {
-    CFCCBlock *self = (CFCCBlock*)CFCBase_allocate(&CFCCBLOCK_META);
-    return CFCCBlock_init(self, contents);
-}
-
-CFCCBlock*
-CFCCBlock_init(CFCCBlock *self, const char *contents) {
-    CFCUTIL_NULL_CHECK(contents);
-    self->contents = CFCUtil_strdup(contents);
-    return self;
-}
-
-void
-CFCCBlock_destroy(CFCCBlock *self) {
-    FREEMEM(self->contents);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-const char*
-CFCCBlock_get_contents(CFCCBlock *self) {
-    return self->contents;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCCBlock.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCCBlock.h b/clownfish/compiler/src/CFCCBlock.h
deleted file mode 100644
index 98ac4d9..0000000
--- a/clownfish/compiler/src/CFCCBlock.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::CBlock - A block of embedded C code.
- *
- * CBlock exists to support embedding literal C code within Clownfish header
- * files:
- *
- *     class Crustacean::Lobster {
- *         ...
- *
- *         inert inline void
- *         say_hello(Lobster *self);
- *     }
- *
- *     __C__
- *     #include <stdio.h>
- *     static CFISH_INLINE void
- *     crust_Lobster_say_hello(crust_Lobster *self)
- *     {
- *         printf("Prepare to die, human scum.\n");
- *     }
- *     __END_C__
- */
-
-#ifndef H_CFCCBLOCK
-#define H_CFCCBLOCK
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCCBlock CFCCBlock;
-
-/** CBlock Constructor.
- *
- * @param contents The contents of the CBlock, not including delimiters.
- */
-CFCCBlock*
-CFCCBlock_new(const char *contents);
-
-CFCCBlock*
-CFCCBlock_init(CFCCBlock *self, const char *contents);
-
-void
-CFCCBlock_destroy(CFCCBlock *self);
-
-/** Accessor.
- */
-const char*
-CFCCBlock_get_contents(CFCCBlock *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCCBLOCK */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCCClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCCClass.c b/clownfish/compiler/src/CFCCClass.c
deleted file mode 100644
index b6def3b..0000000
--- a/clownfish/compiler/src/CFCCClass.c
+++ /dev/null
@@ -1,552 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#include "charmony.h"
-#include "CFCCClass.h"
-#include "CFCClass.h"
-#include "CFCDocuComment.h"
-#include "CFCFunction.h"
-#include "CFCMethod.h"
-#include "CFCParamList.h"
-#include "CFCSymbol.h"
-#include "CFCType.h"
-#include "CFCUtil.h"
-#include "CFCVariable.h"
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-typedef struct CFCPodLink {
-    size_t      total_size;
-    const char *text;
-    size_t      text_size;
-} CFCPodLink;
-
-static char*
-S_man_create_name(CFCClass *klass);
-
-static char*
-S_man_create_synopsis(CFCClass *klass);
-
-static char*
-S_man_create_description(CFCClass *klass);
-
-static char*
-S_man_create_functions(CFCClass *klass);
-
-static char*
-S_man_create_methods(CFCClass *klass);
-
-static char*
-S_man_create_inherited_methods(CFCClass *klass);
-
-static char*
-S_man_create_func(CFCClass *klass, CFCFunction *func, const char *short_sym,
-                  const char *full_sym);
-
-static char*
-S_man_create_param_list(CFCFunction *func, const char *full_sym);
-
-static char*
-S_man_create_inheritance(CFCClass *klass);
-
-static char*
-S_man_escape_content(const char *content);
-
-static void
-S_parse_pod_link(const char *content, CFCPodLink *pod_link);
-
-// Declare dummy host callbacks.
-char*
-CFCCClass_callback_decs(CFCClass *klass) {
-    CFCMethod **fresh_methods = CFCClass_fresh_methods(klass);
-    char       *cb_decs       = CFCUtil_strdup("");
-
-    for (int meth_num = 0; fresh_methods[meth_num] != NULL; meth_num++) {
-        CFCMethod *method = fresh_methods[meth_num];
-
-        // Define callback to NULL.
-        if (CFCMethod_novel(method) && !CFCMethod_final(method)) {
-            const char *override_sym = CFCMethod_full_override_sym(method);
-            cb_decs = CFCUtil_cat(cb_decs, "#define ", override_sym, " NULL\n",
-                                  NULL);
-        }
-    }
-
-    FREEMEM(fresh_methods);
-
-    return cb_decs;
-}
-
-char*
-CFCCClass_create_man_page(CFCClass *klass) {
-    if (!CFCSymbol_public((CFCSymbol*)klass)) { return NULL; }
-
-    const char *class_name = CFCClass_get_class_name(klass);
-
-    // Create NAME.
-    char *name = S_man_create_name(klass);
-
-    // Create SYNOPSIS.
-    char *synopsis = S_man_create_synopsis(klass);
-
-    // Create DESCRIPTION.
-    char *description = S_man_create_description(klass);
-
-    // Create CONSTRUCTORS.
-    char *functions_man = S_man_create_functions(klass);
-
-    // Create METHODS, possibly including an ABSTRACT METHODS section.
-    char *methods_man = S_man_create_methods(klass);
-
-    // Build an INHERITANCE section describing class ancestry.
-    char *inheritance = S_man_create_inheritance(klass);
-
-    // Put it all together.
-    const char pattern[] =
-    ".\\\" Licensed to the Apache Software Foundation (ASF) under one or more\n"
-    ".\\\" contributor license agreements.  See the NOTICE file distributed with\n"
-    ".\\\" this work for additional information regarding copyright ownership.\n"
-    ".\\\" The ASF licenses this file to You under the Apache License, Version 2.0\n"
-    ".\\\" (the \"License\"); you may not use this file except in compliance with\n"
-    ".\\\" the License.  You may obtain a copy of the License at\n"
-    ".\\\"\n"
-    ".\\\"     http://www.apache.org/licenses/LICENSE-2.0\n"
-    ".\\\"\n"
-    ".\\\" Unless required by applicable law or agreed to in writing, software\n"
-    ".\\\" distributed under the License is distributed on an \"AS IS\" BASIS,\n"
-    ".\\\" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
-    ".\\\" See the License for the specific language governing permissions and\n"
-    ".\\\" limitations under the License.\n"
-    ".TH %s 3\n"
-    "%s"
-    "%s"
-    "%s"
-    "%s"
-    "%s"
-    "%s";
-    char *man_page
-        = CFCUtil_sprintf(pattern, class_name, name, synopsis, description,
-                          functions_man, methods_man, inheritance);
-
-    FREEMEM(name);
-    FREEMEM(synopsis);
-    FREEMEM(description);
-    FREEMEM(functions_man);
-    FREEMEM(methods_man);
-    FREEMEM(inheritance);
-
-    return man_page;
-}
-
-static char*
-S_man_create_name(CFCClass *klass) {
-    char *result = CFCUtil_strdup(".SH NAME\n");
-    result = CFCUtil_cat(result, CFCClass_get_class_name(klass), NULL);
-
-    CFCDocuComment *docucom = CFCClass_get_docucomment(klass);
-    if (docucom) {
-        const char *raw_brief = CFCDocuComment_get_brief(docucom);
-        if (raw_brief && raw_brief[0] != '\0') {
-            char *brief = S_man_escape_content(raw_brief);
-            result = CFCUtil_cat(result, " \\- ", brief, NULL);
-            FREEMEM(brief);
-        }
-    }
-
-    result = CFCUtil_cat(result, "\n", NULL);
-
-    return result;
-}
-
-static char*
-S_man_create_synopsis(CFCClass *klass) {
-    CHY_UNUSED_VAR(klass);
-    return CFCUtil_strdup("");
-}
-
-static char*
-S_man_create_description(CFCClass *klass) {
-    char *result  = CFCUtil_strdup("");
-
-    CFCDocuComment *docucom = CFCClass_get_docucomment(klass);
-    if (!docucom) { return result; }
-
-    const char *raw_description = CFCDocuComment_get_long(docucom);
-    if (!raw_description || raw_description[0] == '\0') { return result; }
-
-    char *description = S_man_escape_content(raw_description);
-    result = CFCUtil_cat(result, ".SH DESCRIPTION\n", description, "\n", NULL);
-    FREEMEM(description);
-
-    return result;
-}
-
-static char*
-S_man_create_functions(CFCClass *klass) {
-    CFCFunction **functions = CFCClass_functions(klass);
-    char         *result    = CFCUtil_strdup("");
-
-    for (int func_num = 0; functions[func_num] != NULL; func_num++) {
-        CFCFunction *func = functions[func_num];
-        if (!CFCFunction_public(func)) { continue; }
-
-        if (result[0] == '\0') {
-            result = CFCUtil_cat(result, ".SH FUNCTIONS\n", NULL);
-        }
-
-        const char *micro_sym     = CFCFunction_micro_sym(func);
-        const char *full_func_sym = CFCFunction_full_func_sym(func);
-
-        char *redman = S_man_create_func(klass, func, micro_sym,
-                                         full_func_sym);
-        result = CFCUtil_cat(result, redman, NULL);
-        FREEMEM(redman);
-    }
-
-    return result;
-}
-
-static char*
-S_man_create_methods(CFCClass *klass) {
-    CFCMethod **fresh_methods = CFCClass_fresh_methods(klass);
-    char       *methods_man   = CFCUtil_strdup("");
-    char       *novel_man     = CFCUtil_strdup("");
-    char       *result;
-
-    for (int meth_num = 0; fresh_methods[meth_num] != NULL; meth_num++) {
-        CFCMethod *method = fresh_methods[meth_num];
-        if (!CFCMethod_public(method) || !CFCMethod_novel(method)) {
-            continue;
-        }
-
-        const char *macro_sym = CFCMethod_get_macro_sym(method);
-        char *full_method_sym = CFCMethod_full_method_sym(method, NULL);
-        char *method_man = S_man_create_func(klass, (CFCFunction*)method,
-                                             macro_sym, full_method_sym);
-
-        if (CFCMethod_abstract(method)) {
-            if (methods_man[0] == '\0') {
-                methods_man = CFCUtil_cat(methods_man,
-                                          ".SS Abstract methods\n", NULL);
-            }
-            methods_man = CFCUtil_cat(methods_man, method_man, NULL);
-        }
-        else {
-            if (novel_man[0] == '\0') {
-                novel_man = CFCUtil_cat(novel_man,
-                                        ".SS Novel methods\n", NULL);
-            }
-            novel_man = CFCUtil_cat(novel_man, method_man, NULL);
-        }
-
-        FREEMEM(method_man);
-        FREEMEM(full_method_sym);
-    }
-
-    methods_man = CFCUtil_cat(methods_man, novel_man, NULL);
-
-    // Add methods from parent classes excluding Clownfish::Obj
-    CFCClass *parent = CFCClass_get_parent(klass);
-    while (parent) {
-        if (strcmp(CFCClass_get_class_name(parent), "Clownfish::Obj") == 0) {
-            break;
-        }
-        char *inherited_man = S_man_create_inherited_methods(parent);
-        methods_man = CFCUtil_cat(methods_man, inherited_man, NULL);
-        FREEMEM(inherited_man);
-        parent = CFCClass_get_parent(parent);
-    }
-
-    if (methods_man[0] == '\0') {
-        result = CFCUtil_strdup("");
-    }
-    else {
-        result = CFCUtil_sprintf(".SH METHODS\n%s", methods_man);
-    }
-
-    FREEMEM(methods_man);
-    FREEMEM(novel_man);
-    FREEMEM(fresh_methods);
-    return result;
-}
-
-static char*
-S_man_create_inherited_methods(CFCClass *klass) {
-    CFCMethod **fresh_methods = CFCClass_fresh_methods(klass);
-    char       *result        = CFCUtil_strdup("");
-
-    for (int meth_num = 0; fresh_methods[meth_num] != NULL; meth_num++) {
-        CFCMethod *method = fresh_methods[meth_num];
-        if (!CFCMethod_public(method) || !CFCMethod_novel(method)) {
-            continue;
-        }
-
-        if (result[0] == '\0') {
-            result = CFCUtil_cat(result, ".SS Methods inherited from ",
-                                 CFCClass_get_class_name(klass), "\n", NULL);
-        }
-
-        const char *macro_sym = CFCMethod_get_macro_sym(method);
-        char *full_method_sym = CFCMethod_full_method_sym(method, NULL);
-        char *method_man = S_man_create_func(klass, (CFCFunction*)method,
-                                             macro_sym, full_method_sym);
-        result = CFCUtil_cat(result, method_man, NULL);
-
-        FREEMEM(method_man);
-        FREEMEM(full_method_sym);
-    }
-
-    FREEMEM(fresh_methods);
-    return result;
-}
-
-static char*
-S_man_create_func(CFCClass *klass, CFCFunction *func, const char *short_sym,
-                  const char *full_sym) {
-    CFCType    *return_type   = CFCFunction_get_return_type(func);
-    const char *return_type_c = CFCType_to_c(return_type);
-    const char *incremented   = "";
-
-    if (CFCType_incremented(return_type)) {
-        incremented = " // incremented";
-    }
-
-    char *param_list = S_man_create_param_list(func, full_sym);
-
-    const char *pattern =
-        ".TP\n"
-        ".B %s\n"
-        ".na\n"
-        "%s%s\n"
-        ".br\n"
-        "%s"
-        ".ad\n";
-    char *result = CFCUtil_sprintf(pattern, short_sym, return_type_c,
-                                   incremented, param_list);
-
-    FREEMEM(param_list);
-
-    // Get documentation, which may be inherited.
-    CFCDocuComment *docucomment = CFCFunction_get_docucomment(func);
-    if (!docucomment) {
-        const char *micro_sym = CFCFunction_micro_sym(func);
-        CFCClass *parent = klass;
-        while (NULL != (parent = CFCClass_get_parent(parent))) {
-            CFCFunction *parent_func
-                = (CFCFunction*)CFCClass_method(parent, micro_sym);
-            if (!parent_func) { break; }
-            docucomment = CFCFunction_get_docucomment(parent_func);
-            if (docucomment) { break; }
-        }
-    }
-
-    if (docucomment) {
-        // Description
-        const char *raw_desc = CFCDocuComment_get_description(docucomment);
-        char *desc = S_man_escape_content(raw_desc);
-        result = CFCUtil_cat(result, ".IP\n", desc, "\n", NULL);
-        FREEMEM(desc);
-
-        // Params
-        const char **param_names
-            = CFCDocuComment_get_param_names(docucomment);
-        const char **param_docs
-            = CFCDocuComment_get_param_docs(docucomment);
-        if (param_names[0]) {
-            result = CFCUtil_cat(result, ".RS\n", NULL);
-            for (size_t i = 0; param_names[i] != NULL; i++) {
-                char *doc = S_man_escape_content(param_docs[i]);
-                result = CFCUtil_cat(result, ".TP\n.I ", param_names[i],
-                                     "\n", doc, "\n", NULL);
-                FREEMEM(doc);
-            }
-            result = CFCUtil_cat(result, ".RE\n", NULL);
-        }
-
-        // Return value
-        const char *retval_doc = CFCDocuComment_get_retval(docucomment);
-        if (retval_doc && strlen(retval_doc)) {
-            char *doc = S_man_escape_content(retval_doc);
-            result = CFCUtil_cat(result, ".IP\n.B Returns:\n", doc, "\n",
-                                 NULL);
-            FREEMEM(doc);
-        }
-    }
-
-    return result;
-}
-
-static char*
-S_man_create_param_list(CFCFunction *func, const char *full_sym) {
-    CFCParamList  *param_list = CFCFunction_get_param_list(func);
-    CFCVariable  **variables  = CFCParamList_get_variables(param_list);
-
-    if (!variables[0]) {
-        return CFCUtil_sprintf(".BR %s (void);\n", full_sym);
-    }
-
-    char *result = CFCUtil_sprintf(".BR %s (", full_sym);
-
-    for (int i = 0; variables[i]; ++i) {
-        CFCVariable *variable = variables[i];
-        CFCType     *type     = CFCVariable_get_type(variable);
-        const char  *type_c   = CFCType_to_c(type);
-        const char  *name     = CFCVariable_micro_sym(variable);
-
-        result = CFCUtil_cat(result, "\n.br\n.RB \"    ", type_c, " \" ", name,
-                             NULL);
-
-        if (variables[i+1] || CFCType_decremented(type)) {
-            result = CFCUtil_cat(result, " \"", NULL);
-            if (variables[i+1]) {
-                result = CFCUtil_cat(result, ",", NULL);
-            }
-            else {
-                result = CFCUtil_cat(result, " // decremented", NULL);
-            }
-            result = CFCUtil_cat(result, "\"", NULL);
-        }
-    }
-
-    result = CFCUtil_cat(result, "\n.br\n);\n.br\n", NULL);
-
-    return result;
-}
-
-static char*
-S_man_create_inheritance(CFCClass *klass) {
-    CFCClass *ancestor = CFCClass_get_parent(klass);
-    char     *result   = CFCUtil_strdup("");
-
-    if (!ancestor) { return result; }
-
-    const char *class_name = CFCClass_get_class_name(klass);
-    result = CFCUtil_cat(result, ".SH INHERITANCE\n", class_name, NULL);
-    while (ancestor) {
-        const char *ancestor_name = CFCClass_get_class_name(ancestor);
-        result = CFCUtil_cat(result, " is a ", ancestor_name, NULL);
-        ancestor = CFCClass_get_parent(ancestor);
-    }
-    result = CFCUtil_cat(result, ".\n", NULL);
-
-    return result;
-}
-
-static char*
-S_man_escape_content(const char *content) {
-    size_t  result_len = 0;
-    size_t  result_cap = strlen(content) + 256;
-    char   *result     = (char*)MALLOCATE(result_cap + 1);
-
-    for (size_t i = 0; content[i]; i++) {
-        const char *subst      = content + i;
-        size_t      subst_size = 1;
-
-        switch (content[i]) {
-            case '\\':
-                // Escape backslash.
-                subst      = "\\e";
-                subst_size = 2;
-                break;
-            case '-':
-                // Escape hyphen.
-                subst      = "\\-";
-                subst_size = 2;
-                break;
-            case '\n':
-                // Escape dot after newline.
-                if (content[i+1] == '.') {
-                    subst      = "\n\\";
-                    subst_size = 2;
-                }
-                break;
-            case '<':
-                // <code> markup.
-                if (strncmp(content + i + 1, "code>", 5) == 0) {
-                    subst      = "\\fI";
-                    subst_size = 3;
-                    i += 5;
-                }
-                else if (strncmp(content + i + 1, "/code>", 6) == 0) {
-                    subst      = "\\fP";
-                    subst_size = 3;
-                    i += 6;
-                }
-                break;
-            case 'L':
-                if (content[i+1] == '<') {
-                    // POD-style link.
-                    struct CFCPodLink pod_link;
-                    S_parse_pod_link(content + i + 2, &pod_link);
-                    if (pod_link.total_size) {
-                        subst      = pod_link.text;
-                        subst_size = pod_link.text_size;
-                        i += pod_link.total_size + 1;
-                    }
-                }
-                break;
-            default:
-                break;
-        }
-
-        if (result_len + subst_size > result_cap) {
-            result_cap += 256;
-            result = (char*)REALLOCATE(result, result_cap + 1);
-        }
-
-        memcpy(result + result_len, subst, subst_size);
-        result_len += subst_size;
-    }
-
-    result[result_len] = '\0';
-
-    return result;
-}
-
-// Quick and dirty parsing of POD links. The syntax isn't fully supported
-// and the result isn't man-escaped. But it should be good enough for now
-// since at some point we'll switch to another format anyway.
-static void
-S_parse_pod_link(const char *content, CFCPodLink *pod_link) {
-    int in_text = true;
-
-    for (size_t i = 0; i < 256 && content[i]; ++i) {
-        if (content[i] == '|') {
-            if (in_text) {
-                pod_link->text_size = i;
-                in_text = false;
-            }
-        }
-        else if (content[i] == '>') {
-            pod_link->total_size = i + 1;
-            pod_link->text       = content;
-            if (in_text) {
-                pod_link->text_size = i;
-            }
-            return;
-        }
-    }
-
-    pod_link->total_size = 0;
-    pod_link->text       = NULL;
-    pod_link->text_size  = 0;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCCClass.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCCClass.h b/clownfish/compiler/src/CFCCClass.h
deleted file mode 100644
index b319596..0000000
--- a/clownfish/compiler/src/CFCCClass.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCCCLASS
-#define H_CFCCCLASS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct CFCClass;
-
-/* Return dummy host callbacks defined to NULL.
- */
-char*
-CFCCClass_callback_decs(struct CFCClass *klass);
-
-/** Return the man page for the class.
- */
-char*
-CFCCClass_create_man_page(struct CFCClass *klass);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCCCLASS */
-


[lucy-commits] [28/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Adjust setup_clownfish_env.sh for Perl build

Posted by ma...@apache.org.
Adjust setup_clownfish_env.sh for Perl build

Set PERL5LIB and C_INCLUDE_PATH (for XSBind.h).


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/7329c7ee
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/7329c7ee
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/7329c7ee

Branch: refs/heads/sortex_ptr_only
Commit: 7329c7ee812384fc2c64f63ecfa4f9335a115f76
Parents: 4087b61
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sat Mar 22 20:03:33 2014 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 15 20:54:45 2014 +0200

----------------------------------------------------------------------
 devel/bin/setup_clownfish_env.sh | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/7329c7ee/devel/bin/setup_clownfish_env.sh
----------------------------------------------------------------------
diff --git a/devel/bin/setup_clownfish_env.sh b/devel/bin/setup_clownfish_env.sh
index 9f47ad8..2ec107d 100644
--- a/devel/bin/setup_clownfish_env.sh
+++ b/devel/bin/setup_clownfish_env.sh
@@ -56,15 +56,19 @@ then
     return 1 2>/dev/null || exit 1
 fi
 
-compiler_dir=$src_dir/compiler/c
-runtime_dir=$src_dir/runtime/c
-core_dir=$src_dir/runtime/core
+compiler_dir=$src_dir/compiler
+runtime_dir=$src_dir/runtime
 
-export PATH=`add_to_path "$PATH" "$compiler_dir"`
-export LIBRARY_PATH=`add_to_path "$LIBRARY_PATH" "$runtime_dir"`
-export CLOWNFISH_INCLUDE=`add_to_path "$CLOWNFISH_INCLUDE" "$core_dir"`
+export PATH=`add_to_path "$PATH" "$compiler_dir/c"`
+export C_INCLUDE_PATH=`add_to_path "$C_INCLUDE_PATH" "$runtime_dir/perl/xs"`
+export LIBRARY_PATH=`add_to_path "$LIBRARY_PATH" "$runtime_dir/c"`
+export CLOWNFISH_INCLUDE=`add_to_path "$CLOWNFISH_INCLUDE" "$runtime_dir/core"`
+export PERL5LIB=`add_to_path "$PERL5LIB" "$compiler_dir/perl/blib/arch"`
+export PERL5LIB=`add_to_path "$PERL5LIB" "$compiler_dir/perl/blib/lib"`
+export PERL5LIB=`add_to_path "$PERL5LIB" "$runtime_dir/perl/blib/arch"`
+export PERL5LIB=`add_to_path "$PERL5LIB" "$runtime_dir/perl/blib/lib"`
 
 if [ `uname` != Darwin ]; then
-    export LD_LIBRARY_PATH=`add_to_path "$LD_LIBRARY_PATH" "$runtime_dir"`
+    export LD_LIBRARY_PATH=`add_to_path "$LD_LIBRARY_PATH" "$runtime_dir/c"`
 fi
 


[lucy-commits] [26/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Add Clownfish system include dirs.

Posted by ma...@apache.org.
Add Clownfish system include dirs.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/6fab33e7
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/6fab33e7
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/6fab33e7

Branch: refs/heads/sortex_ptr_only
Commit: 6fab33e7ec39c6bd42d93d2b3108c22c80a0cf3d
Parents: 1704c27
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Apr 1 16:04:02 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 12 00:48:30 2014 -0600

----------------------------------------------------------------------
 perl/Build.PL | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/6fab33e7/perl/Build.PL
----------------------------------------------------------------------
diff --git a/perl/Build.PL b/perl/Build.PL
index 4bd3236..2ff802e 100644
--- a/perl/Build.PL
+++ b/perl/Build.PL
@@ -21,6 +21,7 @@ use File::Spec::Functions qw( catdir );
 use Lucy::Build;
 
 my @BASE_PATH        = Lucy::Build->cf_base_path;
+my @CF_SYS_INCLUDES  = Lucy::Build->cf_system_include_dirs;
 my $MODULES_DIR      = catdir( @BASE_PATH, 'modules' );
 my $SNOWSTEM_SRC_DIR = catdir( $MODULES_DIR, qw( analysis snowstem source ) );
 my $SNOWSTEM_INC_DIR = catdir( $SNOWSTEM_SRC_DIR, 'include' );
@@ -69,6 +70,7 @@ my $builder = Lucy::Build->new(
         $UCD_INC_DIR,
         $UTF8PROC_SRC_DIR,
         $CFR_XS_SOURCE_DIR,
+        @CF_SYS_INCLUDES,
     ],
     clownfish_params => {
         source => [
@@ -79,6 +81,7 @@ my $builder = Lucy::Build->new(
             $UTF8PROC_SRC_DIR,
         ],
         include => [
+            @CF_SYS_INCLUDES,
             $CFR_CORE_SOURCE_DIR,
         ],
     },


[lucy-commits] [14/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCLexHeader.l
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCLexHeader.l b/clownfish/compiler/src/CFCLexHeader.l
deleted file mode 100644
index 567cbeb..0000000
--- a/clownfish/compiler/src/CFCLexHeader.l
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-%{
-    #include "CFC.h"
-    #include "CFCParseHeader.h"
-
-    /* Dupe yytext and invoke Lemon-generated parser. */
-    #define PARSE(token_type) \
-        CFCParseHeader(CFCParser_current_parser, token_type, \
-			CFCParser_dupe(CFCParser_current_state, yytext), \
-			CFCParser_current_state)
-
-    struct cfc_StringID {
-        const char *string;
-        int token_type;
-    };
-    struct cfc_StringID reserved_word_map[] = {
-        {"NULL", CFC_TOKENTYPE_NULL },
-        {"abstract", CFC_TOKENTYPE_ABSTRACT },
-        {"bool", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"char", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"class", CFC_TOKENTYPE_CLASS },
-        {"cnick", CFC_TOKENTYPE_CNICK },
-        {"const", CFC_TOKENTYPE_CONST },
-        {"decremented", CFC_TOKENTYPE_DECREMENTED },
-        {"double", CFC_TOKENTYPE_FLOAT_TYPE_NAME },
-        {"false", CFC_TOKENTYPE_FALSE },
-        {"final", CFC_TOKENTYPE_FINAL },
-        {"float", CFC_TOKENTYPE_FLOAT_TYPE_NAME },
-        {"incremented", CFC_TOKENTYPE_INCREMENTED },
-        {"inert", CFC_TOKENTYPE_INERT },
-        {"inherits", CFC_TOKENTYPE_INHERITS },
-        {"inline", CFC_TOKENTYPE_INLINE },
-        {"int", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"int16_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"int32_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"int64_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"int8_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"long", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"nullable", CFC_TOKENTYPE_NULLABLE },
-        {"parcel", CFC_TOKENTYPE_PARCEL },
-        {"public", CFC_TOKENTYPE_PUBLIC },
-        {"short", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"size_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"true", CFC_TOKENTYPE_TRUE },
-        {"uint16_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"uint32_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"uint64_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"uint8_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"va_list", CFC_TOKENTYPE_VA_LIST },
-        {"void", CFC_TOKENTYPE_VOID },
-    };
-    #define NUM_RESERVED_WORDS \
-        (sizeof(reserved_word_map) / sizeof(struct cfc_StringID))
-
-    static int
-    S_compare(const void *va, const void *vb) {
-        const char *a = (const char*)va;
-        struct cfc_StringID *b
-            = (struct cfc_StringID*)vb;
-        return strcmp(a, b->string);
-    }
-
-    static int
-    S_identifier_or_keyword(const char *word) {
-        struct cfc_StringID *got = (struct cfc_StringID*)
-            bsearch(word, reserved_word_map, NUM_RESERVED_WORDS,
-                    sizeof(struct cfc_StringID), S_compare);
-        if (got) {
-            return got->token_type;
-        }
-        else {
-            return CFC_TOKENTYPE_IDENTIFIER;
-        }
-    }
-%}
-
-%option noyywrap
-%option nodefault
-%option yylineno
-%option never-interactive
-
-%x CBLOCK
-
-%%
-::         { PARSE(CFC_TOKENTYPE_SCOPE_OP); }
-[*]        { PARSE(CFC_TOKENTYPE_ASTERISK); }
-\{         { PARSE(CFC_TOKENTYPE_LEFT_CURLY_BRACE); }
-\}         { PARSE(CFC_TOKENTYPE_RIGHT_CURLY_BRACE); }
-[\[]       { PARSE(CFC_TOKENTYPE_LEFT_SQUARE_BRACKET); }
-[\]]       { PARSE(CFC_TOKENTYPE_RIGHT_SQUARE_BRACKET); }
-[\(]       { PARSE(CFC_TOKENTYPE_LEFT_PAREN); }
-[\)]       { PARSE(CFC_TOKENTYPE_RIGHT_PAREN); }
-\.\.\.     { PARSE(CFC_TOKENTYPE_ELLIPSIS); }
-,          { PARSE(CFC_TOKENTYPE_COMMA); }
-;          { PARSE(CFC_TOKENTYPE_SEMICOLON); }
-=          { PARSE(CFC_TOKENTYPE_EQUALS); }
-
--?0x[0-9A-Fa-f]+       { PARSE(CFC_TOKENTYPE_HEX_LITERAL); }
--?[0-9]+\.[0-9]+       { PARSE(CFC_TOKENTYPE_FLOAT_LITERAL); }
--?[0-9]+               { PARSE(CFC_TOKENTYPE_INTEGER_LITERAL); }
-\"([^\"\\]|\\.)*\"     { PARSE(CFC_TOKENTYPE_STRING_LITERAL); }
-
-[a-zA-Z_][a-zA-Z0-9_]* { PARSE(S_identifier_or_keyword(yytext)); }
-
-__C__[[:space:]]*    { BEGIN(CBLOCK);  PARSE(CFC_TOKENTYPE_CBLOCK_START); }
-<CBLOCK>__END_C__    { BEGIN(INITIAL); PARSE(CFC_TOKENTYPE_CBLOCK_CLOSE); }
-<CBLOCK>__END_C_[^_]   { PARSE(CFC_TOKENTYPE_BLOB); }
-<CBLOCK>[^_]+          { PARSE(CFC_TOKENTYPE_BLOB); }
-<CBLOCK>_+             { PARSE(CFC_TOKENTYPE_BLOB); }
-           
-    /* Parse docucomments, but skip ordinary comments */
-"/**"([^*]|"*"[^/])*"*/" { PARSE(CFC_TOKENTYPE_DOCUCOMMENT); }
-"/*"([^*]|"*"[^/])*"*/"
-
-[ \t\r\n]  /* Skip whitespace. */
-<*>.       { 
-                printf("Bad input character '%s' at line %d\n", yytext, yylineno);
-                yyterminate();
-           }
-<<EOF>>    { yyterminate(); }
-%%
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCMemPool.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCMemPool.c b/clownfish/compiler/src/CFCMemPool.c
deleted file mode 100644
index bf16306..0000000
--- a/clownfish/compiler/src/CFCMemPool.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCMemPool.h"
-#include "CFCUtil.h"
-
-struct CFCMemPool {
-    CFCBase base;
-    size_t arena_size;
-    size_t remaining;
-    char *current;
-    size_t num_arenas;
-    char **arenas;
-};
-
-static const CFCMeta CFCMEMPOOL_META = {
-    "Clownfish::MemPool",
-    sizeof(CFCMemPool),
-    (CFCBase_destroy_t)CFCMemPool_destroy
-};
-
-CFCMemPool*
-CFCMemPool_new(size_t arena_size) {
-    CFCMemPool *self = (CFCMemPool*)CFCBase_allocate(&CFCMEMPOOL_META);
-    return CFCMemPool_init(self, arena_size);
-}
-
-CFCMemPool*
-CFCMemPool_init(CFCMemPool *self, size_t arena_size) {
-    arena_size = arena_size ? arena_size : 0x400; // 1k
-    self->current    = NULL;
-    self->arena_size = arena_size;
-    self->remaining  = 0;
-    self->num_arenas = 0;
-    self->arenas     = NULL;
-    return self;
-}
-
-void*
-CFCMemPool_allocate(CFCMemPool *self, size_t size) {
-    size_t overage = (8 - (size % 8)) % 8;
-    size_t amount = size + overage;
-    size_t arena_size = self->arena_size > amount
-                        ? self->arena_size : amount;
-    if (amount > self->remaining) {
-        self->num_arenas += 1;
-        self->arenas = (char**)REALLOCATE(self->arenas,
-                                          self->num_arenas * sizeof(char*));
-        self->current = (char*)MALLOCATE(arena_size);
-        self->arenas[self->num_arenas - 1] = self->current;
-        self->remaining = amount;
-    }
-    size_t offset = arena_size - self->remaining;
-    void *result = self->current + offset;
-    self->remaining -= amount;
-    return result;
-}
-
-void
-CFCMemPool_destroy(CFCMemPool *self) {
-    for (size_t i = 0; i < self->num_arenas; i++) {
-        FREEMEM(self->arenas[i]);
-    }
-    FREEMEM(self->arenas);
-    CFCBase_destroy((CFCBase*)self);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCMemPool.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCMemPool.h b/clownfish/compiler/src/CFCMemPool.h
deleted file mode 100644
index c315686..0000000
--- a/clownfish/compiler/src/CFCMemPool.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCMEMPOOL
-#define H_CFCMEMPOOL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCMemPool CFCMemPool;
-
-CFCMemPool*
-CFCMemPool_new(size_t arena_size);
-
-CFCMemPool*
-CFCMemPool_init(CFCMemPool *self, size_t arena_size);
-
-void*
-CFCMemPool_allocate(CFCMemPool *self, size_t size);
-
-void
-CFCMemPool_destroy(CFCMemPool *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCMEMPOOL */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCMethod.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCMethod.c b/clownfish/compiler/src/CFCMethod.c
deleted file mode 100644
index f5780e2..0000000
--- a/clownfish/compiler/src/CFCMethod.c
+++ /dev/null
@@ -1,439 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-
-#define CFC_NEED_FUNCTION_STRUCT_DEF
-#include "CFCFunction.h"
-#include "CFCMethod.h"
-#include "CFCType.h"
-#include "CFCClass.h"
-#include "CFCUtil.h"
-#include "CFCParamList.h"
-#include "CFCParcel.h"
-#include "CFCDocuComment.h"
-#include "CFCVariable.h"
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-struct CFCMethod {
-    CFCFunction function;
-    char *macro_sym;
-    char *full_override_sym;
-    char *host_alias;
-    char *short_imp_func;
-    char *imp_func;
-    int is_final;
-    int is_abstract;
-    int is_novel;
-    int is_excluded;
-};
-
-static const CFCMeta CFCMETHOD_META = {
-    "Clownfish::CFC::Model::Method",
-    sizeof(CFCMethod),
-    (CFCBase_destroy_t)CFCMethod_destroy
-};
-
-CFCMethod*
-CFCMethod_new(CFCParcel *parcel, const char *exposure, const char *class_name,
-              const char *class_cnick, const char *macro_sym,
-              CFCType *return_type, CFCParamList *param_list,
-              CFCDocuComment *docucomment, int is_final, int is_abstract) {
-    CFCMethod *self = (CFCMethod*)CFCBase_allocate(&CFCMETHOD_META);
-    return CFCMethod_init(self, parcel, exposure, class_name, class_cnick,
-                          macro_sym, return_type, param_list, docucomment,
-                          is_final, is_abstract);
-}
-
-static int
-S_validate_macro_sym(const char *macro_sym) {
-    if (!macro_sym || !strlen(macro_sym)) { return false; }
-
-    int need_upper  = true;
-    int need_letter = true;
-    for (;; macro_sym++) {
-        if (need_upper  && !isupper(*macro_sym)) { return false; }
-        if (need_letter && !isalpha(*macro_sym)) { return false; }
-        need_upper  = false;
-        need_letter = false;
-
-        // We've reached NULL-termination without problems, so succeed.
-        if (!*macro_sym) { return true; }
-
-        if (!isalnum(*macro_sym)) {
-            if (*macro_sym != '_') { return false; }
-            need_upper  = true;
-        }
-    }
-}
-
-CFCMethod*
-CFCMethod_init(CFCMethod *self, CFCParcel *parcel, const char *exposure,
-               const char *class_name, const char *class_cnick,
-               const char *macro_sym, CFCType *return_type,
-               CFCParamList *param_list, CFCDocuComment *docucomment,
-               int is_final, int is_abstract) {
-    // Validate macro_sym, derive micro_sym.
-    if (!S_validate_macro_sym(macro_sym)) {
-        CFCBase_decref((CFCBase*)self);
-        CFCUtil_die("Invalid macro_sym: '%s'",
-                    macro_sym ? macro_sym : "[NULL]");
-    }
-    char *micro_sym = CFCUtil_strdup(macro_sym);
-    for (size_t i = 0; micro_sym[i] != '\0'; i++) {
-        micro_sym[i] = tolower(micro_sym[i]);
-    }
-
-    // Super-init and clean up derived micro_sym.
-    CFCFunction_init((CFCFunction*)self, parcel, exposure, class_name,
-                     class_cnick, micro_sym, return_type, param_list,
-                     docucomment, false);
-    FREEMEM(micro_sym);
-
-    // Verify that the first element in the arg list is a self.
-    CFCVariable **args = CFCParamList_get_variables(param_list);
-    if (!args[0]) { CFCUtil_die("Missing 'self' argument"); }
-    CFCType *type = CFCVariable_get_type(args[0]);
-    const char *specifier = CFCType_get_specifier(type);
-    const char *prefix    = CFCMethod_get_prefix(self);
-    const char *last_colon = strrchr(class_name, ':');
-    const char *struct_sym = last_colon ? last_colon + 1 : class_name;
-    if (strcmp(specifier, struct_sym) != 0) {
-        char *wanted = CFCUtil_sprintf("%s%s", prefix, struct_sym);
-        int mismatch = strcmp(wanted, specifier);
-        FREEMEM(wanted);
-        if (mismatch) {
-            CFCUtil_die("First arg type doesn't match class: '%s' '%s'",
-                        class_name, specifier);
-        }
-    }
-
-    self->macro_sym         = CFCUtil_strdup(macro_sym);
-    self->full_override_sym = NULL;
-    self->host_alias        = NULL;
-    self->is_final          = is_final;
-    self->is_abstract       = is_abstract;
-    self->is_excluded       = false;
-
-    // Derive name of implementing function.
-    self->short_imp_func
-        = CFCUtil_sprintf("%s_%s_IMP", CFCMethod_get_class_cnick(self),
-                          self->macro_sym);
-    self->imp_func = CFCUtil_sprintf("%s%s", CFCMethod_get_PREFIX(self),
-                                     self->short_imp_func);
-
-    // Assume that this method is novel until we discover when applying
-    // inheritance that it overrides another.
-    self->is_novel = true;
-
-    return self;
-}
-
-void
-CFCMethod_resolve_types(CFCMethod *self, struct CFCClass **classes) {
-    CFCFunction_resolve_types((CFCFunction*)self, classes);
-}
-
-void
-CFCMethod_destroy(CFCMethod *self) {
-    FREEMEM(self->macro_sym);
-    FREEMEM(self->full_override_sym);
-    FREEMEM(self->host_alias);
-    FREEMEM(self->short_imp_func);
-    FREEMEM(self->imp_func);
-    CFCFunction_destroy((CFCFunction*)self);
-}
-
-int
-CFCMethod_compatible(CFCMethod *self, CFCMethod *other) {
-    if (!other) { return false; }
-    if (strcmp(self->macro_sym, other->macro_sym)) { return false; }
-    int my_public = CFCMethod_public(self);
-    int other_public = CFCMethod_public(other);
-    if (!!my_public != !!other_public) { return false; }
-
-    // Check arguments and initial values.
-    CFCParamList *my_param_list    = self->function.param_list;
-    CFCParamList *other_param_list = other->function.param_list;
-    CFCVariable **my_args    = CFCParamList_get_variables(my_param_list);
-    CFCVariable **other_args = CFCParamList_get_variables(other_param_list);
-    const char  **my_vals    = CFCParamList_get_initial_values(my_param_list);
-    const char  **other_vals = CFCParamList_get_initial_values(other_param_list);
-    for (size_t i = 1; ; i++) {  // start at 1, skipping self
-        if (!!my_args[i] != !!other_args[i]) { return false; }
-        if (!!my_vals[i] != !!other_vals[i]) { return false; }
-        if (my_vals[i]) {
-            if (strcmp(my_vals[i], other_vals[i])) { return false; }
-        }
-        if (my_args[i]) {
-            if (!CFCVariable_equals(my_args[i], other_args[i])) {
-                return false;
-            }
-        }
-        else {
-            break;
-        }
-    }
-
-    // Check return types.
-    CFCType *type       = CFCMethod_get_return_type(self);
-    CFCType *other_type = CFCMethod_get_return_type(other);
-    if (CFCType_is_object(type)) {
-        // Weak validation to allow covariant object return types.
-        if (!CFCType_is_object(other_type)) { return false; }
-        if (!CFCType_similar(type, other_type)) { return false; }
-    }
-    else {
-        if (!CFCType_equals(type, other_type)) { return false; }
-    }
-
-    return true;
-}
-
-void
-CFCMethod_override(CFCMethod *self, CFCMethod *orig) {
-    // Check that the override attempt is legal.
-    if (CFCMethod_final(orig)) {
-        const char *orig_class = CFCMethod_get_class_name(orig);
-        const char *my_class   = CFCMethod_get_class_name(self);
-        CFCUtil_die("Attempt to override final method '%s' from '%s' by '%s'",
-                    orig->macro_sym, orig_class, my_class);
-    }
-    if (!CFCMethod_compatible(self, orig)) {
-        const char *func      = CFCMethod_imp_func(self);
-        const char *orig_func = CFCMethod_imp_func(orig);
-        CFCUtil_die("Non-matching signatures for %s and %s", func, orig_func);
-    }
-
-    // Mark the Method as no longer novel.
-    self->is_novel = false;
-}
-
-CFCMethod*
-CFCMethod_finalize(CFCMethod *self) {
-    CFCParcel  *parcel      = CFCMethod_get_parcel(self);
-    const char *exposure    = CFCMethod_get_exposure(self);
-    const char *class_name  = CFCMethod_get_class_name(self);
-    const char *class_cnick = CFCMethod_get_class_cnick(self);
-    CFCMethod  *finalized
-        = CFCMethod_new(parcel, exposure, class_name, class_cnick,
-                        self->macro_sym, self->function.return_type,
-                        self->function.param_list,
-                        self->function.docucomment, true,
-                        self->is_abstract);
-    finalized->is_novel = self->is_novel;
-    return finalized;
-}
-
-void
-CFCMethod_set_host_alias(CFCMethod *self, const char *alias) {
-    if (!alias || !alias[0]) {
-        CFCUtil_die("Missing required param 'alias'");
-    }
-    if (!self->is_novel) {
-        CFCUtil_die("Can't set_host_alias %s -- method %s not novel in %s",
-                    alias, self->macro_sym, CFCMethod_get_class_name(self));
-    }
-    if (self->host_alias) {
-        if (strcmp(self->host_alias, alias) == 0) { return; }
-        CFCUtil_die("Can't set_host_alias %s -- already set to %s for method"
-                    " %s in %s", alias, self->host_alias, self->macro_sym,
-                    CFCMethod_get_class_name(self));
-    }
-    self->host_alias = CFCUtil_strdup(alias);
-}
-
-const char*
-CFCMethod_get_host_alias(CFCMethod *self) {
-    return self->host_alias;
-}
-
-void
-CFCMethod_exclude_from_host(CFCMethod *self) {
-    if (!self->is_novel) {
-        CFCUtil_die("Can't exclude_from_host -- method %s not novel in %s",
-                    self->macro_sym, CFCMethod_get_class_name(self));
-    }
-    self->is_excluded = true;
-}
-
-int
-CFCMethod_excluded_from_host(CFCMethod *self) {
-    return self->is_excluded;
-}
-
-static char*
-S_short_method_sym(CFCMethod *self, CFCClass *invoker, const char *postfix) {
-    const char *cnick;
-    if (invoker) {
-        cnick = CFCClass_get_cnick(invoker);
-    }
-    else {
-        cnick = CFCMethod_get_class_cnick(self);
-    }
-    return CFCUtil_sprintf("%s_%s%s", cnick, self->macro_sym, postfix);
-}
-
-static char*
-S_full_method_sym(CFCMethod *self, CFCClass *invoker, const char *postfix) {
-    const char *PREFIX;
-    const char *cnick;
-    if (invoker) {
-        PREFIX = CFCClass_get_PREFIX(invoker);
-        cnick  = CFCClass_get_cnick(invoker);
-    }
-    else {
-        PREFIX = CFCMethod_get_PREFIX(self);
-        cnick  = CFCMethod_get_class_cnick(self);
-    }
-    return CFCUtil_sprintf("%s%s_%s%s", PREFIX, cnick, self->macro_sym,
-                           postfix);
-}
-
-char*
-CFCMethod_short_method_sym(CFCMethod *self, CFCClass *invoker) {
-    return S_short_method_sym(self, invoker, "");
-}
-
-char*
-CFCMethod_full_method_sym(CFCMethod *self, CFCClass *invoker) {
-    return S_full_method_sym(self, invoker, "");
-}
-
-char*
-CFCMethod_full_offset_sym(CFCMethod *self, CFCClass *invoker) {
-    return S_full_method_sym(self, invoker, "_OFFSET");
-}
-
-const char*
-CFCMethod_get_macro_sym(CFCMethod *self) {
-    return self->macro_sym;
-}
-
-const char*
-CFCMethod_micro_sym(CFCMethod *self) {
-    return CFCSymbol_micro_sym((CFCSymbol*)self);
-}
-
-char*
-CFCMethod_short_typedef(CFCMethod *self, CFCClass *invoker) {
-    return S_short_method_sym(self, invoker, "_t");
-}
-
-char*
-CFCMethod_full_typedef(CFCMethod *self, CFCClass *invoker) {
-    return S_full_method_sym(self, invoker, "_t");
-}
-
-const char*
-CFCMethod_full_override_sym(CFCMethod *self) {
-    if (!self->full_override_sym) {
-        const char *Prefix = CFCMethod_get_Prefix(self);
-        const char *cnick  = CFCMethod_get_class_cnick(self);
-        self->full_override_sym
-            = CFCUtil_sprintf("%s%s_%s_OVERRIDE", Prefix, cnick,
-                              self->macro_sym);
-    }
-    return self->full_override_sym;
-}
-
-int
-CFCMethod_final(CFCMethod *self) {
-    return self->is_final;
-}
-
-int
-CFCMethod_abstract(CFCMethod *self) {
-    return self->is_abstract;
-}
-
-int
-CFCMethod_novel(CFCMethod *self) {
-    return self->is_novel;
-}
-
-CFCType*
-CFCMethod_self_type(CFCMethod *self) {
-    CFCVariable **vars = CFCParamList_get_variables(self->function.param_list);
-    return CFCVariable_get_type(vars[0]);
-}
-
-CFCParcel*
-CFCMethod_get_parcel(CFCMethod *self) {
-    return CFCSymbol_get_parcel((CFCSymbol*)self);
-}
-
-const char*
-CFCMethod_get_prefix(CFCMethod *self) {
-    return CFCSymbol_get_prefix((CFCSymbol*)self);
-}
-
-const char*
-CFCMethod_get_Prefix(CFCMethod *self) {
-    return CFCSymbol_get_Prefix((CFCSymbol*)self);
-}
-
-const char*
-CFCMethod_get_PREFIX(CFCMethod *self) {
-    return CFCSymbol_get_PREFIX((CFCSymbol*)self);
-}
-
-const char*
-CFCMethod_get_exposure(CFCMethod *self) {
-    return CFCSymbol_get_exposure((CFCSymbol*)self);
-}
-
-const char*
-CFCMethod_get_class_name(CFCMethod *self) {
-    return CFCSymbol_get_class_name((CFCSymbol*)self);
-}
-
-const char*
-CFCMethod_get_class_cnick(CFCMethod *self) {
-    return CFCSymbol_get_class_cnick((CFCSymbol*)self);
-}
-
-int
-CFCMethod_public(CFCMethod *self) {
-    return CFCSymbol_public((CFCSymbol*)self);
-}
-
-CFCType*
-CFCMethod_get_return_type(CFCMethod *self) {
-    return CFCFunction_get_return_type((CFCFunction*)self);
-}
-
-CFCParamList*
-CFCMethod_get_param_list(CFCMethod *self) {
-    return CFCFunction_get_param_list((CFCFunction*)self);
-}
-
-const char*
-CFCMethod_imp_func(CFCMethod *self) {
-    return self->imp_func;
-}
-
-const char*
-CFCMethod_short_imp_func(CFCMethod *self) {
-    return self->short_imp_func;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCMethod.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCMethod.h b/clownfish/compiler/src/CFCMethod.h
deleted file mode 100644
index 0c96220..0000000
--- a/clownfish/compiler/src/CFCMethod.h
+++ /dev/null
@@ -1,244 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::Method - Metadata describing an instance method.
- *
- * Clownfish::CFC::Model::Method is a specialized subclass of
- * Clownfish::CFC::Model::Function, with the first argument required to be an
- * Obj.
- *
- * When compiling Clownfish code to C, Method objects generate all the code
- * that Function objects do, but also create symbols for indirect invocation via
- * VTable.
- */
-
-#ifndef H_CFCMETHOD
-#define H_CFCMETHOD
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCMethod CFCMethod;
-struct CFCParcel;
-struct CFCType;
-struct CFCClass;
-struct CFCParamList;
-struct CFCDocuComment;
-
-/**
- * @param parcel See Clownfish::CFC::Model::Function.
- * @param exposure See Clownfish::CFC::Model::Function.  Defaults to "parcel"
- * if not supplied.
- * @param class_name See Clownfish::CFC::Model::Function.
- * @param class_cnick See Clownfish::CFC::Model::Function.
- * @param macro_sym - The mixed case name which will be used when invoking the
- * method.
- * @param return_type See Clownfish::CFC::Model::Function.
- * @param param_list - A Clownfish::CFC::Model::ParamList.  The first element
- * must be an object of the class identified by C<class_name>.
- * @param docucomment see Clownfish::CFC::Model::Function.  May be NULL.
- * @param is_final - Indicate whether the method is final.
- * @param is_abstract - Indicate whether the method is abstract.
- */
-CFCMethod*
-CFCMethod_new(struct CFCParcel *parcel, const char *exposure,
-              const char *class_name, const char *class_cnick,
-              const char *macro_sym, struct CFCType *return_type,
-              struct CFCParamList *param_list,
-              struct CFCDocuComment *docucomment, int is_final,
-              int is_abstract);
-
-CFCMethod*
-CFCMethod_init(CFCMethod *self, struct CFCParcel *parcel,
-               const char *exposure, const char *class_name,
-               const char *class_cnick, const char *macro_sym,
-               struct CFCType *return_type, struct CFCParamList *param_list,
-               struct CFCDocuComment *docucomment, int is_final,
-               int is_abstract);
-
-void
-CFCMethod_resolve_types(CFCMethod *self, struct CFCClass **classes);
-
-void
-CFCMethod_destroy(CFCMethod *self);
-
-/** Returns true if the methods have signatures and attributes which allow one
- * to override the other.
- */
-int
-CFCMethod_compatible(CFCMethod *self, CFCMethod *other);
-
-/** Let the Method know that it is overriding a method which was defined in a
- * parent class, and verify that the override is valid.
- *
- * All methods start out believing that they are "novel", because we don't
- * know about inheritance until we build the hierarchy after all files have
- * been parsed.  override() is a way of going back and relabeling a method as
- * overridden when new information has become available: in this case, that a
- * parent class has defined a method with the same name.
- */
-void
-CFCMethod_override(CFCMethod *self, CFCMethod *orig);
-
-/** As with override, above, this is for going back and changing the nature of
- * a Method after new information has become available -- typically, when we
- * discover that the method has been inherited by a "final" class.
- *
- * However, we don't modify the original Method as with override().  Inherited
- * Method objects are shared between parent and child classes; if a shared
- * Method object were to become final, it would interfere with its own
- * inheritance.  So, we make a copy, slightly modified to indicate that it is
- * "final".
- */
-CFCMethod*
-CFCMethod_finalize(CFCMethod *self);
-
-/**
- * Create the symbol used to invoke the method without the parcel Prefix, e.g.
- * "LobClaw_Pinch".
- * @param invoker Class for which the symbol is created. If invoker is NULL,
- * use the class where the method is defined.
- *
- * @return the symbol.
- */
-char*
-CFCMethod_short_method_sym(CFCMethod *self, struct CFCClass *invoker);
-
-/**
- * Create the fully-qualified symbol used to invoke the method, e.g.
- * "Crust_LobClaw_Pinch".
- * @param invoker Class for which the symbol is created. If invoker is NULL,
- * use the class where the method is defined.
- *
- * @return the symbol.
- */
-char*
-CFCMethod_full_method_sym(CFCMethod *self, struct CFCClass *invoker);
-
-/** Create the fully qualified name of the variable which stores the method's
- * vtable offset, e.g. "Crust_LobClaw_Pinch_OFFSET".
- * @param invoker Class for which the symbol is created. If invoker is NULL,
- * use the class where the method is defined.
- *
- * @return the symbol.
- */
-char*
-CFCMethod_full_offset_sym(CFCMethod *self, struct CFCClass *invoker);
-
-const char*
-CFCMethod_get_macro_sym(CFCMethod *self);
-
-const char*
-CFCMethod_micro_sym(CFCMethod *self);
-
-/** Create the typedef symbol for this method, e.g "Claw_Pinch_t".
- * @param invoker Class for which the symbol is created. If invoker is NULL,
- * use the class where the method is defined.
- *
- * @return the symbol.
- */
-char*
-CFCMethod_short_typedef(CFCMethod *self, struct CFCClass *invoker);
-
-/** Create the fully-qualified typedef symbol, e.g. "Crust_Claw_Pinch_t".
- * @param invoker Class for which the symbol is created. If invoker is NULL,
- * use the class where the method is defined.
- *
- * @return the symbol.
- */
-char*
-CFCMethod_full_typedef(CFCMethod *self, struct CFCClass *invoker);
-
-/** Returns the fully qualified name of the function which implements the
- * callback to the host in the event that a host method has been defined which
- * overrides this method, e.g. "crust_LobClaw_pinch_OVERRIDE".
- */
-const char*
-CFCMethod_full_override_sym(CFCMethod *self);
-
-int
-CFCMethod_final(CFCMethod *self);
-
-int
-CFCMethod_abstract(CFCMethod *self);
-
-/** Returns true if this method is the first implemenation in the inheritance
- * hierarchy in which the method was declared.
- */
-int
-CFCMethod_novel(CFCMethod *self);
-
-/** Return the Clownfish::CFC::Model::Type for <code>self</code>.
- */
-
-struct CFCType*
-CFCMethod_self_type(CFCMethod *self);
-
-void
-CFCMethod_set_host_alias(CFCMethod *self, const char *alias);
-
-const char*
-CFCMethod_get_host_alias(CFCMethod *self);
-
-void
-CFCMethod_exclude_from_host(CFCMethod *self);
-
-int
-CFCMethod_excluded_from_host(CFCMethod *self);
-
-struct CFCParcel*
-CFCMethod_get_parcel(CFCMethod *self);
-
-const char*
-CFCMethod_get_prefix(CFCMethod *self);
-
-const char*
-CFCMethod_get_Prefix(CFCMethod *self);
-
-const char*
-CFCMethod_get_PREFIX(CFCMethod *self);
-
-const char*
-CFCMethod_get_exposure(CFCMethod *self);
-
-const char*
-CFCMethod_get_class_name(CFCMethod *self);
-
-const char*
-CFCMethod_get_class_cnick(CFCMethod *self);
-
-int
-CFCMethod_public(CFCMethod *self);
-
-struct CFCType*
-CFCMethod_get_return_type(CFCMethod *self);
-
-struct CFCParamList*
-CFCMethod_get_param_list(CFCMethod *self);
-
-const char*
-CFCMethod_imp_func(CFCMethod *self);
-
-const char*
-CFCMethod_short_imp_func(CFCMethod *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCMETHOD */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCParamList.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCParamList.c b/clownfish/compiler/src/CFCParamList.c
deleted file mode 100644
index 087030c..0000000
--- a/clownfish/compiler/src/CFCParamList.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCParamList.h"
-#include "CFCVariable.h"
-#include "CFCSymbol.h"
-#include "CFCUtil.h"
-
-struct CFCParamList {
-    CFCBase       base;
-    CFCVariable **variables;
-    char        **values;
-    int           variadic;
-    size_t        num_vars;
-    char         *c_string;
-    char         *name_list;
-};
-
-//
-static void
-S_generate_c_strings(CFCParamList *self);
-
-static const CFCMeta CFCPARAMLIST_META = {
-    "Clownfish::CFC::Model::ParamList",
-    sizeof(CFCParamList),
-    (CFCBase_destroy_t)CFCParamList_destroy
-};
-
-CFCParamList*
-CFCParamList_new(int variadic) {
-    CFCParamList *self = (CFCParamList*)CFCBase_allocate(&CFCPARAMLIST_META);
-    return CFCParamList_init(self, variadic);
-}
-
-CFCParamList*
-CFCParamList_init(CFCParamList *self, int variadic) {
-    self->variadic  = variadic;
-    self->num_vars  = 0;
-    self->variables = (CFCVariable**)CALLOCATE(1, sizeof(void*));
-    self->values    = (char**)CALLOCATE(1, sizeof(char*));
-    self->c_string  = NULL;
-    self->name_list = NULL;
-    return self;
-}
-
-void
-CFCParamList_resolve_types(CFCParamList *self, struct CFCClass **classes) {
-    for (size_t i = 0; self->variables[i]; ++i) {
-        CFCVariable_resolve_type(self->variables[i], classes);
-    }
-}
-
-void
-CFCParamList_add_param(CFCParamList *self, CFCVariable *variable,
-                       const char *value) {
-    CFCUTIL_NULL_CHECK(variable);
-    self->num_vars++;
-    size_t amount = (self->num_vars + 1) * sizeof(void*);
-    self->variables = (CFCVariable**)REALLOCATE(self->variables, amount);
-    self->values    = (char**)REALLOCATE(self->values, amount);
-    self->variables[self->num_vars - 1]
-        = (CFCVariable*)CFCBase_incref((CFCBase*)variable);
-    self->values[self->num_vars - 1] = value ? CFCUtil_strdup(value) : NULL;
-    self->variables[self->num_vars] = NULL;
-    self->values[self->num_vars] = NULL;
-}
-
-void
-CFCParamList_destroy(CFCParamList *self) {
-    for (size_t i = 0; i < self->num_vars; i++) {
-        CFCBase_decref((CFCBase*)self->variables[i]);
-        FREEMEM(self->values[i]);
-    }
-    FREEMEM(self->variables);
-    FREEMEM(self->values);
-    FREEMEM(self->c_string);
-    FREEMEM(self->name_list);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-static void
-S_generate_c_strings(CFCParamList *self) {
-    size_t c_string_size = 1;
-    size_t name_list_size = 1;
-
-    // Calc space requirements and allocate memory.
-    for (size_t i = 0; i < self->num_vars; i++) {
-        CFCVariable *var = self->variables[i];
-        c_string_size += sizeof(", ");
-        c_string_size += strlen(CFCVariable_local_c(var));
-        name_list_size += sizeof(", ");
-        name_list_size += strlen(CFCVariable_micro_sym(var));
-    }
-    if (self->variadic) {
-        c_string_size += sizeof(", ...");
-    }
-    if (self->num_vars == 0) {
-        c_string_size += sizeof("void");
-    }
-    self->c_string  = (char*)MALLOCATE(c_string_size);
-    self->name_list = (char*)MALLOCATE(name_list_size);
-    self->c_string[0] = '\0';
-    self->name_list[0] = '\0';
-
-    // Build the strings.
-    for (size_t i = 0; i < self->num_vars; i++) {
-        CFCVariable *var = self->variables[i];
-        strcat(self->c_string, CFCVariable_local_c(var));
-        strcat(self->name_list, CFCVariable_micro_sym(var));
-        if (i == self->num_vars - 1) {
-            if (self->variadic) {
-                strcat(self->c_string, ", ...");
-            }
-        }
-        else {
-            strcat(self->c_string, ", ");
-            strcat(self->name_list, ", ");
-        }
-    }
-    if (self->num_vars == 0) {
-        strcat(self->c_string, "void");
-    }
-}
-
-CFCVariable**
-CFCParamList_get_variables(CFCParamList *self) {
-    return self->variables;
-}
-
-const char**
-CFCParamList_get_initial_values(CFCParamList *self) {
-    return (const char**)self->values;
-}
-
-size_t
-CFCParamList_num_vars(CFCParamList *self) {
-    return self->num_vars;
-}
-
-void
-CFCParamList_set_variadic(CFCParamList *self, int variadic) {
-    self->variadic = !!variadic;
-}
-
-int
-CFCParamList_variadic(CFCParamList *self) {
-    return self->variadic;
-}
-
-const char*
-CFCParamList_to_c(CFCParamList *self) {
-    if (!self->c_string) { S_generate_c_strings(self); }
-    return self->c_string;
-}
-
-const char*
-CFCParamList_name_list(CFCParamList *self) {
-    if (!self->name_list) { S_generate_c_strings(self); }
-    return self->name_list;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCParamList.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCParamList.h b/clownfish/compiler/src/CFCParamList.h
deleted file mode 100644
index 886fdfe..0000000
--- a/clownfish/compiler/src/CFCParamList.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::ParamList - parameter list.
- */
-
-#ifndef H_CFCPARAMLIST
-#define H_CFCPARAMLIST
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCParamList CFCParamList;
-struct CFCClass;
-struct CFCVariable;
-
-/**
- * @param variadic Should be true if the function is variadic.
- */
-CFCParamList*
-CFCParamList_new(int variadic);
-
-CFCParamList*
-CFCParamList_init(CFCParamList *self, int variadic);
-
-void
-CFCParamList_resolve_types(CFCParamList *self, struct CFCClass **classes);
-
-void
-CFCParamList_destroy(CFCParamList *self);
-
-/** Add a parameter to the ParamList.
- *
- * @param variable A Clownfish::CFC::Model::Variable.
- * @param value The parameter's default value, which should be NULL
- * if there is no default and thus the parameter is required.
- */
-void
-CFCParamList_add_param(CFCParamList *self, struct CFCVariable *variable,
-                       const char *value);
-
-struct CFCVariable**
-CFCParamList_get_variables(CFCParamList *self);
-
-const char**
-CFCParamList_get_initial_values(CFCParamList *self);
-
-void
-CFCParamList_set_variadic(CFCParamList *self, int variadic);
-
-int
-CFCParamList_variadic(CFCParamList *self);
-
-/** Return the number of variables in the ParamList, including "self" for
- * methods.
- */
-size_t
-CFCParamList_num_vars(CFCParamList *self);
-
-
-/** Return a list of the variable's types and names, joined by commas.  For
- * example:
- *
- *     Obj* self, Foo* foo, Bar* bar
- */
-const char*
-CFCParamList_to_c(CFCParamList *self);
-
-/** Return the variable's names, joined by commas.  For example:
- *
- *     self, foo, bar
- */
-const char*
-CFCParamList_name_list(CFCParamList *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPARAMLIST */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCParcel.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCParcel.c b/clownfish/compiler/src/CFCParcel.c
deleted file mode 100644
index 262a5fc..0000000
--- a/clownfish/compiler/src/CFCParcel.c
+++ /dev/null
@@ -1,626 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCParcel.h"
-#include "CFCVersion.h"
-#include "CFCUtil.h"
-
-struct CFCParcel {
-    CFCBase base;
-    char *name;
-    char *cnick;
-    CFCVersion *version;
-    char *prefix;
-    char *Prefix;
-    char *PREFIX;
-    char *privacy_sym;
-    int is_included;
-    char **dependent_parcels;
-    size_t num_dependent_parcels;
-    char **inherited_parcels;
-    size_t num_inherited_parcels;
-};
-
-static CFCParcel *default_parcel = NULL;
-
-#define JSON_STRING 1
-#define JSON_HASH   2
-
-typedef struct JSONNode {
-    int type;
-    char *string;
-    struct JSONNode **kids;
-    size_t num_kids;
-} JSONNode;
-
-static JSONNode*
-S_parse_json_for_parcel(const char *json);
-
-static JSONNode*
-S_parse_json_hash(const char **json);
-
-static JSONNode*
-S_parse_json_string(const char **json);
-
-static void
-S_skip_whitespace(const char **json);
-
-static void
-S_destroy_json(JSONNode *node);
-
-static CFCParcel **registry = NULL;
-static size_t num_registered = 0;
-
-CFCParcel*
-CFCParcel_fetch(const char *name) {
-    // Return the default parcel for either a blank name or a NULL name.
-    if (!name || !strlen(name)) {
-        return CFCParcel_default_parcel();
-    }
-
-    for (size_t i = 0; i < num_registered ; i++) {
-        CFCParcel *existing = registry[i];
-        if (strcmp(existing->name, name) == 0) {
-            return existing;
-        }
-    }
-
-    return NULL;
-}
-
-void
-CFCParcel_register(CFCParcel *self) {
-    const char *name  = self->name;
-    const char *cnick = self->cnick;
-
-    for (size_t i = 0; i < num_registered ; i++) {
-        CFCParcel *other = registry[i];
-
-        if (strcmp(other->name, name) == 0) {
-            CFCUtil_die("Parcel '%s' already registered", name);
-        }
-        if (strcmp(other->cnick, cnick) == 0) {
-            CFCUtil_die("Parcel with nickname '%s' already registered", cnick);
-        }
-    }
-
-    if (!num_registered) {
-        // Init default parcel as first.
-        registry = (CFCParcel**)CALLOCATE(3, sizeof(CFCParcel*));
-        CFCParcel *def = CFCParcel_default_parcel();
-        registry[0] = (CFCParcel*)CFCBase_incref((CFCBase*)def);
-        num_registered++;
-    }
-
-    size_t size = (num_registered + 2) * sizeof(CFCParcel*);
-    registry = (CFCParcel**)REALLOCATE(registry, size);
-    registry[num_registered++] = (CFCParcel*)CFCBase_incref((CFCBase*)self);
-    registry[num_registered]   = NULL;
-}
-
-CFCParcel**
-CFCParcel_all_parcels(void) {
-    size_t size = (num_registered + 1) * sizeof(CFCParcel*);
-    CFCParcel **parcels = (CFCParcel**)MALLOCATE(size);
-    size_t n = 0;
-
-    for (size_t i = 0; registry[i]; ++i) {
-        CFCParcel  *parcel = registry[i];
-        const char *prefix = CFCParcel_get_prefix(parcel);
-
-        // Skip default parcel.
-        if (*prefix) {
-            parcels[n++] = parcel;
-        }
-    }
-
-    parcels[n] = NULL;
-
-    return parcels;
-}
-
-void
-CFCParcel_reap_singletons(void) {
-    for (size_t i = 0; i < num_registered; i++) {
-        CFCBase_decref((CFCBase*)registry[i]);
-    }
-    FREEMEM(registry);
-    num_registered = 0;
-    registry = NULL;
-    CFCBase_decref((CFCBase*)default_parcel);
-    default_parcel = NULL;
-}
-
-static int
-S_validate_name_or_cnick(const char *orig) {
-    const char *ptr = orig;
-    for (; *ptr != 0; ptr++) {
-        if (!isalpha(*ptr)) { return false; }
-    }
-    return true;
-}
-
-static const CFCMeta CFCPARCEL_META = {
-    "Clownfish::CFC::Model::Parcel",
-    sizeof(CFCParcel),
-    (CFCBase_destroy_t)CFCParcel_destroy
-};
-
-CFCParcel*
-CFCParcel_new(const char *name, const char *cnick, CFCVersion *version,
-              int is_included) {
-    CFCParcel *self = (CFCParcel*)CFCBase_allocate(&CFCPARCEL_META);
-    return CFCParcel_init(self, name, cnick, version, is_included);
-}
-
-CFCParcel*
-CFCParcel_init(CFCParcel *self, const char *name, const char *cnick,
-               CFCVersion *version, int is_included) {
-    // Validate name.
-    if (!name || !S_validate_name_or_cnick(name)) {
-        CFCUtil_die("Invalid name: '%s'", name ? name : "[NULL]");
-    }
-    self->name = CFCUtil_strdup(name);
-
-    // Validate or derive cnick.
-    if (cnick) {
-        if (!S_validate_name_or_cnick(cnick)) {
-            CFCUtil_die("Invalid cnick: '%s'", cnick);
-        }
-        self->cnick = CFCUtil_strdup(cnick);
-    }
-    else {
-        // Default cnick to name.
-        self->cnick = CFCUtil_strdup(name);
-    }
-
-    // Default to version v0.
-    if (version) {
-        self->version = (CFCVersion*)CFCBase_incref((CFCBase*)version);
-    }
-    else {
-        self->version = CFCVersion_new("v0");
-    }
-
-    // Derive prefix, Prefix, PREFIX.
-    size_t cnick_len  = strlen(self->cnick);
-    size_t prefix_len = cnick_len ? cnick_len + 1 : 0;
-    size_t amount     = prefix_len + 1;
-    self->prefix = (char*)MALLOCATE(amount);
-    self->Prefix = (char*)MALLOCATE(amount);
-    self->PREFIX = (char*)MALLOCATE(amount);
-    memcpy(self->Prefix, self->cnick, cnick_len);
-    if (cnick_len) {
-        self->Prefix[cnick_len]  = '_';
-        self->Prefix[cnick_len + 1]  = '\0';
-    }
-    else {
-        self->Prefix[cnick_len] = '\0';
-    }
-    for (size_t i = 0; i < amount; i++) {
-        self->prefix[i] = tolower(self->Prefix[i]);
-        self->PREFIX[i] = toupper(self->Prefix[i]);
-    }
-    self->prefix[prefix_len] = '\0';
-    self->Prefix[prefix_len] = '\0';
-    self->PREFIX[prefix_len] = '\0';
-
-    // Derive privacy symbol.
-    size_t privacy_sym_len = cnick_len + 4;
-    self->privacy_sym = (char*)MALLOCATE(privacy_sym_len + 1);
-    memcpy(self->privacy_sym, "CFP_", 4);
-    for (size_t i = 0; i < cnick_len; i++) {
-        self->privacy_sym[i+4] = toupper(self->cnick[i]);
-    }
-    self->privacy_sym[privacy_sym_len] = '\0';
-
-    // Set is_included.
-    self->is_included = is_included;
-
-    // Initialize dependencies.
-    self->dependent_parcels = (char**)CALLOCATE(1, sizeof(char*));
-    self->num_dependent_parcels = 0;
-    self->inherited_parcels = (char**)CALLOCATE(1, sizeof(char*));
-    self->num_inherited_parcels = 0;
-
-    return self;
-}
-
-static CFCParcel*
-S_new_from_json(const char *json, const char *path, int is_included) {
-    JSONNode *parsed = S_parse_json_for_parcel(json);
-    if (!parsed) {
-        CFCUtil_die("Invalid JSON parcel definition in '%s'", path);
-    }
-    const char *name     = NULL;
-    const char *nickname = NULL;
-    CFCVersion *version  = NULL;
-    for (size_t i = 0, max = parsed->num_kids; i < max; i += 2) {
-        JSONNode *key   = parsed->kids[i];
-        JSONNode *value = parsed->kids[i + 1];
-        if (key->type != JSON_STRING) {
-            CFCUtil_die("JSON parsing error (filepath '%s')", path);
-        }
-        if (strcmp(key->string, "name") == 0) {
-            if (value->type != JSON_STRING) {
-                CFCUtil_die("'name' must be a string (filepath %s)", path);
-            }
-            name = value->string;
-        }
-        else if (strcmp(key->string, "nickname") == 0) {
-            if (value->type != JSON_STRING) {
-                CFCUtil_die("'nickname' must be a string (filepath %s)",
-                            path);
-            }
-            nickname = value->string;
-        }
-        else if (strcmp(key->string, "version") == 0) {
-            if (value->type != JSON_STRING) {
-                CFCUtil_die("'version' must be a string (filepath %s)",
-                            path);
-            }
-            version = CFCVersion_new(value->string);
-        }
-    }
-    if (!name) {
-        CFCUtil_die("Missing required key 'name' (filepath '%s')", path);
-    }
-    if (!version) {
-        CFCUtil_die("Missing required key 'version' (filepath '%s')", path);
-    }
-    CFCParcel *self = CFCParcel_new(name, nickname, version, is_included);
-    CFCBase_decref((CFCBase*)version);
-
-    for (size_t i = 0, max = parsed->num_kids; i < max; i += 2) {
-        JSONNode *key   = parsed->kids[i];
-        if (strcmp(key->string, "name") == 0
-            || strcmp(key->string, "nickname") == 0
-            || strcmp(key->string, "version") == 0
-            || strcmp(key->string, "prerequisites") == 0
-           ) {
-            ;
-        }
-        else {
-            CFCUtil_die("Unrecognized key: '%s' (filepath '%s')",
-                        key->string, path);
-        }
-    }
-
-    S_destroy_json(parsed);
-    return self;
-}
-
-CFCParcel*
-CFCParcel_new_from_json(const char *json, int is_included) {
-    return S_new_from_json(json, "[NULL]", is_included);
-}
-
-CFCParcel*
-CFCParcel_new_from_file(const char *path, int is_included) {
-    size_t len;
-    char *json = CFCUtil_slurp_text(path, &len);
-    CFCParcel *self = S_new_from_json(json, path, is_included);
-    FREEMEM(json);
-    return self;
-}
-
-void
-CFCParcel_destroy(CFCParcel *self) {
-    FREEMEM(self->name);
-    FREEMEM(self->cnick);
-    CFCBase_decref((CFCBase*)self->version);
-    FREEMEM(self->prefix);
-    FREEMEM(self->Prefix);
-    FREEMEM(self->PREFIX);
-    FREEMEM(self->privacy_sym);
-    for (size_t i = 0; self->dependent_parcels[i]; ++i) {
-        FREEMEM(self->dependent_parcels[i]);
-    }
-    FREEMEM(self->dependent_parcels);
-    for (size_t i = 0; self->inherited_parcels[i]; ++i) {
-        FREEMEM(self->inherited_parcels[i]);
-    }
-    FREEMEM(self->inherited_parcels);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-CFCParcel*
-CFCParcel_default_parcel(void) {
-    if (default_parcel == NULL) {
-        default_parcel = CFCParcel_new("", "", NULL, false);
-    }
-    return default_parcel;
-}
-
-int
-CFCParcel_equals(CFCParcel *self, CFCParcel *other) {
-    if (strcmp(self->name, other->name)) { return false; }
-    if (strcmp(self->cnick, other->cnick)) { return false; }
-    if (CFCVersion_compare_to(self->version, other->version) != 0) {
-        return false;
-    }
-    if (self->is_included != other->is_included) { return false; }
-    return true;
-}
-
-const char*
-CFCParcel_get_name(CFCParcel *self) {
-    return self->name;
-}
-
-const char*
-CFCParcel_get_cnick(CFCParcel *self) {
-    return self->cnick;
-}
-
-CFCVersion*
-CFCParcel_get_version(CFCParcel *self) {
-    return self->version;
-}
-
-const char*
-CFCParcel_get_prefix(CFCParcel *self) {
-    return self->prefix;
-}
-
-const char*
-CFCParcel_get_Prefix(CFCParcel *self) {
-    return self->Prefix;
-}
-
-const char*
-CFCParcel_get_PREFIX(CFCParcel *self) {
-    return self->PREFIX;
-}
-
-const char*
-CFCParcel_get_privacy_sym(CFCParcel *self) {
-    return self->privacy_sym;
-}
-
-int
-CFCParcel_included(CFCParcel *self) {
-    return self->is_included;
-}
-
-void
-CFCParcel_add_dependent_parcel(CFCParcel *self, CFCParcel *dependent) {
-    const char *name     = CFCParcel_get_name(self);
-    const char *dep_name = CFCParcel_get_name(dependent);
-
-    if (strcmp(name, dep_name) == 0) { return; }
-
-    for (size_t i = 0; self->dependent_parcels[i]; ++i) {
-        const char *other_name = self->dependent_parcels[i];
-        if (strcmp(other_name, dep_name) == 0) { return; }
-    }
-
-    size_t num_parcels = self->num_dependent_parcels;
-    self->dependent_parcels
-        = (char**)REALLOCATE(self->dependent_parcels,
-                             (num_parcels + 2) * sizeof(char*));
-    self->dependent_parcels[num_parcels]   = CFCUtil_strdup(dep_name);
-    self->dependent_parcels[num_parcels+1] = NULL;
-    self->num_dependent_parcels = num_parcels + 1;
-}
-
-void
-CFCParcel_add_inherited_parcel(CFCParcel *self, CFCParcel *inherited) {
-    const char *name     = CFCParcel_get_name(self);
-    const char *inh_name = CFCParcel_get_name(inherited);
-
-    if (strcmp(name, inh_name) == 0) { return; }
-
-    for (size_t i = 0; self->inherited_parcels[i]; ++i) {
-        const char *other_name = self->inherited_parcels[i];
-        if (strcmp(other_name, inh_name) == 0) { return; }
-    }
-
-    size_t num_parcels = self->num_inherited_parcels;
-    self->inherited_parcels
-        = (char**)REALLOCATE(self->inherited_parcels,
-                             (num_parcels + 2) * sizeof(char*));
-    self->inherited_parcels[num_parcels]   = CFCUtil_strdup(inh_name);
-    self->inherited_parcels[num_parcels+1] = NULL;
-    self->num_inherited_parcels = num_parcels + 1;
-
-    // Add to dependent parcels.
-    CFCParcel_add_dependent_parcel(self, inherited);
-}
-
-CFCParcel**
-CFCParcel_dependent_parcels(CFCParcel *self) {
-    CFCParcel **parcels
-        = (CFCParcel**)CALLOCATE(self->num_dependent_parcels + 1,
-                                 sizeof(CFCParcel*));
-
-    for (size_t i = 0; self->dependent_parcels[i]; ++i) {
-        parcels[i] = CFCParcel_fetch(self->dependent_parcels[i]);
-    }
-
-    return parcels;
-}
-
-CFCParcel**
-CFCParcel_inherited_parcels(CFCParcel *self) {
-    CFCParcel **parcels
-        = (CFCParcel**)CALLOCATE(self->num_inherited_parcels + 1,
-                                 sizeof(CFCParcel*));
-
-    for (size_t i = 0; self->inherited_parcels[i]; ++i) {
-        parcels[i] = CFCParcel_fetch(self->inherited_parcels[i]);
-    }
-
-    return parcels;
-}
-
-/*****************************************************************************
- * The hack JSON parser coded up below is only meant to parse Clownfish parcel
- * file content.  It is limited in its capabilities because so little is legal
- * in a .cfp file.
- */
-
-static JSONNode*
-S_parse_json_for_parcel(const char *json) {
-    if (!json) {
-        return NULL;
-    }
-    S_skip_whitespace(&json);
-    if (*json != '{') {
-        return NULL;
-    }
-    JSONNode *parsed = S_parse_json_hash(&json);
-    S_skip_whitespace(&json);
-    if (*json != '\0') {
-        S_destroy_json(parsed);
-        parsed = NULL;
-    }
-    return parsed;
-}
-
-static void
-S_append_kid(JSONNode *node, JSONNode *child) {
-    size_t size = (node->num_kids + 2) * sizeof(JSONNode*);
-    node->kids = (JSONNode**)realloc(node->kids, size);
-    node->kids[node->num_kids++] = child;
-    node->kids[node->num_kids]   = NULL;
-}
-
-static JSONNode*
-S_parse_json_hash(const char **json) {
-    const char *text = *json;
-    S_skip_whitespace(&text);
-    if (*text != '{') {
-        return NULL;
-    }
-    text++;
-    JSONNode *node = (JSONNode*)calloc(1, sizeof(JSONNode));
-    node->type = JSON_HASH;
-    while (1) {
-        // Parse key.
-        S_skip_whitespace(&text);
-        if (*text == '}') {
-            text++;
-            break;
-        }
-        else if (*text == '"') {
-            JSONNode *key = S_parse_json_string(&text);
-            S_skip_whitespace(&text);
-            if (!key || *text != ':') {
-                S_destroy_json(node);
-                return NULL;
-            }
-            text++;
-            S_append_kid(node, key);
-        }
-        else {
-            S_destroy_json(node);
-            return NULL;
-        }
-
-        // Parse value.
-        S_skip_whitespace(&text);
-        JSONNode *value = NULL;
-        if (*text == '"') {
-            value = S_parse_json_string(&text);
-        }
-        else if (*text == '{') {
-            value = S_parse_json_hash(&text);
-        }
-        if (!value) {
-            S_destroy_json(node);
-            return NULL;
-        }
-        S_append_kid(node, value);
-
-        // Parse comma.
-        S_skip_whitespace(&text);
-        if (*text == ',') {
-            text++;
-        }
-        else if (*text == '}') {
-            text++;
-            break;
-        }
-        else {
-            S_destroy_json(node);
-            return NULL;
-        }
-    }
-
-    // Move pointer.
-    *json = text;
-
-    return node;
-}
-
-// Parse a double quoted string.  Don't allow escapes.
-static JSONNode*
-S_parse_json_string(const char **json) {
-    const char *text = *json; 
-    if (*text != '\"') {
-        return NULL;
-    }
-    text++;
-    const char *start = text;
-    while (*text != '"') {
-        if (*text == '\\' || *text == '\0') {
-            return NULL;
-        }
-        text++;
-    }
-    JSONNode *node = (JSONNode*)calloc(1, sizeof(JSONNode));
-    node->type = JSON_STRING;
-    node->string = CFCUtil_strndup(start, text - start);
-
-    // Move pointer.
-    text++;
-    *json = text;
-
-    return node;
-}
-
-static void
-S_skip_whitespace(const char **json) {
-    while (isspace(json[0][0])) { *json = *json + 1; }
-}
-
-static void
-S_destroy_json(JSONNode *node) {
-    if (!node) {
-        return;
-    }
-    if (node->kids) {
-        for (size_t i = 0; node->kids[i] != NULL; i++) {
-            S_destroy_json(node->kids[i]);
-        }
-    }
-    free(node->string);
-    free(node->kids);
-    free(node);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCParcel.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCParcel.h b/clownfish/compiler/src/CFCParcel.h
deleted file mode 100644
index d5cdb5f..0000000
--- a/clownfish/compiler/src/CFCParcel.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::Parcel - Collection of code.
- *
- * A Parcel is a cohesive collection of code, which could, in theory, be
- * published as as a single entity.
- *
- * Clownfish supports two-tier manual namespacing, using a prefix, an optional
- * class nickname, and the local symbol:
- *
- *     prefix_ClassNick_local_symbol
- *
- * Clownfish::CFC::Model::Parcel supports the first tier, specifying initial
- * prefixes.  These prefixes come in three capitalization variants: prefix_,
- * Prefix_, and PREFIX_.
- */
-
-#ifndef H_CFCPARCEL
-#define H_CFCPARCEL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCParcel CFCParcel;
-struct CFCVersion;
-
-/** Return the parcel which has been registered for <code>name</code>.
- */
-CFCParcel*
-CFCParcel_fetch(const char *name);
-
-/** Register the supplied parcel.  Throws an error if a parcel with the same
- * name has already been registered.
- */
-void
-CFCParcel_register(CFCParcel *self);
-
-/** Return a NULL-terminated list of all registered parcels. Must be freed by
- * the caller.
- */
-CFCParcel**
-CFCParcel_all_parcels(void);
-
-/** Decref all singletons at shutdown.
- */
-void
-CFCParcel_reap_singletons(void);
-
-CFCParcel*
-CFCParcel_new(const char *name, const char *cnick,
-              struct CFCVersion *version, int is_included);
-
-CFCParcel*
-CFCParcel_new_from_file(const char *path, int is_included);
-
-CFCParcel*
-CFCParcel_new_from_json(const char *json, int is_included);
-
-CFCParcel*
-CFCParcel_init(CFCParcel *self, const char *name, const char *cnick,
-               struct CFCVersion *version, int is_included);
-
-void
-CFCParcel_destroy(CFCParcel *self);
-
-/** Return the singleton for default parcel, which has no prefix.
- */
-CFCParcel*
-CFCParcel_default_parcel(void);
-
-int
-CFCParcel_equals(CFCParcel *self, CFCParcel *other);
-
-const char*
-CFCParcel_get_name(CFCParcel *self);
-
-const char*
-CFCParcel_get_cnick(CFCParcel *self);
-
-struct CFCVersion*
-CFCParcel_get_version(CFCParcel *self);
-
-/** Return the all-lowercase version of the Parcel's prefix.
- */
-const char*
-CFCParcel_get_prefix(CFCParcel *self);
-
-/** Return the Titlecase version of the Parcel's prefix.
- */
-const char*
-CFCParcel_get_Prefix(CFCParcel *self);
-
-/** Return the all-caps version of the Parcel's prefix.
- */
-const char*
-CFCParcel_get_PREFIX(CFCParcel *self);
-
-/* Return the Parcel's privacy symbol.
- */
-const char*
-CFCParcel_get_privacy_sym(CFCParcel *self);
-
-/** Return true if the parcel is from an include directory.
- */
-int
-CFCParcel_included(CFCParcel *self);
-
-/** Add another Parcel that the Parcel depends on.
- */
-void
-CFCParcel_add_dependent_parcel(CFCParcel *self, CFCParcel *dependent);
-
-/** Add another Parcel containing superclasses that subclasses in the Parcel
- * extend. Also adds the other Parcel to the Parcel's dependencies.
- */
-void
-CFCParcel_add_inherited_parcel(CFCParcel *self, CFCParcel *inherited);
-
-/** Return a NULL-terminated array of all Parcels that the Parcel depends on.
- * Must be freed by the caller.
- */
-CFCParcel**
-CFCParcel_dependent_parcels(CFCParcel *self);
-
-/** Return a NULL-terminated array of all Parcels containing superclasses that
- * subclasses in the Parcel extend. Must be freed by the caller.
- */
-CFCParcel**
-CFCParcel_inherited_parcels(CFCParcel *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPARCEL */
-


[lucy-commits] [42/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Use object-based elements within SortFieldWriter.

Posted by ma...@apache.org.
Use object-based elements within SortFieldWriter.

Use objects rather than structs as an elements within SortFieldWriter,
harmonizing with all other subclasses of SortExternal.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/bb2a97d7
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/bb2a97d7
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/bb2a97d7

Branch: refs/heads/sortex_ptr_only
Commit: bb2a97d7bac3fc7fb43009c06594a0bd3d06b350
Parents: 8369f5f
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Fri Jan 4 14:19:27 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 11:26:56 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/SortFieldWriter.c   | 80 +++++++++++++++++++++++---------
 core/Lucy/Index/SortFieldWriter.cfh | 19 ++++++++
 2 files changed, 78 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/bb2a97d7/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index 123e7f6..7c0e770 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -15,6 +15,7 @@
  */
 
 #define C_LUCY_SORTFIELDWRITER
+#define C_LUCY_SFWRITERELEM
 #include "Lucy/Util/ToolSet.h"
 #include <math.h>
 
@@ -49,11 +50,11 @@ static int32_t
 S_write_files(SortFieldWriter *self, OutStream *ord_out, OutStream *ix_out,
               OutStream *dat_out);
 
-typedef struct lucy_SFWriterElem {
-    Obj *value;
-    int32_t doc_id;
-} lucy_SFWriterElem;
-#define SFWriterElem lucy_SFWriterElem
+// Create an element for the sort pool.  Both the `value` and the object
+// allocation itself will come from the MemoryPool, so the the element will be
+// deallocated via MemPool_Release_All().
+static SFWriterElem*
+S_SFWriterElem_create(MemoryPool *mem_pool, Obj *value, int32_t doc_id);
 
 SortFieldWriter*
 SortFieldWriter_new(Schema *schema, Snapshot *snapshot, Segment *segment,
@@ -196,10 +197,8 @@ SortFieldWriter_Add_IMP(SortFieldWriter *self, int32_t doc_id, Obj *value) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
 
     // Uniq-ify the value, and record it for this document.
-    SFWriterElem *elem
-        = (SFWriterElem*)MemPool_Grab(ivars->mem_pool, sizeof(SFWriterElem));
-    elem->value = S_find_unique_value(ivars->uniq_vals, value);
-    elem->doc_id = doc_id;
+    Obj *copy = S_find_unique_value(ivars->uniq_vals, value);
+    SFWriterElem *elem = S_SFWriterElem_create(ivars->mem_pool, copy, doc_id);
     SortFieldWriter_Feed(self, &elem);
     ivars->count++;
 }
@@ -342,8 +341,8 @@ S_write_val(Obj *val, int8_t prim_id, OutStream *ix_out, OutStream *dat_out,
 int
 SortFieldWriter_Compare_IMP(SortFieldWriter *self, void *va, void *vb) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
-    SFWriterElem *a = *(SFWriterElem**)va;
-    SFWriterElem *b = *(SFWriterElem**)vb;
+    SFWriterElemIVARS *a = SFWriterElem_IVARS(*(SFWriterElem**)va);
+    SFWriterElemIVARS *b = SFWriterElem_IVARS(*(SFWriterElem**)vb);
     int32_t comparison
         = FType_null_back_compare_values(ivars->type, a->value, b->value);
     if (comparison == 0) { comparison = b->doc_id - a->doc_id; }
@@ -561,27 +560,31 @@ S_write_files(SortFieldWriter *self, OutStream *ord_out, OutStream *ix_out,
     // doc id 0.
     SFWriterElem **elem_ptr = (SFWriterElem**)SortFieldWriter_Fetch(self);
     SFWriterElem *elem = *elem_ptr;
-    ords[elem->doc_id] = ord;
+    SFWriterElemIVARS *elem_ivars = SFWriterElem_IVARS(elem);
+    ords[elem_ivars->doc_id] = ord;
     ords[0] = 0;
 
     // Build array of ords, write non-NULL sorted values.
-    ivars->last_val = INCREF(elem->value);
-    Obj *last_val_address = elem->value;
-    S_write_val(elem->value, prim_id, ix_out, dat_out, dat_start);
+    ivars->last_val = INCREF(elem_ivars->value);
+    Obj *last_val_address = elem_ivars->value;
+    S_write_val(elem_ivars->value, prim_id, ix_out, dat_out, dat_start);
     while (NULL != (elem_ptr = (SFWriterElem**)SortFieldWriter_Fetch(self))) {
         elem = *elem_ptr;
-        if (elem->value != last_val_address) {
+        elem_ivars = SFWriterElem_IVARS(elem);
+        if (elem_ivars->value != last_val_address) {
             int32_t comparison
-                = FType_Compare_Values(ivars->type, elem->value, ivars->last_val);
+                = FType_Compare_Values(ivars->type, elem_ivars->value,
+                                       ivars->last_val);
             if (comparison != 0) {
                 ord++;
-                S_write_val(elem->value, prim_id, ix_out, dat_out, dat_start);
+                S_write_val(elem_ivars->value, prim_id, ix_out, dat_out,
+                            dat_start);
                 DECREF(ivars->last_val);
-                ivars->last_val = INCREF(elem->value);
+                ivars->last_val = INCREF(elem_ivars->value);
             }
-            last_val_address = elem->value;
+            last_val_address = elem_ivars->value;
         }
-        ords[elem->doc_id] = ord;
+        ords[elem_ivars->doc_id] = ord;
     }
     DECREF(ivars->last_val);
     ivars->last_val = NULL;
@@ -750,4 +753,39 @@ S_flip_run(SortFieldWriter *run, size_t sub_thresh, InStream *ord_in,
     DECREF(dat_in_dupe);
 }
 
+/***************************************************************************/
+
+static SFWriterElem*
+S_SFWriterElem_create(MemoryPool *mem_pool, Obj *value, int32_t doc_id) {
+    size_t size = VTable_Get_Obj_Alloc_Size(SFWRITERELEM);
+    SFWriterElem *self = (SFWriterElem*)MemPool_Grab(mem_pool, size);
+    VTable_Init_Obj(SFWRITERELEM, (Obj*)self);
+    SFWriterElemIVARS *ivars = SFWriterElem_IVARS(self);
+    ivars->value  = value;
+    ivars->doc_id = doc_id;
+    return self;
+}
+
+void
+SFWriterElem_Destroy_IMP(SFWriterElem *self) {
+    UNUSED_VAR(self);
+    THROW(ERR, "Illegal attempt to destroy SFWriterElem object");
+}
+
+uint32_t
+SFWriterElem_Get_RefCount_IMP(SFWriterElem* self) {
+    UNUSED_VAR(self);
+    return 1;
+}
+
+SFWriterElem*
+SFWriterElem_Inc_RefCount_IMP(SFWriterElem* self) {
+    return self;
+}
+
+uint32_t
+SFWriterElem_Dec_RefCount_IMP(SFWriterElem* self) {
+    UNUSED_VAR(self);
+    return 1;
+}
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/bb2a97d7/core/Lucy/Index/SortFieldWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.cfh b/core/Lucy/Index/SortFieldWriter.cfh
index ac25515..00e85c1 100644
--- a/core/Lucy/Index/SortFieldWriter.cfh
+++ b/core/Lucy/Index/SortFieldWriter.cfh
@@ -100,4 +100,23 @@ class Lucy::Index::SortFieldWriter
     Destroy(SortFieldWriter *self);
 }
 
+class Lucy::Index::SortFieldWriter::SFWriterElem inherits Clownfish::Obj {
+    int32_t doc_id;
+    Obj *value;
+
+    uint32_t
+    Get_RefCount(SFWriterElem* self);
+
+    incremented SFWriterElem*
+    Inc_RefCount(SFWriterElem* self);
+
+    uint32_t
+    Dec_RefCount(SFWriterElem* self);
+
+    /** Throws an error.
+     */
+    public void
+    Destroy(SFWriterElem *self);
+}
+
 


[lucy-commits] [07/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/clownfish/runtime/common/charmonizer.main b/clownfish/runtime/common/charmonizer.main
deleted file mode 100644
index 5db08b1..0000000
--- a/clownfish/runtime/common/charmonizer.main
+++ /dev/null
@@ -1,429 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* Source fragment for the Clownfish runtime's charmonizer.c.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "Charmonizer/Probe.h"
-#include "Charmonizer/Probe/AtomicOps.h"
-#include "Charmonizer/Probe/BuildEnv.h"
-#include "Charmonizer/Probe/DirManip.h"
-#include "Charmonizer/Probe/Floats.h"
-#include "Charmonizer/Probe/FuncMacro.h"
-#include "Charmonizer/Probe/Headers.h"
-#include "Charmonizer/Probe/Integers.h"
-#include "Charmonizer/Probe/LargeFiles.h"
-#include "Charmonizer/Probe/Memory.h"
-#include "Charmonizer/Probe/SymbolVisibility.h"
-#include "Charmonizer/Probe/UnusedVars.h"
-#include "Charmonizer/Probe/VariadicMacros.h"
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/ConfWriterC.h"
-#include "Charmonizer/Core/ConfWriterPerl.h"
-#include "Charmonizer/Core/ConfWriterRuby.h"
-
-typedef struct SourceFileContext {
-    chaz_MakeVar *var;
-} SourceFileContext;
-
-static const char cfish_version[]       = "0.3.0";
-static const char cfish_major_version[] = "0.3";
-
-static void
-S_add_compiler_flags(struct chaz_CLIArgs *args) {
-    chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-
-    if (chaz_Probe_gcc_version_num()) {
-        if (getenv("LUCY_VALGRIND")) {
-            chaz_CFlags_append(extra_cflags,
-                "-DLUCY_VALGRIND -fno-inline-functions");
-        }
-        else if (getenv("LUCY_DEBUG")) {
-            chaz_CFlags_append(extra_cflags,
-                "-DLUCY_DEBUG -pedantic -Wall -Wextra -Wno-variadic-macros");
-            if (args->charmony_pm) {
-                chaz_CFlags_append(extra_cflags, "-DPERL_GCC_PEDANTIC");
-            }
-        }
-
-        /* Only core source files require this -- not our headers and
-         * autogenerated files. */
-        chaz_CFlags_append(extra_cflags, "-std=gnu99 -D_GNU_SOURCE");
-    }
-    else if (chaz_Probe_msvc_version_num()) {
-        /* Compile as C++ under MSVC. */
-        chaz_CFlags_append(extra_cflags, "/TP");
-
-        /* Thwart stupid warnings. */
-        chaz_CFlags_append(extra_cflags, "/D_CRT_SECURE_NO_WARNINGS");
-        chaz_CFlags_append(extra_cflags, "/D_SCL_SECURE_NO_WARNINGS");
-
-        if (chaz_Probe_msvc_version_num() < 1300) {
-            /* Redefine 'for' to fix broken 'for' scoping under MSVC6. */
-            chaz_CFlags_append(extra_cflags, "/Dfor=\"if(0);else for\"");
-        }
-    }
-
-    /* When compiling for Perl bindings, define HAS_BOOL so that the Perl
-     * headers don't redefine 'bool' in conflict with C++.
-     *
-     * TODO: Compile all files that #include Perl headers separately and
-     * remove this directive.
-     */
-    if (args->charmony_pm) {
-        chaz_CFlags_add_define(extra_cflags, "HAS_BOOL", NULL);
-    }
-
-    chaz_CFlags_add_define(extra_cflags, "CFP_CFISH", NULL);
-    chaz_CFlags_add_define(extra_cflags, "CFP_TESTCFISH", NULL);
-}
-
-static int
-S_ends_with(const char *string, const char *postfix) {
-    size_t len         = strlen(string);
-    size_t postfix_len = strlen(postfix);
-    return len >= postfix_len
-           && memcmp(string + len - postfix_len, postfix, postfix_len) == 0;
-}
-
-static void
-S_c_file_callback(const char *dir, char *file, void *context) {
-    SourceFileContext *sfc = (SourceFileContext*)context;
-    const char *dir_sep = chaz_OS_dir_sep();
-    const char *obj_ext = chaz_CC_obj_ext();
-    size_t file_len = strlen(file);
-    char *obj_file;
-
-    /* Strip extension */
-    if (!S_ends_with(file, ".c")) {
-        chaz_Util_warn("Unexpected C filename: %s", file);
-        return;
-    }
-    file[file_len-2] = '\0';
-
-    obj_file = chaz_Util_join("", dir, dir_sep, file, obj_ext, NULL);
-    chaz_MakeVar_append(sfc->var, obj_file);
-    free(obj_file);
-}
-
-static void
-S_cfh_file_callback(const char *dir, char *file, void *context) {
-    SourceFileContext *sfc = (SourceFileContext*)context;
-    const char *dir_sep = chaz_OS_dir_sep();
-    char *cfh_file;
-
-    if (!S_ends_with(file, ".cfh")) {
-        chaz_Util_warn("Unexpected Clownfish header filename: %s", file);
-        return;
-    }
-
-    cfh_file = chaz_Util_join(dir_sep, dir, file, NULL);
-    chaz_MakeVar_append(sfc->var, cfh_file);
-    free(cfh_file);
-}
-
-static void
-S_write_makefile(struct chaz_CLIArgs *args) {
-    SourceFileContext sfc;
-
-    const char *base_dir = "..";
-    const char *dir_sep  = chaz_OS_dir_sep();
-    const char *exe_ext  = chaz_OS_exe_ext();
-    const char *obj_ext  = chaz_CC_obj_ext();
-
-    char *core_dir  = chaz_Util_join(dir_sep, base_dir, "core", NULL);
-    char *cfc_dir   = chaz_Util_join(dir_sep, base_dir, "..", "compiler", "c",
-                                     NULL);
-    char *cfc_exe   = chaz_Util_join("", cfc_dir, dir_sep, "cfc", exe_ext,
-                                     NULL);
-    char *test_cfish_exe  = chaz_Util_join("", "t", dir_sep, "test_cfish",
-                                           exe_ext, NULL);
-    char *autogen_inc_dir = chaz_Util_join(dir_sep, "autogen", "include",
-                                           NULL);
-
-    chaz_MakeFile *makefile;
-    chaz_MakeVar  *var;
-    chaz_MakeRule *rule;
-    chaz_MakeRule *clean_rule;
-    chaz_MakeRule *distclean_rule;
-
-    chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-    chaz_CFlags *makefile_cflags;
-    chaz_CFlags *link_flags;
-    chaz_CFlags *test_cflags;
-
-    chaz_SharedLib *lib;
-    const char     *math_library = chaz_Floats_math_library();
-    char           *lib_filename;
-    char           *test_command;
-    char           *scratch;
-
-    printf("Creating Makefile...\n");
-
-    makefile = chaz_MakeFile_new();
-
-    /* Directories */
-
-    chaz_MakeFile_add_var(makefile, "BASE_DIR", base_dir);
-
-    /* C compiler */
-
-    chaz_MakeFile_add_var(makefile, "CC", chaz_CC_get_cc());
-
-    makefile_cflags = chaz_CC_new_cflags();
-
-    chaz_CFlags_enable_optimization(makefile_cflags);
-    chaz_CFlags_enable_debugging(makefile_cflags);
-    chaz_CFlags_disable_strict_aliasing(makefile_cflags);
-    chaz_CFlags_compile_shared_library(makefile_cflags);
-    chaz_CFlags_hide_symbols(makefile_cflags);
-    if (args->code_coverage) {
-        chaz_CFlags_enable_code_coverage(makefile_cflags);
-    }
-
-    chaz_CFlags_add_include_dir(makefile_cflags, ".");
-    chaz_CFlags_add_include_dir(makefile_cflags, autogen_inc_dir);
-
-    var = chaz_MakeFile_add_var(makefile, "CFLAGS", NULL);
-    chaz_MakeVar_append(var, chaz_CFlags_get_string(extra_cflags));
-    chaz_MakeVar_append(var, chaz_CFlags_get_string(makefile_cflags));
-    chaz_MakeVar_append(var, chaz_CC_get_cflags());
-
-    chaz_CFlags_destroy(makefile_cflags);
-
-    /* Object files */
-
-    var = chaz_MakeFile_add_var(makefile, "CLOWNFISH_OBJS", NULL);
-    sfc.var = var;
-
-    chaz_Make_list_files("src",        "c", S_c_file_callback, &sfc);
-    chaz_Make_list_files(core_dir,     "c", S_c_file_callback, &sfc);
-
-    scratch = chaz_Util_join("", "autogen", dir_sep, "source", dir_sep,
-                             "cfish_parcel", obj_ext, NULL);
-    chaz_MakeVar_append(var, scratch);
-    free(scratch);
-    scratch = chaz_Util_join("", "autogen", dir_sep, "source", dir_sep,
-                             "testcfish_parcel", obj_ext, NULL);
-    chaz_MakeVar_append(var, scratch);
-    free(scratch);
-
-    /* Clownfish header files */
-
-    var = chaz_MakeFile_add_var(makefile, "CLOWNFISH_HEADERS", NULL);
-    sfc.var = var;
-
-    chaz_Make_list_files(core_dir, "cfh", S_cfh_file_callback, &sfc);
-
-    /* Rules */
-
-    lib = chaz_SharedLib_new("cfish", cfish_version, cfish_major_version);
-    lib_filename = chaz_SharedLib_filename(lib);
-    chaz_MakeFile_add_rule(makefile, "all", lib_filename);
-
-    rule = chaz_MakeFile_add_rule(makefile, cfc_exe, NULL);
-    chaz_MakeRule_add_make_command(rule, cfc_dir, NULL);
-
-    rule = chaz_MakeFile_add_rule(makefile, "autogen", cfc_exe);
-    chaz_MakeRule_add_prereq(rule, "$(CLOWNFISH_HEADERS)");
-    scratch = chaz_Util_join("", cfc_exe, " --source=", core_dir,
-                             " --dest=autogen --header=cfc_header", NULL);
-    chaz_MakeRule_add_command(rule, scratch);
-    /* TODO: Find a way to touch the autogen directory on Windows. */
-    if (chaz_Make_shell_type() == CHAZ_OS_POSIX) {
-        chaz_MakeRule_add_command(rule, "touch autogen");
-    }
-    free(scratch);
-
-    /* Needed for parallel builds. */
-    scratch = chaz_Util_join(dir_sep, "autogen", "source", "cfish_parcel.c",
-                             NULL);
-    rule = chaz_MakeFile_add_rule(makefile, scratch, "autogen");
-    scratch = chaz_Util_join(dir_sep, "autogen", "source",
-                             "testcfish_parcel.c", NULL);
-    rule = chaz_MakeFile_add_rule(makefile, scratch, "autogen");
-    free(scratch);
-
-    chaz_MakeFile_add_rule(makefile, "$(CLOWNFISH_OBJS)", "autogen");
-
-    link_flags = chaz_CC_new_cflags();
-    chaz_CFlags_enable_debugging(link_flags);
-    if (math_library) {
-        chaz_CFlags_add_external_library(link_flags, math_library);
-    }
-    if (args->code_coverage) {
-        chaz_CFlags_enable_code_coverage(link_flags);
-    }
-    chaz_MakeFile_add_shared_lib(makefile, lib, "$(CLOWNFISH_OBJS)",
-                                 link_flags);
-    chaz_CFlags_destroy(link_flags);
-
-    test_cflags = chaz_CC_new_cflags();
-    chaz_CFlags_enable_optimization(test_cflags);
-    chaz_CFlags_add_include_dir(test_cflags, autogen_inc_dir);
-    chaz_CFlags_add_library(test_cflags, lib);
-    scratch = chaz_Util_join(dir_sep, "t", "test_cfish.c", NULL);
-    rule = chaz_MakeFile_add_compiled_exe(makefile, test_cfish_exe, scratch,
-                                          test_cflags);
-    free(scratch);
-    chaz_MakeRule_add_prereq(rule, lib_filename);
-    chaz_CFlags_destroy(test_cflags);
-
-    rule = chaz_MakeFile_add_rule(makefile, "test", test_cfish_exe);
-    if (strcmp(chaz_OS_shared_lib_ext(), ".so") == 0) {
-        test_command = chaz_Util_join(" ", "LD_LIBRARY_PATH=.", test_cfish_exe,
-                                      NULL);
-    }
-    else {
-        test_command = chaz_Util_strdup(test_cfish_exe);
-    }
-    chaz_MakeRule_add_command(rule, test_command);
-
-    if (args->code_coverage) {
-        rule = chaz_MakeFile_add_rule(makefile, "coverage", test_cfish_exe);
-        chaz_MakeRule_add_command(rule,
-                                  "lcov"
-                                  " --zerocounters"
-                                  " --directory $(BASE_DIR)");
-        chaz_MakeRule_add_command(rule, test_command);
-        chaz_MakeRule_add_command(rule,
-                                  "lcov"
-                                  " --capture"
-                                  " --directory $(BASE_DIR)"
-                                  " --base-directory ."
-                                  " --rc lcov_branch_coverage=1"
-                                  " --output-file clownfish.info");
-        chaz_MakeRule_add_command(rule,
-                                  "genhtml"
-                                  " --branch-coverage"
-                                  " --output-directory coverage"
-                                  " clownfish.info");
-    }
-
-    clean_rule = chaz_MakeFile_clean_rule(makefile);
-    chaz_MakeRule_add_rm_command(clean_rule, "$(CLOWNFISH_OBJS)");
-    chaz_MakeRule_add_recursive_rm_command(clean_rule, "autogen");
-
-    if (args->code_coverage) {
-        chaz_MakeRule_add_rm_command(clean_rule, "clownfish.info");
-        chaz_MakeRule_add_recursive_rm_command(clean_rule, "coverage");
-    }
-
-    chaz_MakeRule_add_make_command(clean_rule, cfc_dir, "clean");
-
-    distclean_rule = chaz_MakeFile_distclean_rule(makefile);
-    chaz_MakeRule_add_make_command(distclean_rule, cfc_dir, "distclean");
-
-    chaz_MakeFile_write(makefile);
-
-    chaz_MakeFile_destroy(makefile);
-    chaz_SharedLib_destroy(lib);
-    free(core_dir);
-    free(cfc_dir);
-    free(cfc_exe);
-    free(test_cfish_exe);
-    free(autogen_inc_dir);
-    free(lib_filename);
-    free(test_command);
-}
-
-int main(int argc, const char **argv) {
-    /* Initialize. */
-    struct chaz_CLIArgs args;
-    {
-        int result = chaz_Probe_parse_cli_args(argc, argv, &args);
-        if (!result) {
-            chaz_Probe_die_usage();
-        }
-        chaz_Probe_init(&args);
-        S_add_compiler_flags(&args);
-    }
-    {
-        int i;
-        for (i = 0; i < argc; i++) {
-            if (strncmp(argv[i], "--disable-threads", 17) == 0) {
-                chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-                chaz_CFlags_append(extra_cflags, "-DCFISH_NOTHREADS");
-                break;
-            }
-        }
-    }
-
-    /* Employ integer features but don't define stdint types in charmony.h. */
-    chaz_ConfWriter_append_conf(
-        "#define CHY_EMPLOY_INTEGERLIMITS\n"
-        "#define CHY_EMPLOY_INTEGERLITERALS\n"
-        "#define CHY_EMPLOY_INTEGERFORMATSTRINGS\n\n"
-    );
-
-    /* Run probe modules. Booleans, DirManip and LargeFiles are only needed for
-     * the Charmonizer tests.
-     */
-    chaz_BuildEnv_run();
-    chaz_DirManip_run();
-    chaz_Headers_run();
-    chaz_AtomicOps_run();
-    chaz_FuncMacro_run();
-    chaz_Booleans_run();
-    chaz_Integers_run();
-    chaz_Floats_run();
-    chaz_LargeFiles_run();
-    chaz_Memory_run();
-    chaz_UnusedVars_run();
-    chaz_VariadicMacros_run();
-
-    /* Write custom postamble. */
-    chaz_ConfWriter_append_conf(
-        "#ifdef CHY_HAS_SYS_TYPES_H\n"
-        "  #include <sys/types.h>\n"
-        "#endif\n\n"
-    );
-    chaz_ConfWriter_append_conf(
-        "#ifdef CHY_HAS_ALLOCA_H\n"
-        "  #include <alloca.h>\n"
-        "#elif defined(CHY_HAS_MALLOC_H)\n"
-        "  #include <malloc.h>\n"
-        "#elif defined(CHY_ALLOCA_IN_STDLIB_H)\n"
-        "  #include <stdlib.h>\n"
-        "#endif\n\n"
-    );
-    chaz_ConfWriter_append_conf(
-        "#ifdef CHY_HAS_WINDOWS_H\n"
-        "  /* Target Windows XP. */\n"
-        "  #ifndef WINVER\n"
-        "    #define WINVER 0x0500\n"
-        "  #endif\n"
-        "  #ifndef _WIN32_WINNT\n"
-        "    #define _WIN32_WINNT 0x0500\n"
-        "  #endif\n"
-        "#endif\n\n"
-    );
-
-    if (args.write_makefile) {
-        S_write_makefile(&args);
-    }
-
-    /* Clean up. */
-    chaz_Probe_clean_up();
-
-    return 0;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish.c b/clownfish/runtime/core/Clownfish.c
deleted file mode 100644
index 130b87a..0000000
--- a/clownfish/runtime/core/Clownfish.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Clownfish/Num.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/Err.h"
-
-void
-cfish_init_parcel() {
-    cfish_Bool_init_class();
-    cfish_Hash_init_class();
-    cfish_Err_init_class();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish.cfp
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish.cfp b/clownfish/runtime/core/Clownfish.cfp
deleted file mode 100644
index ae91f8a..0000000
--- a/clownfish/runtime/core/Clownfish.cfp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "name": "Clownfish",
-    "nickname": "Cfish",
-    "version": "v0.3.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/ByteBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/ByteBuf.c b/clownfish/runtime/core/Clownfish/ByteBuf.c
deleted file mode 100644
index c267d28..0000000
--- a/clownfish/runtime/core/Clownfish/ByteBuf.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_BYTEBUF
-#define C_CFISH_VIEWBYTEBUF
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#include "Clownfish/VTable.h"
-#include "Clownfish/ByteBuf.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Util/Memory.h"
-
-static void
-S_grow(ByteBuf *self, size_t size);
-
-ByteBuf*
-BB_new(size_t capacity) {
-    ByteBuf *self = (ByteBuf*)VTable_Make_Obj(BYTEBUF);
-    return BB_init(self, capacity);
-}
-
-ByteBuf*
-BB_init(ByteBuf *self, size_t capacity) {
-    size_t amount = capacity ? capacity : sizeof(int64_t);
-    self->buf   = NULL;
-    self->size  = 0;
-    self->cap   = 0;
-    S_grow(self, amount);
-    return self;
-}
-
-ByteBuf*
-BB_new_bytes(const void *bytes, size_t size) {
-    ByteBuf *self = (ByteBuf*)VTable_Make_Obj(BYTEBUF);
-    BB_init(self, size);
-    memcpy(self->buf, bytes, size);
-    self->size = size;
-    return self;
-}
-
-ByteBuf*
-BB_new_steal_bytes(void *bytes, size_t size, size_t capacity) {
-    ByteBuf *self = (ByteBuf*)VTable_Make_Obj(BYTEBUF);
-    return BB_init_steal_bytes(self, bytes, size, capacity);
-}
-
-ByteBuf*
-BB_init_steal_bytes(ByteBuf *self, void *bytes, size_t size,
-                    size_t capacity) {
-    self->buf  = (char*)bytes;
-    self->size = size;
-    self->cap  = capacity;
-    return self;
-}
-
-void
-BB_Destroy_IMP(ByteBuf *self) {
-    FREEMEM(self->buf);
-    SUPER_DESTROY(self, BYTEBUF);
-}
-
-ByteBuf*
-BB_Clone_IMP(ByteBuf *self) {
-    return BB_new_bytes(self->buf, self->size);
-}
-
-void
-BB_Set_Size_IMP(ByteBuf *self, size_t size) {
-    if (size > self->cap) {
-        THROW(ERR, "Can't set size to %u64 (greater than capacity of %u64)",
-              (uint64_t)size, (uint64_t)self->cap);
-    }
-    self->size = size;
-}
-
-char*
-BB_Get_Buf_IMP(ByteBuf *self) {
-    return self->buf;
-}
-
-size_t
-BB_Get_Size_IMP(ByteBuf *self) {
-    return self->size;
-}
-
-size_t
-BB_Get_Capacity_IMP(ByteBuf *self) {
-    return self->cap;
-}
-
-static CFISH_INLINE bool
-SI_equals_bytes(ByteBuf *self, const void *bytes, size_t size) {
-    if (self->size != size) { return false; }
-    return (memcmp(self->buf, bytes, self->size) == 0);
-}
-
-bool
-BB_Equals_IMP(ByteBuf *self, Obj *other) {
-    ByteBuf *const twin = (ByteBuf*)other;
-    if (twin == self)              { return true; }
-    if (!Obj_Is_A(other, BYTEBUF)) { return false; }
-    return SI_equals_bytes(self, twin->buf, twin->size);
-}
-
-bool
-BB_Equals_Bytes_IMP(ByteBuf *self, const void *bytes, size_t size) {
-    return SI_equals_bytes(self, bytes, size);
-}
-
-int32_t
-BB_Hash_Sum_IMP(ByteBuf *self) {
-    uint32_t       sum = 5381;
-    uint8_t *const buf = (uint8_t*)self->buf;
-
-    for (size_t i = 0, max = self->size; i < max; i++) {
-        sum = ((sum << 5) + sum) ^ buf[i];
-    }
-
-    return (int32_t)sum;
-}
-
-static CFISH_INLINE void
-SI_mimic_bytes(ByteBuf *self, const void *bytes, size_t size) {
-    if (size > self->cap) { S_grow(self, size); }
-    memmove(self->buf, bytes, size);
-    self->size = size;
-}
-
-void
-BB_Mimic_Bytes_IMP(ByteBuf *self, const void *bytes, size_t size) {
-    SI_mimic_bytes(self, bytes, size);
-}
-
-void
-BB_Mimic_IMP(ByteBuf *self, Obj *other) {
-    ByteBuf *twin = (ByteBuf*)CERTIFY(other, BYTEBUF);
-    SI_mimic_bytes(self, twin->buf, twin->size);
-}
-
-static CFISH_INLINE void
-SI_cat_bytes(ByteBuf *self, const void *bytes, size_t size) {
-    const size_t new_size = self->size + size;
-    if (new_size > self->cap) {
-        S_grow(self, Memory_oversize(new_size, sizeof(char)));
-    }
-    memcpy((self->buf + self->size), bytes, size);
-    self->size = new_size;
-}
-
-void
-BB_Cat_Bytes_IMP(ByteBuf *self, const void *bytes, size_t size) {
-    SI_cat_bytes(self, bytes, size);
-}
-
-void
-BB_Cat_IMP(ByteBuf *self, ByteBuf *other) {
-    SI_cat_bytes(self, other->buf, other->size);
-}
-
-static void
-S_grow(ByteBuf *self, size_t size) {
-    if (size > self->cap) {
-        size_t amount    = size;
-        size_t remainder = amount % sizeof(int64_t);
-        if (remainder) {
-            amount += sizeof(int64_t);
-            amount -= remainder;
-        }
-        self->buf = (char*)REALLOCATE(self->buf, amount);
-        self->cap = amount;
-    }
-}
-
-char*
-BB_Grow_IMP(ByteBuf *self, size_t size) {
-    if (size > self->cap) { S_grow(self, size); }
-    return self->buf;
-}
-
-int
-BB_compare(const void *va, const void *vb) {
-    ByteBuf *a = *(ByteBuf**)va;
-    ByteBuf *b = *(ByteBuf**)vb;
-    const size_t size = a->size < b->size ? a->size : b->size;
-
-    int32_t comparison = memcmp(a->buf, b->buf, size);
-
-    if (comparison == 0 && a->size != b->size) {
-        comparison = a->size < b->size ? -1 : 1;
-    }
-
-    return comparison;
-}
-
-int32_t
-BB_Compare_To_IMP(ByteBuf *self, Obj *other) {
-    CERTIFY(other, BYTEBUF);
-    return BB_compare(&self, &other);
-}
-
-/******************************************************************/
-
-ViewByteBuf*
-ViewBB_new(char *buf, size_t size) {
-    ViewByteBuf *self = (ViewByteBuf*)VTable_Make_Obj(VIEWBYTEBUF);
-    return ViewBB_init(self, buf, size);
-}
-
-ViewByteBuf*
-ViewBB_init(ViewByteBuf *self, char *buf, size_t size) {
-    self->cap  = 0;
-    self->buf  = buf;
-    self->size = size;
-    return self;
-}
-
-void
-ViewBB_Destroy_IMP(ViewByteBuf *self) {
-    Obj_Destroy_t super_duper_destroy = METHOD_PTR(OBJ, CFISH_Obj_Destroy);
-    super_duper_destroy((Obj*)self);
-}
-
-void
-ViewBB_Assign_Bytes_IMP(ViewByteBuf *self, char*buf, size_t size) {
-    self->buf  = buf;
-    self->size = size;
-}
-
-void
-ViewBB_Assign_IMP(ViewByteBuf *self, ByteBuf *other) {
-    self->buf  = other->buf;
-    self->size = other->size;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/ByteBuf.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/ByteBuf.cfh b/clownfish/runtime/core/Clownfish/ByteBuf.cfh
deleted file mode 100644
index 60b258c..0000000
--- a/clownfish/runtime/core/Clownfish/ByteBuf.cfh
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/**
- * Growable buffer holding arbitrary bytes.
- */
-
-class Clownfish::ByteBuf cnick BB inherits Clownfish::Obj {
-
-    char    *buf;
-    size_t   size;  /* number of valid bytes */
-    size_t   cap;   /* allocated bytes, including terminating null */
-
-    /**
-     * @param capacity initial capacity of the ByteBuf, in bytes.
-     */
-    inert incremented ByteBuf*
-    new(size_t capacity);
-
-    inert ByteBuf*
-    init(ByteBuf *self, size_t capacity);
-
-    /** Return a pointer to a new ByteBuf which holds a copy of the passed-in
-     * string.
-     */
-    inert incremented ByteBuf*
-    new_bytes(const void *bytes, size_t size);
-
-    /** Return a pointer to a new ByteBuf which assumes ownership of the
-     * passed-in string.
-     */
-    inert incremented ByteBuf*
-    new_steal_bytes(void *bytes, size_t size, size_t capacity);
-
-    /** Initialize the ByteBuf and assume ownership of the passed-in string.
-     */
-    public inert ByteBuf*
-    init_steal_bytes(ByteBuf *self, void *bytes, size_t size,
-                     size_t capacity);
-
-    /** Lexical comparison of two ByteBufs, with level of indirection set to
-     * please qsort and friends.
-     */
-    inert int
-    compare(const void *va, const void *vb);
-
-    /** Set the object's size member.  If greater than the object's capacity,
-     * throws an error.
-     */
-    void
-    Set_Size(ByteBuf *self, size_t size);
-
-    /** Accessor for "size" member.
-     */
-    size_t
-    Get_Size(ByteBuf *self);
-
-    /** Accessor for raw internal buffer.
-     */
-    nullable char*
-    Get_Buf(ByteBuf *self);
-
-    /** Return the number of bytes in the Object's allocation.
-     */
-    size_t
-    Get_Capacity(ByteBuf *self);
-
-    public void
-    Mimic(ByteBuf *self, Obj *other);
-
-    void
-    Mimic_Bytes(ByteBuf *self, const void *bytes, size_t size);
-
-    /** Concatenate the passed-in bytes onto the end of the ByteBuf. Allocate
-     * more memory as needed.
-     */
-    void
-    Cat_Bytes(ByteBuf *self, const void *bytes, size_t size);
-
-    /** Concatenate the contents of <code>other</code> onto the end of the
-     * original ByteBuf. Allocate more memory as needed.
-     */
-    void
-    Cat(ByteBuf *self, ByteBuf *other);
-
-    /** Assign more memory to the ByteBuf, if it doesn't already have enough
-     * room to hold <code>size</code> bytes.  Cannot shrink the allocation.
-     *
-     * @return a pointer to the raw buffer.
-     */
-    nullable char*
-    Grow(ByteBuf *self, size_t size);
-
-    /** Test whether the ByteBuf matches the passed-in bytes.
-     */
-    bool
-    Equals_Bytes(ByteBuf *self, const void *bytes, size_t size);
-
-    public int32_t
-    Compare_To(ByteBuf *self, Obj *other);
-
-    public incremented ByteBuf*
-    Clone(ByteBuf *self);
-
-    public void
-    Destroy(ByteBuf *self);
-
-    public bool
-    Equals(ByteBuf *self, Obj *other);
-
-    public int32_t
-    Hash_Sum(ByteBuf *self);
-}
-
-/**
- * A ByteBuf that doesn't own its own string.
- */
-class Clownfish::ViewByteBuf cnick ViewBB
-    inherits Clownfish::ByteBuf {
-
-    /** Return a pointer to a new "view" ByteBuf, offing a persective on the
-     * passed-in string.
-     */
-    inert incremented ViewByteBuf*
-    new(char *buf, size_t size);
-
-    inert incremented ViewByteBuf*
-    init(ViewByteBuf *self, char *buf, size_t size);
-
-    /** Assign buf and size members to the passed in values.
-     */
-    void
-    Assign_Bytes(ViewByteBuf *self, char *buf, size_t size);
-
-    /** Assign buf and size members from the passed-in ByteBuf.
-     */
-    void
-    Assign(ViewByteBuf *self, ByteBuf *other);
-
-    public void
-    Destroy(ViewByteBuf *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/CharBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.c b/clownfish/runtime/core/Clownfish/CharBuf.c
deleted file mode 100644
index 8dbeb36..0000000
--- a/clownfish/runtime/core/Clownfish/CharBuf.c
+++ /dev/null
@@ -1,409 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_CHARBUF
-#define C_CFISH_STRING
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "Clownfish/CharBuf.h"
-
-#include "Clownfish/Err.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/Util/StringHelper.h"
-#include "Clownfish/VTable.h"
-
-// Helper function for throwing invalid UTF-8 error. Since THROW uses
-// a String internally, calling THROW with invalid UTF-8 would create an
-// infinite loop -- so we fwrite some of the bogus text to stderr and
-// invoke THROW with a generic message.
-#define DIE_INVALID_UTF8(text, size) \
-    S_die_invalid_utf8(text, size, __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
-static void
-S_die_invalid_utf8(const char *text, size_t size, const char *file, int line,
-                   const char *func);
-
-// Helper function for throwing invalid pattern error.
-static void
-S_die_invalid_pattern(const char *pattern);
-
-CharBuf*
-CB_new(size_t size) {
-    CharBuf *self = (CharBuf*)VTable_Make_Obj(CHARBUF);
-    return CB_init(self, size);
-}
-
-CharBuf*
-CB_init(CharBuf *self, size_t size) {
-    // Derive.
-    self->ptr = (char*)MALLOCATE(size + 1);
-
-    // Init.
-    *self->ptr = '\0'; // Empty string.
-
-    // Assign.
-    self->size = 0;
-    self->cap  = size + 1;
-
-    return self;
-}
-
-CharBuf*
-CB_new_from_str(String *string) {
-    return CB_new_from_trusted_utf8(string->ptr, string->size);
-}
-
-CharBuf*
-CB_new_from_utf8(const char *ptr, size_t size) {
-    if (!StrHelp_utf8_valid(ptr, size)) {
-        DIE_INVALID_UTF8(ptr, size);
-    }
-    return CB_new_from_trusted_utf8(ptr, size);
-}
-
-CharBuf*
-CB_new_from_trusted_utf8(const char *ptr, size_t size) {
-    CharBuf *self = (CharBuf*)VTable_Make_Obj(CHARBUF);
-
-    // Derive.
-    self->ptr = (char*)MALLOCATE(size + 1);
-
-    // Copy.
-    memcpy(self->ptr, ptr, size);
-
-    // Assign.
-    self->size      = size;
-    self->cap       = size + 1;
-    self->ptr[size] = '\0'; // Null terminate.
-
-    return self;
-}
-
-CharBuf*
-CB_newf(const char *pattern, ...) {
-    CharBuf *self = CB_new(strlen(pattern));
-    va_list args;
-    va_start(args, pattern);
-    CB_VCatF(self, pattern, args);
-    va_end(args);
-    return self;
-}
-
-void
-CB_Destroy_IMP(CharBuf *self) {
-    FREEMEM(self->ptr);
-    SUPER_DESTROY(self, CHARBUF);
-}
-
-char*
-CB_Grow_IMP(CharBuf *self, size_t size) {
-    if (size >= self->cap) {
-        self->cap = size + 1;
-        self->ptr = (char*)REALLOCATE(self->ptr, self->cap);
-    }
-    return self->ptr;
-}
-
-static void
-S_die_invalid_utf8(const char *text, size_t size, const char *file, int line,
-                   const char *func) {
-    fprintf(stderr, "Invalid UTF-8, aborting: '");
-    fwrite(text, sizeof(char), size < 200 ? size : 200, stderr);
-    if (size > 200) { fwrite("[...]", sizeof(char), 5, stderr); }
-    fprintf(stderr, "' (length %lu)\n", (unsigned long)size);
-    Err_throw_at(ERR, file, line, func, "Invalid UTF-8");
-}
-
-static void
-S_die_invalid_pattern(const char *pattern) {
-    size_t  pattern_len = strlen(pattern);
-    fprintf(stderr, "Invalid pattern, aborting: '");
-    fwrite(pattern, sizeof(char), pattern_len, stderr);
-    fprintf(stderr, "'\n");
-    THROW(ERR, "Invalid pattern.");
-}
-
-void
-CB_catf(CharBuf *self, const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    CB_VCatF(self, pattern, args);
-    va_end(args);
-}
-
-void
-CB_VCatF_IMP(CharBuf *self, const char *pattern, va_list args) {
-    size_t      pattern_len   = strlen(pattern);
-    const char *pattern_start = pattern;
-    const char *pattern_end   = pattern + pattern_len;
-    char        buf[64];
-
-    for (; pattern < pattern_end; pattern++) {
-        const char *slice_end = pattern;
-
-        // Consume all characters leading up to a '%'.
-        while (slice_end < pattern_end && *slice_end != '%') { slice_end++; }
-        if (pattern != slice_end) {
-            size_t size = slice_end - pattern;
-            CB_Cat_Trusted_Utf8(self, pattern, size);
-            pattern = slice_end;
-        }
-
-        if (pattern < pattern_end) {
-            pattern++; // Move past '%'.
-
-            switch (*pattern) {
-                case '%': {
-                        CB_Cat_Trusted_Utf8(self, "%", 1);
-                    }
-                    break;
-                case 'o': {
-                        Obj *obj = va_arg(args, Obj*);
-                        if (!obj) {
-                            CB_Cat_Trusted_Utf8(self, "[NULL]", 6);
-                        }
-                        else if (Obj_Is_A(obj, STRING)) {
-                            CB_Cat(self, (String*)obj);
-                        }
-                        else {
-                            String *string = Obj_To_String(obj);
-                            CB_Cat(self, string);
-                            DECREF(string);
-                        }
-                    }
-                    break;
-                case 'i': {
-                        int64_t val = 0;
-                        size_t size;
-                        if (pattern[1] == '8') {
-                            val = va_arg(args, int32_t);
-                            pattern++;
-                        }
-                        else if (pattern[1] == '3' && pattern[2] == '2') {
-                            val = va_arg(args, int32_t);
-                            pattern += 2;
-                        }
-                        else if (pattern[1] == '6' && pattern[2] == '4') {
-                            val = va_arg(args, int64_t);
-                            pattern += 2;
-                        }
-                        else {
-                            S_die_invalid_pattern(pattern_start);
-                        }
-                        size = sprintf(buf, "%" PRId64, val);
-                        CB_Cat_Trusted_Utf8(self, buf, size);
-                    }
-                    break;
-                case 'u': {
-                        uint64_t val = 0;
-                        size_t size;
-                        if (pattern[1] == '8') {
-                            val = va_arg(args, uint32_t);
-                            pattern += 1;
-                        }
-                        else if (pattern[1] == '3' && pattern[2] == '2') {
-                            val = va_arg(args, uint32_t);
-                            pattern += 2;
-                        }
-                        else if (pattern[1] == '6' && pattern[2] == '4') {
-                            val = va_arg(args, uint64_t);
-                            pattern += 2;
-                        }
-                        else {
-                            S_die_invalid_pattern(pattern_start);
-                        }
-                        size = sprintf(buf, "%" PRIu64, val);
-                        CB_Cat_Trusted_Utf8(self, buf, size);
-                    }
-                    break;
-                case 'f': {
-                        if (pattern[1] == '6' && pattern[2] == '4') {
-                            double num  = va_arg(args, double);
-                            char bigbuf[512];
-                            size_t size = sprintf(bigbuf, "%g", num);
-                            CB_Cat_Trusted_Utf8(self, bigbuf, size);
-                            pattern += 2;
-                        }
-                        else {
-                            S_die_invalid_pattern(pattern_start);
-                        }
-                    }
-                    break;
-                case 'x': {
-                        if (pattern[1] == '3' && pattern[2] == '2') {
-                            unsigned long val = va_arg(args, uint32_t);
-                            size_t size = sprintf(buf, "%.8lx", val);
-                            CB_Cat_Trusted_Utf8(self, buf, size);
-                            pattern += 2;
-                        }
-                        else {
-                            S_die_invalid_pattern(pattern_start);
-                        }
-                    }
-                    break;
-                case 's': {
-                        char *string = va_arg(args, char*);
-                        if (string == NULL) {
-                            CB_Cat_Trusted_Utf8(self, "[NULL]", 6);
-                        }
-                        else {
-                            size_t size = strlen(string);
-                            if (StrHelp_utf8_valid(string, size)) {
-                                CB_Cat_Trusted_Utf8(self, string, size);
-                            }
-                            else {
-                                CB_Cat_Trusted_Utf8(self, "[INVALID UTF8]", 14);
-                            }
-                        }
-                    }
-                    break;
-                default: {
-                        // Assume NULL-terminated pattern string, which
-                        // eliminates the need for bounds checking if '%' is
-                        // the last visible character.
-                        S_die_invalid_pattern(pattern_start);
-                    }
-            }
-        }
-    }
-}
-
-String*
-CB_To_String_IMP(CharBuf *self) {
-    return Str_new_from_trusted_utf8(self->ptr, self->size);
-}
-
-String*
-CB_Yield_String_IMP(CharBuf *self) {
-    String *retval
-        = Str_new_steal_trusted_utf8(self->ptr, self->size);
-    self->ptr  = NULL;
-    self->size = 0;
-    self->cap  = 0;
-    return retval;
-}
-
-void
-CB_Cat_Char_IMP(CharBuf *self, int32_t code_point) {
-    const size_t MAX_UTF8_BYTES = 4;
-    if (self->size + MAX_UTF8_BYTES >= self->cap) {
-        CB_Grow(self, Memory_oversize(self->size + MAX_UTF8_BYTES,
-                                     sizeof(char)));
-    }
-    char *end = self->ptr + self->size;
-    size_t count = StrHelp_encode_utf8_char(code_point, (uint8_t*)end);
-    self->size += count;
-    *(end + count) = '\0';
-}
-
-CharBuf*
-CB_Clone_IMP(CharBuf *self) {
-    return CB_new_from_trusted_utf8(self->ptr, self->size);
-}
-
-static CFISH_INLINE void
-SI_mimic_utf8(CharBuf *self, const char* ptr, size_t size) {
-    if (size >= self->cap) { CB_Grow(self, size); }
-    memmove(self->ptr, ptr, size);
-    self->size = size;
-    self->ptr[size] = '\0';
-}
-
-void
-CB_Mimic_Utf8_IMP(CharBuf *self, const char* ptr, size_t size) {
-    if (!StrHelp_utf8_valid(ptr, size)) {
-        DIE_INVALID_UTF8(ptr, size);
-    }
-    SI_mimic_utf8(self, ptr, size);
-}
-
-void
-CB_Mimic_IMP(CharBuf *self, Obj *other) {
-    const char *ptr;
-    size_t size;
-    if (Obj_Is_A(other, CHARBUF)) {
-        CharBuf *twin = (CharBuf*)other;
-        ptr  = twin->ptr;
-        size = twin->size;
-    }
-    else if (Obj_Is_A(other, STRING)) {
-        String *twin = (String*)other;
-        ptr  = twin->ptr;
-        size = twin->size;
-    }
-    else {
-        THROW(ERR, "CharBuf can't mimic %o", Obj_Get_Class_Name(other));
-    }
-    SI_mimic_utf8(self, ptr, size);
-}
-
-static CFISH_INLINE void
-SI_cat_utf8(CharBuf *self, const char* ptr, size_t size) {
-    const size_t new_size = self->size + size;
-    if (new_size >= self->cap) {
-        size_t amount = Memory_oversize(new_size, sizeof(char));
-        CB_Grow(self, amount);
-    }
-    memcpy(self->ptr + self->size, ptr, size);
-    self->size = new_size;
-    self->ptr[new_size] = '\0';
-}
-
-void
-CB_Cat_Utf8_IMP(CharBuf *self, const char* ptr, size_t size) {
-    if (!StrHelp_utf8_valid(ptr, size)) {
-        DIE_INVALID_UTF8(ptr, size);
-    }
-    SI_cat_utf8(self, ptr, size);
-}
-
-void
-CB_Cat_Trusted_Utf8_IMP(CharBuf *self, const char* ptr, size_t size) {
-    SI_cat_utf8(self, ptr, size);
-}
-
-void
-CB_Cat_IMP(CharBuf *self, String *string) {
-    SI_cat_utf8(self, string->ptr, string->size);
-}
-
-void
-CB_Set_Size_IMP(CharBuf *self, size_t size) {
-    if (size >= self->cap) {
-        THROW(ERR, "Can't set size of CharBuf beyond capacity");
-    }
-    self->size = size;
-}
-
-size_t
-CB_Get_Size_IMP(CharBuf *self) {
-    return self->size;
-}
-
-char*
-CB_Get_Ptr8_IMP(CharBuf *self) {
-    return self->ptr;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/CharBuf.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/CharBuf.cfh b/clownfish/runtime/core/Clownfish/CharBuf.cfh
deleted file mode 100644
index 77a6e32..0000000
--- a/clownfish/runtime/core/Clownfish/CharBuf.cfh
+++ /dev/null
@@ -1,152 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/**
- * Growable buffer holding Unicode characters.
- */
-
-class Clownfish::CharBuf cnick CB
-    inherits Clownfish::Obj {
-
-    char    *ptr;
-    size_t   size;
-    size_t   cap;  /* allocated bytes, including terminating null */
-
-    inert incremented CharBuf*
-    new(size_t size);
-
-    inert CharBuf*
-    init(CharBuf *self, size_t size);
-
-    /** Return a new CharBuf which holds a copy of the passed-in String.
-     */
-    inert incremented CharBuf*
-    new_from_str(String *string);
-
-    /** Return a new CharBuf which holds a copy of the passed-in string.
-     * Check for UTF-8 validity.
-     */
-    inert incremented CharBuf*
-    new_from_utf8(const char *utf8, size_t size);
-
-    /** Return a new CharBuf which holds a copy of the passed-in string.  No
-     * validity checking is performed.
-     */
-    inert incremented CharBuf*
-    new_from_trusted_utf8(const char *utf8, size_t size);
-
-    /** Return a pointer to a new CharBuf which contains formatted data
-     * expanded according to CB_VCatF.
-     *
-     * Note: a user-supplied <code>pattern</code> string is a security hole
-     * and must not be allowed.
-     */
-    inert incremented CharBuf*
-    newf(const char *pattern, ...);
-
-    public void
-    Mimic(CharBuf *self, Obj *other);
-
-    void
-    Mimic_Utf8(CharBuf *self, const char *ptr, size_t size);
-
-    /** Concatenate the passed-in string onto the end of the CharBuf.
-     */
-    void
-    Cat_Utf8(CharBuf *self, const char *ptr, size_t size);
-
-    /** Concatenate the supplied text onto the end of the CharBuf.  Don't
-     * check for UTF-8 validity.
-     */
-    void
-    Cat_Trusted_Utf8(CharBuf *self, const char *ptr, size_t size);
-
-    /** Concatenate the contents of <code>string</code> onto the end of the
-     * caller.
-     */
-    void
-    Cat(CharBuf *self, String *string);
-
-    /** Concatenate formatted arguments.  Similar to the printf family, but
-     * only accepts minimal options (just enough for decent error messages).
-     *
-     * Objects:  %o
-     * char*:    %s
-     * integers: %i8 %i32 %i64 %u8 %u32 %u64
-     * floats:   %f64
-     * hex:      %x32
-     *
-     * Note that all Clownfish Objects, including CharBufs, are printed via
-     * %o (which invokes Obj_To_String()).
-     */
-    void
-    VCatF(CharBuf *self, const char *pattern, va_list args);
-
-    /** Invokes CB_VCatF to concatenate formatted arguments.  Note that this
-     * is only a function and not a method.
-     */
-    inert void
-    catf(CharBuf *self, const char *pattern, ...);
-
-    /** Concatenate one Unicode character onto the end of the CharBuf.
-     */
-    void
-    Cat_Char(CharBuf *self, int32_t code_point);
-
-    /** Assign more memory to the CharBuf, if it doesn't already have enough
-     * room to hold a string of <code>size</code> bytes.  Cannot shrink the
-     * allocation.
-     *
-     * @return a pointer to the raw buffer.
-     */
-    char*
-    Grow(CharBuf *self, size_t size);
-
-    /** Set the CharBuf's <code>size</code> attribute.
-     */
-    void
-    Set_Size(CharBuf *self, size_t size);
-
-    /** Get the CharBuf's <code>size</code> attribute.
-     */
-    size_t
-    Get_Size(CharBuf *self);
-
-    /** Return the internal backing array for the CharBuf if its internal
-     * encoding is UTF-8.  If it is not encoded as UTF-8 throw an exception.
-     */
-    char*
-    Get_Ptr8(CharBuf *self);
-
-    public incremented CharBuf*
-    Clone(CharBuf *self);
-
-    public void
-    Destroy(CharBuf *self);
-
-    public incremented String*
-    To_String(CharBuf *self);
-
-    /** Return the content of the CharBuf as String and clear the CharBuf.
-     * This is more efficient than To_String().
-     */
-    public incremented String*
-    Yield_String(CharBuf *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Err.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.c b/clownfish/runtime/core/Clownfish/Err.c
deleted file mode 100644
index 742ffcc..0000000
--- a/clownfish/runtime/core/Clownfish/Err.c
+++ /dev/null
@@ -1,272 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_ERR
-#define C_CFISH_OBJ
-#define C_CFISH_VTABLE
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#include "Clownfish/Err.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/String.h"
-#include "Clownfish/VTable.h"
-#include "Clownfish/Util/Memory.h"
-
-Err*
-Err_new(String *mess) {
-    Err *self = (Err*)VTable_Make_Obj(ERR);
-    return Err_init(self, mess);
-}
-
-Err*
-Err_init(Err *self, String *mess) {
-    self->mess = mess;
-    return self;
-}
-
-void
-Err_Destroy_IMP(Err *self) {
-    DECREF(self->mess);
-    SUPER_DESTROY(self, ERR);
-}
-
-String*
-Err_To_String_IMP(Err *self) {
-    return (String*)INCREF(self->mess);
-}
-
-void
-Err_Cat_Mess_IMP(Err *self, String *mess) {
-    String *new_mess = Str_Cat(self->mess, mess);
-    DECREF(self->mess);
-    self->mess = new_mess;
-}
-
-// Fallbacks in case variadic macros aren't available.
-#ifndef CHY_HAS_VARIADIC_MACROS
-static String*
-S_str_vnewf(char *pattern, va_list args) {
-    CharBuf *buf = CB_new(strlen(pattern) + 10);
-    CB_VCatF(buf, pattern, args);
-    String *message = CB_Yield_String(buf);
-    DECREF(buf);
-    return message;
-}
-void
-THROW(VTable *vtable, char *pattern, ...) {
-    va_list args;
-
-    va_start(args, pattern);
-    String *message = S_str_vnewf(pattern, args);
-    va_end(args);
-
-    Err *err = (Err*)VTable_Make_Obj(vtable);
-    err = Err_init(err, message);
-    Err_do_throw(err);
-}
-void
-CFISH_WARN(char *pattern, ...) {
-    va_list args;
-
-    va_start(args, pattern);
-    String *message = S_str_vnewf(pattern, args);
-    va_end(args);
-
-    Err_warn_mess(message);
-}
-String*
-CFISH_MAKE_MESS(char *pattern, ...) {
-    va_list args;
-
-    va_start(args, pattern);
-    String *message = S_str_vnewf(pattern, args);
-    va_end(args);
-
-    return message;
-}
-#endif
-
-
-static String*
-S_vmake_mess(const char *file, int line, const char *func,
-             const char *pattern, va_list args) {
-    size_t guess_len = strlen(file)
-                       + (func ? strlen(func) : 0)
-                       + strlen(pattern)
-                       + 30;
-    CharBuf *buf = CB_new(guess_len);
-    CB_VCatF(buf, pattern, args);
-    if (func != NULL) {
-        CB_catf(buf, "\n\t%s at %s line %i32\n", func, file, (int32_t)line);
-    }
-    else {
-        CB_catf(buf, "\n\t%s line %i32\n", file, (int32_t)line);
-    }
-    String *message = CB_Yield_String(buf);
-    DECREF(buf);
-    return message;
-}
-
-String*
-Err_make_mess(const char *file, int line, const char *func,
-              const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    String *message = S_vmake_mess(file, line, func, pattern, args);
-    va_end(args);
-    return message;
-}
-
-void
-Err_warn_at(const char *file, int line, const char *func,
-            const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    String *message = S_vmake_mess(file, line, func, pattern, args);
-    va_end(args);
-    Err_warn_mess(message);
-}
-
-String*
-Err_Get_Mess_IMP(Err *self) {
-    return self->mess;
-}
-
-void
-Err_Add_Frame_IMP(Err *self, const char *file, int line, const char *func) {
-    CharBuf *buf = CB_new_from_str(self->mess);
-
-    if (!Str_Ends_With_Utf8(self->mess, "\n", 1)) {
-        CB_Cat_Char(buf, '\n');
-    }
-
-    if (func != NULL) {
-        CB_catf(buf, "\t%s at %s line %i32\n", func, file, (int32_t)line);
-    }
-    else {
-        CB_catf(buf, "\tat %s line %i32\n", file, (int32_t)line);
-    }
-
-    DECREF(self->mess);
-    self->mess = CB_Yield_String(buf);
-    DECREF(buf);
-}
-
-void
-Err_rethrow(Err *self, const char *file, int line, const char *func) {
-    Err_Add_Frame_IMP(self, file, line, func);
-    Err_do_throw(self);
-}
-
-void
-Err_throw_at(VTable *vtable, const char *file, int line,
-             const char *func, const char *pattern, ...) {
-    va_list args;
-
-    va_start(args, pattern);
-    String *message = S_vmake_mess(file, line, func, pattern, args);
-    va_end(args);
-
-    Err *err = (Err*)VTable_Make_Obj(vtable);
-    err = Err_init(err, message);
-    Err_do_throw(err);
-}
-
-// Inlined, slightly optimized version of Obj_is_a.
-static CFISH_INLINE bool
-SI_obj_is_a(Obj *obj, VTable *target_vtable) {
-    VTable *vtable = obj->vtable;
-
-    while (vtable != NULL) {
-        if (vtable == target_vtable) {
-            return true;
-        }
-        vtable = vtable->parent;
-    }
-
-    return false;
-}
-
-Obj*
-Err_downcast(Obj *obj, VTable *vtable, const char *file, int line,
-             const char *func) {
-    if (obj && !SI_obj_is_a(obj, vtable)) {
-        Err_throw_at(ERR, file, line, func, "Can't downcast from %o to %o",
-                     Obj_Get_Class_Name(obj), VTable_Get_Name(vtable));
-    }
-    return obj;
-}
-
-Obj*
-Err_certify(Obj *obj, VTable *vtable, const char *file, int line,
-            const char *func) {
-    if (!obj) {
-        Err_throw_at(ERR, file, line, func, "Object isn't a %o, it's NULL",
-                     VTable_Get_Name(vtable));
-    }
-    else if (!SI_obj_is_a(obj, vtable)) {
-        Err_throw_at(ERR, file, line, func, "Can't downcast from %o to %o",
-                     Obj_Get_Class_Name(obj), VTable_Get_Name(vtable));
-    }
-    return obj;
-}
-
-#ifdef CHY_HAS_WINDOWS_H
-
-#include <windows.h>
-
-char*
-Err_win_error() {
-    size_t buf_size = 256;
-    char *buf = (char*)MALLOCATE(buf_size);
-    size_t message_len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
-                                       NULL,       // message source table
-                                       GetLastError(),
-                                       0,          // language id
-                                       buf,
-                                       buf_size,
-                                       NULL        // empty va_list
-                                      );
-    if (message_len == 0) {
-        char unknown[] = "Unknown error";
-        size_t len = sizeof(unknown);
-        strncpy(buf, unknown, len);
-    }
-    else if (message_len > 1) {
-        // Kill stupid newline.
-        buf[message_len - 2] = '\0';
-    }
-    return buf;
-}
-
-#else
-
-char*
-Err_win_error() {
-    return NULL; // Never called.
-}
-
-#endif // CHY_HAS_WINDOWS_H
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Err.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Err.cfh b/clownfish/runtime/core/Clownfish/Err.cfh
deleted file mode 100644
index 348e0ed..0000000
--- a/clownfish/runtime/core/Clownfish/Err.cfh
+++ /dev/null
@@ -1,254 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-__C__
-typedef void 
-(*CFISH_Err_Attempt_t)(void *context);
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define Err_Attempt_t CFISH_Err_Attempt_t
-#endif
-__END_C__
-
-/**
- * Exception.
- *
- * Clownfish::Err is the base class for exceptions in the Clownfish object
- * hierarchy.
- *
- * The Err module also provides access to a per-thread Err shared variable via
- * set_error() and get_error().  It may be used to store an Err object
- * temporarily, so that calling code may choose how to handle a particular
- * error condition.
- */
-public class Clownfish::Err inherits Clownfish::Obj {
-
-    String *mess;
-
-    inert void
-    init_class();
-
-    inert incremented Err*
-    new(decremented String *mess);
-
-    inert Err*
-    init(Err *self, decremented String *mess);
-
-    public void
-    Destroy(Err *self);
-
-    public incremented String*
-    To_String(Err *self);
-
-    void*
-    To_Host(Err *self);
-
-    /** Concatenate the supplied argument onto the internal "mess".
-     */
-    public void
-    Cat_Mess(Err *self, String *mess);
-
-    public String*
-    Get_Mess(Err *self);
-
-    /** Add information about the current stack frame onto <code>mess</code>.
-     */
-    void
-    Add_Frame(Err *self, const char *file, int line, const char *func);
-
-    /** Set the value of "error", a per-thread Err shared variable.
-     */
-    public inert void
-    set_error(decremented Err *error);
-
-    /** Retrieve per-thread Err shared variable "error".
-     */
-    public inert nullable Err*
-    get_error();
-
-    /** Run <code>routine</code> within the host's exception handling
-     * environment, catching and returning any errors that occur.
-     * 
-     * If an unrecognized host exception is trapped, it will be wrapped in an
-     * Err so that it can be handled by Clownfish code.
-     *
-     * @return an Err, or NULL if no exception occurs.
-     */
-    public inert incremented nullable Err*
-    trap(CFISH_Err_Attempt_t routine, void *context);
-
-    /** Print an error message to stderr with some C contextual information.
-     * Usually invoked via the WARN(pattern, ...) macro.
-     */
-    inert void
-    warn_at(const char *file, int line, const char *func,
-            const char *pattern, ...);
-
-    /** Raise an exception. Usually invoked via the THROW macro.
-     */
-    inert void
-    throw_at(VTable *vtable, const char *file, int line, const char *func,
-               const char *pattern, ...);
-
-    /** Throw an existing exception after tacking on additional context data.
-     */
-    inert void
-    rethrow(Err *error, const char *file, int line, const char *func);
-
-    /** Raise an exception.  Clean up the supplied message by decrementing its
-     * refcount.
-     *
-     * @param vtable The vtable for the Err class to throw.
-     * @param message Error message, to be output verbatim.
-     */
-    inert void
-    throw_mess(VTable *vtable, decremented String *message);
-
-    /** Invoke host exception handling.
-     */
-    inert void
-    do_throw(decremented Err *self);
-
-    /** Invoke host warning mechanism.  Clean up the supplied message by
-     * decrementing its refcount.
-     *
-     * @param message Error message, to be output verbatim.
-     */
-    inert void
-    warn_mess(decremented String *message);
-
-    /** Create a formatted error message.  Ususally invoked via the MAKE_MESS
-     * macro.
-     */
-    inert String*
-    make_mess(const char *file, int line, const char *func,
-              const char *pattern, ...);
-
-    /** Verify that <code>obj</code> is either NULL or inherits from
-     * the class represented by <code>vtable</code>.
-     *
-     * @return the object.
-     */
-    inert nullable Obj*
-    downcast(Obj *obj, VTable *vtable, const char *file, int line,
-                const char *func);
-
-    /** Verify that <code>obj</code> is not NULL and inherits from the class
-     * represented by <code>vtable</code>.
-     *
-     * @return the object.
-     */
-    inert Obj*
-    certify(Obj *obj, VTable *vtable, const char *file, int line,
-            const char *func);
-
-    /** Verify that an object belongs to a subclass and not an abstract class.
-     */
-    inert inline void
-    abstract_class_check(Obj *obj, VTable *vtable);
-
-    /** On Windows, return a newly allocated buffer containing the string
-     * description for the the last error in the thread.
-     */
-    inert char*
-    win_error();
-}
-
-__C__
-#ifdef CFISH_HAS_FUNC_MACRO
- #define CFISH_ERR_FUNC_MACRO CFISH_FUNC_MACRO
-#else
- #define CFISH_ERR_FUNC_MACRO NULL
-#endif
-
-#define CFISH_ERR_ADD_FRAME(_error) \
-    CFISH_Err_Add_Frame(_error, __FILE__, __LINE__, \
-                        CFISH_ERR_FUNC_MACRO)
-
-#define CFISH_RETHROW(_error) \
-    cfish_Err_rethrow((cfish_Err*)_error, __FILE__, __LINE__, \
-                      CFISH_ERR_FUNC_MACRO)
-
-/** Macro version of cfish_Err_throw_at which inserts contextual information
- * automatically, provided that the compiler supports the necessary features.
- */
-#ifdef CFISH_HAS_VARIADIC_MACROS
- #ifdef CFISH_HAS_ISO_VARIADIC_MACROS
-  #define CFISH_THROW(_vtable, ...) \
-    cfish_Err_throw_at(_vtable, __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, \
-                       __VA_ARGS__)
-  #define CFISH_WARN(...) \
-    cfish_Err_warn_at(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, __VA_ARGS__)
-  #define CFISH_MAKE_MESS(...) \
-    cfish_Err_make_mess(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, \
-                        __VA_ARGS__)
- #elif defined(CFISH_HAS_GNUC_VARIADIC_MACROS)
-  #define CFISH_THROW(_vtable, args...) \
-    cfish_Err_throw_at(_vtable, __FILE__, __LINE__, \
-                       CFISH_ERR_FUNC_MACRO, ##args)
-  #define CFISH_WARN(args...) \
-    cfish_Err_warn_at(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, ##args)
-  #define CFISH_MAKE_MESS(args...) \
-    cfish_Err_make_mess(__FILE__, __LINE__, CFISH_ERR_FUNC_MACRO, ##args)
- #endif
-#else
-  void
-  CFISH_THROW(cfish_VTable *vtable, char* format, ...);
-  void
-  CFISH_WARN(char* format, ...);
-  cfish_String*
-  CFISH_MAKE_MESS(char* format, ...);
-#endif
-
-#define CFISH_DOWNCAST(_obj, _vtable) \
-    cfish_Err_downcast((cfish_Obj*)(_obj), (_vtable), \
-                       __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
-
-
-#define CFISH_CERTIFY(_obj, _vtable) \
-    cfish_Err_certify((cfish_Obj*)(_obj), (_vtable), \
-                      __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
-
-static CFISH_INLINE void
-cfish_Err_abstract_class_check(cfish_Obj *obj, cfish_VTable *vtable) {
-    cfish_VTable *const my_vtable = (cfish_VTable*)((cfish_Dummy*)obj)->vtable;
-    if (my_vtable == vtable) {
-        cfish_String *mess = CFISH_MAKE_MESS("%o is an abstract class",
-                                              CFISH_Obj_Get_Class_Name(obj));
-        CFISH_Obj_Dec_RefCount(obj);
-        cfish_Err_throw_mess(CFISH_ERR, mess);
-    }
-}
-
-#define CFISH_ABSTRACT_CLASS_CHECK(_obj, _vtable) \
-    cfish_Err_abstract_class_check(((cfish_Obj*)_obj), _vtable)
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define THROW                 CFISH_THROW
-  #define RETHROW               CFISH_RETHROW
-  #define WARN                  CFISH_WARN
-  #define MAKE_MESS             CFISH_MAKE_MESS
-  #define ERR_ADD_FRAME         CFISH_ERR_ADD_FRAME
-  #define ERR_FUNC_MACRO        CFISH_ERR_FUNC_MACRO
-  #define DOWNCAST              CFISH_DOWNCAST
-  #define CERTIFY               CFISH_CERTIFY
-  #define ABSTRACT_CLASS_CHECK  CFISH_ABSTRACT_CLASS_CHECK
-#endif
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Hash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.c b/clownfish/runtime/core/Clownfish/Hash.c
deleted file mode 100644
index ed6cb6f..0000000
--- a/clownfish/runtime/core/Clownfish/Hash.c
+++ /dev/null
@@ -1,368 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_HASH
-#define C_CFISH_HASHTOMBSTONE
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdlib.h>
-
-#include "Clownfish/VTable.h"
-
-#include "Clownfish/Hash.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/Util/Memory.h"
-
-static HashTombStone *TOMBSTONE;
-
-#define HashEntry cfish_HashEntry
-
-typedef struct HashEntry {
-    Obj     *key;
-    Obj     *value;
-    int32_t  hash_sum;
-} HashEntry;
-
-// Reset the iterator.  Hash_Iterate must be called to restart iteration.
-static CFISH_INLINE void
-SI_kill_iter(Hash *self);
-
-// Return the entry associated with the key, if any.
-static CFISH_INLINE HashEntry*
-SI_fetch_entry(Hash *self, Obj *key, int32_t hash_sum);
-
-// Double the number of buckets and redistribute all entries.
-static CFISH_INLINE HashEntry*
-SI_rebuild_hash(Hash *self);
-
-void
-Hash_init_class() {
-    TOMBSTONE = (HashTombStone*)VTable_Make_Obj(HASHTOMBSTONE);
-}
-
-Hash*
-Hash_new(uint32_t capacity) {
-    Hash *self = (Hash*)VTable_Make_Obj(HASH);
-    return Hash_init(self, capacity);
-}
-
-Hash*
-Hash_init(Hash *self, uint32_t capacity) {
-    // Allocate enough space to hold the requested number of elements without
-    // triggering a rebuild.
-    uint32_t requested_capacity = capacity < INT32_MAX ? capacity : INT32_MAX;
-    uint32_t threshold;
-    capacity = 16;
-    while (1) {
-        threshold = (capacity / 3) * 2;
-        if (threshold > requested_capacity) { break; }
-        capacity *= 2;
-    }
-
-    // Init.
-    self->size         = 0;
-    self->iter_tick    = -1;
-
-    // Derive.
-    self->capacity     = capacity;
-    self->entries      = (HashEntry*)CALLOCATE(capacity, sizeof(HashEntry));
-    self->threshold    = threshold;
-
-    return self;
-}
-
-void
-Hash_Destroy_IMP(Hash *self) {
-    if (self->entries) {
-        Hash_Clear(self);
-        FREEMEM(self->entries);
-    }
-    SUPER_DESTROY(self, HASH);
-}
-
-void
-Hash_Clear_IMP(Hash *self) {
-    HashEntry *entry       = (HashEntry*)self->entries;
-    HashEntry *const limit = entry + self->capacity;
-
-    // Iterate through all entries.
-    for (; entry < limit; entry++) {
-        if (!entry->key) { continue; }
-        DECREF(entry->key);
-        DECREF(entry->value);
-        entry->key       = NULL;
-        entry->value     = NULL;
-        entry->hash_sum  = 0;
-    }
-
-    self->size = 0;
-}
-
-void
-Hash_do_store(Hash *self, Obj *key, Obj *value,
-              int32_t hash_sum, bool use_this_key) {
-    HashEntry *entries = self->size >= self->threshold
-                         ? SI_rebuild_hash(self)
-                         : (HashEntry*)self->entries;
-    uint32_t       tick = hash_sum;
-    const uint32_t mask = self->capacity - 1;
-
-    while (1) {
-        tick &= mask;
-        HashEntry *entry = entries + tick;
-        if (entry->key == (Obj*)TOMBSTONE || !entry->key) {
-            if (entry->key == (Obj*)TOMBSTONE) {
-                // Take note of diminished tombstone clutter.
-                self->threshold++;
-            }
-            entry->key       = use_this_key
-                               ? key
-                               : Hash_Make_Key(self, key, hash_sum);
-            entry->value     = value;
-            entry->hash_sum  = hash_sum;
-            self->size++;
-            break;
-        }
-        else if (entry->hash_sum == hash_sum
-                 && Obj_Equals(key, entry->key)
-                ) {
-            DECREF(entry->value);
-            entry->value = value;
-            break;
-        }
-        tick++; // linear scan
-    }
-}
-
-void
-Hash_Store_IMP(Hash *self, Obj *key, Obj *value) {
-    Hash_do_store(self, key, value, Obj_Hash_Sum(key), false);
-}
-
-void
-Hash_Store_Utf8_IMP(Hash *self, const char *key, size_t key_len, Obj *value) {
-    StackString *key_buf = SSTR_WRAP_UTF8((char*)key, key_len);
-    Hash_do_store(self, (Obj*)key_buf, value,
-                  SStr_Hash_Sum(key_buf), false);
-}
-
-Obj*
-Hash_Make_Key_IMP(Hash *self, Obj *key, int32_t hash_sum) {
-    UNUSED_VAR(self);
-    UNUSED_VAR(hash_sum);
-    return Obj_Clone(key);
-}
-
-Obj*
-Hash_Fetch_Utf8_IMP(Hash *self, const char *key, size_t key_len) {
-    StackString *key_buf = SSTR_WRAP_UTF8(key, key_len);
-    return Hash_Fetch_IMP(self, (Obj*)key_buf);
-}
-
-static CFISH_INLINE HashEntry*
-SI_fetch_entry(Hash *self, Obj *key, int32_t hash_sum) {
-    uint32_t tick = hash_sum;
-    HashEntry *const entries = (HashEntry*)self->entries;
-    HashEntry *entry;
-
-    while (1) {
-        tick &= self->capacity - 1;
-        entry = entries + tick;
-        if (!entry->key) {
-            // Failed to find the key, so return NULL.
-            return NULL;
-        }
-        else if (entry->hash_sum == hash_sum
-                 && Obj_Equals(key, entry->key)
-                ) {
-            return entry;
-        }
-        tick++;
-    }
-}
-
-Obj*
-Hash_Fetch_IMP(Hash *self, Obj *key) {
-    HashEntry *entry = SI_fetch_entry(self, key, Obj_Hash_Sum(key));
-    return entry ? entry->value : NULL;
-}
-
-Obj*
-Hash_Delete_IMP(Hash *self, Obj *key) {
-    HashEntry *entry = SI_fetch_entry(self, key, Obj_Hash_Sum(key));
-    if (entry) {
-        Obj *value = entry->value;
-        DECREF(entry->key);
-        entry->key       = (Obj*)TOMBSTONE;
-        entry->value     = NULL;
-        entry->hash_sum  = 0;
-        self->size--;
-        self->threshold--; // limit number of tombstones
-        return value;
-    }
-    else {
-        return NULL;
-    }
-}
-
-Obj*
-Hash_Delete_Utf8_IMP(Hash *self, const char *key, size_t key_len) {
-    StackString *key_buf = SSTR_WRAP_UTF8(key, key_len);
-    return Hash_Delete_IMP(self, (Obj*)key_buf);
-}
-
-uint32_t
-Hash_Iterate_IMP(Hash *self) {
-    SI_kill_iter(self);
-    return self->size;
-}
-
-static CFISH_INLINE void
-SI_kill_iter(Hash *self) {
-    self->iter_tick = -1;
-}
-
-bool
-Hash_Next_IMP(Hash *self, Obj **key, Obj **value) {
-    while (1) {
-        if (++self->iter_tick >= (int32_t)self->capacity) {
-            // Bail since we've completed the iteration.
-            --self->iter_tick;
-            *key   = NULL;
-            *value = NULL;
-            return false;
-        }
-        else {
-            HashEntry *const entry
-                = (HashEntry*)self->entries + self->iter_tick;
-            if (entry->key && entry->key != (Obj*)TOMBSTONE) {
-                // Success!
-                *key   = entry->key;
-                *value = entry->value;
-                return true;
-            }
-        }
-    }
-}
-
-Obj*
-Hash_Find_Key_IMP(Hash *self, Obj *key, int32_t hash_sum) {
-    HashEntry *entry = SI_fetch_entry(self, key, hash_sum);
-    return entry ? entry->key : NULL;
-}
-
-VArray*
-Hash_Keys_IMP(Hash *self) {
-    Obj *key;
-    Obj *val;
-    VArray *keys = VA_new(self->size);
-    Hash_Iterate(self);
-    while (Hash_Next(self, &key, &val)) {
-        VA_Push(keys, INCREF(key));
-    }
-    return keys;
-}
-
-VArray*
-Hash_Values_IMP(Hash *self) {
-    Obj *key;
-    Obj *val;
-    VArray *values = VA_new(self->size);
-    Hash_Iterate(self);
-    while (Hash_Next(self, &key, &val)) { VA_Push(values, INCREF(val)); }
-    return values;
-}
-
-bool
-Hash_Equals_IMP(Hash *self, Obj *other) {
-    Hash    *twin = (Hash*)other;
-    Obj     *key;
-    Obj     *val;
-
-    if (twin == self)             { return true; }
-    if (!Obj_Is_A(other, HASH))   { return false; }
-    if (self->size != twin->size) { return false; }
-
-    Hash_Iterate(self);
-    while (Hash_Next(self, &key, &val)) {
-        Obj *other_val = Hash_Fetch(twin, key);
-        if (!other_val || !Obj_Equals(other_val, val)) { return false; }
-    }
-
-    return true;
-}
-
-uint32_t
-Hash_Get_Capacity_IMP(Hash *self) {
-    return self->capacity;
-}
-
-uint32_t
-Hash_Get_Size_IMP(Hash *self) {
-    return self->size;
-}
-
-static CFISH_INLINE HashEntry*
-SI_rebuild_hash(Hash *self) {
-    HashEntry *old_entries = (HashEntry*)self->entries;
-    HashEntry *entry       = old_entries;
-    HashEntry *limit       = old_entries + self->capacity;
-
-    SI_kill_iter(self);
-    self->capacity *= 2;
-    self->threshold = (self->capacity / 3) * 2;
-    self->entries   = (HashEntry*)CALLOCATE(self->capacity, sizeof(HashEntry));
-    self->size      = 0;
-
-    for (; entry < limit; entry++) {
-        if (!entry->key || entry->key == (Obj*)TOMBSTONE) {
-            continue;
-        }
-        Hash_do_store(self, entry->key, entry->value,
-                      entry->hash_sum, true);
-    }
-
-    FREEMEM(old_entries);
-
-    return (HashEntry*)self->entries;
-}
-
-/***************************************************************************/
-
-uint32_t
-HashTombStone_Get_RefCount_IMP(HashTombStone* self) {
-    CHY_UNUSED_VAR(self);
-    return 1;
-}
-
-HashTombStone*
-HashTombStone_Inc_RefCount_IMP(HashTombStone* self) {
-    return self;
-}
-
-uint32_t
-HashTombStone_Dec_RefCount_IMP(HashTombStone* self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Hash.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Hash.cfh b/clownfish/runtime/core/Clownfish/Hash.cfh
deleted file mode 100644
index afa1904..0000000
--- a/clownfish/runtime/core/Clownfish/Hash.cfh
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/**
- * Hashtable.
- *
- * Values are stored by reference and may be any kind of Obj. By default, keys
- * are cloned and so must belong to a class that implements Clone(); however,
- * this behavior can be changed by overridding Make_Key(), e.g. to implement
- * efficient hash sets.
- */
-class Clownfish::Hash inherits Clownfish::Obj {
-
-    void          *entries;
-    uint32_t       capacity;
-    uint32_t       size;
-    uint32_t       threshold;    /* rehashing trigger point */
-    int32_t        iter_tick;    /* used when iterating */
-
-    inert void
-    init_class();
-
-    inert incremented Hash*
-    new(uint32_t capacity = 0);
-
-    /**
-     * @param capacity The number of elements that the hash will be asked to
-     * hold initially.
-     */
-    inert Hash*
-    init(Hash *self, uint32_t capacity = 0);
-
-    /** Empty the hash of all key-value pairs.
-     */
-    void
-    Clear(Hash *self);
-
-    /** Store a key-value pair.  If <code>key</code> is not already present,
-     * Make_Key() will be called to manufacture the internally used key.
-     */
-    void
-    Store(Hash *self, Obj *key, decremented Obj *value);
-
-    void
-    Store_Utf8(Hash *self, const char *str, size_t len,
-               decremented Obj *value);
-
-    /** Fetch the value associated with <code>key</code>.
-     *
-     * @return the value, or NULL if <code>key</code> is not present.
-     */
-    nullable Obj*
-    Fetch(Hash *self, Obj *key);
-
-    nullable Obj*
-    Fetch_Utf8(Hash *self, const char *key, size_t key_len);
-
-    /** Attempt to delete a key-value pair from the hash.
-     *
-     * @return the value if <code>key</code> exists and thus deletion
-     * succeeds; otherwise NULL.
-     */
-    incremented nullable Obj*
-    Delete(Hash *self, Obj *key);
-
-    incremented nullable Obj*
-    Delete_Utf8(Hash *self, const char *key, size_t key_ley);
-
-    /** Prepare to iterate over all the key-value pairs in the hash.
-     *
-     * @return the number of pairs which will be iterated over.
-     */
-    uint32_t
-    Iterate(Hash *self);
-
-    /** Retrieve the next key-value pair from the hash, setting the supplied
-     * pointers to point at them.
-     *
-     * @return true while iterating, false when the iterator has been
-     * exhausted.
-     */
-    bool
-    Next(Hash *self, Obj **key, Obj **value);
-
-    /** Search for a key which Equals the key supplied, and return the key
-     * rather than its value.
-     */
-    nullable Obj*
-    Find_Key(Hash *self, Obj *key, int32_t hash_sum);
-
-    /** Return an VArray of pointers to the hash's keys.
-     */
-    incremented VArray*
-    Keys(Hash *self);
-
-    /** Return an VArray of pointers to the hash's values.
-     */
-    incremented VArray*
-    Values(Hash *self);
-
-    /** Create a key to be stored within the hash entry.  Implementations must
-     * supply an object which produces the same Hash_Sum() value and tests
-     * true for Equals().  By default, calls Clone().
-     */
-    public incremented Obj*
-    Make_Key(Hash *self, Obj *key, int32_t hash_sum);
-
-    uint32_t
-    Get_Capacity(Hash *self);
-
-    /** Accessor for Hash's "size" member.
-     *
-     * @return the number of key-value pairs.
-     */
-    public uint32_t
-    Get_Size(Hash *self);
-
-    public bool
-    Equals(Hash *self, Obj *other);
-
-    public void
-    Destroy(Hash *self);
-}
-
-class Clownfish::Hash::HashTombStone
-    inherits Clownfish::Obj {
-
-    uint32_t
-    Get_RefCount(HashTombStone* self);
-
-    incremented HashTombStone*
-    Inc_RefCount(HashTombStone* self);
-
-    uint32_t
-    Dec_RefCount(HashTombStone* self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/LockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/LockFreeRegistry.c b/clownfish/runtime/core/Clownfish/LockFreeRegistry.c
deleted file mode 100644
index 2ad0205..0000000
--- a/clownfish/runtime/core/Clownfish/LockFreeRegistry.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_LOCKFREEREGISTRY
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "Clownfish/LockFreeRegistry.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/VTable.h"
-#include "Clownfish/Util/Atomic.h"
-#include "Clownfish/Util/Memory.h"
-
-typedef struct cfish_LFRegEntry {
-    Obj *key;
-    Obj *value;
-    int32_t hash_sum;
-    struct cfish_LFRegEntry *volatile next;
-} cfish_LFRegEntry;
-#define LFRegEntry cfish_LFRegEntry
-
-LockFreeRegistry*
-LFReg_new(size_t capacity) {
-    LockFreeRegistry *self
-        = (LockFreeRegistry*)VTable_Make_Obj(LOCKFREEREGISTRY);
-    return LFReg_init(self, capacity);
-}
-
-LockFreeRegistry*
-LFReg_init(LockFreeRegistry *self, size_t capacity) {
-    self->capacity = capacity;
-    self->entries  = CALLOCATE(capacity, sizeof(void*));
-    return self;
-}
-
-bool
-LFReg_Register_IMP(LockFreeRegistry *self, Obj *key, Obj *value) {
-    LFRegEntry  *new_entry = NULL;
-    int32_t      hash_sum  = Obj_Hash_Sum(key);
-    size_t       bucket    = (uint32_t)hash_sum  % self->capacity;
-    LFRegEntry  *volatile *entries = (LFRegEntry*volatile*)self->entries;
-    LFRegEntry  *volatile *slot    = &(entries[bucket]);
-
-    // Proceed through the linked list.  Bail out if the key has already been
-    // registered.
-FIND_END_OF_LINKED_LIST:
-    while (*slot) {
-        LFRegEntry *entry = *slot;
-        if (entry->hash_sum == hash_sum) {
-            if (Obj_Equals(key, entry->key)) {
-                return false;
-            }
-        }
-        slot = &(entry->next);
-    }
-
-    // We've found an empty slot. Create the new entry.
-    if (!new_entry) {
-        new_entry = (LFRegEntry*)MALLOCATE(sizeof(LFRegEntry));
-        new_entry->hash_sum  = hash_sum;
-        new_entry->key       = INCREF(key);
-        new_entry->value     = INCREF(value);
-        new_entry->next      = NULL;
-    }
-
-    /* Attempt to append the new node onto the end of the linked list.
-     * However, if another thread filled the slot since we found it (perhaps
-     * while we were allocating that new node), the compare-and-swap will
-     * fail.  If that happens, we have to go back and find the new end of the
-     * linked list, then try again. */
-    if (!Atomic_cas_ptr((void*volatile*)slot, NULL, new_entry)) {
-        goto FIND_END_OF_LINKED_LIST;
-    }
-
-    return true;
-}
-
-Obj*
-LFReg_Fetch_IMP(LockFreeRegistry *self, Obj *key) {
-    int32_t      hash_sum  = Obj_Hash_Sum(key);
-    size_t       bucket    = (uint32_t)hash_sum  % self->capacity;
-    LFRegEntry **entries   = (LFRegEntry**)self->entries;
-    LFRegEntry  *entry     = entries[bucket];
-
-    while (entry) {
-        if (entry->hash_sum  == hash_sum) {
-            if (Obj_Equals(key, entry->key)) {
-                return entry->value;
-            }
-        }
-        entry = entry->next;
-    }
-
-    return NULL;
-}
-
-void
-LFReg_Destroy_IMP(LockFreeRegistry *self) {
-    LFRegEntry **entries = (LFRegEntry**)self->entries;
-
-    for (size_t i = 0; i < self->capacity; i++) {
-        LFRegEntry *entry = entries[i];
-        while (entry) {
-            LFRegEntry *next_entry = entry->next;
-            DECREF(entry->key);
-            DECREF(entry->value);
-            FREEMEM(entry);
-            entry = next_entry;
-        }
-    }
-    FREEMEM(self->entries);
-
-    SUPER_DESTROY(self, LOCKFREEREGISTRY);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/LockFreeRegistry.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/LockFreeRegistry.cfh b/clownfish/runtime/core/Clownfish/LockFreeRegistry.cfh
deleted file mode 100644
index 2a3d62a..0000000
--- a/clownfish/runtime/core/Clownfish/LockFreeRegistry.cfh
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Specialized lock free hash table for storing VTables.
- */
-class Clownfish::LockFreeRegistry cnick LFReg inherits Clownfish::Obj {
-
-    size_t  capacity;
-    void   *entries;
-
-    inert incremented LockFreeRegistry*
-    new(size_t capacity);
-
-    inert LockFreeRegistry*
-    init(LockFreeRegistry *self, size_t capacity);
-
-    public void
-    Destroy(LockFreeRegistry *self);
-
-    bool
-    Register(LockFreeRegistry *self, Obj *key, Obj *value);
-
-    nullable Obj*
-    Fetch(LockFreeRegistry *self, Obj *key);
-
-    void*
-    To_Host(LockFreeRegistry *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Method.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Method.c b/clownfish/runtime/core/Clownfish/Method.c
deleted file mode 100644
index e7a72e5..0000000
--- a/clownfish/runtime/core/Clownfish/Method.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_METHOD
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Method.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/VTable.h"
-
-Method*
-Method_new(String *name, cfish_method_t callback_func, size_t offset) {
-    Method *self = (Method*)VTable_Make_Obj(METHOD);
-    return Method_init(self, name, callback_func, offset);
-}
-
-Method*
-Method_init(Method *self, String *name, cfish_method_t callback_func,
-            size_t offset) {
-    self->name          = Str_Clone(name);
-    self->host_alias    = NULL;
-    self->callback_func = callback_func;
-    self->offset        = offset;
-    self->is_excluded   = false;
-    return self;
-}
-
-void
-Method_Destroy_IMP(Method *self) {
-    THROW(ERR, "Insane attempt to destroy Method '%o'", self->name);
-}
-
-Obj*
-Method_Inc_RefCount_IMP(Method *self) {
-    return (Obj*)self;
-}
-
-uint32_t
-Method_Dec_RefCount_IMP(Method *self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
-uint32_t
-Method_Get_RefCount_IMP(Method *self) {
-    UNUSED_VAR(self);
-    // See comments in VTable.c
-    return 1;
-}
-
-String*
-Method_Get_Name_IMP(Method *self) {
-    return self->name;
-}
-
-String*
-Method_Get_Host_Alias_IMP(Method *self) {
-    return self->host_alias;
-}
-
-bool
-Method_Is_Excluded_From_Host_IMP(Method *self) {
-    return self->is_excluded;
-}
-
-


[lucy-commits] [06/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Method.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Method.cfh b/clownfish/runtime/core/Clownfish/Method.cfh
deleted file mode 100644
index 4f73384..0000000
--- a/clownfish/runtime/core/Clownfish/Method.cfh
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Method metadata.
- */
-
-class Clownfish::Method inherits Clownfish::Obj {
-
-    String         *name;
-    String         *host_alias;
-    cfish_method_t  callback_func;
-    size_t          offset;
-    bool            is_excluded;
-
-    inert Method*
-    new(String *name, cfish_method_t callback_func, size_t offset);
-
-    inert Method*
-    init(Method *self, String *name, cfish_method_t callback_func,
-         size_t offset);
-
-    String*
-    Get_Name(Method *self);
-
-    nullable String*
-    Get_Host_Alias(Method *self);
-
-    bool
-    Is_Excluded_From_Host(Method *self);
-
-    incremented Obj*
-    Inc_RefCount(Method *self);
-
-    uint32_t
-    Dec_RefCount(Method *self);
-
-    uint32_t
-    Get_RefCount(Method *self);
-
-    public void
-    Destroy(Method *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Num.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Num.c b/clownfish/runtime/core/Clownfish/Num.c
deleted file mode 100644
index cf38a86..0000000
--- a/clownfish/runtime/core/Clownfish/Num.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_NUM
-#define C_CFISH_INTNUM
-#define C_CFISH_FLOATNUM
-#define C_CFISH_INTEGER32
-#define C_CFISH_INTEGER64
-#define C_CFISH_FLOAT32
-#define C_CFISH_FLOAT64
-#define C_CFISH_BOOLNUM
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Num.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/VTable.h"
-
-Num*
-Num_init(Num *self) {
-    ABSTRACT_CLASS_CHECK(self, NUM);
-    return self;
-}
-
-bool
-Num_Equals_IMP(Num *self, Obj *other) {
-    Num *twin = (Num*)other;
-    if (twin == self) { return true; }
-    if (!Obj_Is_A(other, NUM)) { return false; }
-    if (Num_To_F64(self) != Num_To_F64(twin)) { return false; }
-    if (Num_To_I64(self) != Num_To_I64(twin)) { return false; }
-    return true;
-}
-
-/***************************************************************************/
-
-FloatNum*
-FloatNum_init(FloatNum *self) {
-    ABSTRACT_CLASS_CHECK(self, FLOATNUM);
-    return (FloatNum*)Num_init((Num*)self);
-}
-
-int32_t
-FloatNum_Compare_To_IMP(FloatNum *self, Obj *other) {
-    Num *twin = (Num*)CERTIFY(other, NUM);
-    double f64_diff = FloatNum_To_F64(self) - Num_To_F64(twin);
-    if (f64_diff < 0)      { return -1; }
-    else if (f64_diff > 0) { return 1;  }
-    return 0;
-}
-
-String*
-FloatNum_To_String_IMP(FloatNum *self) {
-    return Str_newf("%f64", FloatNum_To_F64(self));
-}
-
-/***************************************************************************/
-
-IntNum*
-IntNum_init(IntNum *self) {
-    ABSTRACT_CLASS_CHECK(self, INTNUM);
-    return (IntNum*)Num_init((Num*)self);
-}
-
-int32_t
-IntNum_Compare_To_IMP(IntNum *self, Obj *other) {
-    if (!Obj_Is_A(other, INTNUM)) {
-        return -Obj_Compare_To(other, (Obj*)self);
-    }
-    int64_t self_value  = IntNum_To_I64(self);
-    int64_t other_value = Obj_To_I64(other);
-    if (self_value < other_value)      { return -1; }
-    else if (self_value > other_value) { return 1;  }
-    return 0;
-}
-
-String*
-IntNum_To_String_IMP(IntNum *self) {
-    return Str_newf("%i64", IntNum_To_I64(self));
-}
-
-/***************************************************************************/
-
-Float32*
-Float32_new(float value) {
-    Float32 *self = (Float32*)VTable_Make_Obj(FLOAT32);
-    return Float32_init(self, value);
-}
-
-Float32*
-Float32_init(Float32 *self, float value) {
-    self->value = value;
-    return (Float32*)FloatNum_init((FloatNum*)self);
-}
-
-float
-Float32_Get_Value_IMP(Float32 *self) {
-    return self->value;
-}
-
-void
-Float32_Set_Value_IMP(Float32 *self, float value) {
-    self->value = value;
-}
-
-double
-Float32_To_F64_IMP(Float32 *self) {
-    return self->value;
-}
-
-int64_t
-Float32_To_I64_IMP(Float32 *self) {
-    return (int64_t)self->value;
-}
-
-int32_t
-Float32_Hash_Sum_IMP(Float32 *self) {
-    return *(int32_t*)&self->value;
-}
-
-Float32*
-Float32_Clone_IMP(Float32 *self) {
-    return Float32_new(self->value);
-}
-
-void
-Float32_Mimic_IMP(Float32 *self, Obj *other) {
-    Float32 *twin = (Float32*)CERTIFY(other, FLOAT32);
-    self->value = twin->value;
-}
-
-/***************************************************************************/
-
-Float64*
-Float64_new(double value) {
-    Float64 *self = (Float64*)VTable_Make_Obj(FLOAT64);
-    return Float64_init(self, value);
-}
-
-Float64*
-Float64_init(Float64 *self, double value) {
-    self->value = value;
-    return (Float64*)FloatNum_init((FloatNum*)self);
-}
-
-double
-Float64_Get_Value_IMP(Float64 *self) {
-    return self->value;
-}
-
-void
-Float64_Set_Value_IMP(Float64 *self, double value) {
-    self->value = value;
-}
-
-double
-Float64_To_F64_IMP(Float64 *self) {
-    return self->value;
-}
-
-int64_t
-Float64_To_I64_IMP(Float64 *self) {
-    return (int64_t)self->value;
-}
-
-Float64*
-Float64_Clone_IMP(Float64 *self) {
-    return Float64_new(self->value);
-}
-
-void
-Float64_Mimic_IMP(Float64 *self, Obj *other) {
-    Float64 *twin = (Float64*)CERTIFY(other, FLOAT64);
-    self->value = twin->value;
-}
-
-int32_t
-Float64_Hash_Sum_IMP(Float64 *self) {
-    int32_t *ints = (int32_t*)&self->value;
-    return ints[0] ^ ints[1];
-}
-
-/***************************************************************************/
-
-Integer32*
-Int32_new(int32_t value) {
-    Integer32 *self = (Integer32*)VTable_Make_Obj(INTEGER32);
-    return Int32_init(self, value);
-}
-
-Integer32*
-Int32_init(Integer32 *self, int32_t value) {
-    self->value = value;
-    return (Integer32*)IntNum_init((IntNum*)self);
-}
-
-int32_t
-Int32_Get_Value_IMP(Integer32 *self) {
-    return self->value;
-}
-
-void
-Int32_Set_Value_IMP(Integer32 *self, int32_t value) {
-    self->value = value;
-}
-
-double
-Int32_To_F64_IMP(Integer32 *self) {
-    return self->value;
-}
-
-int64_t
-Int32_To_I64_IMP(Integer32 *self) {
-    return self->value;
-}
-
-Integer32*
-Int32_Clone_IMP(Integer32 *self) {
-    return Int32_new(self->value);
-}
-
-void
-Int32_Mimic_IMP(Integer32 *self, Obj *other) {
-    Integer32 *twin = (Integer32*)CERTIFY(other, INTEGER32);
-    self->value = twin->value;
-}
-
-int32_t
-Int32_Hash_Sum_IMP(Integer32 *self) {
-    return self->value;
-}
-
-/***************************************************************************/
-
-Integer64*
-Int64_new(int64_t value) {
-    Integer64 *self = (Integer64*)VTable_Make_Obj(INTEGER64);
-    return Int64_init(self, value);
-}
-
-Integer64*
-Int64_init(Integer64 *self, int64_t value) {
-    self->value = value;
-    return (Integer64*)IntNum_init((IntNum*)self);
-}
-
-int64_t
-Int64_Get_Value_IMP(Integer64 *self) {
-    return self->value;
-}
-
-void
-Int64_Set_Value_IMP(Integer64 *self, int64_t value) {
-    self->value = value;
-}
-
-double
-Int64_To_F64_IMP(Integer64 *self) {
-    return (double)self->value;
-}
-
-int64_t
-Int64_To_I64_IMP(Integer64 *self) {
-    return self->value;
-}
-
-Integer64*
-Int64_Clone_IMP(Integer64 *self) {
-    return Int64_new(self->value);
-}
-
-void
-Int64_Mimic_IMP(Integer64 *self, Obj *other) {
-    Integer64 *twin = (Integer64*)CERTIFY(other, INTEGER64);
-    self->value = twin->value;
-}
-
-int32_t
-Int64_Hash_Sum_IMP(Integer64 *self) {
-    int32_t *ints = (int32_t*)&self->value;
-    return ints[0] ^ ints[1];
-}
-
-bool
-Int64_Equals_IMP(Integer64 *self, Obj *other) {
-    Num *twin = (Num*)other;
-    if (twin == (Num*)self)         { return true; }
-    if (!Obj_Is_A(other, NUM)) { return false; }
-    if (Num_Is_A(twin, FLOATNUM)) {
-        double  floating_val = Num_To_F64(twin);
-        int64_t int_val      = (int64_t)floating_val;
-        if ((double)int_val != floating_val) { return false; }
-        if (int_val != self->value)          { return false; }
-    }
-    else {
-        if (self->value != Num_To_I64(twin)) { return false; }
-    }
-    return true;
-}
-
-/***************************************************************************/
-
-
-BoolNum *Bool_true_singleton;
-BoolNum *Bool_false_singleton;
-
-void
-Bool_init_class() {
-    Bool_true_singleton          = (BoolNum*)VTable_Make_Obj(BOOLNUM);
-    Bool_true_singleton->value   = true;
-    Bool_true_singleton->string  = Str_newf("true");
-    Bool_false_singleton         = (BoolNum*)VTable_Make_Obj(BOOLNUM);
-    Bool_false_singleton->value  = false;
-    Bool_false_singleton->string = Str_newf("false");
-}
-
-BoolNum*
-Bool_singleton(bool value) {
-    return value ? CFISH_TRUE : CFISH_FALSE;
-}
-
-void
-Bool_Destroy_IMP(BoolNum *self) {
-    if (self && self != CFISH_TRUE && self != CFISH_FALSE) {
-        SUPER_DESTROY(self, BOOLNUM);
-    }
-}
-
-bool
-Bool_Get_Value_IMP(BoolNum *self) {
-    return self->value;
-}
-
-double
-Bool_To_F64_IMP(BoolNum *self) {
-    return (double)self->value;
-}
-
-int64_t
-Bool_To_I64_IMP(BoolNum *self) {
-    return self->value;
-}
-
-bool
-Bool_To_Bool_IMP(BoolNum *self) {
-    return self->value;
-}
-
-BoolNum*
-Bool_Clone_IMP(BoolNum *self) {
-    return self;
-}
-
-int32_t
-Bool_Hash_Sum_IMP(BoolNum *self) {
-    int64_t hash_sum = PTR_TO_I64(self) + self->value;
-    return (int32_t)hash_sum;
-}
-
-String*
-Bool_To_String_IMP(BoolNum *self) {
-    return (String*)INCREF(self->string);
-}
-
-bool
-Bool_Equals_IMP(BoolNum *self, Obj *other) {
-    return self == (BoolNum*)other;
-}
-
-BoolNum*
-Bool_Inc_RefCount_IMP(BoolNum *self) {
-    return self;
-}
-
-uint32_t
-Bool_Dec_RefCount_IMP(BoolNum *self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Num.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Num.cfh b/clownfish/runtime/core/Clownfish/Num.cfh
deleted file mode 100644
index 56983ce..0000000
--- a/clownfish/runtime/core/Clownfish/Num.cfh
+++ /dev/null
@@ -1,277 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Abstract base class for numbers.
- */
-abstract class Clownfish::Num inherits Clownfish::Obj {
-
-    inert Num*
-    init(Num *self);
-
-    public bool
-    Equals(Num *self, Obj *other);
-}
-
-/** Abstract base class for floating point numbers.
- */
-abstract class Clownfish::FloatNum inherits Clownfish::Num {
-
-    inert FloatNum*
-    init(FloatNum *self);
-
-    public int32_t
-    Compare_To(FloatNum *self, Obj *other);
-
-    public incremented String*
-    To_String(FloatNum *self);
-}
-
-
-/** Abstract base class for Integers.
- */
-abstract class Clownfish::IntNum inherits Clownfish::Num {
-
-    inert IntNum*
-    init(IntNum *self);
-
-    public int32_t
-    Compare_To(IntNum *self, Obj *other);
-
-    public incremented String*
-    To_String(IntNum *self);
-}
-
-/** Single precision floating point number.
- */
-class Clownfish::Float32 inherits Clownfish::FloatNum {
-
-    float value;
-
-    /**
-     * @param value Initial value.
-     */
-    inert Float32*
-    init(Float32* self, float value);
-
-    inert Float32*
-    new(float value);
-
-    void
-    Set_Value(Float32 *self, float value);
-
-    float
-    Get_Value(Float32 *self);
-
-    public int64_t
-    To_I64(Float32 *self);
-
-    public double
-    To_F64(Float32 *self);
-
-    public int32_t
-    Hash_Sum(Float32 *self);
-
-    public incremented Float32*
-    Clone(Float32 *self);
-
-    public void
-    Mimic(Float32 *self, Obj *other);
-}
-
-/** Double precision floating point number.
- */
-class Clownfish::Float64 inherits Clownfish::FloatNum {
-
-    double value;
-
-    /**
-     * @param value Initial value.
-     */
-    inert Float64*
-    init(Float64* self, double value);
-
-    inert Float64*
-    new(double value);
-
-    void
-    Set_Value(Float64 *self, double value);
-
-    double
-    Get_Value(Float64 *self);
-
-    public int64_t
-    To_I64(Float64 *self);
-
-    public double
-    To_F64(Float64 *self);
-
-    public int32_t
-    Hash_Sum(Float64 *self);
-
-    public incremented Float64*
-    Clone(Float64 *self);
-
-    public void
-    Mimic(Float64 *self, Obj *other);
-}
-
-/** 32-bit signed integer.
- */
-class Clownfish::Integer32 cnick Int32
-    inherits Clownfish::IntNum {
-
-    int32_t value;
-
-    /**
-     * @param value Initial value.
-     */
-    inert Integer32*
-    init(Integer32* self, int32_t value);
-
-    inert Integer32*
-    new(int32_t value);
-
-    void
-    Set_Value(Integer32 *self, int32_t value);
-
-    int32_t
-    Get_Value(Integer32 *self);
-
-    public int64_t
-    To_I64(Integer32 *self);
-
-    public double
-    To_F64(Integer32 *self);
-
-    public int32_t
-    Hash_Sum(Integer32 *self);
-
-    public incremented Integer32*
-    Clone(Integer32 *self);
-
-    public void
-    Mimic(Integer32 *self, Obj *other);
-}
-
-/**
- * 64-bit signed integer.
- */
-class Clownfish::Integer64 cnick Int64
-    inherits Clownfish::IntNum {
-
-    int64_t value;
-
-    /**
-     * @param value Initial value.
-     */
-    inert Integer64*
-    init(Integer64* self, int64_t value);
-
-    inert Integer64*
-    new(int64_t value);
-
-    void
-    Set_Value(Integer64 *self, int64_t value);
-
-    int64_t
-    Get_Value(Integer64 *self);
-
-    public int64_t
-    To_I64(Integer64 *self);
-
-    public double
-    To_F64(Integer64 *self);
-
-    public int32_t
-    Hash_Sum(Integer64 *self);
-
-    public bool
-    Equals(Integer64 *self, Obj *other);
-
-    public incremented Integer64*
-    Clone(Integer64 *self);
-
-    public void
-    Mimic(Integer64 *self, Obj *other);
-}
-
-
-/**
- * Boolean type.
- * 
- * There are only two singleton instances of this class: CFISH_TRUE and
- * CFISH_FALSE.
- */
-class Clownfish::BoolNum cnick Bool inherits Clownfish::IntNum {
-    bool value;
-    String *string;
-
-    inert BoolNum *true_singleton;
-    inert BoolNum *false_singleton;
-
-    inert void
-    init_class();
-
-    /** Return either CFISH_TRUE or CFISH_FALSE depending on the supplied
-     * value.
-     */
-    inert BoolNum*
-    singleton(bool value);
-
-    public void
-    Destroy(BoolNum *self);
-
-    bool
-    Get_Value(BoolNum *self);
-
-    public int64_t
-    To_I64(BoolNum *self);
-
-    public double
-    To_F64(BoolNum *self);
-
-    public bool
-    To_Bool(BoolNum *self);
-
-    public int32_t
-    Hash_Sum(BoolNum *self);
-
-    /* Returns self. */
-    public incremented BoolNum*
-    Clone(BoolNum *self);
-
-    public bool
-    Equals(BoolNum *self, Obj *other);
-
-    public incremented String*
-    To_String(BoolNum *self);
-
-    incremented BoolNum*
-    Inc_RefCount(BoolNum *self);
-
-    uint32_t
-    Dec_RefCount(BoolNum *self);
-}
-
-__C__
-
-#define CFISH_TRUE  cfish_Bool_true_singleton
-#define CFISH_FALSE cfish_Bool_false_singleton
-
-__END_C__
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Obj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Obj.c b/clownfish/runtime/core/Clownfish/Obj.c
deleted file mode 100644
index d76ea19..0000000
--- a/clownfish/runtime/core/Clownfish/Obj.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_OBJ
-#define C_CFISH_VTABLE
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "Clownfish/Obj.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/VTable.h"
-#include "Clownfish/Util/Memory.h"
-
-Obj*
-Obj_init(Obj *self) {
-    ABSTRACT_CLASS_CHECK(self, OBJ);
-    return self;
-}
-
-void
-Obj_Destroy_IMP(Obj *self) {
-    FREEMEM(self);
-}
-
-int32_t
-Obj_Hash_Sum_IMP(Obj *self) {
-    int64_t hash_sum = PTR_TO_I64(self);
-    return (int32_t)hash_sum;
-}
-
-bool
-Obj_Is_A_IMP(Obj *self, VTable *ancestor) {
-    VTable *vtable = self ? self->vtable : NULL;
-
-    while (vtable != NULL) {
-        if (vtable == ancestor) {
-            return true;
-        }
-        vtable = vtable->parent;
-    }
-
-    return false;
-}
-
-bool
-Obj_Equals_IMP(Obj *self, Obj *other) {
-    return (self == other);
-}
-
-String*
-Obj_To_String_IMP(Obj *self) {
-#if (SIZEOF_PTR == 4)
-    return Str_newf("%o@0x%x32", Obj_Get_Class_Name(self), self);
-#elif (SIZEOF_PTR == 8)
-    int64_t   iaddress   = PTR_TO_I64(self);
-    uint64_t  address    = (uint64_t)iaddress;
-    uint32_t  address_hi = address >> 32;
-    uint32_t  address_lo = address & 0xFFFFFFFF;
-    return Str_newf("%o@0x%x32%x32", Obj_Get_Class_Name(self), address_hi,
-                    address_lo);
-#else
-  #error "Unexpected pointer size."
-#endif
-}
-
-bool
-Obj_To_Bool_IMP(Obj *self) {
-    return !!Obj_To_I64(self);
-}
-
-VTable*
-Obj_Get_VTable_IMP(Obj *self) {
-    return self->vtable;
-}
-
-String*
-Obj_Get_Class_Name_IMP(Obj *self) {
-    return VTable_Get_Name(self->vtable);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Obj.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Obj.cfh b/clownfish/runtime/core/Clownfish/Obj.cfh
deleted file mode 100644
index fafccfc..0000000
--- a/clownfish/runtime/core/Clownfish/Obj.cfh
+++ /dev/null
@@ -1,192 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Base class for all objects.
- */
-
-public class Clownfish::Obj {
-
-    VTable *vtable;
-
-    /** Abstract initializer.
-     */
-    public inert Obj*
-    init(Obj* self);
-
-    /** Return an object's refcount.
-     */
-    uint32_t
-    Get_RefCount(Obj *self);
-
-    /** Increment an object's refcount.
-     *
-     * @return The object, allowing an assignment idiom.
-     */
-    incremented Obj*
-    Inc_RefCount(Obj *self);
-
-    /** NULL-safe invocation of Inc_RefCount().
-     *
-     * @return NULL if <code>self</code> is NULL, otherwise the return value
-     * of Inc_RefCount().
-     */
-    inert inline incremented Obj*
-    incref(Obj *self);
-
-    /** Decrement an object's refcount, calling Destroy() if it hits 0.
-     *
-     * @return the modified refcount.
-     */
-    uint32_t
-    Dec_RefCount(Obj *self);
-
-    /** NULL-safe invocation of Dec_RefCount().
-     *
-     * @return NULL if <code>self</code> is NULL, otherwise the return value
-     * of Dec_RefCount().
-     */
-    inert inline uint32_t
-    decref(Obj *self);
-
-    /** Return a host-language object wrapper for this object.
-     */
-    void*
-    To_Host(Obj *self);
-
-    /** Return a clone of the object.
-     */
-    public abstract incremented Obj*
-    Clone(Obj *self);
-
-    /** Generic destructor.  Frees the struct itself but not any complex
-     * member elements.
-     */
-    public void
-    Destroy(Obj *self);
-
-    /** Invoke the Destroy() method found in <code>vtable</code> on
-     * <code>self</code>.
-     *
-     * TODO: Eliminate this function if we can arrive at a proper SUPER syntax.
-     */
-    inert inline void
-    super_destroy(Obj *self, VTable *vtable);
-
-    /** Indicate whether two objects are the same.  By default, compares the
-     * memory address.
-     *
-     * @param other Another Obj.
-     */
-    public bool
-    Equals(Obj *self, Obj *other);
-
-    /** Indicate whether one object is less than, equal to, or greater than
-     * another.
-     *
-     * @param other Another Obj.
-     * @return 0 if the objects are equal, a negative number if
-     * <code>self</code> is less than <code>other</code>, and a positive
-     * number if <code>self</code> is greater than <code>other</code>.
-     */
-    public abstract int32_t
-    Compare_To(Obj *self, Obj *other);
-
-    /** Return a hash code for the object -- by default, the memory address.
-     */
-    public int32_t
-    Hash_Sum(Obj *self);
-
-    /** Return the object's VTable.
-     */
-    public VTable*
-    Get_VTable(Obj *self);
-
-    /** Return the name of the class that the object belongs to.
-     */
-    public String*
-    Get_Class_Name(Obj *self);
-
-    /** Indicate whether the object is a descendent of <code>ancestor</code>.
-     */
-    public bool
-    Is_A(Obj *self, VTable *ancestor);
-
-    /** Generic stringification: "ClassName@hex_mem_address".
-     */
-    public incremented String*
-    To_String(Obj *self);
-
-    /** Convert the object to a 64-bit integer.
-     */
-    public abstract int64_t
-    To_I64(Obj *self);
-
-    /** Convert the object to a double precision floating point number.
-     */
-    public abstract double
-    To_F64(Obj *self);
-
-    /** Evaluate the object in a boolean context.  By default, invokes
-     * To_I64() and returns true if it is non-zero.
-     */
-    public bool
-    To_Bool(Obj *self);
-
-    /** Update the internal state of the object to mimic that of
-     * <code>other</code>.
-     */
-    public abstract void
-    Mimic(Obj *self, Obj *other);
-}
-
-__C__
-static CFISH_INLINE void
-cfish_Obj_super_destroy(cfish_Obj *self, cfish_VTable *vtable) {
-    CFISH_Obj_Destroy_t super_destroy
-        = CFISH_SUPER_METHOD_PTR(vtable, CFISH_Obj_Destroy);
-    super_destroy(self);
-}
-
-#define CFISH_SUPER_DESTROY(_self, _vtable) \
-    cfish_Obj_super_destroy((cfish_Obj*)_self, _vtable)
-
-static CFISH_INLINE cfish_Obj*
-cfish_Obj_incref(cfish_Obj *self) {
-    if (self != NULL) { return CFISH_Obj_Inc_RefCount(self); }
-    else { return NULL; }
-}
-
-#define CFISH_INCREF(_self) cfish_Obj_incref((cfish_Obj*)_self)
-
-static CFISH_INLINE uint32_t
-cfish_Obj_decref(cfish_Obj *self) {
-    if (self != NULL) { return CFISH_Obj_Dec_RefCount(self); }
-    else { return 0; }
-}
-
-#define CFISH_DECREF(_self) cfish_Obj_decref((cfish_Obj*)_self)
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define SUPER_DESTROY(_self, _vtable)   CFISH_SUPER_DESTROY(_self, _vtable)
-  #define INCREF(_self)                   CFISH_INCREF(_self)
-  #define DECREF(_self)                   CFISH_DECREF(_self)
-#endif
-
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/String.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/String.c b/clownfish/runtime/core/Clownfish/String.c
deleted file mode 100644
index 9f691ad..0000000
--- a/clownfish/runtime/core/Clownfish/String.c
+++ /dev/null
@@ -1,921 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_STRING
-#define C_CFISH_STACKSTRING
-#define C_CFISH_STRINGITERATOR
-#define C_CFISH_STACKSTRINGITERATOR
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-
-#include "Clownfish/VTable.h"
-#include "Clownfish/String.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/Util/StringHelper.h"
-
-#define STR_STACKTOP(string) \
-    Str_StackTop(string, alloca(sizeof(StackStringIterator)))
-#define STR_STACKTAIL(string) \
-    Str_StackTail(string, alloca(sizeof(StackStringIterator)))
-
-// Helper function for throwing invalid UTF-8 error. Since THROW uses
-// a String internally, calling THROW with invalid UTF-8 would create an
-// infinite loop -- so we fwrite some of the bogus text to stderr and
-// invoke THROW with a generic message.
-#define DIE_INVALID_UTF8(text, size) \
-    S_die_invalid_utf8(text, size, __FILE__, __LINE__, CFISH_ERR_FUNC_MACRO)
-static void
-S_die_invalid_utf8(const char *text, size_t size, const char *file, int line,
-                   const char *func);
-
-String*
-Str_new_from_utf8(const char *utf8, size_t size) {
-    if (!StrHelp_utf8_valid(utf8, size)) {
-        DIE_INVALID_UTF8(utf8, size);
-    }
-    String *self = (String*)VTable_Make_Obj(STRING);
-    return Str_init_from_trusted_utf8(self, utf8, size);
-}
-
-String*
-Str_new_from_trusted_utf8(const char *utf8, size_t size) {
-    String *self = (String*)VTable_Make_Obj(STRING);
-    return Str_init_from_trusted_utf8(self, utf8, size);
-}
-
-String*
-Str_init_from_trusted_utf8(String *self, const char *utf8, size_t size) {
-    // Allocate.
-    char *ptr = (char*)MALLOCATE(size + 1);
-
-    // Copy.
-    memcpy(ptr, utf8, size);
-    ptr[size] = '\0'; // Null terminate.
-
-    // Assign.
-    self->ptr    = ptr;
-    self->size   = size;
-    self->origin = self;
-
-    return self;
-}
-
-String*
-Str_new_steal_utf8(char *utf8, size_t size) {
-    if (!StrHelp_utf8_valid(utf8, size)) {
-        DIE_INVALID_UTF8(utf8, size);
-    }
-    String *self = (String*)VTable_Make_Obj(STRING);
-    return Str_init_steal_trusted_utf8(self, utf8, size);
-}
-
-String*
-Str_new_steal_trusted_utf8(char *utf8, size_t size) {
-    String *self = (String*)VTable_Make_Obj(STRING);
-    return Str_init_steal_trusted_utf8(self, utf8, size);
-}
-
-String*
-Str_init_steal_trusted_utf8(String *self, char *utf8, size_t size) {
-    self->ptr    = utf8;
-    self->size   = size;
-    self->origin = self;
-    return self;
-}
-
-String*
-Str_new_wrap_utf8(const char *utf8, size_t size) {
-    if (!StrHelp_utf8_valid(utf8, size)) {
-        DIE_INVALID_UTF8(utf8, size);
-    }
-    String *self = (String*)VTable_Make_Obj(STRING);
-    return Str_init_wrap_trusted_utf8(self, utf8, size);
-}
-
-String*
-Str_new_wrap_trusted_utf8(const char *utf8, size_t size) {
-    String *self = (String*)VTable_Make_Obj(STRING);
-    return Str_init_wrap_trusted_utf8(self, utf8, size);
-}
-
-String*
-Str_init_wrap_trusted_utf8(String *self, const char *ptr, size_t size) {
-    self->ptr    = ptr;
-    self->size   = size;
-    self->origin = NULL;
-    return self;
-}
-
-String*
-Str_new_from_char(int32_t code_point) {
-    const size_t MAX_UTF8_BYTES = 4;
-    char   *ptr  = (char*)MALLOCATE(MAX_UTF8_BYTES + 1);
-    size_t  size = StrHelp_encode_utf8_char(code_point, (uint8_t*)ptr);
-    ptr[size] = '\0';
-
-    String *self = (String*)VTable_Make_Obj(STRING);
-    self->ptr    = ptr;
-    self->size   = size;
-    self->origin = self;
-    return self;
-}
-
-String*
-Str_newf(const char *pattern, ...) {
-    CharBuf *buf = CB_new(strlen(pattern));
-    va_list args;
-    va_start(args, pattern);
-    CB_VCatF(buf, pattern, args);
-    va_end(args);
-    String *self = CB_Yield_String(buf);
-    DECREF(buf);
-    return self;
-}
-
-static String*
-S_new_substring(String *string, size_t byte_offset, size_t size) {
-    String *self = (String*)VTable_Make_Obj(STRING);
-
-    if (string->origin == NULL) {
-        // Copy substring of wrapped strings.
-        Str_init_from_trusted_utf8(self, string->ptr + byte_offset, size);
-    }
-    else {
-        self->ptr    = string->ptr + byte_offset;
-        self->size   = size;
-        self->origin = (String*)INCREF(string->origin);
-    }
-
-    return self;
-}
-
-Obj*
-Str_Inc_RefCount_IMP(String *self) {
-    if (self->origin == NULL) {
-        // Copy wrapped strings when the refcount is increased.
-        String *copy = (String*)VTable_Make_Obj(STRING);
-        return (Obj*)Str_init_from_trusted_utf8(copy, self->ptr, self->size);
-    }
-    else {
-        Str_Inc_RefCount_t super_incref
-            = SUPER_METHOD_PTR(STRING, CFISH_Str_Inc_RefCount);
-        return super_incref(self);
-    }
-}
-
-void
-Str_Destroy_IMP(String *self) {
-    if (self->origin == self) {
-        FREEMEM((char*)self->ptr);
-    }
-    else {
-        DECREF(self->origin);
-    }
-    SUPER_DESTROY(self, STRING);
-}
-
-int32_t
-Str_Hash_Sum_IMP(String *self) {
-    uint32_t hashvalue = 5381;
-    StackStringIterator *iter = STR_STACKTOP(self);
-
-    const SStrIter_Next_t next
-        = METHOD_PTR(STACKSTRINGITERATOR, CFISH_SStrIter_Next);
-    int32_t code_point;
-    while (STRITER_DONE != (code_point = next(iter))) {
-        hashvalue = ((hashvalue << 5) + hashvalue) ^ code_point;
-    }
-
-    return (int32_t) hashvalue;
-}
-
-static void
-S_die_invalid_utf8(const char *text, size_t size, const char *file, int line,
-                   const char *func) {
-    fprintf(stderr, "Invalid UTF-8, aborting: '");
-    fwrite(text, sizeof(char), size < 200 ? size : 200, stderr);
-    if (size > 200) { fwrite("[...]", sizeof(char), 5, stderr); }
-    fprintf(stderr, "' (length %lu)\n", (unsigned long)size);
-    Err_throw_at(ERR, file, line, func, "Invalid UTF-8");
-}
-
-String*
-Str_To_String_IMP(String *self) {
-    return (String*)INCREF(self);
-}
-
-String*
-Str_Swap_Chars_IMP(String *self, int32_t match, int32_t replacement) {
-    CharBuf *charbuf = CB_new(self->size);
-    StackStringIterator *iter = STR_STACKTOP(self);
-    int32_t code_point;
-
-    while (STRITER_DONE != (code_point = SStrIter_Next(iter))) {
-        if (code_point == match) { code_point = replacement; }
-        CB_Cat_Char(charbuf, code_point);
-    }
-
-    String *retval = CB_Yield_String(charbuf);
-    DECREF(charbuf);
-    return retval;
-}
-
-int64_t
-Str_To_I64_IMP(String *self) {
-    return Str_BaseX_To_I64(self, 10);
-}
-
-int64_t
-Str_BaseX_To_I64_IMP(String *self, uint32_t base) {
-    StackStringIterator *iter = STR_STACKTOP(self);
-    int64_t retval = 0;
-    bool is_negative = false;
-    int32_t code_point = SStrIter_Next(iter);
-
-    // Advance past minus sign.
-    if (code_point == '-') {
-        code_point = SStrIter_Next(iter);
-        is_negative = true;
-    }
-
-    // Accumulate.
-    while (code_point != STRITER_DONE) {
-        if (isalnum(code_point)) {
-            int32_t addend = isdigit(code_point)
-                             ? code_point - '0'
-                             : tolower(code_point) - 'a' + 10;
-            if (addend > (int32_t)base) { break; }
-            retval *= base;
-            retval += addend;
-        }
-        else {
-            break;
-        }
-        code_point = SStrIter_Next(iter);
-    }
-
-    // Apply minus sign.
-    if (is_negative) { retval = 0 - retval; }
-
-    return retval;
-}
-
-static double
-S_safe_to_f64(String *self) {
-    size_t amount = self->size < 511 ? self->size : 511;
-    char buf[512];
-    memcpy(buf, self->ptr, amount);
-    buf[amount] = 0; // NULL-terminate.
-    return strtod(buf, NULL);
-}
-
-double
-Str_To_F64_IMP(String *self) {
-    char   *end;
-    double  value    = strtod(self->ptr, &end);
-    size_t  consumed = end - self->ptr;
-    if (consumed > self->size) { // strtod overran
-        value = S_safe_to_f64(self);
-    }
-    return value;
-}
-
-char*
-Str_To_Utf8_IMP(String *self) {
-    char *buf = (char*)malloc(self->size + 1);
-    memcpy(buf, self->ptr, self->size);
-    buf[self->size] = '\0'; // NULL-terminate.
-    return buf;
-}
-
-String*
-Str_Clone_IMP(String *self) {
-    return (String*)INCREF(self);
-}
-
-String*
-Str_Cat_IMP(String *self, String *other) {
-    return Str_Cat_Trusted_Utf8(self, other->ptr, other->size);
-}
-
-String*
-Str_Cat_Utf8_IMP(String *self, const char* ptr, size_t size) {
-    if (!StrHelp_utf8_valid(ptr, size)) {
-        DIE_INVALID_UTF8(ptr, size);
-    }
-    return Str_Cat_Trusted_Utf8(self, ptr, size);
-}
-
-String*
-Str_Cat_Trusted_Utf8_IMP(String *self, const char* ptr, size_t size) {
-    size_t  result_size = self->size + size;
-    char   *result_ptr  = (char*)MALLOCATE(result_size + 1);
-    memcpy(result_ptr, self->ptr, self->size);
-    memcpy(result_ptr + self->size, ptr, size);
-    result_ptr[result_size] = '\0';
-    String *result = (String*)VTable_Make_Obj(STRING);
-    return Str_init_steal_trusted_utf8(result, result_ptr, result_size);
-}
-
-bool
-Str_Starts_With_IMP(String *self, String *prefix) {
-    return Str_Starts_With_Utf8_IMP(self, prefix->ptr, prefix->size);
-}
-
-bool
-Str_Starts_With_Utf8_IMP(String *self, const char *prefix, size_t size) {
-    if (size <= self->size
-        && (memcmp(self->ptr, prefix, size) == 0)
-       ) {
-        return true;
-    }
-    else {
-        return false;
-    }
-}
-
-bool
-Str_Equals_IMP(String *self, Obj *other) {
-    String *const twin = (String*)other;
-    if (twin == self)              { return true; }
-    if (!Obj_Is_A(other, STRING)) { return false; }
-    return Str_Equals_Utf8_IMP(self, twin->ptr, twin->size);
-}
-
-int32_t
-Str_Compare_To_IMP(String *self, Obj *other) {
-    CERTIFY(other, STRING);
-    return Str_compare(&self, &other);
-}
-
-bool
-Str_Equals_Utf8_IMP(String *self, const char *ptr, size_t size) {
-    if (self->size != size) {
-        return false;
-    }
-    return (memcmp(self->ptr, ptr, self->size) == 0);
-}
-
-bool
-Str_Ends_With_IMP(String *self, String *postfix) {
-    return Str_Ends_With_Utf8_IMP(self, postfix->ptr, postfix->size);
-}
-
-bool
-Str_Ends_With_Utf8_IMP(String *self, const char *postfix, size_t postfix_len) {
-    if (postfix_len <= self->size) {
-        const char *start = self->ptr + self->size - postfix_len;
-        if (memcmp(start, postfix, postfix_len) == 0) {
-            return true;
-        }
-    }
-
-    return false;
-}
-
-int64_t
-Str_Find_IMP(String *self, String *substring) {
-    return Str_Find_Utf8(self, substring->ptr, substring->size);
-}
-
-int64_t
-Str_Find_Utf8_IMP(String *self, const char *ptr, size_t size) {
-    StackStringIterator *iter = STR_STACKTOP(self);
-    int64_t location = 0;
-
-    while (iter->byte_offset + size <= self->size) {
-        if (memcmp(self->ptr + iter->byte_offset, ptr, size) == 0) {
-            return location;
-        }
-        SStrIter_Advance(iter, 1);
-        location++;
-    }
-
-    return -1;
-}
-
-String*
-Str_Trim_IMP(String *self) {
-    StackStringIterator *top = STR_STACKTOP(self);
-    SStrIter_Skip_Next_Whitespace(top);
-
-    StackStringIterator *tail = NULL;
-    if (top->byte_offset < self->size) {
-        tail = STR_STACKTAIL(self);
-        SStrIter_Skip_Prev_Whitespace(tail);
-    }
-
-    return StrIter_substring((StringIterator*)top, (StringIterator*)tail);
-}
-
-String*
-Str_Trim_Top_IMP(String *self) {
-    StackStringIterator *top = STR_STACKTOP(self);
-    SStrIter_Skip_Next_Whitespace(top);
-    return StrIter_substring((StringIterator*)top, NULL);
-}
-
-String*
-Str_Trim_Tail_IMP(String *self) {
-    StackStringIterator *tail = STR_STACKTAIL(self);
-    SStrIter_Skip_Prev_Whitespace(tail);
-    return StrIter_substring(NULL, (StringIterator*)tail);
-}
-
-size_t
-Str_Length_IMP(String *self) {
-    StackStringIterator *iter = STR_STACKTOP(self);
-    return SStrIter_Advance(iter, SIZE_MAX);
-}
-
-int32_t
-Str_Code_Point_At_IMP(String *self, size_t tick) {
-    StackStringIterator *iter = STR_STACKTOP(self);
-    SStrIter_Advance(iter, tick);
-    int32_t code_point = SStrIter_Next(iter);
-    return code_point == STRITER_DONE ? 0 : code_point;
-}
-
-int32_t
-Str_Code_Point_From_IMP(String *self, size_t tick) {
-    if (tick == 0) { return 0; }
-    StackStringIterator *iter = STR_STACKTAIL(self);
-    SStrIter_Recede(iter, tick - 1);
-    int32_t code_point = SStrIter_Prev(iter);
-    return code_point == STRITER_DONE ? 0 : code_point;
-}
-
-String*
-Str_SubString_IMP(String *self, size_t offset, size_t len) {
-    StackStringIterator *iter = STR_STACKTOP(self);
-
-    SStrIter_Advance(iter, offset);
-    size_t start_offset = iter->byte_offset;
-
-    SStrIter_Advance(iter, len);
-    size_t size = iter->byte_offset - start_offset;
-
-    return S_new_substring(self, start_offset, size);
-}
-
-int
-Str_compare(const void *va, const void *vb) {
-    String *a = *(String**)va;
-    String *b = *(String**)vb;
-    size_t min_size;
-    int    tie;
-
-    if (a->size <= b->size) {
-        min_size = a->size;
-        tie      = a->size < b->size ? -1 : 0;
-    }
-    else {
-        min_size = b->size;
-        tie      = 1;
-    }
-
-    int comparison = memcmp(a->ptr, b->ptr, min_size);
-    if (comparison < 0) { return -1; }
-    if (comparison > 0) { return 1; }
-
-    return tie;
-}
-
-bool
-Str_less_than(const void *va, const void *vb) {
-    return Str_compare(va, vb) < 0 ? true : false;
-}
-
-size_t
-Str_Get_Size_IMP(String *self) {
-    return self->size;
-}
-
-const char*
-Str_Get_Ptr8_IMP(String *self) {
-    return self->ptr;
-}
-
-StringIterator*
-Str_Top_IMP(String *self) {
-    return StrIter_new(self, 0);
-}
-
-StringIterator*
-Str_Tail_IMP(String *self) {
-    return StrIter_new(self, self->size);
-}
-
-StackStringIterator*
-Str_StackTop_IMP(String *self, void *allocation) {
-    return SStrIter_new(allocation, self, 0);
-}
-
-StackStringIterator*
-Str_StackTail_IMP(String *self, void *allocation) {
-    return SStrIter_new(allocation, self, self->size);
-}
-
-/*****************************************************************/
-
-StackString*
-SStr_new_from_str(void *allocation, size_t alloc_size, String *string) {
-    size_t  size = string->size;
-    char   *ptr  = ((char*)allocation) + sizeof(StackString);
-
-    if (alloc_size < sizeof(StackString) + size + 1) {
-        THROW(ERR, "alloc_size of StackString too small");
-    }
-
-    memcpy(ptr, string->ptr, size);
-    ptr[size] = '\0';
-
-    StackString *self = (StackString*)VTable_Init_Obj(STACKSTRING, allocation);
-    self->ptr    = ptr;
-    self->size   = size;
-    self->origin = NULL;
-    return self;
-}
-
-StackString*
-SStr_wrap_str(void *allocation, const char *ptr, size_t size) {
-    StackString *self
-        = (StackString*)VTable_Init_Obj(STACKSTRING, allocation);
-    self->size   = size;
-    self->ptr    = ptr;
-    self->origin = NULL;
-    return self;
-}
-
-StackString*
-SStr_wrap(void *allocation, String *source) {
-    return SStr_wrap_str(allocation, source->ptr, source->size);
-}
-
-size_t
-SStr_size() {
-    return sizeof(StackString);
-}
-
-void
-SStr_Destroy_IMP(StackString *self) {
-    THROW(ERR, "Can't destroy a StackString ('%o')", self);
-}
-
-/*****************************************************************/
-
-StringIterator*
-StrIter_new(String *string, size_t byte_offset) {
-    StringIterator *self = (StringIterator*)VTable_Make_Obj(STRINGITERATOR);
-    self->string      = (String*)INCREF(string);
-    self->byte_offset = byte_offset;
-    return self;
-}
-
-String*
-StrIter_substring(StringIterator *top, StringIterator *tail) {
-    String *string;
-    size_t  top_offset;
-    size_t  tail_offset;
-
-    if (tail == NULL) {
-        if (top == NULL) {
-            THROW(ERR, "StrIter_substring: Both top and tail are NULL");
-        }
-        string      = top->string;
-        tail_offset = string->size;
-    }
-    else {
-        string = tail->string;
-        if (top != NULL && string != top->string) {
-            THROW(ERR, "StrIter_substring: strings don't match");
-        }
-
-        tail_offset = tail->byte_offset;
-        if (tail_offset > string->size) {
-            THROW(ERR, "Invalid StringIterator offset");
-        }
-    }
-
-    if (top == NULL) {
-        top_offset = 0;
-    }
-    else {
-        top_offset = top->byte_offset;
-        if (top_offset > tail_offset) {
-            THROW(ERR, "StrIter_substring: top is behind tail");
-        }
-    }
-
-    return S_new_substring(string, top_offset, tail_offset - top_offset);
-}
-
-StringIterator*
-StrIter_Clone_IMP(StringIterator *self) {
-    return StrIter_new(self->string, self->byte_offset);
-}
-
-void
-StrIter_Assign_IMP(StringIterator *self, StringIterator *other) {
-    if (self->string != other->string) {
-        DECREF(self->string);
-        self->string = (String*)INCREF(other->string);
-    }
-    self->byte_offset = other->byte_offset;
-}
-
-bool
-StrIter_Equals_IMP(StringIterator *self, Obj *other) {
-    StringIterator *const twin = (StringIterator*)other;
-    if (twin == self)                     { return true; }
-    if (!Obj_Is_A(other, STRINGITERATOR)) { return false; }
-    return self->string == twin->string
-           && self->byte_offset == twin->byte_offset;
-}
-
-int32_t
-StrIter_Compare_To_IMP(StringIterator *self, Obj *other) {
-    StringIterator *twin = (StringIterator*)CERTIFY(other, STRINGITERATOR);
-    if (self->string != twin->string) {
-        THROW(ERR, "Can't compare iterators of different strings");
-    }
-    if (self->byte_offset < twin->byte_offset) { return -1; }
-    if (self->byte_offset > twin->byte_offset) { return 1; }
-    return 0;
-}
-
-bool
-StrIter_Has_Next_IMP(StringIterator *self) {
-    return self->byte_offset < self->string->size;
-}
-
-bool
-StrIter_Has_Prev_IMP(StringIterator *self) {
-    return self->byte_offset != 0;
-}
-
-int32_t
-StrIter_Next_IMP(StringIterator *self) {
-    String *string      = self->string;
-    size_t  byte_offset = self->byte_offset;
-    size_t  size        = string->size;
-
-    if (byte_offset >= size) { return STRITER_DONE; }
-
-    const uint8_t *const ptr = (const uint8_t*)string->ptr;
-    int32_t retval = ptr[byte_offset++];
-
-    if (retval >= 0x80) {
-        /*
-         * The 'mask' bit is tricky. In each iteration, 'retval' is
-         * left-shifted by 6 and 'mask' by 5 bits. So relative to the first
-         * byte of the sequence, 'mask' moves one bit to the right.
-         *
-         * The possible outcomes after the loop are:
-         *
-         * Two byte sequence
-         * retval: 110aaaaa bbbbbb
-         * mask:   00100000 000000
-         *
-         * Three byte sequence
-         * retval: 1110aaaa bbbbbb cccccc
-         * mask:   00010000 000000 000000
-         *
-         * Four byte sequence
-         * retval: 11110aaa bbbbbb cccccc dddddd
-         * mask:   00001000 000000 000000 000000
-         *
-         * This also illustrates why the exit condition (retval & mask)
-         * works. After the first iteration, the third most significant bit
-         * is tested. After the second iteration, the fourth, and so on.
-         */
-
-        int32_t mask = 1 << 6;
-
-        do {
-            if (byte_offset >= size) {
-                THROW(ERR, "StrIter_Next: Invalid UTF-8");
-            }
-
-            retval = (retval << 6) | (ptr[byte_offset++] & 0x3F);
-            mask <<= 5;
-        } while (retval & mask);
-
-        retval &= mask - 1;
-    }
-
-    self->byte_offset = byte_offset;
-    return retval;
-}
-
-int32_t
-StrIter_Prev_IMP(StringIterator *self) {
-    size_t byte_offset = self->byte_offset;
-
-    if (byte_offset == 0) { return STRITER_DONE; }
-
-    const uint8_t *const ptr = (const uint8_t*)self->string->ptr;
-    int32_t retval = ptr[--byte_offset];
-
-    if (retval >= 0x80) {
-        // Construct the result from right to left.
-
-        if (byte_offset == 0) {
-            THROW(ERR, "StrIter_Prev: Invalid UTF-8");
-        }
-
-        retval &= 0x3F;
-        int shift = 6;
-        int32_t first_byte_mask = 0x1F;
-        int32_t byte = ptr[--byte_offset];
-
-        while ((byte & 0xC0) == 0x80) {
-            if (byte_offset == 0) {
-                THROW(ERR, "StrIter_Prev: Invalid UTF-8");
-            }
-
-            retval |= (byte & 0x3F) << shift;
-            shift += 6;
-            first_byte_mask >>= 1;
-            byte = ptr[--byte_offset];
-        }
-
-        retval |= (byte & first_byte_mask) << shift;
-    }
-
-    self->byte_offset = byte_offset;
-    return retval;
-}
-
-size_t
-StrIter_Advance_IMP(StringIterator *self, size_t num) {
-    size_t num_skipped = 0;
-    size_t byte_offset = self->byte_offset;
-    size_t size        = self->string->size;
-    const uint8_t *const ptr = (const uint8_t*)self->string->ptr;
-
-    while (num_skipped < num) {
-        if (byte_offset >= size) {
-            break;
-        }
-        uint8_t first_byte = ptr[byte_offset];
-        byte_offset += StrHelp_UTF8_COUNT[first_byte];
-        ++num_skipped;
-    }
-
-    if (byte_offset > size) {
-        THROW(ERR, "StrIter_Advance: Invalid UTF-8");
-    }
-
-    self->byte_offset = byte_offset;
-    return num_skipped;
-}
-
-size_t
-StrIter_Recede_IMP(StringIterator *self, size_t num) {
-    size_t num_skipped = 0;
-    size_t byte_offset = self->byte_offset;
-    const uint8_t *const ptr = (const uint8_t*)self->string->ptr;
-
-    while (num_skipped < num) {
-        if (byte_offset == 0) {
-            break;
-        }
-
-        uint8_t byte;
-        do {
-            if (byte_offset == 0) {
-                THROW(ERR, "StrIter_Recede: Invalid UTF-8");
-            }
-
-            byte = ptr[--byte_offset];
-        } while ((byte & 0xC0) == 0x80);
-        ++num_skipped;
-    }
-
-    self->byte_offset = byte_offset;
-    return num_skipped;
-}
-
-size_t
-StrIter_Skip_Next_Whitespace_IMP(StringIterator *self) {
-    size_t  num_skipped = 0;
-    size_t  byte_offset = self->byte_offset;
-    int32_t code_point;
-
-    while (STRITER_DONE != (code_point = StrIter_Next(self))) {
-        if (!StrHelp_is_whitespace(code_point)) { break; }
-        byte_offset = self->byte_offset;
-        ++num_skipped;
-    }
-
-    self->byte_offset = byte_offset;
-    return num_skipped;
-}
-
-size_t
-StrIter_Skip_Prev_Whitespace_IMP(StringIterator *self) {
-    size_t  num_skipped = 0;
-    size_t  byte_offset = self->byte_offset;
-    int32_t code_point;
-
-    while (STRITER_DONE != (code_point = StrIter_Prev(self))) {
-        if (!StrHelp_is_whitespace(code_point)) { break; }
-        byte_offset = self->byte_offset;
-        ++num_skipped;
-    }
-
-    self->byte_offset = byte_offset;
-    return num_skipped;
-}
-
-bool
-StrIter_Starts_With_IMP(StringIterator *self, String *prefix) {
-    return StrIter_Starts_With_Utf8_IMP(self, prefix->ptr, prefix->size);
-}
-
-bool
-StrIter_Starts_With_Utf8_IMP(StringIterator *self, const char *prefix,
-                             size_t size) {
-    String *string      = self->string;
-    size_t  byte_offset = self->byte_offset;
-
-    if (byte_offset > string->size) {
-        THROW(ERR, "Invalid StringIterator offset");
-    }
-
-    if (string->size - byte_offset < size) { return false; }
-
-    return memcmp(string->ptr + byte_offset, prefix, size) == 0;
-}
-
-bool
-StrIter_Ends_With_IMP(StringIterator *self, String *postfix) {
-    return StrIter_Ends_With_Utf8_IMP(self, postfix->ptr, postfix->size);
-}
-
-bool
-StrIter_Ends_With_Utf8_IMP(StringIterator *self, const char *postfix,
-                           size_t size) {
-    String *string      = self->string;
-    size_t  byte_offset = self->byte_offset;
-
-    if (byte_offset > string->size) {
-        THROW(ERR, "Invalid StringIterator offset");
-    }
-
-    if (byte_offset < size) { return false; }
-
-    return memcmp(string->ptr + byte_offset - size, postfix, size) == 0;
-}
-
-void
-StrIter_Destroy_IMP(StringIterator *self) {
-    DECREF(self->string);
-    SUPER_DESTROY(self, STRINGITERATOR);
-}
-
-/*****************************************************************/
-
-StackStringIterator*
-SStrIter_new(void *allocation, String *string, size_t byte_offset) {
-    StackStringIterator *self
-        = (StackStringIterator*)VTable_Init_Obj(STACKSTRINGITERATOR,
-                                                allocation);
-    // Assume that the string will be available for the lifetime of the
-    // iterator and don't increase its refcount.
-    self->string      = string;
-    self->byte_offset = byte_offset;
-    return self;
-}
-
-void
-SStrIter_Destroy_IMP(StackStringIterator *self) {
-    UNUSED_VAR(self);
-    THROW(ERR, "Can't destroy a StackStringIterator");
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/String.cfh b/clownfish/runtime/core/Clownfish/String.cfh
deleted file mode 100644
index 8a065cb..0000000
--- a/clownfish/runtime/core/Clownfish/String.cfh
+++ /dev/null
@@ -1,449 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/**
- * Immutable string holding Unicode characters.
- */
-
-class Clownfish::String cnick Str
-    inherits Clownfish::Obj {
-
-    const char *ptr;
-    size_t      size;
-    String     *origin;
-
-    /** Return a new String which holds a copy of the passed-in string.
-     * Check for UTF-8 validity.
-     */
-    inert incremented String*
-    new_from_utf8(const char *utf8, size_t size);
-
-    /** Return a new String which holds a copy of the passed-in string.  No
-     * validity checking is performed.
-     */
-    inert incremented String*
-    new_from_trusted_utf8(const char *utf8, size_t size);
-
-    /** Initialize the String using the passed-in string.  Do not check
-     * validity of supplied UTF-8.
-     */
-    inert String*
-    init_from_trusted_utf8(String *self, const char *utf8, size_t size);
-
-    /** Return a pointer to a new String which assumes ownership of the
-     * passed-in string.  Check validity of supplied UTF-8.
-     */
-    inert incremented String*
-    new_steal_utf8(char *utf8, size_t size);
-
-    /** Return a pointer to a new String which assumes ownership of the
-     * passed-in string.  Do not check validity of supplied UTF-8.
-     */
-    inert incremented String*
-    new_steal_trusted_utf8(char *utf8, size_t size);
-
-    /** Initialize the String using the passed-in string.  Do not check
-     * validity of supplied UTF-8.
-     */
-    public inert String*
-    init_steal_trusted_utf8(String *self, char *utf8, size_t size);
-
-    /** Return a pointer to a new String which wraps an external buffer
-     * containing UTF-8.  The buffer must stay unchanged for the lifetime
-     * of the String.  Check validity of supplied UTF-8.
-     */
-    inert incremented String*
-    new_wrap_utf8(const char *utf8, size_t size);
-
-    /** Return a pointer to a new String which wraps an external buffer
-     * containing UTF-8.  The buffer must stay unchanged for the lifetime
-     * of the String.  Do not check validity of supplied UTF-8.
-     */
-    inert incremented String*
-    new_wrap_trusted_utf8(const char *utf8, size_t size);
-
-    /** Initialize the String which wraps an external buffer containing
-     * UTF-8.  Do not check validity of supplied UTF-8.
-     */
-    public inert String*
-    init_wrap_trusted_utf8(String *self, const char *utf8, size_t size);
-
-    /** Return a String which holds a single character.
-     */
-    inert incremented String*
-    new_from_char(int32_t code_point);
-
-    /** Return a pointer to a new String which contains formatted data
-     * expanded according to CB_VCatF.
-     *
-     * Note: a user-supplied <code>pattern</code> string is a security hole
-     * and must not be allowed.
-     */
-    inert incremented String*
-    newf(const char *pattern, ...);
-
-    /** Perform lexical comparison of two Strings, with level of indirection
-     * set to please qsort and friends.
-     */
-    inert int
-    compare(const void *va, const void *vb);
-
-    /** Perform lexical comparison of two Strings, with level of indirection
-     * set to please qsort and friends, and return true if <code>a</code> is
-     * less than <code>b</code>.
-     */
-    inert bool
-    less_than(const void *va, const void *vb);
-
-    /** Return the concatenation of the String and <code>other</code>.
-     */
-    incremented String*
-    Cat(String *self, String *other);
-
-    /** Return the concatenation of the String and the passed-in raw UTF-8.
-     */
-    incremented String*
-    Cat_Utf8(String *self, const char *ptr, size_t size);
-
-    /** Return the concatenation of the String and the passed-in raw UTF-8.
-     * Don't check for UTF-8 validity.
-     */
-    incremented String*
-    Cat_Trusted_Utf8(String *self, const char *ptr, size_t size);
-
-    /** Replace all instances of one character for the other.
-     *
-     * @return a new String with the characters replaced.
-     */
-    incremented String*
-    Swap_Chars(String *self, int32_t match, int32_t replacement);
-
-    public int64_t
-    To_I64(String *self);
-
-    /** Extract a 64-bit integer from a variable-base stringified version.
-     */
-    int64_t
-    BaseX_To_I64(String *self, uint32_t base);
-
-    public double
-    To_F64(String *self);
-
-    /** Test whether the String starts with the content of another.
-     */
-    bool
-    Starts_With(String *self, String *prefix);
-
-    /** Test whether the String starts with the passed-in string.
-     */
-    bool
-    Starts_With_Utf8(String *self, const char *prefix, size_t size);
-
-    /** Test whether the String ends with the content of another.
-     */
-    bool
-    Ends_With(String *self, String *postfix);
-
-    /** Test whether the String ends with the passed-in string.
-     */
-    bool
-    Ends_With_Utf8(String *self, const char *postfix, size_t size);
-
-    /** Return the location of the substring within the String (measured in
-     * code points), or -1 if the substring does not match.
-     */
-    int64_t
-    Find(String *self, String *substring);
-
-    int64_t
-    Find_Utf8(String *self, const char *ptr, size_t size);
-
-    /** Test whether the String matches the passed-in string.
-     */
-    bool
-    Equals_Utf8(String *self, const char *ptr, size_t size);
-
-    /** Return the number of Unicode code points in the object's string.
-     */
-    size_t
-    Length(String *self);
-
-    /** Get the String's <code>size</code> attribute.
-     */
-    size_t
-    Get_Size(String *self);
-
-    /** Return the internal backing array for the String if its internal
-     * encoding is UTF-8.  If it is not encoded as UTF-8 throw an exception.
-     */
-    const char*
-    Get_Ptr8(String *self);
-
-    /** Return a NULL-terminated copy of the string data in UTF-8 encoding.
-     * The buffer must be freed by the caller.
-     */
-    char*
-    To_Utf8(String *self);
-
-    public incremented String*
-    Clone(String *self);
-
-    incremented Obj*
-    Inc_RefCount(String *self);
-
-    public void
-    Destroy(String *self);
-
-    public bool
-    Equals(String *self, Obj *other);
-
-    public int32_t
-    Compare_To(String *self, Obj *other);
-
-    public int32_t
-    Hash_Sum(String *self);
-
-    public incremented String*
-    To_String(String *self);
-
-    /** Remove Unicode whitespace characters from both top and tail.
-     */
-    String*
-    Trim(String *self);
-
-    /** Remove leading Unicode whitespace.
-     */
-    String*
-    Trim_Top(String *self);
-
-    /** Remove trailing Unicode whitespace.
-     */
-    String*
-    Trim_Tail(String *self);
-
-    /** Return the Unicode code point at the specified number of code points
-     * in.  Return 0 if the string length is exceeded.  (XXX It would be
-     * better to throw an exception, but that's not practical with UTF-8 and
-     * no cached length.)
-     */
-    int32_t
-    Code_Point_At(String *self, size_t tick);
-
-    /** Return the Unicode code point at the specified number of code points
-     * counted backwards from the end of the string.  Return 0 if outside the
-     * string.
-     */
-    int32_t
-    Code_Point_From(String *self, size_t tick);
-
-    /** Return a newly allocated String containing a copy of the indicated
-     * substring.
-     * @param offset Offset from the top, in code points.
-     * @param len The desired length of the substring, in code points.
-     */
-    incremented String*
-    SubString(String *self, size_t offset, size_t len);
-
-    /** Return an iterator to the start of the string.
-     */
-    incremented StringIterator*
-    Top(String *self);
-
-    /** Return an iterator to the end of the string.
-     */
-    incremented StringIterator*
-    Tail(String *self);
-
-    /** Return a stack iterator to the start of the string.
-     */
-    incremented StackStringIterator*
-    StackTop(String *self, void *allocation);
-
-    /** Return a stack iterator to the end of the string.
-     */
-    incremented StackStringIterator*
-    StackTail(String *self, void *allocation);
-}
-
-class Clownfish::StackString cnick SStr
-    inherits Clownfish::String {
-
-    /**
-     * @param allocation A single block of memory which will be used for both
-     * the StackString object and its buffer.
-     * @param alloc_size The size of the allocation.
-     * @param string String to be copied.
-     */
-    inert incremented StackString*
-    new_from_str(void *allocation, size_t alloc_size, String *string);
-
-    inert incremented StackString*
-    wrap(void *allocation, String *source);
-
-    inert incremented StackString*
-    wrap_str(void *allocation, const char *ptr, size_t size);
-
-    /** Return the size for a StackString struct.
-     */
-    inert size_t
-    size();
-
-    /** Throws an error.
-     */
-    public void
-    Destroy(StackString *self);
-}
-
-class Clownfish::StringIterator cnick StrIter
-    inherits Clownfish::Obj {
-
-    String *string;
-    size_t  byte_offset;
-
-    inert incremented StringIterator*
-    new(String *string, size_t byte_offset);
-
-    /** Return the substring between the top and tail iterators.
-     * @param offset Top iterator. Use start of string if NULL.
-     * @param len Tail iterator. Use end of string if NULL.
-     */
-    inert incremented String*
-    substring(StringIterator *top, StringIterator *tail);
-
-    public incremented StringIterator*
-    Clone(StringIterator *self);
-
-    public void
-    Assign(StringIterator *self, StringIterator *other);
-
-    public bool
-    Equals(StringIterator *self, Obj *other);
-
-    public int32_t
-    Compare_To(StringIterator *self, Obj *other);
-
-    /** Return true if the iterator is not at the end of the string.
-     */
-    public bool
-    Has_Next(StringIterator *self);
-
-    /** Return true if the iterator is not at the start of the string.
-     */
-    public bool
-    Has_Prev(StringIterator *self);
-
-    /** Return the code point after the current position and advance the
-     * iterator. Return CFISH_STRITER_DONE at the end of the string.
-     */
-    public int32_t
-    Next(StringIterator *self);
-
-    /** Return the code point before the current position and go one step back.
-     * Return CFISH_STRITER_DONE at the start of the string.
-     */
-    public int32_t
-    Prev(StringIterator *self);
-
-    /** Skip code points.
-     * @param num The number of code points to skip.
-     * @return the number of code points actually skipped. This can be less
-     * than the requested number if the end of the string is reached.
-     */
-    public size_t
-    Advance(StringIterator *self, size_t num);
-
-    /** Skip code points backward.
-     * @param num The number of code points to skip.
-     * @return the number of code points actually skipped. This can be less
-     * than the requested number if the start of the string is reached.
-     */
-    public size_t
-    Recede(StringIterator *self, size_t num);
-
-    /** Skip whitespace.
-     * @return the number of code points skipped.
-     */
-    public size_t
-    Skip_Next_Whitespace(StringIterator *self);
-
-    /** Skip whitespace backward.
-     * @return the number of code points skipped.
-     */
-    public size_t
-    Skip_Prev_Whitespace(StringIterator *self);
-
-    /** Test whether the content after the iterator starts with
-     * <code>prefix</code>.
-     */
-    bool
-    Starts_With(StringIterator *self, String *prefix);
-
-    /** Test whether the content after the iterator starts with the passed-in
-     * string.
-     */
-    bool
-    Starts_With_Utf8(StringIterator *self, const char *prefix, size_t size);
-
-    /** Test whether the content before the iterator ends with
-     * <code>postfix</code>.
-     */
-    bool
-    Ends_With(StringIterator *self, String *postfix);
-
-    /** Test whether the content before the iterator ends with the passed-in
-     * string.
-     */
-    bool
-    Ends_With_Utf8(StringIterator *self, const char *postfix, size_t size);
-
-    public void
-    Destroy(StringIterator *self);
-}
-
-class Clownfish::StackStringIterator cnick SStrIter
-    inherits Clownfish::StringIterator {
-
-    inert incremented StackStringIterator*
-    new(void *allocation, String *string, size_t byte_offset);
-
-    public void
-    Destroy(StackStringIterator *self);
-}
-
-__C__
-
-#define CFISH_SSTR_BLANK() \
-   cfish_SStr_wrap_str(cfish_alloca(cfish_SStr_size()), "", 0)
-
-#define CFISH_SSTR_WRAP(source) \
-    cfish_SStr_wrap(cfish_alloca(cfish_SStr_size()), source)
-
-#define CFISH_SSTR_WRAP_UTF8(ptr, size) \
-    cfish_SStr_wrap_str(cfish_alloca(cfish_SStr_size()), ptr, size)
-
-#define CFISH_STRITER_DONE  -1
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define SSTR_BLANK             CFISH_SSTR_BLANK
-  #define SSTR_WRAP              CFISH_SSTR_WRAP
-  #define SSTR_WRAP_UTF8         CFISH_SSTR_WRAP_UTF8
-  #define STRITER_DONE           CFISH_STRITER_DONE
-#endif
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test.c b/clownfish/runtime/core/Clownfish/Test.c
deleted file mode 100644
index b891331..0000000
--- a/clownfish/runtime/core/Clownfish/Test.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test.h"
-
-#include "Clownfish/TestHarness/TestBatch.h"
-#include "Clownfish/TestHarness/TestSuite.h"
-
-#include "Clownfish/Test/TestByteBuf.h"
-#include "Clownfish/Test/TestString.h"
-#include "Clownfish/Test/TestCharBuf.h"
-#include "Clownfish/Test/TestErr.h"
-#include "Clownfish/Test/TestHash.h"
-#include "Clownfish/Test/TestLockFreeRegistry.h"
-#include "Clownfish/Test/TestNum.h"
-#include "Clownfish/Test/TestObj.h"
-#include "Clownfish/Test/TestVArray.h"
-#include "Clownfish/Test/Util/TestAtomic.h"
-#include "Clownfish/Test/Util/TestMemory.h"
-#include "Clownfish/Test/Util/TestNumberUtils.h"
-#include "Clownfish/Test/Util/TestStringHelper.h"
-
-TestSuite*
-Test_create_test_suite() {
-    TestSuite *suite = TestSuite_new();
-
-    TestSuite_Add_Batch(suite, (TestBatch*)TestVArray_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestHash_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestObj_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestErr_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestBB_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestStr_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestCB_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestNumUtil_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestNum_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestStrHelp_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestAtomic_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestLFReg_new());
-    TestSuite_Add_Batch(suite, (TestBatch*)TestMemory_new());
-
-    return suite;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test.cfh b/clownfish/runtime/core/Clownfish/Test.cfh
deleted file mode 100644
index 68dc8bc..0000000
--- a/clownfish/runtime/core/Clownfish/Test.cfh
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-/** Clownfish test suite.
- */
-inert class Clownfish::Test {
-    inert incremented TestSuite*
-    create_test_suite();
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c b/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
deleted file mode 100644
index dcea3b5..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestByteBuf.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestByteBuf.h"
-
-#include "Clownfish/ByteBuf.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
-
-TestByteBuf*
-TestBB_new() {
-    return (TestByteBuf*)VTable_Make_Obj(TESTBYTEBUF);
-}
-
-static void
-test_Equals(TestBatchRunner *runner) {
-    ByteBuf *wanted = BB_new_bytes("foo", 4); // Include terminating NULL.
-    ByteBuf *got    = BB_new_bytes("foo", 4);
-
-    TEST_TRUE(runner, BB_Equals(wanted, (Obj*)got), "Equals");
-    TEST_INT_EQ(runner, BB_Hash_Sum(got), BB_Hash_Sum(wanted), "Hash_Sum");
-
-    TEST_TRUE(runner, BB_Equals_Bytes(got, "foo", 4), "Equals_Bytes");
-    TEST_FALSE(runner, BB_Equals_Bytes(got, "foo", 3),
-               "Equals_Bytes spoiled by different size");
-    TEST_FALSE(runner, BB_Equals_Bytes(got, "bar", 4),
-               "Equals_Bytes spoiled by different content");
-
-    BB_Set_Size(got, 3);
-    TEST_FALSE(runner, BB_Equals(wanted, (Obj*)got),
-               "Different size spoils Equals");
-    TEST_FALSE(runner, BB_Hash_Sum(got) == BB_Hash_Sum(wanted),
-               "Different size spoils Hash_Sum (probably -- at least this one)");
-
-    BB_Mimic_Bytes(got, "bar", 4);
-    TEST_INT_EQ(runner, BB_Get_Size(wanted), BB_Get_Size(got),
-                "same length");
-    TEST_FALSE(runner, BB_Equals(wanted, (Obj*)got),
-               "Different content spoils Equals");
-
-    DECREF(got);
-    DECREF(wanted);
-}
-
-static void
-test_Grow(TestBatchRunner *runner) {
-    ByteBuf *bb = BB_new(1);
-    TEST_INT_EQ(runner, BB_Get_Capacity(bb), 8,
-                "Allocate in 8-byte increments");
-    BB_Grow(bb, 9);
-    TEST_INT_EQ(runner, BB_Get_Capacity(bb), 16,
-                "Grow in 8-byte increments");
-    DECREF(bb);
-}
-
-static void
-test_Clone(TestBatchRunner *runner) {
-    ByteBuf *bb = BB_new_bytes("foo", 3);
-    ByteBuf *twin = BB_Clone(bb);
-    TEST_TRUE(runner, BB_Equals(bb, (Obj*)twin), "Clone");
-    DECREF(bb);
-    DECREF(twin);
-}
-
-static void
-test_compare(TestBatchRunner *runner) {
-    ByteBuf *a = BB_new_bytes("foo\0a", 5);
-    ByteBuf *b = BB_new_bytes("foo\0b", 5);
-
-    BB_Set_Size(a, 4);
-    BB_Set_Size(b, 4);
-    TEST_INT_EQ(runner, BB_compare(&a, &b), 0,
-                "BB_compare returns 0 for equal ByteBufs");
-
-    BB_Set_Size(a, 3);
-    TEST_TRUE(runner, BB_compare(&a, &b) < 0, "shorter ByteBuf sorts first");
-
-    BB_Set_Size(a, 5);
-    BB_Set_Size(b, 5);
-    TEST_TRUE(runner, BB_compare(&a, &b) < 0,
-              "NULL doesn't interfere with BB_compare");
-
-    DECREF(a);
-    DECREF(b);
-}
-
-static void
-test_Mimic(TestBatchRunner *runner) {
-    ByteBuf *a = BB_new_bytes("foo", 3);
-    ByteBuf *b = BB_new(0);
-
-    BB_Mimic(b, (Obj*)a);
-    TEST_TRUE(runner, BB_Equals(a, (Obj*)b), "Mimic");
-
-    BB_Mimic_Bytes(a, "bar", 4);
-    TEST_TRUE(runner, strcmp(BB_Get_Buf(a), "bar") == 0,
-              "Mimic_Bytes content");
-    TEST_INT_EQ(runner, BB_Get_Size(a), 4, "Mimic_Bytes size");
-
-    BB_Mimic(b, (Obj*)a);
-    TEST_TRUE(runner, BB_Equals(a, (Obj*)b), "Mimic");
-
-    DECREF(a);
-    DECREF(b);
-}
-
-static void
-test_Cat(TestBatchRunner *runner) {
-    ByteBuf *wanted  = BB_new_bytes("foobar", 6);
-    ByteBuf *got     = BB_new_bytes("foo", 3);
-    ByteBuf *scratch = BB_new_bytes("bar", 3);
-
-    BB_Cat(got, scratch);
-    TEST_TRUE(runner, BB_Equals(wanted, (Obj*)got), "Cat");
-
-    BB_Mimic_Bytes(wanted, "foobarbaz", 9);
-    BB_Cat_Bytes(got, "baz", 3);
-    TEST_TRUE(runner, BB_Equals(wanted, (Obj*)got), "Cat_Bytes");
-
-    DECREF(scratch);
-    DECREF(got);
-    DECREF(wanted);
-}
-
-void
-TestBB_Run_IMP(TestByteBuf *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 21);
-    test_Equals(runner);
-    test_Grow(runner);
-    test_Clone(runner);
-    test_compare(runner);
-    test_Mimic(runner);
-    test_Cat(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestByteBuf.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestByteBuf.cfh b/clownfish/runtime/core/Clownfish/Test/TestByteBuf.cfh
deleted file mode 100644
index 3335c95..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestByteBuf.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestByteBuf cnick TestBB
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestByteBuf*
-    new();
-
-    void
-    Run(TestByteBuf *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c b/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
deleted file mode 100644
index 48c36a1..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestCharBuf.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Test/TestCharBuf.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
-
-static char smiley[] = { (char)0xE2, (char)0x98, (char)0xBA, 0 };
-static uint32_t smiley_len = 3;
-
-TestCharBuf*
-TestCB_new() {
-    return (TestCharBuf*)VTable_Make_Obj(TESTCHARBUF);
-}
-
-static CharBuf*
-S_get_cb(const char *string) {
-    return CB_new_from_utf8(string, strlen(string));
-}
-
-static String*
-S_get_str(const char *string) {
-    return Str_new_from_utf8(string, strlen(string));
-}
-
-static bool
-S_cb_equals(CharBuf *cb, String *other) {
-    String *string = CB_To_String(cb);
-    bool retval = Str_Equals(string, (Obj*)other);
-    DECREF(string);
-    return retval;
-}
-
-static void
-test_Cat(TestBatchRunner *runner) {
-    String  *wanted = Str_newf("a%s", smiley);
-    CharBuf *got    = S_get_cb("");
-
-    CB_Cat(got, wanted);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Cat");
-    DECREF(got);
-
-    got = S_get_cb("a");
-    CB_Cat_Char(got, 0x263A);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Cat_Char");
-    DECREF(got);
-
-    got = S_get_cb("a");
-    CB_Cat_Utf8(got, smiley, smiley_len);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Cat_Utf8");
-    DECREF(got);
-
-    got = S_get_cb("a");
-    CB_Cat_Trusted_Utf8(got, smiley, smiley_len);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Cat_Trusted_Utf8");
-    DECREF(got);
-
-    DECREF(wanted);
-}
-
-static void
-test_Mimic_and_Clone(TestBatchRunner *runner) {
-    String  *wanted    = S_get_str("foo");
-    CharBuf *wanted_cb = S_get_cb("foo");
-    CharBuf *got       = S_get_cb("bar");
-
-    CB_Mimic(got, (Obj*)wanted);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Mimic String");
-    DECREF(got);
-
-    got = S_get_cb("bar");
-    CB_Mimic(got, (Obj*)wanted_cb);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Mimic CharBuf");
-    DECREF(got);
-
-    got = S_get_cb("bar");
-    CB_Mimic_Utf8(got, "foo", 3);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Mimic_Utf8");
-    DECREF(got);
-
-    got = CB_Clone(wanted_cb);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Clone");
-    DECREF(got);
-
-    DECREF(wanted);
-}
-
-/*
-static void
-test_Truncate(TestBatchRunner *runner) {
-    String  *wanted = Str_newf("a%s", smiley);
-    CharBuf *got    = CB_newf("a%s%sb%sc", smiley, smiley, smiley);
-    CB_Truncate(got, 2);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "Truncate");
-    DECREF(wanted);
-    DECREF(got);
-}
-*/
-
-static void
-test_vcatf_s(TestBatchRunner *runner) {
-    String  *wanted = S_get_str("foo bar bizzle baz");
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %s baz", "bizzle");
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%s");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_null_string(TestBatchRunner *runner) {
-    String  *wanted = S_get_str("foo bar [NULL] baz");
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %s baz", NULL);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%s NULL");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_str(TestBatchRunner *runner) {
-    String  *wanted = S_get_str("foo bar ZEKE baz");
-    String  *catworthy = S_get_str("ZEKE");
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %o baz", catworthy);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%o CharBuf");
-    DECREF(catworthy);
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_obj(TestBatchRunner *runner) {
-    String    *wanted = S_get_str("ooga 20 booga");
-    Integer32 *i32 = Int32_new(20);
-    CharBuf   *got = S_get_cb("ooga");
-    CB_catf(got, " %o booga", i32);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%o Obj");
-    DECREF(i32);
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_null_obj(TestBatchRunner *runner) {
-    String  *wanted = S_get_str("foo bar [NULL] baz");
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %o baz", NULL);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%o NULL");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_i8(TestBatchRunner *runner) {
-    String *wanted = S_get_str("foo bar -3 baz");
-    int8_t num = -3;
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %i8 baz", num);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%i8");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_i32(TestBatchRunner *runner) {
-    String *wanted = S_get_str("foo bar -100000 baz");
-    int32_t num = -100000;
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %i32 baz", num);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%i32");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_i64(TestBatchRunner *runner) {
-    String *wanted = S_get_str("foo bar -5000000000 baz");
-    int64_t num = INT64_C(-5000000000);
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %i64 baz", num);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%i64");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_u8(TestBatchRunner *runner) {
-    String *wanted = S_get_str("foo bar 3 baz");
-    uint8_t num = 3;
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %u8 baz", num);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%u8");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_u32(TestBatchRunner *runner) {
-    String *wanted = S_get_str("foo bar 100000 baz");
-    uint32_t num = 100000;
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %u32 baz", num);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%u32");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_u64(TestBatchRunner *runner) {
-    String *wanted = S_get_str("foo bar 5000000000 baz");
-    uint64_t num = UINT64_C(5000000000);
-    CharBuf *got = S_get_cb("foo ");
-    CB_catf(got, "bar %u64 baz", num);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%u64");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_f64(TestBatchRunner *runner) {
-    String *wanted;
-    char buf[64];
-    float num = 1.3f;
-    CharBuf *got = S_get_cb("foo ");
-    sprintf(buf, "foo bar %g baz", num);
-    wanted = Str_new_from_trusted_utf8(buf, strlen(buf));
-    CB_catf(got, "bar %f64 baz", num);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%f64");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_vcatf_x32(TestBatchRunner *runner) {
-    String *wanted;
-    char buf[64];
-    unsigned long num = INT32_MAX;
-    CharBuf *got = S_get_cb("foo ");
-#if (SIZEOF_LONG == 4)
-    sprintf(buf, "foo bar %.8lx baz", num);
-#elif (SIZEOF_INT == 4)
-    sprintf(buf, "foo bar %.8x baz", (unsigned)num);
-#endif
-    wanted = Str_new_from_trusted_utf8(buf, strlen(buf));
-    CB_catf(got, "bar %x32 baz", (uint32_t)num);
-    TEST_TRUE(runner, S_cb_equals(got, wanted), "%%x32");
-    DECREF(wanted);
-    DECREF(got);
-}
-
-void
-TestCB_Run_IMP(TestCharBuf *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 21);
-    test_vcatf_s(runner);
-    test_vcatf_null_string(runner);
-    test_vcatf_str(runner);
-    test_vcatf_obj(runner);
-    test_vcatf_null_obj(runner);
-    test_vcatf_i8(runner);
-    test_vcatf_i32(runner);
-    test_vcatf_i64(runner);
-    test_vcatf_u8(runner);
-    test_vcatf_u32(runner);
-    test_vcatf_u64(runner);
-    test_vcatf_f64(runner);
-    test_vcatf_x32(runner);
-    test_Cat(runner);
-    test_Mimic_and_Clone(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestCharBuf.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestCharBuf.cfh b/clownfish/runtime/core/Clownfish/Test/TestCharBuf.cfh
deleted file mode 100644
index 3cc5d43..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestCharBuf.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestCharBuf cnick TestCB
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestCharBuf*
-    new();
-
-    void
-    Run(TestCharBuf *self, TestBatchRunner *runner);
-}
-
-


[lucy-commits] [38/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Adjust regen_charmonizer.pl after Clownfish removal

Posted by ma...@apache.org.
Adjust regen_charmonizer.pl after Clownfish removal


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/d4282a9a
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/d4282a9a
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/d4282a9a

Branch: refs/heads/sortex_ptr_only
Commit: d4282a9a244444127cebd481a309603425cf59cb
Parents: 920dca8
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Apr 23 16:40:52 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Apr 23 16:40:52 2014 +0200

----------------------------------------------------------------------
 devel/bin/regen_charmonizer.pl | 31 +++++--------------------------
 1 file changed, 5 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/d4282a9a/devel/bin/regen_charmonizer.pl
----------------------------------------------------------------------
diff --git a/devel/bin/regen_charmonizer.pl b/devel/bin/regen_charmonizer.pl
index 53e4f2a..916c85a 100755
--- a/devel/bin/regen_charmonizer.pl
+++ b/devel/bin/regen_charmonizer.pl
@@ -38,30 +38,9 @@ my $MELD_EXE = catfile( $CHAZ_DIR, 'buildbin', 'meld.pl' );
 die("Couldn't find meld.pl at $MELD_EXE")
     if !-e $MELD_EXE;
 
-# Clownfish compiler.
-{
-    my $main = catfile(qw( clownfish compiler common charmonizer.main ));
-    my $out  = $main;
-    $out =~ s/\.main/.c/ or die "no match";
-    unlink $out;
-    system( $MELD_EXE, "--probes=", "--files=$main", "--out=$out" );
-}
-
-# Clownfish runtime.
-{
-    my $main = catfile(qw( clownfish runtime common charmonizer.main ));
-    my $out  = $main;
-    $out =~ s/\.main/.c/ or die "no match";
-    unlink $out;
-    system( $MELD_EXE, '--probes=', "--files=$main", "--out=$out" );
-}
-
-# Lucy core.
-{
-    my $main = catfile(qw( common charmonizer.main ));
-    my $out  = $main;
-    $out =~ s/\.main/.c/ or die "no match";
-    unlink $out;
-    system( $MELD_EXE, '--probes=', "--files=$main", "--out=$out" );
-}
+my $main = catfile(qw( common charmonizer.main ));
+my $out  = $main;
+$out =~ s/\.main/.c/ or die "no match";
+unlink $out;
+system( $MELD_EXE, '--probes=', "--files=$main", "--out=$out" );
 


[lucy-commits] [05/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestErr.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestErr.c b/clownfish/runtime/core/Clownfish/Test/TestErr.c
deleted file mode 100644
index 5627d7d..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestErr.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestErr.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
-
-TestErr*
-TestErr_new() {
-    return (TestErr*)VTable_Make_Obj(TESTERR);
-}
-
-static void
-test_To_String(TestBatchRunner *runner) {
-    String *message = Str_newf("oops");
-    Err *error = Err_new(message);
-    String *string = Err_To_String(error);
-    TEST_TRUE(runner, Str_Equals(message, (Obj*)string),
-              "Stringifies as message");
-    DECREF(string);
-    DECREF(error);
-}
-
-void
-TestErr_Run_IMP(TestErr *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 1);
-    test_To_String(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestErr.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestErr.cfh b/clownfish/runtime/core/Clownfish/Test/TestErr.cfh
deleted file mode 100644
index 178017c..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestErr.cfh
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestErr
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestErr*
-    new();
-
-    void
-    Run(TestErr *self, TestBatchRunner *runner);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestHash.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestHash.c b/clownfish/runtime/core/Clownfish/Test/TestHash.c
deleted file mode 100644
index e5000c9..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestHash.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <time.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestHash.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Hash.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
-
-TestHash*
-TestHash_new() {
-    return (TestHash*)VTable_Make_Obj(TESTHASH);
-}
-
-static void
-test_Equals(TestBatchRunner *runner) {
-    Hash *hash  = Hash_new(0);
-    Hash *other = Hash_new(0);
-    StackString *stuff = SSTR_WRAP_UTF8("stuff", 5);
-
-    TEST_TRUE(runner, Hash_Equals(hash, (Obj*)other),
-              "Empty hashes are equal");
-
-    Hash_Store_Utf8(hash, "foo", 3, (Obj*)CFISH_TRUE);
-    TEST_FALSE(runner, Hash_Equals(hash, (Obj*)other),
-               "Add one pair and Equals returns false");
-
-    Hash_Store_Utf8(other, "foo", 3, (Obj*)CFISH_TRUE);
-    TEST_TRUE(runner, Hash_Equals(hash, (Obj*)other),
-              "Add a matching pair and Equals returns true");
-
-    Hash_Store_Utf8(other, "foo", 3, INCREF(stuff));
-    TEST_FALSE(runner, Hash_Equals(hash, (Obj*)other),
-               "Non-matching value spoils Equals");
-
-    DECREF(hash);
-    DECREF(other);
-}
-
-static void
-test_Store_and_Fetch(TestBatchRunner *runner) {
-    Hash          *hash         = Hash_new(100);
-    Hash          *dupe         = Hash_new(100);
-    const uint32_t starting_cap = Hash_Get_Capacity(hash);
-    VArray        *expected     = VA_new(100);
-    VArray        *got          = VA_new(100);
-    StackString *twenty       = SSTR_WRAP_UTF8("20", 2);
-    StackString *forty        = SSTR_WRAP_UTF8("40", 2);
-    StackString *foo          = SSTR_WRAP_UTF8("foo", 3);
-
-    for (int32_t i = 0; i < 100; i++) {
-        String *str = Str_newf("%i32", i);
-        Hash_Store(hash, (Obj*)str, (Obj*)str);
-        Hash_Store(dupe, (Obj*)str, INCREF(str));
-        VA_Push(expected, INCREF(str));
-    }
-    TEST_TRUE(runner, Hash_Equals(hash, (Obj*)dupe), "Equals");
-
-    TEST_INT_EQ(runner, Hash_Get_Capacity(hash), starting_cap,
-                "Initial capacity sufficient (no rebuilds)");
-
-    for (int32_t i = 0; i < 100; i++) {
-        Obj *key  = VA_Fetch(expected, i);
-        Obj *elem = Hash_Fetch(hash, key);
-        VA_Push(got, (Obj*)INCREF(elem));
-    }
-
-    TEST_TRUE(runner, VA_Equals(got, (Obj*)expected),
-              "basic Store and Fetch");
-    TEST_INT_EQ(runner, Hash_Get_Size(hash), 100,
-                "size incremented properly by Hash_Store");
-
-    TEST_TRUE(runner, Hash_Fetch(hash, (Obj*)foo) == NULL,
-              "Fetch against non-existent key returns NULL");
-
-    Obj *stored_foo = INCREF(foo);
-    Hash_Store(hash, (Obj*)forty, stored_foo);
-    TEST_TRUE(runner, SStr_Equals(foo, Hash_Fetch(hash, (Obj*)forty)),
-              "Hash_Store replaces existing value");
-    TEST_FALSE(runner, Hash_Equals(hash, (Obj*)dupe),
-               "replacement value spoils equals");
-    TEST_INT_EQ(runner, Hash_Get_Size(hash), 100,
-                "size unaffected after value replaced");
-
-    TEST_TRUE(runner, Hash_Delete(hash, (Obj*)forty) == stored_foo,
-              "Delete returns value");
-    DECREF(stored_foo);
-    TEST_INT_EQ(runner, Hash_Get_Size(hash), 99,
-                "size decremented by successful Delete");
-    TEST_TRUE(runner, Hash_Delete(hash, (Obj*)forty) == NULL,
-              "Delete returns NULL when key not found");
-    TEST_INT_EQ(runner, Hash_Get_Size(hash), 99,
-                "size not decremented by unsuccessful Delete");
-    DECREF(Hash_Delete(dupe, (Obj*)forty));
-    TEST_TRUE(runner, VA_Equals(got, (Obj*)expected), "Equals after Delete");
-
-    Hash_Clear(hash);
-    TEST_TRUE(runner, Hash_Fetch(hash, (Obj*)twenty) == NULL, "Clear");
-    TEST_TRUE(runner, Hash_Get_Size(hash) == 0, "size is 0 after Clear");
-
-    DECREF(hash);
-    DECREF(dupe);
-    DECREF(got);
-    DECREF(expected);
-}
-
-static void
-test_Keys_Values_Iter(TestBatchRunner *runner) {
-    Hash     *hash     = Hash_new(0); // trigger multiple rebuilds.
-    VArray   *expected = VA_new(100);
-    VArray   *keys;
-    VArray   *values;
-
-    for (uint32_t i = 0; i < 500; i++) {
-        String *str = Str_newf("%u32", i);
-        Hash_Store(hash, (Obj*)str, (Obj*)str);
-        VA_Push(expected, INCREF(str));
-    }
-
-    VA_Sort(expected, NULL, NULL);
-
-    keys   = Hash_Keys(hash);
-    values = Hash_Values(hash);
-    VA_Sort(keys, NULL, NULL);
-    VA_Sort(values, NULL, NULL);
-    TEST_TRUE(runner, VA_Equals(keys, (Obj*)expected), "Keys");
-    TEST_TRUE(runner, VA_Equals(values, (Obj*)expected), "Values");
-    VA_Clear(keys);
-    VA_Clear(values);
-
-    {
-        Obj *key;
-        Obj *value;
-        Hash_Iterate(hash);
-        while (Hash_Next(hash, &key, &value)) {
-            VA_Push(keys, INCREF(key));
-            VA_Push(values, INCREF(value));
-        }
-    }
-
-    VA_Sort(keys, NULL, NULL);
-    VA_Sort(values, NULL, NULL);
-    TEST_TRUE(runner, VA_Equals(keys, (Obj*)expected), "Keys from Iter");
-    TEST_TRUE(runner, VA_Equals(values, (Obj*)expected), "Values from Iter");
-
-    {
-        StackString *forty = SSTR_WRAP_UTF8("40", 2);
-        StackString *nope  = SSTR_WRAP_UTF8("nope", 4);
-        Obj *key = Hash_Find_Key(hash, (Obj*)forty, SStr_Hash_Sum(forty));
-        TEST_TRUE(runner, Obj_Equals(key, (Obj*)forty), "Find_Key");
-        key = Hash_Find_Key(hash, (Obj*)nope, SStr_Hash_Sum(nope)),
-        TEST_TRUE(runner, key == NULL,
-                  "Find_Key returns NULL for non-existent key");
-    }
-
-    DECREF(hash);
-    DECREF(expected);
-    DECREF(keys);
-    DECREF(values);
-}
-
-static void
-test_stress(TestBatchRunner *runner) {
-    Hash     *hash     = Hash_new(0); // trigger multiple rebuilds.
-    VArray   *expected = VA_new(1000);
-    VArray   *keys;
-    VArray   *values;
-
-    for (uint32_t i = 0; i < 1000; i++) {
-        String *str = TestUtils_random_string(rand() % 1200);
-        while (Hash_Fetch(hash, (Obj*)str)) {
-            DECREF(str);
-            str = TestUtils_random_string(rand() % 1200);
-        }
-        Hash_Store(hash, (Obj*)str, (Obj*)str);
-        VA_Push(expected, INCREF(str));
-    }
-
-    VA_Sort(expected, NULL, NULL);
-
-    // Overwrite for good measure.
-    for (uint32_t i = 0; i < 1000; i++) {
-        String *str = (String*)VA_Fetch(expected, i);
-        Hash_Store(hash, (Obj*)str, INCREF(str));
-    }
-
-    keys   = Hash_Keys(hash);
-    values = Hash_Values(hash);
-    VA_Sort(keys, NULL, NULL);
-    VA_Sort(values, NULL, NULL);
-    TEST_TRUE(runner, VA_Equals(keys, (Obj*)expected), "stress Keys");
-    TEST_TRUE(runner, VA_Equals(values, (Obj*)expected), "stress Values");
-
-    DECREF(keys);
-    DECREF(values);
-    DECREF(expected);
-    DECREF(hash);
-}
-
-void
-TestHash_Run_IMP(TestHash *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 27);
-    srand((unsigned int)time((time_t*)NULL));
-    test_Equals(runner);
-    test_Store_and_Fetch(runner);
-    test_Keys_Values_Iter(runner);
-    test_stress(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestHash.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestHash.cfh b/clownfish/runtime/core/Clownfish/Test/TestHash.cfh
deleted file mode 100644
index a730105..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestHash.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestHash
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestHash*
-    new();
-
-    void
-    Run(TestHash *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c b/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
deleted file mode 100644
index 515db9a..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Test/TestLockFreeRegistry.h"
-
-#include "Clownfish/LockFreeRegistry.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
-
-TestLockFreeRegistry*
-TestLFReg_new() {
-    return (TestLockFreeRegistry*)VTable_Make_Obj(TESTLOCKFREEREGISTRY);
-}
-
-StupidHashCharBuf*
-StupidHashCharBuf_new(const char *text) {
-    return (StupidHashCharBuf*)Str_new_from_utf8(text, strlen(text));
-}
-
-int32_t
-StupidHashCharBuf_Hash_Sum_IMP(StupidHashCharBuf *self) {
-    UNUSED_VAR(self);
-    return 1;
-}
-
-static void
-test_all(TestBatchRunner *runner) {
-    LockFreeRegistry *registry = LFReg_new(10);
-    StupidHashCharBuf *foo = StupidHashCharBuf_new("foo");
-    StupidHashCharBuf *bar = StupidHashCharBuf_new("bar");
-    StupidHashCharBuf *baz = StupidHashCharBuf_new("baz");
-    StupidHashCharBuf *foo_dupe = StupidHashCharBuf_new("foo");
-
-    TEST_TRUE(runner, LFReg_Register(registry, (Obj*)foo, (Obj*)foo),
-              "Register() returns true on success");
-    TEST_FALSE(runner,
-               LFReg_Register(registry, (Obj*)foo_dupe, (Obj*)foo_dupe),
-               "Can't Register() keys that test equal");
-
-    TEST_TRUE(runner, LFReg_Register(registry, (Obj*)bar, (Obj*)bar),
-              "Register() key with the same Hash_Sum but that isn't Equal");
-
-    TEST_TRUE(runner, LFReg_Fetch(registry, (Obj*)foo_dupe) == (Obj*)foo,
-              "Fetch()");
-    TEST_TRUE(runner, LFReg_Fetch(registry, (Obj*)bar) == (Obj*)bar,
-              "Fetch() again");
-    TEST_TRUE(runner, LFReg_Fetch(registry, (Obj*)baz) == NULL,
-              "Fetch() non-existent key returns NULL");
-
-    DECREF(foo_dupe);
-    DECREF(baz);
-    DECREF(bar);
-    DECREF(foo);
-    DECREF(registry);
-}
-
-void
-TestLFReg_Run_IMP(TestLockFreeRegistry *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
-    test_all(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.cfh b/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.cfh
deleted file mode 100644
index 80db8af..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestLockFreeRegistry.cfh
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestLockFreeRegistry cnick TestLFReg
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestLockFreeRegistry*
-    new();
-
-    void
-    Run(TestLockFreeRegistry *self, TestBatchRunner *runner);
-}
-
-/** Private test-only class for stressing LockFreeRegistry.
- */
-class Clownfish::Test::StupidHashCharBuf inherits Clownfish::String {
-    inert incremented StupidHashCharBuf*
-    new(const char *text);
-
-    /** Always returns 1, guaranteeing collisions. */
-    public int32_t
-    Hash_Sum(StupidHashCharBuf *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestNum.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestNum.c b/clownfish/runtime/core/Clownfish/Test/TestNum.c
deleted file mode 100644
index f84c2c0..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestNum.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestNum.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VTable.h"
-
-TestNum*
-TestNum_new() {
-    return (TestNum*)VTable_Make_Obj(TESTNUM);
-}
-
-static void
-test_To_String(TestBatchRunner *runner) {
-    Float32   *f32 = Float32_new(1.33f);
-    Float64   *f64 = Float64_new(1.33);
-    Integer32 *i32 = Int32_new(INT32_MAX);
-    Integer64 *i64 = Int64_new(INT64_MAX);
-    String *f32_string = Float32_To_String(f32);
-    String *f64_string = Float64_To_String(f64);
-    String *i32_string = Int32_To_String(i32);
-    String *i64_string = Int64_To_String(i64);
-    String *true_string  = Bool_To_String(CFISH_TRUE);
-    String *false_string = Bool_To_String(CFISH_FALSE);
-
-    TEST_TRUE(runner, Str_Starts_With_Utf8(f32_string, "1.3", 3),
-              "Float32_To_String");
-    TEST_TRUE(runner, Str_Starts_With_Utf8(f64_string, "1.3", 3),
-              "Float64_To_String");
-    TEST_TRUE(runner, Str_Equals_Utf8(i32_string, "2147483647", 10),
-              "Int32_To_String");
-    TEST_TRUE(runner, Str_Equals_Utf8(i64_string, "9223372036854775807", 19),
-              "Int64_To_String");
-    TEST_TRUE(runner, Str_Equals_Utf8(true_string, "true", 4),
-              "Bool_To_String [true]");
-    TEST_TRUE(runner, Str_Equals_Utf8(false_string, "false", 5),
-              "Bool_To_String [false]");
-
-    DECREF(false_string);
-    DECREF(true_string);
-    DECREF(i64_string);
-    DECREF(i32_string);
-    DECREF(f64_string);
-    DECREF(f32_string);
-    DECREF(i64);
-    DECREF(i32);
-    DECREF(f64);
-    DECREF(f32);
-}
-
-static void
-test_accessors(TestBatchRunner *runner) {
-    Float32   *f32 = Float32_new(1.0);
-    Float64   *f64 = Float64_new(1.0);
-    Integer32 *i32 = Int32_new(1);
-    Integer64 *i64 = Int64_new(1);
-    float  wanted32 = 1.33f;
-    double wanted64 = 1.33;
-    float  got32;
-    double got64;
-
-    Float32_Set_Value(f32, 1.33f);
-    TEST_FLOAT_EQ(runner, Float32_Get_Value(f32), 1.33f,
-                  "F32 Set_Value Get_Value");
-
-    Float64_Set_Value(f64, 1.33);
-    got64 = Float64_Get_Value(f64);
-    TEST_TRUE(runner, *(int64_t*)&got64 == *(int64_t*)&wanted64,
-              "F64 Set_Value Get_Value");
-
-    TEST_TRUE(runner, Float32_To_I64(f32) == 1, "Float32_To_I64");
-    TEST_TRUE(runner, Float64_To_I64(f64) == 1, "Float64_To_I64");
-
-    got32 = (float)Float32_To_F64(f32);
-    TEST_TRUE(runner, *(int32_t*)&got32 == *(int32_t*)&wanted32,
-              "Float32_To_F64");
-
-    got64 = Float64_To_F64(f64);
-    TEST_TRUE(runner, *(int64_t*)&got64 == *(int64_t*)&wanted64,
-              "Float64_To_F64");
-
-    Int32_Set_Value(i32, INT32_MIN);
-    TEST_INT_EQ(runner, Int32_Get_Value(i32), INT32_MIN,
-                "I32 Set_Value Get_Value");
-
-    Int64_Set_Value(i64, INT64_MIN);
-    TEST_TRUE(runner, Int64_Get_Value(i64) == INT64_MIN,
-              "I64 Set_Value Get_Value");
-
-    Int32_Set_Value(i32, -1);
-    Int64_Set_Value(i64, -1);
-    TEST_TRUE(runner, Int32_To_F64(i32) == -1, "Int32_To_F64");
-    TEST_TRUE(runner, Int64_To_F64(i64) == -1, "Int64_To_F64");
-
-    TEST_INT_EQ(runner, Bool_Get_Value(CFISH_TRUE), true,
-                "Bool_Get_Value [true]");
-    TEST_INT_EQ(runner, Bool_Get_Value(CFISH_FALSE), false,
-                "Bool_Get_Value [false]");
-    TEST_TRUE(runner, Bool_To_I64(CFISH_TRUE) == true,
-              "Bool_To_I64 [true]");
-    TEST_TRUE(runner, Bool_To_I64(CFISH_FALSE) == false,
-              "Bool_To_I64 [false]");
-    TEST_TRUE(runner, Bool_To_F64(CFISH_TRUE) == 1.0,
-              "Bool_To_F64 [true]");
-    TEST_TRUE(runner, Bool_To_F64(CFISH_FALSE) == 0.0,
-              "Bool_To_F64 [false]");
-
-    DECREF(i64);
-    DECREF(i32);
-    DECREF(f64);
-    DECREF(f32);
-}
-
-static void
-test_Equals_and_Compare_To(TestBatchRunner *runner) {
-    Float32   *f32 = Float32_new(1.0);
-    Float64   *f64 = Float64_new(1.0);
-    Integer32 *i32 = Int32_new(INT32_MAX);
-    Integer64 *i64 = Int64_new(INT64_MAX);
-
-    TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) == 0,
-              "F32_Compare_To equal");
-    TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f64),
-              "F32_Equals equal");
-
-    Float64_Set_Value(f64, 2.0);
-    TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) < 0,
-              "F32_Compare_To less than");
-    TEST_FALSE(runner, Float32_Equals(f32, (Obj*)f64),
-               "F32_Equals less than");
-
-    Float64_Set_Value(f64, 0.0);
-    TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) > 0,
-              "F32_Compare_To greater than");
-    TEST_FALSE(runner, Float32_Equals(f32, (Obj*)f64),
-               "F32_Equals greater than");
-
-    Float64_Set_Value(f64, 1.0);
-    Float32_Set_Value(f32, 1.0);
-    TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) == 0,
-              "F64_Compare_To equal");
-    TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f32),
-              "F64_Equals equal");
-
-    Float32_Set_Value(f32, 2.0);
-    TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) < 0,
-              "F64_Compare_To less than");
-    TEST_FALSE(runner, Float64_Equals(f64, (Obj*)f32),
-               "F64_Equals less than");
-
-    Float32_Set_Value(f32, 0.0);
-    TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) > 0,
-              "F64_Compare_To greater than");
-    TEST_FALSE(runner, Float64_Equals(f64, (Obj*)f32),
-               "F64_Equals greater than");
-
-    Float64_Set_Value(f64, INT64_MAX * 2.0);
-    TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)i64) > 0,
-              "Float64 comparison to Integer64");
-    TEST_TRUE(runner, Int64_Compare_To(i64, (Obj*)f64) < 0,
-              "Integer64 comparison to Float64");
-
-    Float32_Set_Value(f32, INT32_MAX * 2.0f);
-    TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)i32) > 0,
-              "Float32 comparison to Integer32");
-    TEST_TRUE(runner, Int32_Compare_To(i32, (Obj*)f32) < 0,
-              "Integer32 comparison to Float32");
-
-    Int64_Set_Value(i64, INT64_C(0x6666666666666666));
-    Integer64 *i64_copy = Int64_new(INT64_C(0x6666666666666666));
-    TEST_TRUE(runner, Int64_Compare_To(i64, (Obj*)i64_copy) == 0,
-              "Integer64 comparison to same number");
-
-    TEST_TRUE(runner, Bool_Equals(CFISH_TRUE, (Obj*)CFISH_TRUE),
-              "CFISH_TRUE Equals itself");
-    TEST_TRUE(runner, Bool_Equals(CFISH_FALSE, (Obj*)CFISH_FALSE),
-              "CFISH_FALSE Equals itself");
-    TEST_FALSE(runner, Bool_Equals(CFISH_FALSE, (Obj*)CFISH_TRUE),
-               "CFISH_FALSE not Equals CFISH_TRUE ");
-    TEST_FALSE(runner, Bool_Equals(CFISH_TRUE, (Obj*)CFISH_FALSE),
-               "CFISH_TRUE not Equals CFISH_FALSE ");
-    TEST_FALSE(runner, Bool_Equals(CFISH_TRUE, (Obj*)STRING),
-               "CFISH_TRUE not Equals random other object ");
-
-    DECREF(i64_copy);
-    DECREF(i64);
-    DECREF(i32);
-    DECREF(f64);
-    DECREF(f32);
-}
-
-static void
-test_Clone(TestBatchRunner *runner) {
-    Float32   *f32 = Float32_new(1.33f);
-    Float64   *f64 = Float64_new(1.33);
-    Integer32 *i32 = Int32_new(INT32_MAX);
-    Integer64 *i64 = Int64_new(INT64_MAX);
-    Float32   *f32_dupe = Float32_Clone(f32);
-    Float64   *f64_dupe = Float64_Clone(f64);
-    Integer32 *i32_dupe = Int32_Clone(i32);
-    Integer64 *i64_dupe = Int64_Clone(i64);
-    TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f32_dupe),
-              "Float32 Clone");
-    TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f64_dupe),
-              "Float64 Clone");
-    TEST_TRUE(runner, Int32_Equals(i32, (Obj*)i32_dupe),
-              "Integer32 Clone");
-    TEST_TRUE(runner, Int64_Equals(i64, (Obj*)i64_dupe),
-              "Integer64 Clone");
-    TEST_TRUE(runner, Bool_Equals(CFISH_TRUE, (Obj*)Bool_Clone(CFISH_TRUE)),
-              "BoolNum Clone");
-    DECREF(i64_dupe);
-    DECREF(i32_dupe);
-    DECREF(f64_dupe);
-    DECREF(f32_dupe);
-    DECREF(i64);
-    DECREF(i32);
-    DECREF(f64);
-    DECREF(f32);
-}
-
-static void
-test_Mimic(TestBatchRunner *runner) {
-    Float32   *f32 = Float32_new(1.33f);
-    Float64   *f64 = Float64_new(1.33);
-    Integer32 *i32 = Int32_new(INT32_MAX);
-    Integer64 *i64 = Int64_new(INT64_MAX);
-    Float32   *f32_dupe = Float32_new(0.0f);
-    Float64   *f64_dupe = Float64_new(0.0);
-    Integer32 *i32_dupe = Int32_new(0);
-    Integer64 *i64_dupe = Int64_new(0);
-    Float32_Mimic(f32_dupe, (Obj*)f32);
-    Float64_Mimic(f64_dupe, (Obj*)f64);
-    Int32_Mimic(i32_dupe, (Obj*)i32);
-    Int64_Mimic(i64_dupe, (Obj*)i64);
-    TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f32_dupe),
-              "Float32 Mimic");
-    TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f64_dupe),
-              "Float64 Mimic");
-    TEST_TRUE(runner, Int32_Equals(i32, (Obj*)i32_dupe),
-              "Integer32 Mimic");
-    TEST_TRUE(runner, Int64_Equals(i64, (Obj*)i64_dupe),
-              "Integer64 Mimic");
-    DECREF(i64_dupe);
-    DECREF(i32_dupe);
-    DECREF(f64_dupe);
-    DECREF(f32_dupe);
-    DECREF(i64);
-    DECREF(i32);
-    DECREF(f64);
-    DECREF(f32);
-}
-
-void
-TestNum_Run_IMP(TestNum *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 53);
-    test_To_String(runner);
-    test_accessors(runner);
-    test_Equals_and_Compare_To(runner);
-    test_Clone(runner);
-    test_Mimic(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestNum.cfh b/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
deleted file mode 100644
index 6d1f663..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestNum
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestNum*
-    new();
-
-    void
-    Run(TestNum *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestObj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.c b/clownfish/runtime/core/Clownfish/Test/TestObj.c
deleted file mode 100644
index 63e2bae..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestObj.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Test/TestObj.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/VTable.h"
-
-TestObj*
-TestObj_new() {
-    return (TestObj*)VTable_Make_Obj(TESTOBJ);
-}
-
-static Obj*
-S_new_testobj() {
-    StackString *klass = SSTR_WRAP_UTF8("TestObj", 7);
-    Obj *obj;
-    VTable *vtable = VTable_fetch_vtable((String*)klass);
-    if (!vtable) {
-        vtable = VTable_singleton((String*)klass, OBJ);
-    }
-    obj = VTable_Make_Obj(vtable);
-    return Obj_init(obj);
-}
-
-static void
-test_refcounts(TestBatchRunner *runner) {
-    Obj *obj = S_new_testobj();
-
-    TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 1,
-                "Correct starting refcount");
-
-    obj = Obj_Inc_RefCount(obj);
-    TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 2, "Inc_RefCount");
-
-    Obj_Dec_RefCount(obj);
-    TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 1, "Dec_RefCount");
-
-    DECREF(obj);
-}
-
-static void
-test_To_String(TestBatchRunner *runner) {
-    Obj *testobj = S_new_testobj();
-    String *string = Obj_To_String(testobj);
-    TEST_TRUE(runner, Str_Find_Utf8(string, "TestObj", 7) >= 0, "To_String");
-    DECREF(string);
-    DECREF(testobj);
-}
-
-static void
-test_Equals(TestBatchRunner *runner) {
-    Obj *testobj = S_new_testobj();
-    Obj *other   = S_new_testobj();
-
-    TEST_TRUE(runner, Obj_Equals(testobj, testobj),
-              "Equals is true for the same object");
-    TEST_FALSE(runner, Obj_Equals(testobj, other),
-               "Distinct objects are not equal");
-
-    DECREF(testobj);
-    DECREF(other);
-}
-
-static void
-test_Hash_Sum(TestBatchRunner *runner) {
-    Obj *testobj = S_new_testobj();
-    int64_t address64 = PTR_TO_I64(testobj);
-    int32_t address32 = (int32_t)address64;
-    TEST_TRUE(runner, (Obj_Hash_Sum(testobj) == address32),
-              "Hash_Sum uses memory address");
-    DECREF(testobj);
-}
-
-static void
-test_Is_A(TestBatchRunner *runner) {
-    String *string     = Str_new_from_trusted_utf8("", 0);
-    VTable *str_vtable = Str_Get_VTable(string);
-    String *klass      = Str_Get_Class_Name(string);
-
-    TEST_TRUE(runner, Str_Is_A(string, STRING), "String Is_A String.");
-    TEST_TRUE(runner, Str_Is_A(string, OBJ), "String Is_A Obj.");
-    TEST_TRUE(runner, str_vtable == STRING, "Get_VTable");
-    TEST_TRUE(runner, Str_Equals(VTable_Get_Name(STRING), (Obj*)klass),
-              "Get_Class_Name");
-
-    DECREF(string);
-}
-
-static void
-S_attempt_init(void *context) {
-    Obj_init((Obj*)context);
-}
-
-static void
-S_attempt_Clone(void *context) {
-    Obj_Clone((Obj*)context);
-}
-
-static void
-S_attempt_Compare_To(void *context) {
-    Obj_Compare_To((Obj*)context, (Obj*)context);
-}
-
-static void
-S_attempt_To_I64(void *context) {
-    Obj_To_I64((Obj*)context);
-}
-
-static void
-S_attempt_To_F64(void *context) {
-    Obj_To_F64((Obj*)context);
-}
-
-static void
-S_attempt_Mimic(void *context) {
-    Obj_Mimic((Obj*)context, (Obj*)context);
-}
-
-static void
-S_verify_abstract_error(TestBatchRunner *runner, Err_Attempt_t routine,
-                        void *context, const char *name) {
-    char message[100];
-    sprintf(message, "%s() is abstract", name);
-    Err *error = Err_trap(routine, context);
-    TEST_TRUE(runner, error != NULL
-              && Err_Is_A(error, ERR) 
-              && Str_Find_Utf8(Err_Get_Mess(error), "bstract", 7) != -1,
-              message);
-    DECREF(error);
-}
-
-static void
-test_abstract_routines(TestBatchRunner *runner) {
-    Obj *blank = VTable_Make_Obj(OBJ);
-    S_verify_abstract_error(runner, S_attempt_init, blank, "init");
-
-    Obj *obj = S_new_testobj();
-    S_verify_abstract_error(runner, S_attempt_Clone,      obj, "Clone");
-    S_verify_abstract_error(runner, S_attempt_Compare_To, obj, "Compare_To");
-    S_verify_abstract_error(runner, S_attempt_To_I64,     obj, "To_I64");
-    S_verify_abstract_error(runner, S_attempt_To_F64,     obj, "To_F64");
-    S_verify_abstract_error(runner, S_attempt_Mimic,      obj, "Mimic");
-    DECREF(obj);
-}
-
-void
-TestObj_Run_IMP(TestObj *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 17);
-    test_refcounts(runner);
-    test_To_String(runner);
-    test_Equals(runner);
-    test_Hash_Sum(runner);
-    test_Is_A(runner);
-    test_abstract_routines(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.cfh b/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
deleted file mode 100644
index eb4a0b6..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestObj
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestObj*
-    new();
-
-    void
-    Run(TestObj *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestString.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestString.c b/clownfish/runtime/core/Clownfish/Test/TestString.c
deleted file mode 100644
index 634154a..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestString.c
+++ /dev/null
@@ -1,527 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Test/TestString.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/VTable.h"
-
-#define SMILEY "\xE2\x98\xBA"
-static char smiley[] = { (char)0xE2, (char)0x98, (char)0xBA, 0 };
-static uint32_t smiley_len = 3;
-static uint32_t smiley_cp  = 0x263A;
-
-TestString*
-TestStr_new() {
-    return (TestString*)VTable_Make_Obj(TESTSTRING);
-}
-
-static String*
-S_get_str(const char *string) {
-    return Str_new_from_utf8(string, strlen(string));
-}
-
-// Surround a smiley with lots of whitespace.
-static String*
-S_smiley_with_whitespace(int *num_spaces_ptr) {
-    int32_t spaces[] = {
-        ' ',    '\t',   '\r',   '\n',   0x000B, 0x000C, 0x000D, 0x0085,
-        0x00A0, 0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004,
-        0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x2028, 0x2029,
-        0x202F, 0x205F, 0x3000
-    };
-    int num_spaces = sizeof(spaces) / sizeof(uint32_t);
-
-    CharBuf *buf = CB_new(0);
-    for (int i = 0; i < num_spaces; i++) { CB_Cat_Char(buf, spaces[i]); }
-    CB_Cat_Char(buf, smiley_cp);
-    for (int i = 0; i < num_spaces; i++) { CB_Cat_Char(buf, spaces[i]); }
-
-    String *retval = CB_To_String(buf);
-    if (num_spaces_ptr) { *num_spaces_ptr = num_spaces; }
-
-    DECREF(buf);
-    return retval;
-}
-
-static void
-test_Cat(TestBatchRunner *runner) {
-    String *wanted = Str_newf("a%s", smiley);
-    String *source;
-    String *got;
-
-    source = S_get_str("");
-    got = Str_Cat(source, wanted);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Cat");
-    DECREF(got);
-    DECREF(source);
-
-    source = S_get_str("a");
-    got = Str_Cat_Utf8(source, smiley, smiley_len);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Cat_Utf8");
-    DECREF(got);
-    DECREF(source);
-
-    source = S_get_str("a");
-    got = Str_Cat_Trusted_Utf8(source, smiley, smiley_len);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Cat_Trusted_Utf8");
-    DECREF(got);
-    DECREF(source);
-
-    DECREF(wanted);
-}
-
-static void
-test_Clone(TestBatchRunner *runner) {
-    String *wanted = S_get_str("foo");
-    String *got    = S_get_str("bar");
-
-    got = Str_Clone(wanted);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "Clone");
-    DECREF(got);
-
-    DECREF(wanted);
-}
-
-static void
-test_Find(TestBatchRunner *runner) {
-    String *string;
-    String *substring = S_get_str("foo");
-
-    string = S_get_str("");
-    TEST_TRUE(runner, Str_Find(string, substring) == -1, "Not in empty string");
-    DECREF(string);
-
-    string = S_get_str("foo");
-    TEST_TRUE(runner, Str_Find(string, substring) == 0, "Find complete string");
-    DECREF(string);
-
-    string = S_get_str("afoo");
-    TEST_TRUE(runner, Str_Find(string, substring) == 1, "Find after first");
-    // TODO: Enable this test when we have real substrings.
-    /*Str_Set_Size(string, 3);
-    TEST_TRUE(runner, Str_Find(string, substring) == -1, "Don't overrun");*/
-    DECREF(string);
-
-    string = S_get_str("afood");
-    TEST_TRUE(runner, Str_Find(string, substring) == 1, "Find in middle");
-    DECREF(string);
-
-    DECREF(substring);
-}
-
-static void
-test_Code_Point_At_and_From(TestBatchRunner *runner) {
-    int32_t code_points[] = {
-        'a', smiley_cp, smiley_cp, 'b', smiley_cp, 'c'
-    };
-    uint32_t num_code_points = sizeof(code_points) / sizeof(int32_t);
-    String *string = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    uint32_t i;
-
-    for (i = 0; i < num_code_points; i++) {
-        uint32_t from = num_code_points - i;
-        TEST_INT_EQ(runner, Str_Code_Point_At(string, i), code_points[i],
-                    "Code_Point_At %ld", (long)i);
-        TEST_INT_EQ(runner, Str_Code_Point_From(string, from),
-                    code_points[i], "Code_Point_From %ld", (long)from);
-    }
-
-    DECREF(string);
-}
-
-static void
-test_SubString(TestBatchRunner *runner) {
-    String *string = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    String *wanted = Str_newf("%sb%s", smiley, smiley);
-    String *got = Str_SubString(string, 2, 3);
-    TEST_TRUE(runner, Str_Equals(wanted, (Obj*)got), "SubString");
-    DECREF(wanted);
-    DECREF(got);
-    DECREF(string);
-}
-
-static void
-test_Trim(TestBatchRunner *runner) {
-    String *ws_smiley = S_smiley_with_whitespace(NULL);
-    String *ws_foo    = S_get_str("  foo  ");
-    String *ws_only   = S_get_str("  \t  \r\n");
-    String *trimmed   = S_get_str("a     b");
-    String *got;
-
-    got = Str_Trim(ws_smiley);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, smiley, smiley_len), "Trim");
-    DECREF(got);
-
-    got = Str_Trim_Top(ws_foo);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "foo  ", 5), "Trim_Top");
-    DECREF(got);
-
-    got = Str_Trim_Tail(ws_foo);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "  foo", 5), "Trim_Tail");
-    DECREF(got);
-
-    got = Str_Trim(ws_only);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "", 0), "Trim with only whitespace");
-    DECREF(got);
-
-    got = Str_Trim_Top(ws_only);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "", 0),
-              "Trim_Top with only whitespace");
-    DECREF(got);
-
-    got = Str_Trim_Tail(ws_only);
-    TEST_TRUE(runner, Str_Equals_Utf8(got, "", 0),
-              "Trim_Tail with only whitespace");
-    DECREF(got);
-
-    got = Str_Trim(trimmed);
-    TEST_TRUE(runner, Str_Equals(got, (Obj*)trimmed),
-              "Trim doesn't change trimmed string");
-    DECREF(got);
-
-    got = Str_Trim_Top(trimmed);
-    TEST_TRUE(runner, Str_Equals(got, (Obj*)trimmed),
-              "Trim_Top doesn't change trimmed string");
-    DECREF(got);
-
-    got = Str_Trim_Tail(trimmed);
-    TEST_TRUE(runner, Str_Equals(got, (Obj*)trimmed),
-              "Trim_Tail doesn't change trimmed string");
-    DECREF(got);
-
-    DECREF(trimmed);
-    DECREF(ws_only);
-    DECREF(ws_foo);
-    DECREF(ws_smiley);
-}
-
-static void
-test_To_F64(TestBatchRunner *runner) {
-    String *string;
-
-    string = S_get_str("1.5");
-    double difference = 1.5 - Str_To_F64(string);
-    if (difference < 0) { difference = 0 - difference; }
-    TEST_TRUE(runner, difference < 0.001, "To_F64");
-    DECREF(string);
-
-    string = S_get_str("-1.5");
-    difference = 1.5 + Str_To_F64(string);
-    if (difference < 0) { difference = 0 - difference; }
-    TEST_TRUE(runner, difference < 0.001, "To_F64 negative");
-    DECREF(string);
-
-    // TODO: Enable this test when we have real substrings.
-    /*string = S_get_str("1.59");
-    double value_full = Str_To_F64(string);
-    Str_Set_Size(string, 3);
-    double value_short = Str_To_F64(string);
-    TEST_TRUE(runner, value_short < value_full,
-              "TO_F64 doesn't run past end of string");
-    DECREF(string);*/
-}
-
-static void
-test_To_I64(TestBatchRunner *runner) {
-    String *string;
-
-    string = S_get_str("10");
-    TEST_TRUE(runner, Str_To_I64(string) == 10, "To_I64");
-    DECREF(string);
-
-    string = S_get_str("-10");
-    TEST_TRUE(runner, Str_To_I64(string) == -10, "To_I64 negative");
-    DECREF(string);
-}
-
-static void
-test_To_Utf8(TestBatchRunner *runner) {
-    String *string = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    char *buf = Str_To_Utf8(string);
-    TEST_TRUE(runner, strcmp(buf, "a" SMILEY SMILEY "b" SMILEY "c") == 0,
-              "To_Utf8");
-    FREEMEM(buf);
-    DECREF(string);
-}
-
-static void
-test_Length(TestBatchRunner *runner) {
-    String *string = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    TEST_INT_EQ(runner, Str_Length(string), 6, "Length");
-    DECREF(string);
-}
-
-static void
-test_Compare_To(TestBatchRunner *runner) {
-    String *abc = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    String *ab  = Str_newf("a%s%sb", smiley, smiley);
-    String *ac  = Str_newf("a%s%sc", smiley, smiley);
-
-    TEST_TRUE(runner, Str_Compare_To(abc, (Obj*)abc) == 0,
-              "Compare_To abc abc");
-    TEST_TRUE(runner, Str_Compare_To(ab, (Obj*)abc) < 0,
-              "Compare_To ab abc");
-    TEST_TRUE(runner, Str_Compare_To(abc, (Obj*)ab) > 0,
-              "Compare_To abc ab");
-    TEST_TRUE(runner, Str_Compare_To(ab, (Obj*)ac) < 0,
-              "Compare_To ab ac");
-    TEST_TRUE(runner, Str_Compare_To(ac, (Obj*)ab) > 0,
-              "Compare_To ac ab");
-
-    DECREF(ac);
-    DECREF(ab);
-    DECREF(abc);
-}
-
-static void
-test_Swap_Chars(TestBatchRunner *runner) {
-    String *source = S_get_str("aXXbXc");
-    String *got    = Str_Swap_Chars(source, 'X', smiley_cp);
-    String *wanted = Str_newf("a%s%sb%sc", smiley, smiley, smiley);
-    TEST_TRUE(runner, Str_Equals(got, (Obj*)wanted), "Swap_Chars");
-    DECREF(wanted);
-    DECREF(got);
-    DECREF(source);
-}
-
-static void
-test_iterator(TestBatchRunner *runner) {
-    static const int32_t code_points[] = {
-        0x41,
-        0x7F,
-        0x80,
-        0x7FF,
-        0x800,
-        0xFFFF,
-        0x10000,
-        0x10FFFF
-    };
-    static size_t num_code_points
-        = sizeof(code_points) / sizeof(code_points[0]);
-
-    CharBuf *buf = CB_new(0);
-    for (size_t i = 0; i < num_code_points; ++i) {
-        CB_Cat_Char(buf, code_points[i]);
-    }
-    String *string = CB_To_String(buf);
-
-    {
-        StringIterator *top  = Str_Top(string);
-        StringIterator *tail = Str_Tail(string);
-
-        TEST_INT_EQ(runner, StrIter_Compare_To(top, (Obj*)tail), -1,
-                    "Compare_To top < tail");
-        TEST_INT_EQ(runner, StrIter_Compare_To(tail, (Obj*)top), 1,
-                    "Compare_To tail > top");
-        TEST_INT_EQ(runner, StrIter_Compare_To(top, (Obj*)top), 0,
-                    "Compare_To top == top");
-
-        StringIterator *clone = StrIter_Clone(top);
-        TEST_TRUE(runner, StrIter_Equals(clone, (Obj*)top), "Clone");
-
-        StrIter_Assign(clone, tail);
-        TEST_TRUE(runner, StrIter_Equals(clone, (Obj*)tail), "Assign");
-
-        DECREF(clone);
-        DECREF(top);
-        DECREF(tail);
-    }
-
-    {
-        StringIterator *iter = Str_Top(string);
-
-        for (size_t i = 0; i < num_code_points; ++i) {
-            TEST_TRUE(runner, StrIter_Has_Next(iter), "Has_Next %d", i);
-            int32_t code_point = StrIter_Next(iter);
-            TEST_INT_EQ(runner, code_point, code_points[i], "Next %d", i);
-        }
-
-        TEST_TRUE(runner, !StrIter_Has_Next(iter),
-                  "Has_Next at end of string");
-        TEST_INT_EQ(runner, StrIter_Next(iter), STRITER_DONE,
-                    "Next at end of string");
-
-        StringIterator *tail = Str_Tail(string);
-        TEST_TRUE(runner, StrIter_Equals(iter, (Obj*)tail), "Equals tail");
-
-        DECREF(tail);
-        DECREF(iter);
-    }
-
-    {
-        StringIterator *iter = Str_Tail(string);
-
-        for (int i = num_code_points - 1; i >= 0; --i) {
-            TEST_TRUE(runner, StrIter_Has_Prev(iter), "Has_Prev %d", i);
-            int32_t code_point = StrIter_Prev(iter);
-            TEST_INT_EQ(runner, code_point, code_points[i], "Prev %d", i);
-        }
-
-        TEST_TRUE(runner, !StrIter_Has_Prev(iter),
-                  "Has_Prev at end of string");
-        TEST_INT_EQ(runner, StrIter_Prev(iter), STRITER_DONE,
-                    "Prev at start of string");
-
-        StringIterator *top = Str_Top(string);
-        TEST_TRUE(runner, StrIter_Equals(iter, (Obj*)top), "Equals top");
-
-        DECREF(top);
-        DECREF(iter);
-    }
-
-    {
-        StringIterator *iter = Str_Top(string);
-
-        StrIter_Next(iter);
-        TEST_INT_EQ(runner, StrIter_Advance(iter, 2), 2,
-                    "Advance returns number of code points");
-        TEST_INT_EQ(runner, StrIter_Next(iter), code_points[3],
-                    "Advance works");
-        TEST_INT_EQ(runner,
-                    StrIter_Advance(iter, 1000000), num_code_points - 4,
-                    "Advance past end of string");
-
-        StrIter_Prev(iter);
-        TEST_INT_EQ(runner, StrIter_Recede(iter, 2), 2,
-                    "Recede returns number of code points");
-        TEST_INT_EQ(runner, StrIter_Prev(iter), code_points[num_code_points-4],
-                    "Recede works");
-        TEST_INT_EQ(runner, StrIter_Recede(iter, 1000000), num_code_points - 4,
-                    "Recede past start of string");
-
-        DECREF(iter);
-    }
-
-    DECREF(string);
-    DECREF(buf);
-}
-
-static void
-test_iterator_whitespace(TestBatchRunner *runner) {
-    int num_spaces;
-    String *ws_smiley = S_smiley_with_whitespace(&num_spaces);
-
-    {
-        StringIterator *iter = Str_Top(ws_smiley);
-        TEST_INT_EQ(runner, StrIter_Skip_Next_Whitespace(iter), num_spaces,
-                    "Skip_Next_Whitespace");
-        TEST_INT_EQ(runner, StrIter_Skip_Next_Whitespace(iter), 0,
-                    "Skip_Next_Whitespace without whitespace");
-        DECREF(iter);
-    }
-
-    {
-        StringIterator *iter = Str_Tail(ws_smiley);
-        TEST_INT_EQ(runner, StrIter_Skip_Prev_Whitespace(iter), num_spaces,
-                    "Skip_Prev_Whitespace");
-        TEST_INT_EQ(runner, StrIter_Skip_Prev_Whitespace(iter), 0,
-                    "Skip_Prev_Whitespace without whitespace");
-        DECREF(iter);
-    }
-
-    DECREF(ws_smiley);
-}
-
-static void
-test_iterator_substring(TestBatchRunner *runner) {
-    String *string = Str_newf("a%sb%sc%sd", smiley, smiley, smiley);
-
-    StringIterator *start = Str_Top(string);
-    StringIterator *end = Str_Tail(string);
-
-    {
-        String *substring = StrIter_substring(start, end);
-        TEST_TRUE(runner, Str_Equals(substring, (Obj*)string),
-                  "StrIter_substring whole string");
-        DECREF(substring);
-    }
-
-    StrIter_Advance(start, 2);
-    StrIter_Recede(end, 2);
-
-    {
-        String *substring = StrIter_substring(start, end);
-        String *wanted = Str_newf("b%sc", smiley);
-        TEST_TRUE(runner, Str_Equals(substring, (Obj*)wanted),
-                  "StrIter_substring");
-
-        TEST_TRUE(runner, StrIter_Starts_With(start, wanted), "Starts_With");
-        TEST_TRUE(runner, StrIter_Ends_With(end, wanted), "Ends_With");
-
-        DECREF(wanted);
-        DECREF(substring);
-    }
-
-    {
-        String *substring = StrIter_substring(end, NULL);
-        String *wanted = Str_newf("%sd", smiley);
-        TEST_TRUE(runner, Str_Equals(substring, (Obj*)wanted),
-                  "StrIter_substring with NULL tail");
-        DECREF(wanted);
-        DECREF(substring);
-    }
-
-    {
-        String *substring = StrIter_substring(NULL, start);
-        String *wanted = Str_newf("a%s", smiley);
-        TEST_TRUE(runner, Str_Equals(substring, (Obj*)wanted),
-                  "StrIter_substring with NULL top");
-        DECREF(wanted);
-        DECREF(substring);
-    }
-
-    DECREF(start);
-    DECREF(end);
-    DECREF(string);
-}
-
-void
-TestStr_Run_IMP(TestString *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 101);
-    test_Cat(runner);
-    test_Clone(runner);
-    test_Code_Point_At_and_From(runner);
-    test_Find(runner);
-    test_SubString(runner);
-    test_Trim(runner);
-    test_To_F64(runner);
-    test_To_I64(runner);
-    test_To_Utf8(runner);
-    test_Length(runner);
-    test_Compare_To(runner);
-    test_Swap_Chars(runner);
-    test_iterator(runner);
-    test_iterator_whitespace(runner);
-    test_iterator_substring(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestString.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestString.cfh b/clownfish/runtime/core/Clownfish/Test/TestString.cfh
deleted file mode 100644
index aaf1289..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestString.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestString cnick TestStr
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestString*
-    new();
-
-    void
-    Run(TestString *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.c b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
deleted file mode 100644
index 06c1590..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestVArray.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Test/TestVArray.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Num.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
-
-TestVArray*
-TestVArray_new() {
-    return (TestVArray*)VTable_Make_Obj(TESTVARRAY);
-}
-
-static void
-test_Equals(TestBatchRunner *runner) {
-    VArray *array = VA_new(0);
-    VArray *other = VA_new(0);
-    StackString *stuff = SSTR_WRAP_UTF8("stuff", 5);
-
-    TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
-              "Empty arrays are equal");
-
-    VA_Push(array, (Obj*)CFISH_TRUE);
-    TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
-               "Add one elem and Equals returns false");
-
-    VA_Push(other, (Obj*)CFISH_TRUE);
-    TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
-              "Add a matching elem and Equals returns true");
-
-    VA_Store(array, 2, (Obj*)CFISH_TRUE);
-    TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
-               "Add elem after a NULL and Equals returns false");
-
-    VA_Store(other, 2, (Obj*)CFISH_TRUE);
-    TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
-              "Empty elems don't spoil Equals");
-
-    VA_Store(other, 2, INCREF(stuff));
-    TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
-               "Non-matching value spoils Equals");
-
-    VA_Excise(array, 1, 2); // removes empty elems
-    VA_Delete(other, 1);    // leaves NULL in place of deleted elem
-    VA_Delete(other, 2);
-    TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
-               "Empty trailing elements spoil Equals");
-
-    DECREF(array);
-    DECREF(other);
-}
-
-static void
-test_Store_Fetch(TestBatchRunner *runner) {
-    VArray *array = VA_new(0);
-    String *elem;
-
-    TEST_TRUE(runner, VA_Fetch(array, 2) == NULL, "Fetch beyond end");
-
-    VA_Store(array, 2, (Obj*)Str_newf("foo"));
-    elem = (String*)CERTIFY(VA_Fetch(array, 2), STRING);
-    TEST_INT_EQ(runner, 3, VA_Get_Size(array), "Store updates size");
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "foo", 3), "Store");
-
-    elem = (String*)INCREF(elem);
-    TEST_INT_EQ(runner, 2, Str_Get_RefCount(elem),
-                "start with refcount of 2");
-    VA_Store(array, 2, (Obj*)Str_newf("bar"));
-    TEST_INT_EQ(runner, 1, Str_Get_RefCount(elem),
-                "Displacing elem via Store updates refcount");
-    DECREF(elem);
-    elem = (String*)CERTIFY(VA_Fetch(array, 2), STRING);
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "bar", 3), "Store displacement");
-
-    DECREF(array);
-}
-
-static void
-test_Push_Pop_Shift_Unshift(TestBatchRunner *runner) {
-    VArray *array = VA_new(0);
-    String *elem;
-
-    TEST_INT_EQ(runner, VA_Get_Size(array), 0, "size starts at 0");
-    VA_Push(array, (Obj*)Str_newf("a"));
-    VA_Push(array, (Obj*)Str_newf("b"));
-    VA_Push(array, (Obj*)Str_newf("c"));
-
-    TEST_INT_EQ(runner, VA_Get_Size(array), 3, "size after Push");
-    TEST_TRUE(runner, NULL != CERTIFY(VA_Fetch(array, 2), STRING), "Push");
-
-    elem = (String*)CERTIFY(VA_Shift(array), STRING);
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "a", 1), "Shift");
-    TEST_INT_EQ(runner, VA_Get_Size(array), 2, "size after Shift");
-    DECREF(elem);
-
-    elem = (String*)CERTIFY(VA_Pop(array), STRING);
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "c", 1), "Pop");
-    TEST_INT_EQ(runner, VA_Get_Size(array), 1, "size after Pop");
-    DECREF(elem);
-
-    VA_Unshift(array, (Obj*)Str_newf("foo"));
-    elem = (String*)CERTIFY(VA_Fetch(array, 0), STRING);
-    TEST_TRUE(runner, Str_Equals_Utf8(elem, "foo", 3), "Unshift");
-    TEST_INT_EQ(runner, VA_Get_Size(array), 2, "size after Shift");
-
-    DECREF(array);
-}
-
-static void
-test_Delete(TestBatchRunner *runner) {
-    VArray *wanted = VA_new(5);
-    VArray *got    = VA_new(5);
-    uint32_t i;
-
-    for (i = 0; i < 5; i++) { VA_Push(got, (Obj*)Str_newf("%u32", i)); }
-    VA_Store(wanted, 0, (Obj*)Str_newf("0", i));
-    VA_Store(wanted, 1, (Obj*)Str_newf("1", i));
-    VA_Store(wanted, 4, (Obj*)Str_newf("4", i));
-    DECREF(VA_Delete(got, 2));
-    DECREF(VA_Delete(got, 3));
-    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got), "Delete");
-
-    DECREF(wanted);
-    DECREF(got);
-}
-
-static void
-test_Resize(TestBatchRunner *runner) {
-    VArray *array = VA_new(3);
-    uint32_t i;
-
-    for (i = 0; i < 2; i++) { VA_Push(array, (Obj*)Str_newf("%u32", i)); }
-    TEST_INT_EQ(runner, VA_Get_Capacity(array), 3, "Start with capacity 3");
-
-    VA_Resize(array, 4);
-    TEST_INT_EQ(runner, VA_Get_Size(array), 4, "Resize up");
-    TEST_INT_EQ(runner, VA_Get_Capacity(array), 4,
-                "Resize changes capacity");
-
-    VA_Resize(array, 2);
-    TEST_INT_EQ(runner, VA_Get_Size(array), 2, "Resize down");
-    TEST_TRUE(runner, VA_Fetch(array, 2) == NULL, "Resize down zaps elem");
-
-    DECREF(array);
-}
-
-static void
-test_Excise(TestBatchRunner *runner) {
-    VArray *wanted = VA_new(5);
-    VArray *got    = VA_new(5);
-
-    for (uint32_t i = 0; i < 5; i++) {
-        VA_Push(wanted, (Obj*)Str_newf("%u32", i));
-        VA_Push(got, (Obj*)Str_newf("%u32", i));
-    }
-
-    VA_Excise(got, 7, 1);
-    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
-              "Excise outside of range is no-op");
-
-    VA_Excise(got, 2, 2);
-    DECREF(VA_Delete(wanted, 2));
-    DECREF(VA_Delete(wanted, 3));
-    VA_Store(wanted, 2, VA_Delete(wanted, 4));
-    VA_Resize(wanted, 3);
-    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
-              "Excise multiple elems");
-
-    VA_Excise(got, 2, 2);
-    VA_Resize(wanted, 2);
-    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
-              "Splicing too many elems truncates");
-
-    VA_Excise(got, 0, 1);
-    VA_Store(wanted, 0, VA_Delete(wanted, 1));
-    VA_Resize(wanted, 1);
-    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
-              "Excise first elem");
-
-    DECREF(got);
-    DECREF(wanted);
-}
-
-static void
-test_Push_VArray(TestBatchRunner *runner) {
-    VArray *wanted  = VA_new(0);
-    VArray *got     = VA_new(0);
-    VArray *scratch = VA_new(0);
-    uint32_t i;
-
-    for (i = 0; i < 4; i++) { VA_Push(wanted, (Obj*)Str_newf("%u32", i)); }
-    for (i = 0; i < 2; i++) { VA_Push(got, (Obj*)Str_newf("%u32", i)); }
-    for (i = 2; i < 4; i++) { VA_Push(scratch, (Obj*)Str_newf("%u32", i)); }
-
-    VA_Push_VArray(got, scratch);
-    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got), "Push_VArray");
-
-    DECREF(wanted);
-    DECREF(got);
-    DECREF(scratch);
-}
-
-static void
-test_Slice(TestBatchRunner *runner) {
-    VArray *array = VA_new(0);
-    for (uint32_t i = 0; i < 10; i++) { VA_Push(array, (Obj*)Str_newf("%u32", i)); }
-    {
-        VArray *slice = VA_Slice(array, 0, 10);
-        TEST_TRUE(runner, VA_Equals(array, (Obj*)slice), "Slice entire array");
-        DECREF(slice);
-    }
-    {
-        VArray *slice = VA_Slice(array, 0, 11);
-        TEST_TRUE(runner, VA_Equals(array, (Obj*)slice),
-            "Exceed length");
-        DECREF(slice);
-    }
-    {
-        VArray *wanted = VA_new(0);
-        VA_Push(wanted, (Obj*)Str_newf("9"));
-        VArray *slice = VA_Slice(array, 9, 11);
-        TEST_TRUE(runner, VA_Equals(slice, (Obj*)wanted),
-            "Exceed length, start near end");
-        DECREF(slice);
-        DECREF(wanted);
-    }
-    {
-        VArray *slice = VA_Slice(array, 0, 0);
-        TEST_TRUE(runner, VA_Get_Size(slice) == 0, "empty slice");
-        DECREF(slice);
-    }
-    {
-        VArray *slice = VA_Slice(array, 20, 1);
-        TEST_TRUE(runner, VA_Get_Size(slice) ==  0, "exceed offset");
-        DECREF(slice);
-    }
-    {
-        VArray *wanted = VA_new(0);
-        VA_Push(wanted, (Obj*)Str_newf("9"));
-        VArray *slice = VA_Slice(array, 9, UINT32_MAX - 1);
-        TEST_TRUE(runner, VA_Get_Size(slice) == 1, "guard against overflow");
-        DECREF(slice);
-        DECREF(wanted);
-    }
-    DECREF(array);
-}
-
-static void
-test_Clone_and_Shallow_Copy(TestBatchRunner *runner) {
-    VArray *array = VA_new(0);
-    VArray *twin;
-    uint32_t i;
-
-    for (i = 0; i < 10; i++) {
-        VA_Push(array, (Obj*)Int32_new(i));
-    }
-    twin = VA_Shallow_Copy(array);
-    TEST_TRUE(runner, VA_Equals(array, (Obj*)twin), "Shallow_Copy");
-    TEST_TRUE(runner, VA_Fetch(array, 1) == VA_Fetch(twin, 1),
-              "Shallow_Copy doesn't clone elements");
-    DECREF(twin);
-
-    twin = VA_Clone(array);
-    TEST_TRUE(runner, VA_Equals(array, (Obj*)twin), "Clone");
-    TEST_TRUE(runner, VA_Fetch(array, 1) != VA_Fetch(twin, 1),
-              "Clone performs deep clone");
-
-    DECREF(array);
-    DECREF(twin);
-}
-
-void
-TestVArray_Run_IMP(TestVArray *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 43);
-    test_Equals(runner);
-    test_Store_Fetch(runner);
-    test_Push_Pop_Shift_Unshift(runner);
-    test_Delete(runner);
-    test_Resize(runner);
-    test_Excise(runner);
-    test_Push_VArray(runner);
-    test_Slice(runner);
-    test_Clone_and_Shallow_Copy(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh b/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
deleted file mode 100644
index 735fccb..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::TestVArray
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestVArray*
-    new();
-
-    void
-    Run(TestVArray *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
deleted file mode 100644
index 320ff91..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/Util/TestAtomic.h"
-
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/Util/Atomic.h"
-#include "Clownfish/VTable.h"
-
-TestAtomic*
-TestAtomic_new() {
-    return (TestAtomic*)VTable_Make_Obj(TESTATOMIC);
-}
-
-static void
-test_cas_ptr(TestBatchRunner *runner) {
-    int    foo = 1;
-    int    bar = 2;
-    int   *foo_pointer = &foo;
-    int   *bar_pointer = &bar;
-    int   *target      = NULL;
-
-    TEST_TRUE(runner,
-              Atomic_cas_ptr((void**)&target, NULL, foo_pointer),
-              "cas_ptr returns true on success");
-    TEST_TRUE(runner, target == foo_pointer, "cas_ptr sets target");
-
-    target = NULL;
-    TEST_FALSE(runner,
-               Atomic_cas_ptr((void**)&target, bar_pointer, foo_pointer),
-               "cas_ptr returns false when it old_value doesn't match");
-    TEST_TRUE(runner, target == NULL,
-              "cas_ptr doesn't do anything to target when old_value doesn't match");
-
-    target = foo_pointer;
-    TEST_TRUE(runner,
-              Atomic_cas_ptr((void**)&target, foo_pointer, bar_pointer),
-              "cas_ptr from one value to another");
-    TEST_TRUE(runner, target == bar_pointer, "cas_ptr sets target");
-}
-
-void
-TestAtomic_Run_IMP(TestAtomic *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
-    test_cas_ptr(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
deleted file mode 100644
index 2788342..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::Util::TestAtomic
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestAtomic*
-    new();
-
-    void
-    Run(TestAtomic *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
deleted file mode 100644
index 1878242..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Test/Util/TestMemory.h"
-
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/VTable.h"
-
-TestMemory*
-TestMemory_new() {
-    return (TestMemory*)VTable_Make_Obj(TESTMEMORY);
-}
-
-static void
-test_oversize__growth_rate(TestBatchRunner *runner) {
-    bool     success             = true;
-    uint64_t size                = 0;
-    double   growth_count        = 0;
-    double   average_growth_rate = 0.0;
-
-    while (size < SIZE_MAX) {
-        uint64_t next_size = Memory_oversize((size_t)size + 1, sizeof(void*));
-        if (next_size < size) {
-            success = false;
-            FAIL(runner, "Asked for %" PRId64 ", got smaller amount %" PRId64,
-                 size + 1, next_size);
-            break;
-        }
-        if (size > 0) {
-            growth_count += 1;
-            double growth_rate = U64_TO_DOUBLE(next_size) /
-                                 U64_TO_DOUBLE(size);
-            double sum = growth_rate + (growth_count - 1) * average_growth_rate;
-            average_growth_rate = sum / growth_count;
-            if (average_growth_rate < 1.1) {
-                FAIL(runner, "Average growth rate dropped below 1.1x: %f",
-                     average_growth_rate);
-                success = false;
-                break;
-            }
-        }
-        size = next_size;
-    }
-    TEST_TRUE(runner, growth_count > 0, "Grew %f times", growth_count);
-    if (success) {
-        TEST_TRUE(runner, average_growth_rate > 1.1,
-                  "Growth rate of oversize() averages above 1.1: %.3f",
-                  average_growth_rate);
-    }
-
-    for (int minimum = 1; minimum < 8; minimum++) {
-        uint64_t next_size = Memory_oversize(minimum, sizeof(void*));
-        double growth_rate = U64_TO_DOUBLE(next_size) / (double)minimum;
-        TEST_TRUE(runner, growth_rate > 1.2,
-                  "Growth rate is higher for smaller arrays (%d, %.3f)", minimum,
-                  growth_rate);
-    }
-}
-
-static void
-test_oversize__ceiling(TestBatchRunner *runner) {
-    for (int width = 0; width < 10; width++) {
-        size_t size = Memory_oversize(SIZE_MAX, width);
-        TEST_TRUE(runner, size == SIZE_MAX,
-                  "Memory_oversize hits ceiling at SIZE_MAX (width %d)", width);
-        size = Memory_oversize(SIZE_MAX - 1, width);
-        TEST_TRUE(runner, size == SIZE_MAX,
-                  "Memory_oversize hits ceiling at SIZE_MAX (width %d)", width);
-    }
-}
-
-static void
-test_oversize__rounding(TestBatchRunner *runner) {
-    int widths[] = { 1, 2, 4, 0 };
-
-    for (int width_tick = 0; widths[width_tick] != 0; width_tick++) {
-        int width = widths[width_tick];
-        for (int i = 0; i < 25; i++) {
-            size_t size = Memory_oversize(i, width);
-            size_t bytes = size * width;
-            if (bytes % sizeof(void*) != 0) {
-                FAIL(runner, "Rounding failure for %d, width %d",
-                     i, width);
-                return;
-            }
-        }
-    }
-    PASS(runner, "Round allocations up to the size of a pointer");
-}
-
-void
-TestMemory_Run_IMP(TestMemory *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 30);
-    test_oversize__growth_rate(runner);
-    test_oversize__ceiling(runner);
-    test_oversize__rounding(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
deleted file mode 100644
index d0b5803..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::Util::TestMemory
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestMemory*
-    new();
-
-    void
-    Run(TestMemory *self, TestBatchRunner *runner);
-}
-
-


[lucy-commits] [19/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/201-method.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/201-method.t b/clownfish/compiler/perl/t/201-method.t
deleted file mode 100644
index d1b232e..0000000
--- a/clownfish/compiler/perl/t/201-method.t
+++ /dev/null
@@ -1,139 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 30;
-
-BEGIN { use_ok('Clownfish::CFC::Model::Method') }
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-$parser->parse('parcel Neato;')
-    or die "failed to process parcel_definition";
-
-my %args = (
-    parcel      => 'Neato',
-    return_type => $parser->parse('Obj*'),
-    class_name  => 'Neato::Foo',
-    class_cnick => 'Foo',
-    param_list  => $parser->parse('(Foo *self, int32_t count = 0)'),
-    macro_sym   => 'Return_An_Obj',
-);
-
-my $method = Clownfish::CFC::Model::Method->new(%args);
-isa_ok( $method, "Clownfish::CFC::Model::Method" );
-
-ok( $method->parcel, "parcel exposure by default" );
-
-eval {
-    my $death
-        = Clownfish::CFC::Model::Method->new( %args, extra_arg => undef );
-};
-like( $@, qr/extra_arg/, "Extra arg kills constructor" );
-
-eval {
-    Clownfish::CFC::Model::Method->new( %args, macro_sym => 'return_an_obj' );
-};
-like( $@, qr/macro_sym/, "Invalid macro_sym kills constructor" );
-
-my $dupe = Clownfish::CFC::Model::Method->new(%args);
-ok( $method->compatible($dupe), "compatible()" );
-
-my $macro_sym_differs
-    = Clownfish::CFC::Model::Method->new( %args, macro_sym => 'Eat' );
-ok( !$method->compatible($macro_sym_differs),
-    "different macro_sym spoils compatible()"
-);
-ok( !$macro_sym_differs->compatible($method), "... reversed" );
-
-my $extra_param = Clownfish::CFC::Model::Method->new( %args,
-    param_list => $parser->parse('(Foo *self, int32_t count = 0, int b)'), );
-ok( !$method->compatible($macro_sym_differs),
-    "extra param spoils compatible()"
-);
-ok( !$extra_param->compatible($method), "... reversed" );
-
-my $default_differs = Clownfish::CFC::Model::Method->new( %args,
-    param_list => $parser->parse('(Foo *self, int32_t count = 1)'), );
-ok( !$method->compatible($default_differs),
-    "different initial_value spoils compatible()"
-);
-ok( !$default_differs->compatible($method), "... reversed" );
-
-my $missing_default = Clownfish::CFC::Model::Method->new( %args,
-    param_list => $parser->parse('(Foo *self, int32_t count)'), );
-ok( !$method->compatible($missing_default),
-    "missing initial_value spoils compatible()"
-);
-ok( !$missing_default->compatible($method), "... reversed" );
-
-my $param_name_differs = Clownfish::CFC::Model::Method->new( %args,
-    param_list => $parser->parse('(Foo *self, int32_t countess)'), );
-ok( !$method->compatible($param_name_differs),
-    "different param name spoils compatible()"
-);
-ok( !$param_name_differs->compatible($method), "... reversed" );
-
-my $param_type_differs = Clownfish::CFC::Model::Method->new( %args,
-    param_list => $parser->parse('(Foo *self, uint32_t count)'), );
-ok( !$method->compatible($param_type_differs),
-    "different param type spoils compatible()"
-);
-ok( !$param_type_differs->compatible($method), "... reversed" );
-
-my $self_type_differs = Clownfish::CFC::Model::Method->new(
-    %args,
-    class_name  => 'Neato::Bar',
-    class_cnick => 'Bar',
-    param_list  => $parser->parse('(Bar *self, int32_t count = 0)'),
-);
-ok( $method->compatible($self_type_differs),
-    "different self type still compatible(), since can't test inheritance" );
-ok( $self_type_differs->compatible($method), "... reversed" );
-
-my $not_final = Clownfish::CFC::Model::Method->new(%args);
-my $final     = $not_final->finalize;
-
-eval { $method->override($final); };
-like( $@, qr/final/i, "Can't override final method" );
-
-ok( $not_final->compatible($final), "Finalize clones properly" );
-
-for my $meth_meth (qw( short_method_sym full_method_sym full_offset_sym)) {
-    eval { my $blah = $method->$meth_meth; };
-    like( $@, qr/invoker/, "$meth_meth requires invoker" );
-}
-
-$parser->set_class_name("Neato::Obj");
-$parser->set_class_cnick("Obj");
-isa_ok(
-    $parser->parse($_),
-    "Clownfish::CFC::Model::Method",
-    "method declaration: $_"
-    )
-    for (
-    'public int Do_Foo(Obj *self);',
-    'Obj* Gimme_An_Obj(Obj *self);',
-    'void Do_Whatever(Obj *self, uint32_t a_num, float real);',
-    'Foo* Fetch_Foo(Obj *self, int num);',
-    );
-
-for ( 'public final void The_End(Obj *self);', ) {
-    my $meth = $parser->parse($_);
-    ok( $meth && $meth->final, "final method: $_" );
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/202-overridden_method.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/202-overridden_method.t b/clownfish/compiler/perl/t/202-overridden_method.t
deleted file mode 100644
index 5e166ea..0000000
--- a/clownfish/compiler/perl/t/202-overridden_method.t
+++ /dev/null
@@ -1,46 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-
-use Clownfish::CFC::Model::Method;
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-$parser->parse('parcel Neato;')
-    or die "failed to process parcel_definition";
-
-my %args = (
-    return_type => $parser->parse('Obj*'),
-    class_name  => 'Neato::Foo',
-    class_cnick => 'Foo',
-    param_list  => $parser->parse('(Foo *self)'),
-    macro_sym   => 'Return_An_Obj',
-    parcel      => 'Neato',
-);
-
-my $orig      = Clownfish::CFC::Model::Method->new(%args);
-my $overrider = Clownfish::CFC::Model::Method->new(
-    %args,
-    param_list  => $parser->parse('(FooJr *self)'),
-    class_name  => 'Neato::Foo::FooJr',
-    class_cnick => 'FooJr'
-);
-$overrider->override($orig);
-ok( !$overrider->novel, "A Method which overrides another is not 'novel'" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/203-final_method.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/203-final_method.t b/clownfish/compiler/perl/t/203-final_method.t
deleted file mode 100644
index 8829f41..0000000
--- a/clownfish/compiler/perl/t/203-final_method.t
+++ /dev/null
@@ -1,40 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 2;
-
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-$parser->parse('parcel Neato;')
-    or die "failed to process parcel_definition";
-
-my %args = (
-    return_type => $parser->parse('Obj*'),
-    class_name  => 'Neato::Foo',
-    class_cnick => 'Foo',
-    param_list  => $parser->parse('(Foo* self)'),
-    macro_sym   => 'Return_An_Obj',
-    parcel      => 'Neato',
-);
-
-my $not_final_method = Clownfish::CFC::Model::Method->new(%args);
-my $final_method     = $not_final_method->finalize;
-ok( !$not_final_method->final, "not final by default" );
-ok( $final_method->final,      "finalize" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/300-variable.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/300-variable.t b/clownfish/compiler/perl/t/300-variable.t
deleted file mode 100644
index a5f33be..0000000
--- a/clownfish/compiler/perl/t/300-variable.t
+++ /dev/null
@@ -1,86 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 13;
-
-BEGIN { use_ok('Clownfish::CFC::Model::Variable') }
-
-my $parser = Clownfish::CFC::Parser->new;
-$parser->parse('parcel Neato;')
-    or die "failed to process parcel_definition";
-
-sub new_type { $parser->parse(shift) }
-
-eval {
-    my $death = Clownfish::CFC::Model::Variable->new(
-        micro_sym => 'foo',
-        type      => new_type('int'),
-        extra_arg => undef,
-    );
-};
-like( $@, qr/extra_arg/, "Extra arg kills constructor" );
-
-eval {
-    my $death = Clownfish::CFC::Model::Variable->new( micro_sym => 'foo' );
-};
-like( $@, qr/type/, "type is required" );
-eval {
-    my $death
-        = Clownfish::CFC::Model::Variable->new( type => new_type('int32_t') );
-};
-like( $@, qr/micro_sym/, "micro_sym is required" );
-
-my $var = Clownfish::CFC::Model::Variable->new(
-    micro_sym => 'foo',
-    type      => new_type('float*')
-);
-$var->resolve_type([]);
-is( $var->local_c,           'float* foo',  "local_c" );
-is( $var->local_declaration, 'float* foo;', "declaration" );
-ok( $var->local, "default to local access" );
-
-$var = Clownfish::CFC::Model::Variable->new(
-    micro_sym => 'foo',
-    type      => new_type('float[1]')
-);
-$var->resolve_type([]);
-is( $var->local_c, 'float foo[1]',
-    "to_c appends array to var name rather than type specifier" );
-
-my $foo_class = $parser->parse("class Foo {}");
-$var = Clownfish::CFC::Model::Variable->new(
-    parcel      => 'Neato',
-    micro_sym   => 'foo',
-    type        => new_type("Foo*"),
-    class_name  => 'Crustacean::Lobster::LobsterClaw',
-    class_cnick => 'LobClaw',
-);
-$var->resolve_type([ $foo_class ]);
-is( $var->global_c, 'neato_Foo* neato_LobClaw_foo', "global_c" );
-
-isa_ok(
-    $parser->parse($_),
-    "Clownfish::CFC::Model::Variable",
-    "var_declaration_statement: $_"
-    )
-    for (
-    'int foo;',
-    'inert Obj *obj;',
-    'public inert int32_t **foo;',
-    'Dog *fido;'
-    );

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/301-param_list.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/301-param_list.t b/clownfish/compiler/perl/t/301-param_list.t
deleted file mode 100644
index b315e9a..0000000
--- a/clownfish/compiler/perl/t/301-param_list.t
+++ /dev/null
@@ -1,57 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 13;
-
-BEGIN { use_ok('Clownfish::CFC::Model::ParamList') }
-
-my $parser = Clownfish::CFC::Parser->new;
-$parser->parse('parcel Neato;')
-    or die "failed to process parcel_definition";
-
-isa_ok(
-    $parser->parse($_),
-    "Clownfish::CFC::Model::Variable",
-    "param_variable: $_"
-) for ( 'uint32_t baz', 'String *stuff', 'float **ptr', );
-
-my $obj_class = $parser->parse("class Obj {}");
-
-my $param_list = $parser->parse("(Obj *self, int num)");
-$param_list->resolve_types([ $obj_class ]);
-isa_ok( $param_list, "Clownfish::CFC::Model::ParamList" );
-ok( !$param_list->variadic, "not variadic" );
-is( $param_list->to_c, 'neato_Obj* self, int num', "to_c" );
-is( $param_list->name_list, 'self, num', "name_list" );
-
-$param_list = $parser->parse("(Obj *self=NULL, int num, ...)");
-$param_list->resolve_types([ $obj_class ]);
-ok( $param_list->variadic, "variadic" );
-is_deeply(
-    $param_list->get_initial_values,
-    [ "NULL", undef ],
-    "initial_values"
-);
-is( $param_list->to_c, 'neato_Obj* self, int num, ...', "to_c" );
-is( $param_list->num_vars, 2, "num_vars" );
-isa_ok(
-    $param_list->get_variables->[0],
-    "Clownfish::CFC::Model::Variable",
-    "get_variables..."
-);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/400-file_spec.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/400-file_spec.t b/clownfish/compiler/perl/t/400-file_spec.t
deleted file mode 100644
index 246bf33..0000000
--- a/clownfish/compiler/perl/t/400-file_spec.t
+++ /dev/null
@@ -1,39 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 4;
-
-use Clownfish::CFC::Model::FileSpec;
-
-my %args = (
-    source_dir  => 'Clownfish/_include',
-    path_part   => 'Stuff/Thing',
-);
-my $file_spec;
-
-$file_spec = Clownfish::CFC::Model::FileSpec->new(%args);
-is( $file_spec->get_source_dir, "Clownfish/_include", "get_source_dir" );
-is( $file_spec->get_path_part, "Stuff/Thing", "get_path_part" );
-ok( !$file_spec->included, "included default" );
-
-$file_spec = Clownfish::CFC::Model::FileSpec->new(
-    %args,
-    is_included => 1,
-);
-ok( $file_spec->included, "included" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/401-class.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/401-class.t b/clownfish/compiler/perl/t/401-class.t
deleted file mode 100644
index 1c83a90..0000000
--- a/clownfish/compiler/perl/t/401-class.t
+++ /dev/null
@@ -1,274 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 53;
-use Clownfish::CFC::Model::Class;
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-
-my $thing = Clownfish::CFC::Model::Variable->new(
-    parcel     => 'Neato',
-    class_name => 'Foo',
-    type       => $parser->parse('Thing*'),
-    micro_sym  => 'thing',
-);
-my $widget = Clownfish::CFC::Model::Variable->new(
-    class_name => 'Widget',
-    type       => $parser->parse('Widget*'),
-    micro_sym  => 'widget',
-);
-my $tread_water = Clownfish::CFC::Model::Function->new(
-    parcel      => 'Neato',
-    class_name  => 'Foo',
-    return_type => $parser->parse('void'),
-    micro_sym   => 'tread_water',
-    param_list  => $parser->parse('()'),
-);
-my %foo_create_args = (
-    parcel     => 'Neato',
-    class_name => 'Foo',
-);
-
-my $foo = Clownfish::CFC::Model::Class->create(%foo_create_args);
-$foo->add_function($tread_water);
-$foo->add_member_var($thing);
-$foo->add_inert_var($widget);
-my $should_be_foo = Clownfish::CFC::Model::Class->fetch_singleton(
-    parcel     => 'Neato',
-    class_name => 'Foo',
-);
-is( $$foo, $$should_be_foo, "fetch_singleton" );
-
-eval { Clownfish::CFC::Model::Class->create(%foo_create_args) };
-like( $@, qr/two classes with name/i,
-      "Can't call create for the same class more than once" );
-eval {
-    Clownfish::CFC::Model::Class->create(
-        parcel     => 'Neato',
-        class_name => 'Other::Foo',
-    );
-};
-like( $@, qr/class name conflict/i,
-      "Can't create classes wth the same final component" );
-eval {
-    Clownfish::CFC::Model::Class->create(
-        parcel     => 'Neato',
-        class_name => 'Bar',
-        cnick      => 'Foo',
-    );
-};
-like( $@, qr/class nickname conflict/i,
-      "Can't create classes wth the same nickname" );
-
-my $foo_jr = Clownfish::CFC::Model::Class->create(
-    parcel            => 'Neato',
-    class_name        => 'Foo::FooJr',
-    parent_class_name => 'Foo',
-);
-
-is( $foo_jr->get_struct_sym,  'FooJr',       "struct_sym" );
-is( $foo_jr->full_struct_sym, 'neato_FooJr', "full_struct_sym" );
-
-my $file_spec = Clownfish::CFC::Model::FileSpec->new(
-    source_dir  => '.',
-    path_part   => 'Foo/FooJr',
-);
-my $final_foo = Clownfish::CFC::Model::Class->create(
-    parcel            => 'Neato',
-    class_name        => 'Foo::FooJr::FinalFoo',
-    parent_class_name => 'Foo::FooJr',
-    file_spec         => $file_spec,
-    final             => 1,
-);
-ok( $final_foo->final, "final" );
-is( $final_foo->include_h, 'Foo/FooJr.h', "inlude_h uses path_part" );
-is( $final_foo->get_parent_class_name, 'Foo::FooJr',
-    "get_parent_class_name" );
-
-$parser->parse("parcel Neato;");
-$parser->set_class_name("Foo");
-my $do_stuff = $parser->parse('void Do_Stuff(Foo *self);')
-    or die "parsing failure";
-$foo->add_method($do_stuff);
-
-$parser->set_class_name("InertFoo");
-my $inert_do_stuff = $parser->parse('void Do_Stuff(InertFoo *self);')
-    or die "parsing failure";
-$parser->set_class_name("");
-
-my %inert_args = (
-    parcel     => 'Neato',
-    class_name => 'InertFoo',
-    inert      => 1,
-);
-eval {
-    my $class = Clownfish::CFC::Model::Class->create(%inert_args);
-    $class->add_method($inert_do_stuff);
-};
-like(
-    $@,
-    qr/inert class/i,
-    "Error out on conflict between inert attribute and object method"
-);
-
-$foo->add_child($foo_jr);
-$foo_jr->add_child($final_foo);
-$foo->grow_tree;
-eval { $foo->grow_tree };
-like( $@, qr/grow_tree/, "call grow_tree only once." );
-eval { $foo_jr->add_method($do_stuff) };
-like( $@, qr/grow_tree/, "Forbid add_method after grow_tree." );
-
-is( ${ $foo_jr->get_parent },    $$foo,    "grow_tree, one level" );
-is( ${ $final_foo->get_parent }, $$foo_jr, "grow_tree, two levels" );
-is( ${ $foo->fresh_method("Do_Stuff") }, $$do_stuff, 'fresh_method' );
-is( ${ $foo_jr->method("Do_Stuff") },    $$do_stuff, "inherited method" );
-ok( !$foo_jr->fresh_method("Do_Stuff"),    'inherited method not "fresh"' );
-ok( $final_foo->method("Do_Stuff")->final, "Finalize inherited method" );
-ok( !$foo_jr->method("Do_Stuff")->final, "Don't finalize method in parent" );
-is_deeply( $foo->inert_vars,        [$widget],      "inert vars" );
-is_deeply( $foo->functions,         [$tread_water], "inert funcs" );
-is_deeply( $foo->methods,           [$do_stuff],    "methods" );
-is_deeply( $foo->fresh_methods,     [$do_stuff],    "fresh_methods" );
-is_deeply( $foo->fresh_member_vars, [$thing],       "fresh_member_vars" );
-is_deeply( $foo_jr->member_vars,    [$thing],       "inherit member vars" );
-is_deeply( $foo_jr->functions,         [], "don't inherit inert funcs" );
-is_deeply( $foo_jr->fresh_member_vars, [], "fresh_member_vars" );
-is_deeply( $foo_jr->inert_vars,        [], "don't inherit inert vars" );
-is_deeply( $final_foo->fresh_methods,  [], "fresh_methods" );
-
-is_deeply( $foo->tree_to_ladder, [ $foo, $foo_jr, $final_foo ],
-    'tree_to_ladder' );
-
-ok( $parser->parse("$_ class Iam$_ { }")->$_, "class_modifier: $_" )
-    for (qw( final inert ));
-
-is( $parser->parse("class Fu::$_ inherits $_ { }")->get_parent_class_name,
-    $_, "class_inheritance: $_" )
-    for ( 'Fooble', 'Foo::FooJr::FooIII' );
-
-is( $parser->parse("class MissingInherits { }")->get_parent_class_name,
-    "Clownfish::Obj", "class inherits from Clownfish::Obj by default" );
-
-my $class_content
-    = 'public class Foo::Foodie cnick Foodie inherits Foo { int num; }';
-my $class = $parser->parse($class_content);
-isa_ok( $class, "Clownfish::CFC::Model::Class", "class_declaration FooJr" );
-ok( ( scalar grep { $_->micro_sym eq 'num' } @{ $class->member_vars } ),
-    "parsed member var" );
-
-$class_content = q|
-    /**
-     * Bow wow.
-     *
-     * Wow wow wow.
-     */
-    public class Animal::Dog inherits Animal {
-        public inert Dog* init(Dog *self, String *name, String *fave_food);
-        inert uint32_t count();
-        inert uint64_t num_dogs;
-        public inert Dog* top_dog;
-
-        String  *name;
-        bool     likes_to_go_fetch;
-        ChewToy *squishy;
-        Owner   *mom;
-
-        void               Destroy(Dog *self);
-        public String*     Bark(Dog *self);
-        public void        Eat(Dog *self);
-        public void        Bite(Dog *self, Enemy *enemy);
-        public Thing      *Fetch(Dog *self, Thing *thing);
-        public final void  Bury(Dog *self, Bone *bone);
-        public abstract incremented nullable Thing*
-        Scratch(Dog *self);
-
-        int32_t[1]  flexible_array_at_end_of_struct;
-    }
-|;
-
-$class = $parser->parse($class_content);
-isa_ok( $class, "Clownfish::CFC::Model::Class", "class_declaration Dog" );
-ok( ( scalar grep { $_->micro_sym eq 'num_dogs' } @{ $class->inert_vars } ),
-    "parsed inert var" );
-ok( ( scalar grep { $_->micro_sym eq 'top_dog' } @{ $class->inert_vars } ),
-    "parsed public inert var" );
-ok( ( scalar grep { $_->micro_sym eq 'mom' } @{ $class->member_vars } ),
-    "parsed member var" );
-ok( ( scalar grep { $_->micro_sym eq 'squishy' } @{ $class->member_vars } ),
-    "parsed member var" );
-ok( ( scalar grep { $_->micro_sym eq 'init' } @{ $class->functions } ),
-    "parsed function" );
-ok( ( scalar grep { $_->micro_sym eq 'destroy' } @{ $class->methods } ),
-    "parsed parcel method" );
-ok( ( scalar grep { $_->micro_sym eq 'bury' } @{ $class->methods } ),
-    "parsed public method" );
-ok( ( scalar grep { $_->micro_sym eq 'scratch' } @{ $class->methods } ),
-    "parsed public abstract nullable method" );
-
-for my $method ( @{ $class->methods } ) {
-    if ( $method->micro_sym eq 'scratch' ) {
-        ok( $method->get_return_type->nullable,
-            "public abstract incremented nullable flagged as nullable" );
-    }
-}
-is( ( scalar grep { $_->public } @{ $class->methods } ),
-    6, "pass acl to Method constructor" );
-
-$class_content = qq|
-    inert class Rigor::Mortis cnick Mort {
-        inert void lie_still();
-    }|;
-$class = $parser->parse($class_content);
-isa_ok( $class, "Clownfish::CFC::Model::Class", "inert class_declaration" );
-ok( $class->inert, "inert modifier parsed and passed to constructor" );
-
-$class_content = qq|
-    final class Ultimo {
-        /** Throws an error.
-         */
-        void Say_Never(Ultimo *self);
-    }|;
-$class = $parser->parse($class_content);
-ok( $class->final, "final class_declaration" );
-
-Clownfish::CFC::Model::Class->_clear_registry();
-
-{
-    eval {
-        my $class = Clownfish::CFC::Model::Class->create(%foo_create_args);
-        my $inert = Clownfish::CFC::Model::Class->create(%inert_args);
-        $class->add_child($inert);
-    };
-    like( $@, qr/inert class/i, "inert class can't inherit" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-}
-
-{
-    eval {
-        my $class = Clownfish::CFC::Model::Class->create(%foo_create_args);
-        my $inert = Clownfish::CFC::Model::Class->create(%inert_args);
-        $inert->add_child($class);
-    };
-    like( $@, qr/inert class/i, "can't inherit from inert class" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/402-c_block.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/402-c_block.t b/clownfish/compiler/perl/t/402-c_block.t
deleted file mode 100644
index 94fb50d..0000000
--- a/clownfish/compiler/perl/t/402-c_block.t
+++ /dev/null
@@ -1,36 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 5;
-
-use Clownfish::CFC::Model::CBlock;
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-
-my $block = Clownfish::CFC::Model::CBlock->new( contents => 'int foo;' );
-isa_ok( $block, "Clownfish::CFC::Model::CBlock" );
-is( $block->get_contents, 'int foo;', "get_contents" );
-eval { Clownfish::CFC::Model::CBlock->new };
-like( $@, qr/contents/, "content required" );
-
-$block = $parser->parse(qq| __C__\n#define FOO_BAR 1\n__END_C__  |);
-
-isa_ok( $block, "Clownfish::CFC::Model::CBlock" );
-is( $block->get_contents, "#define FOO_BAR 1\n", "parse embed_c" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/403-parcel.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/403-parcel.t b/clownfish/compiler/perl/t/403-parcel.t
deleted file mode 100644
index c311987..0000000
--- a/clownfish/compiler/perl/t/403-parcel.t
+++ /dev/null
@@ -1,112 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 18;
-use File::Spec::Functions qw( catfile );
-
-BEGIN { use_ok('Clownfish::CFC::Model::Parcel') }
-
-my $foo = Clownfish::CFC::Model::Parcel->new( name => "Foo" );
-isa_ok( $foo, "Clownfish::CFC::Model::Parcel", "new" );
-ok( !$foo->included, "not included" );
-$foo->register;
-
-my $same_name = Clownfish::CFC::Model::Parcel->new( name => "Foo" );
-eval { $same_name->register; };
-like( $@, qr/parcel .* already registered/i,
-      "can't register two parcels with the same name" );
-
-my $same_nick = Clownfish::CFC::Model::Parcel->new(
-    name  => "OtherFoo",
-    cnick => "Foo",
-);
-eval { $same_nick->register; };
-like( $@, qr/parcel with nickname .* already registered/i,
-      "can't register two parcels with the same nickname" );
-
-my $included_foo = Clownfish::CFC::Model::Parcel->new(
-    name        => "IncludedFoo",
-    is_included => 1,
-);
-ok( $included_foo->included, "included" );
-$included_foo->register;
-
-my $parcels = Clownfish::CFC::Model::Parcel->all_parcels;
-my @names = sort(map { $_->get_name } @$parcels);
-is_deeply( \@names, [ "Foo", "IncludedFoo" ], "all_parcels" );
-
-my $dependent_foo = Clownfish::CFC::Model::Parcel->new(
-    name        => "DependentFoo",
-    is_included => 1,
-);
-$dependent_foo->register;
-
-$foo->add_inherited_parcel($included_foo);
-$foo->add_dependent_parcel($dependent_foo);
-my @dep_names = sort(map { $_->get_name } @{ $foo->dependent_parcels });
-is_deeply( \@dep_names, [ "DependentFoo", "IncludedFoo" ],
-           "dependent_parcels" );
-my @inh_names = sort(map { $_->get_name } @{ $foo->inherited_parcels });
-is_deeply( \@inh_names, [ "IncludedFoo" ], "inherited_parcels" );
-
-my $json = qq|
-        {
-            "name": "Crustacean",
-            "nickname": "Crust",
-            "version": "v0.1.0"
-        }
-|;
-isa_ok(
-    Clownfish::CFC::Model::Parcel->new_from_json( json => $json ),
-    "Clownfish::CFC::Model::Parcel",
-    "new_from_json"
-);
-
-isa_ok(
-    Clownfish::CFC::Model::Parcel->new_from_file(
-        path => catfile(qw( t cfbase Animal.cfp )),
-    ),
-    "Clownfish::CFC::Model::Parcel",
-    "new_from_file"
-);
-
-# Register singleton.
-my $parcel = Clownfish::CFC::Model::Parcel->new(
-    name  => 'Crustacean',
-    cnick => 'Crust',
-);
-$parcel->register;
-is( $parcel->get_version->get_vstring, 'v0', "get_version" );
-
-my $thing = Clownfish::CFC::Model::Symbol->new(
-    micro_sym => 'sym',
-    exposure  => 'parcel',
-);
-is( $thing->get_prefix, '', 'get_prefix with no parcel' );
-is( $thing->get_Prefix, '', 'get_Prefix with no parcel' );
-is( $thing->get_PREFIX, '', 'get_PREFIx with no parcel' );
-
-$thing = Clownfish::CFC::Model::Symbol->new(
-    micro_sym => 'sym',
-    parcel    => 'Crustacean',
-    exposure  => 'parcel'
-);
-is( $thing->get_prefix, 'crust_', 'get_prefix with parcel' );
-is( $thing->get_Prefix, 'Crust_', 'get_Prefix with parcel' );
-is( $thing->get_PREFIX, 'CRUST_', 'get_PREFIx with parcel' );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/404-file.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/404-file.t b/clownfish/compiler/perl/t/404-file.t
deleted file mode 100644
index 11668c4..0000000
--- a/clownfish/compiler/perl/t/404-file.t
+++ /dev/null
@@ -1,99 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 21;
-use File::Spec::Functions qw( catdir );
-
-use Clownfish::CFC::Model::File;
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-
-my $parcel_declaration = "parcel Stuff;";
-my $class_content      = qq|
-    class Stuff::Thing {
-        Foo *foo;
-        Bar *bar;
-    }
-    class Foo {}
-    class Bar {}
-|;
-my $c_block = "__C__\nint foo;\n__END_C__\n";
-
-my $path_part = catdir(qw( Stuff Thing ));
-my $file_spec = Clownfish::CFC::Model::FileSpec->new(
-    source_dir  => '.',
-    path_part   => $path_part,
-);
-
-{
-    my $file
-        = $parser->_parse_file( "$parcel_declaration\n$class_content\n$c_block",
-        $file_spec );
-
-    is( $file->get_source_dir, ".", "get_source_dir" );
-    is( $file->get_path_part, $path_part, "get_path_part" );
-    ok( !$file->included, "included" );
-
-    my $guard_name = $file->guard_name;
-    is( $guard_name, "H_STUFF_THING", "guard_name" );
-    like( $file->guard_start, qr/$guard_name/, "guard_start" );
-    like( $file->guard_close, qr/$guard_name/,
-        "guard_close includes guard_name" );
-
-    ok( !$file->get_modified, "modified false at start" );
-    $file->set_modified(1);
-    ok( $file->get_modified, "set_modified, get_modified" );
-
-    my $path_sep = $^O =~ /^mswin/i ? '\\' : '/';
-    my $path_to_stuff_thing = join( $path_sep, qw( path to Stuff Thing ) );
-    is( $file->cfh_path('path/to'), "$path_to_stuff_thing.cfh", "cfh_path" );
-    is( $file->c_path('path/to'),   "$path_to_stuff_thing.c",   "c_path" );
-    is( $file->h_path('path/to'),   "$path_to_stuff_thing.h",   "h_path" );
-
-    my $classes = $file->classes;
-    is( scalar @$classes, 3, "classes() filters blocks" );
-    my $class = $classes->[0];
-    my ( $foo, $bar ) = @{ $class->member_vars };
-    $foo->resolve_type($classes);
-    $bar->resolve_type($classes);
-    is( $foo->get_type->get_specifier,
-        'stuff_Foo', 'file production picked up parcel def' );
-    is( $bar->get_type->get_specifier, 'stuff_Bar', 'parcel def is sticky' );
-
-    my $blocks = $file->blocks;
-    is( scalar @$blocks, 5, "all five blocks" );
-    isa_ok( $blocks->[0], "Clownfish::CFC::Model::Parcel" );
-    isa_ok( $blocks->[1], "Clownfish::CFC::Model::Class" );
-    isa_ok( $blocks->[2], "Clownfish::CFC::Model::Class" );
-    isa_ok( $blocks->[3], "Clownfish::CFC::Model::Class" );
-    isa_ok( $blocks->[4], "Clownfish::CFC::Model::CBlock" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-}
-
-{
-    my $file = $parser->_parse_file( $class_content, $file_spec );
-    my ($class) = @{ $file->classes };
-    my ( $foo, $bar ) = @{ $class->member_vars };
-    is( $foo->get_type->get_specifier, 'Foo', 'file production resets parcel' );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/500-hierarchy.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/500-hierarchy.t b/clownfish/compiler/perl/t/500-hierarchy.t
deleted file mode 100644
index 6c2a10c..0000000
--- a/clownfish/compiler/perl/t/500-hierarchy.t
+++ /dev/null
@@ -1,105 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 21;
-
-use Clownfish::CFC::Model::Hierarchy;
-use Clownfish::CFC::Util qw( a_isa_b );
-use File::Spec::Functions qw( catdir catfile splitpath );
-use Fcntl;
-use File::Path qw( rmtree mkpath );
-
-my $base_dir = catdir(qw( t cfbase ));
-my %args = (
-    dest => catdir(qw( t cfdest )),
-);
-
-# Clean up.
-rmtree( $args{dest} );
-
-eval {
-    my $death
-        = Clownfish::CFC::Model::Hierarchy->new( %args, extra_arg => undef );
-};
-like( $@, qr/extra_arg/, "Extra arg kills constructor" );
-
-my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(%args);
-isa_ok( $hierarchy, "Clownfish::CFC::Model::Hierarchy" );
-is( $hierarchy->get_dest, $args{dest}, "get_dest" );
-
-my $inc_dest = catfile( $args{dest}, "include" );
-is( $hierarchy->get_include_dest, $inc_dest, "get_include_dest" );
-
-my $src_dest = catfile( $args{dest}, "source" );
-is( $hierarchy->get_source_dest, $src_dest, "get_source_dest" );
-
-$hierarchy->add_source_dir($base_dir);
-is_deeply( $hierarchy->get_source_dirs, [ $base_dir ], "get_source_dirs" );
-
-$hierarchy->build;
-
-my @files = @{ $hierarchy->files };
-is( scalar @files, 3, "recursed and found all three files" );
-my %files;
-for my $file (@files) {
-    die "not a File" unless isa_ok( $file, "Clownfish::CFC::Model::File" );
-    ok( !$file->get_modified, "start off not modified" );
-    my ($class) = grep {
-        a_isa_b( $_, "Clownfish::CFC::Model::Class" )
-        && $_->get_class_name ne 'Clownfish::Obj'
-    } @{ $file->blocks };
-    die "no class" unless $class;
-    $files{ $class->get_class_name } = $file;
-}
-my $animal = $files{'Animal'}       or die "No Animal";
-my $dog    = $files{'Animal::Dog'}  or die "No Dog";
-my $util   = $files{'Animal::Util'} or die "No Util";
-
-my $classes = $hierarchy->ordered_classes;
-is( scalar @$classes, 4, "all classes" );
-for my $class (@$classes) {
-    die "not a Class" unless isa_ok( $class, "Clownfish::CFC::Model::Class" );
-}
-
-# Generate fake C files, with times set to one second ago.
-my $one_second_ago = time() - 1;
-for my $file (@files) {
-    my $h_path = $file->h_path( $inc_dest );
-    my ( undef, $dir, undef ) = splitpath($h_path);
-    mkpath($dir);
-    sysopen( my $fh, $h_path, O_CREAT | O_EXCL | O_WRONLY )
-        or die "Can't open '$h_path': $!";
-    print $fh "#include <stdio.h>\n";    # fake content.
-    close $fh or die "Can't close '$h_path': $!";
-    utime( $one_second_ago, $one_second_ago, $h_path )
-        or die "utime failed for '$h_path': $!";
-}
-
-my $path_to_animal_cf = $animal->cfh_path( $base_dir );
-utime( undef, undef, $path_to_animal_cf )
-    or die "utime for '$path_to_animal_cf' failed";    # touch
-
-$hierarchy->propagate_modified;
-
-ok( $animal->get_modified, "Animal modified" );
-ok( $dog->get_modified, "Parent's modification propagates to child's file" );
-ok( !$util->get_modified, "modification doesn't propagate to inert class" );
-
-# Clean up.
-rmtree( $args{dest} );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/501-include_dir.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/501-include_dir.t b/clownfish/compiler/perl/t/501-include_dir.t
deleted file mode 100644
index 8f16f4a..0000000
--- a/clownfish/compiler/perl/t/501-include_dir.t
+++ /dev/null
@@ -1,102 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 24;
-
-use Clownfish::CFC::Model::Hierarchy;
-use File::Spec::Functions qw( catdir catfile splitpath );
-use File::Path qw( rmtree );
-
-my $base_dir = catdir(qw( t cfbase ));
-my $ext_dir  = catdir(qw( t cfext ));
-my $dest_dir = catdir(qw( t cfdest ));
-
-# One source, one include
-
-{
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(dest => $dest_dir);
-
-    $hierarchy->add_source_dir($ext_dir);
-    is_deeply( $hierarchy->get_source_dirs, [ $ext_dir ], "get_source_dirs" );
-
-    $hierarchy->add_include_dir($base_dir);
-    is_deeply( $hierarchy->get_include_dirs, [ $base_dir ],
-               "get_include_dirs" );
-
-    $hierarchy->build;
-
-    my $classes = $hierarchy->ordered_classes;
-    is( scalar @$classes, 5, "all classes" );
-    my $num_included = 0;
-    for my $class (@$classes) {
-        die "not a Class"
-            unless isa_ok( $class, "Clownfish::CFC::Model::Class" );
-
-        my $expect;
-
-        if ($class->get_class_name eq "Animal::Rottweiler") {
-            $expect = 0;
-            my $parent_name = $class->get_parent->get_class_name;
-            is( $parent_name, "Animal::Dog", "parent of included class" );
-        }
-        else {
-            $expect = 1;
-        }
-
-        my $included = $class->included ? 1 : 0;
-        ++$num_included if $included;
-
-        is( $included, $expect, "included" );
-    }
-    is( $num_included, 4, "included class count" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-    Clownfish::CFC::Model::Parcel->reap_singletons();
-}
-
-# Two sources
-
-{
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(dest => $dest_dir);
-
-    $hierarchy->add_source_dir($base_dir);
-    $hierarchy->add_source_dir($ext_dir);
-    is_deeply( $hierarchy->get_source_dirs, [ $base_dir, $ext_dir ],
-               "get_source_dirs" );
-    is_deeply( $hierarchy->get_include_dirs, [], "get_include_dirs" );
-
-    $hierarchy->build;
-
-    my $classes = $hierarchy->ordered_classes;
-    is( scalar @$classes, 5, "all classes" );
-    for my $class (@$classes) {
-        die "not a Class" unless isa_ok( $class, "Clownfish::CFC::Model::Class" );
-
-        if ($class->get_class_name eq "Animal::Rottweiler") {
-            my $parent_name = $class->get_parent->get_class_name;
-            is( $parent_name, "Animal::Dog", "parent of class from second source" );
-        }
-    }
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-    Clownfish::CFC::Model::Parcel->reap_singletons();
-}
-
-# Clean up.
-rmtree($dest_dir);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/502-clash.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/502-clash.t b/clownfish/compiler/perl/t/502-clash.t
deleted file mode 100644
index ae64da1..0000000
--- a/clownfish/compiler/perl/t/502-clash.t
+++ /dev/null
@@ -1,115 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 5;
-
-use Clownfish::CFC::Model::Hierarchy;
-use File::Spec::Functions qw( catdir catfile splitpath );
-use File::Path qw( rmtree );
-
-my $base_dir        = catdir(qw( t cfbase ));
-my $ext_dir         = catdir(qw( t cfext ));
-my $dest_dir        = catdir(qw( t cfdest ));
-my $class_clash_dir = catdir(qw( t cfclash class ));
-my $file_clash_dir  = catdir(qw( t cfclash file ));
-
-{
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(dest => $dest_dir);
-
-    $hierarchy->add_source_dir($base_dir);
-    $hierarchy->add_source_dir($file_clash_dir);
-
-    eval { $hierarchy->build; };
-
-    my $filename = catfile(qw( Animal Dog.cfh ));
-    like( $@, qr/File \Q$filename\E already registered/,
-          "source/source filename clash" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-    Clownfish::CFC::Model::Parcel->reap_singletons();
-}
-
-{
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(dest => $dest_dir);
-
-    $hierarchy->add_source_dir($class_clash_dir);
-    $hierarchy->add_include_dir($base_dir);
-
-    eval { $hierarchy->build; };
-
-    like( $@, qr/Two classes with name/, "source/include class name clash" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-    Clownfish::CFC::Model::Parcel->reap_singletons();
-}
-
-{
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(dest => $dest_dir);
-
-    $hierarchy->add_source_dir($base_dir);
-    $hierarchy->add_include_dir($file_clash_dir);
-
-    $hierarchy->build;
-
-    my $classes = $hierarchy->ordered_classes;
-    is( scalar @$classes, 4, "source/include filename clash" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-    Clownfish::CFC::Model::Parcel->reap_singletons();
-}
-
-# Parcel/class include mismatch
-
-my $foo_dir = catdir(qw( t cfclash foo ));
-my $bar_dir = catdir(qw( t cfclash bar ));
-
-{
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(dest => $dest_dir);
-
-    $hierarchy->add_source_dir($foo_dir);
-    $hierarchy->add_include_dir($bar_dir);
-    $hierarchy->add_include_dir($base_dir);
-
-    eval { $hierarchy->build; };
-
-    like( $@, qr/Class .* from include dir .* parcel .* from source dir/,
-          "included class with source parcel" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-    Clownfish::CFC::Model::Parcel->reap_singletons();
-}
-
-{
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(dest => $dest_dir);
-
-    $hierarchy->add_source_dir($bar_dir);
-    $hierarchy->add_include_dir($foo_dir);
-    $hierarchy->add_include_dir($base_dir);
-
-    eval { $hierarchy->build; };
-
-    like( $@, qr/Class .* from source dir .* parcel .* from include dir/,
-          "source class with included parcel" );
-
-    Clownfish::CFC::Model::Class->_clear_registry();
-    Clownfish::CFC::Model::Parcel->reap_singletons();
-}
-
-# Clean up.
-rmtree($dest_dir);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/600-parser.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/600-parser.t b/clownfish/compiler/perl/t/600-parser.t
deleted file mode 100644
index 94dbed3..0000000
--- a/clownfish/compiler/perl/t/600-parser.t
+++ /dev/null
@@ -1,167 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 87;
-
-BEGIN { use_ok('Clownfish::CFC::Parser') }
-
-my $parser = Clownfish::CFC::Parser->new;
-isa_ok( $parser, "Clownfish::CFC::Parser" );
-
-isa_ok(
-    $parser->parse("parcel Fish;"),
-    "Clownfish::CFC::Model::Parcel",
-    "parcel_definition"
-);
-
-# Set and leave parcel.
-my $registered = Clownfish::CFC::Model::Parcel->new(
-    name  => 'Crustacean',
-    cnick => 'Crust',
-);
-$registered->register;
-my $parcel = $parser->parse('parcel Crustacean;')
-    or die "failed to process parcel_definition";
-is( $$parcel, $$registered, "Fetch registered parcel" );
-is( ${ $parser->get_parcel },
-    $$parcel, "parcel_definition sets internal \$parcel var" );
-
-for (qw( foo _foo foo_yoo FOO Foo fOO f00 foo_foo_foo )) {
-    my $var = $parser->parse("int32_t $_;");
-    is( $var->micro_sym, $_, "identifier/declarator: $_" );
-}
-
-for (qw( void float uint32_t int64_t uint8_t bool )) {
-    my $var = $parser->parse("int32_t $_;");
-    ok( !defined($var), "reserved word not parsed as identifier: $_" );
-}
-
-isa_ok( $parser->parse("bool"),
-    "Clownfish::CFC::Model::Type", "Charmony integer specifier bool" );
-
-for (qw( ByteBuf Obj ANDMatcher )) {
-    my $class = $parser->parse("class $_ {}");
-    my $type  = $parser->parse("$_*");
-    $type->resolve([ $class ]);
-    is( $type->get_specifier, "crust_$_", "object_type_specifier $_" );
-}
-
-ok( $parser->parse("const char")->const, "type_qualifier const" );
-
-ok( $parser->parse("$_ inert int32_t foo;")->$_, "exposure_specifier $_" )
-    for qw( public );
-
-ok( $parser->parse("int32_t foo;")->private,
-    "exposure_specifier '' implicitly private" );
-
-isa_ok( $parser->parse($_), "Clownfish::CFC::Model::Type", "type $_" )
-    for ( 'const char *', 'Obj*', 'i32_t', 'char[]', 'long[1]', 'i64_t[30]' );
-
-is( $parser->parse("(int32_t foo = $_)")->get_initial_values->[0],
-    $_, "hex_constant: $_" )
-    for (qw( 0x1 0x0a 0xFFFFFFFF -0xFC ));
-
-is( $parser->parse("(int32_t foo = $_)")->get_initial_values->[0],
-    $_, "integer_constant: $_" )
-    for (qw( 1 -9999  0 10000 ));
-
-is( $parser->parse("(double foo = $_)")->get_initial_values->[0],
-    $_, "float_constant: $_" )
-    for (qw( 1.0 -9999.999  0.1 0.0 ));
-
-is( $parser->parse("(String *foo = $_)")->get_initial_values->[0],
-    $_, "string_literal: $_" )
-    for ( q|"blah"|, q|"blah blah"|, q|"\\"blah\\" \\"blah\\""| );
-
-my @composites = ( 'int[]', "i32_t **", "Foo **", "Foo ***", "const void *" );
-for my $composite (@composites) {
-    my $parsed = $parser->parse($composite);
-    ok( $parsed && $parsed->is_composite, "composite_type: $composite" );
-}
-
-my @object_types = ( 'Obj *', "incremented Foo*", "decremented String *" );
-for my $object_type (@object_types) {
-    my $parsed = $parser->parse($object_type);
-    ok( $parsed && $parsed->is_object, "object_type: $object_type" );
-}
-
-my %param_lists = (
-    '(int foo)'                 => 1,
-    '(Obj *foo, Foo **foo_ptr)' => 2,
-    '()'                        => 0,
-);
-while ( my ( $param_list, $num_params ) = each %param_lists ) {
-    my $parsed = $parser->parse($param_list);
-    isa_ok(
-        $parsed,
-        "Clownfish::CFC::Model::ParamList",
-        "param_list: $param_list"
-    );
-}
-ok( $parser->parse("(int foo, ...)")->variadic, "variadic param list" );
-my $param_list = $parser->parse(q|(int foo = 0xFF, char *bar ="blah")|);
-is_deeply(
-    $param_list->get_initial_values,
-    [ '0xFF', '"blah"' ],
-    "initial values"
-);
-
-my %sub_args = ( class => 'Stuff::Obj', cnick => 'Obj' );
-
-$parser->set_class_name('Stuff::Obj');
-$parser->set_class_cnick('Obj');
-ok( $parser->parse($_), "declaration statement: $_" )
-    for (
-    'public Foo* Spew_Foo(Obj *self, uint32_t *how_many);',
-    'public inert Hash *hash;',
-    );
-
-for (qw( Foo FooJr FooIII Foo4th )) {
-    my $class = $parser->parse("class $_ {}");
-    my $type  = $parser->parse("$_*");
-    $type->resolve([ $class ]);
-    is( $type->get_specifier, "crust_$_", "object_type_specifier: $_" )
-}
-Clownfish::CFC::Model::Class->_clear_registry();
-
-SKIP: {
-    skip( "Can't recover from bad specifier under flex/lemon parser", 6 );
-    ok( !$parser->parse("$_*"), "illegal object_type_specifier: $_" )
-        for (qw( foo fooBar Foo_Bar FOOBAR 1Foo 1FOO ));
-}
-
-is( $parser->parse("class $_ { }")->get_class_name, $_, "class_name: $_" )
-    for (qw( Foo Foo::FooJr Foo::FooJr::FooIII Foo::FooJr::FooIII::Foo4th ));
-
-SKIP: {
-    skip( "Can't recover from bad class name under flex/lemon parser", 6 );
-    ok( !$parser->parse("class $_ { }"), "illegal class_name: $_" )
-        for (qw( foo fooBar Foo_Bar FOOBAR 1Foo 1FOO ));
-}
-
-is( $parser->parse(qq|class Foodie$_ cnick $_ { }|)->get_cnick,
-    $_, "cnick: $_" )
-    for (qw( Food FF ));
-
-SKIP: {
-    skip( "Can't recover from bad cnick under flex/lemon parser", 3 );
-    is( !$parser->parse(qq|class Foodie$_ cnick $_ { }|),
-        "Illegal cnick: $_" )
-        for (qw( foo fOO 1Foo ));
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfbase/Animal.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfbase/Animal.cfh b/clownfish/compiler/perl/t/cfbase/Animal.cfh
deleted file mode 100644
index 46130b7..0000000
--- a/clownfish/compiler/perl/t/cfbase/Animal.cfh
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Animal;
-
-class Clownfish::Obj { }
-
-abstract class Animal { }

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfbase/Animal.cfp
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfbase/Animal.cfp b/clownfish/compiler/perl/t/cfbase/Animal.cfp
deleted file mode 100644
index e2b5ab5..0000000
--- a/clownfish/compiler/perl/t/cfbase/Animal.cfp
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-    "name": "Animal",
-    "version": "v0.1.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfbase/Animal/Dog.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfbase/Animal/Dog.cfh b/clownfish/compiler/perl/t/cfbase/Animal/Dog.cfh
deleted file mode 100644
index 6d54baa..0000000
--- a/clownfish/compiler/perl/t/cfbase/Animal/Dog.cfh
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Animal;
-
-class Animal::Dog inherits Animal {
-    public inert incremented Dog*
-    new();
-
-    public inert Dog*
-    init(Dog *self);
-
-    public void
-    Bark(Dog *self);
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfbase/Animal/Util.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfbase/Animal/Util.cfh b/clownfish/compiler/perl/t/cfbase/Animal/Util.cfh
deleted file mode 100644
index f5688a5..0000000
--- a/clownfish/compiler/perl/t/cfbase/Animal/Util.cfh
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Animal;
-
-inert class Animal::Util {
-    inert void
-    groom(Animal *animal);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfclash/bar/Bar.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfclash/bar/Bar.cfh b/clownfish/compiler/perl/t/cfclash/bar/Bar.cfh
deleted file mode 100644
index 89e798e..0000000
--- a/clownfish/compiler/perl/t/cfclash/bar/Bar.cfh
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Bar;
-
-public class Bar inherits Clownfish::Obj {
-    int var;
-
-    public void
-    Method(Bar *self);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfclash/bar/Bar.cfp
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfclash/bar/Bar.cfp b/clownfish/compiler/perl/t/cfclash/bar/Bar.cfp
deleted file mode 100644
index e5868f6..0000000
--- a/clownfish/compiler/perl/t/cfclash/bar/Bar.cfp
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-    "name": "Bar",
-    "version": "v1.0.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfclash/bar/Baz.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfclash/bar/Baz.cfh b/clownfish/compiler/perl/t/cfclash/bar/Baz.cfh
deleted file mode 100644
index 00e4033..0000000
--- a/clownfish/compiler/perl/t/cfclash/bar/Baz.cfh
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Foo;
-
-public class Baz inherits Clownfish::Obj {
-    int var;
-
-    public void
-    Method(Baz *self);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfclash/class/Animal/DogClash.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfclash/class/Animal/DogClash.cfh b/clownfish/compiler/perl/t/cfclash/class/Animal/DogClash.cfh
deleted file mode 100644
index 3eba020..0000000
--- a/clownfish/compiler/perl/t/cfclash/class/Animal/DogClash.cfh
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel AnimalExtension;
-
-class Animal::Dog inherits Clownfish::Obj {
-    public inert incremented Dog*
-    new();
-
-    public inert Dog*
-    init(Dog *self);
-
-    public void
-    Bark(Dog *self);
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfclash/class/AnimalExtension.cfp
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfclash/class/AnimalExtension.cfp b/clownfish/compiler/perl/t/cfclash/class/AnimalExtension.cfp
deleted file mode 100644
index 76f31d3..0000000
--- a/clownfish/compiler/perl/t/cfclash/class/AnimalExtension.cfp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "name": "AnimalExtension",
-    "nickname": "AniExt",
-    "version": "v0.1.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfclash/file/Animal/Dog.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfclash/file/Animal/Dog.cfh b/clownfish/compiler/perl/t/cfclash/file/Animal/Dog.cfh
deleted file mode 100644
index 1357109..0000000
--- a/clownfish/compiler/perl/t/cfclash/file/Animal/Dog.cfh
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Animal;
-
-class Animal::AnotherDog inherits Animal {
-    public inert incremented AnotherDog*
-    new();
-
-    public inert AnotherDog*
-    init(AnotherDog *self);
-
-    public void
-    Bark(AnotherDog *self);
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfclash/foo/Foo.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfclash/foo/Foo.cfh b/clownfish/compiler/perl/t/cfclash/foo/Foo.cfh
deleted file mode 100644
index b770d8a..0000000
--- a/clownfish/compiler/perl/t/cfclash/foo/Foo.cfh
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Foo;
-
-public class Foo inherits Clownfish::Obj {
-    int var;
-
-    public void
-    Method(Foo *self);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfclash/foo/Foo.cfp
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfclash/foo/Foo.cfp b/clownfish/compiler/perl/t/cfclash/foo/Foo.cfp
deleted file mode 100644
index 2995169..0000000
--- a/clownfish/compiler/perl/t/cfclash/foo/Foo.cfp
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-    "name": "Foo",
-    "version": "v1.0.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfext/Animal/Rottweiler.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfext/Animal/Rottweiler.cfh b/clownfish/compiler/perl/t/cfext/Animal/Rottweiler.cfh
deleted file mode 100644
index 9e78b58..0000000
--- a/clownfish/compiler/perl/t/cfext/Animal/Rottweiler.cfh
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel AnimalExtension;
-
-class Animal::Rottweiler inherits Animal::Dog {
-    public inert incremented Rottweiler*
-    new();
-
-    public inert Rottweiler*
-    init(Rottweiler *self);
-
-    public void
-    Bark(Rottweiler *self);
-
-    public void
-    Bite(Rottweiler *self);
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/cfext/AnimalExtension.cfp
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/cfext/AnimalExtension.cfp b/clownfish/compiler/perl/t/cfext/AnimalExtension.cfp
deleted file mode 100644
index 76f31d3..0000000
--- a/clownfish/compiler/perl/t/cfext/AnimalExtension.cfp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "name": "AnimalExtension",
-    "nickname": "AniExt",
-    "version": "v0.1.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/001-util.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/001-util.t b/clownfish/compiler/perl/t/core/001-util.t
deleted file mode 100644
index b3ad862..0000000
--- a/clownfish/compiler/perl/t/core/001-util.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Util');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/050-docucomment.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/050-docucomment.t b/clownfish/compiler/perl/t/core/050-docucomment.t
deleted file mode 100644
index 09ad252..0000000
--- a/clownfish/compiler/perl/t/core/050-docucomment.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::DocuComment');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/051-symbol.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/051-symbol.t b/clownfish/compiler/perl/t/core/051-symbol.t
deleted file mode 100644
index 4209292..0000000
--- a/clownfish/compiler/perl/t/core/051-symbol.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Symbol');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/052-version.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/052-version.t b/clownfish/compiler/perl/t/core/052-version.t
deleted file mode 100644
index d5c2f63..0000000
--- a/clownfish/compiler/perl/t/core/052-version.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Version');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/100-type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/100-type.t b/clownfish/compiler/perl/t/core/100-type.t
deleted file mode 100644
index f5a0e24..0000000
--- a/clownfish/compiler/perl/t/core/100-type.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Type');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/200-function.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/200-function.t b/clownfish/compiler/perl/t/core/200-function.t
deleted file mode 100644
index d70d2b8..0000000
--- a/clownfish/compiler/perl/t/core/200-function.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Function');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/201-method.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/201-method.t b/clownfish/compiler/perl/t/core/201-method.t
deleted file mode 100644
index 0f24c25..0000000
--- a/clownfish/compiler/perl/t/core/201-method.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Method');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/300-variable.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/300-variable.t b/clownfish/compiler/perl/t/core/300-variable.t
deleted file mode 100644
index c89f830..0000000
--- a/clownfish/compiler/perl/t/core/300-variable.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Variable');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/301-param_list.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/301-param_list.t b/clownfish/compiler/perl/t/core/301-param_list.t
deleted file mode 100644
index 23cdeb6..0000000
--- a/clownfish/compiler/perl/t/core/301-param_list.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::ParamList');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/400-file_spec.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/400-file_spec.t b/clownfish/compiler/perl/t/core/400-file_spec.t
deleted file mode 100644
index c3d25b4..0000000
--- a/clownfish/compiler/perl/t/core/400-file_spec.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::FileSpec');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/401-class.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/401-class.t b/clownfish/compiler/perl/t/core/401-class.t
deleted file mode 100644
index 6e3b1b2..0000000
--- a/clownfish/compiler/perl/t/core/401-class.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Class');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/402-c_block.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/402-c_block.t b/clownfish/compiler/perl/t/core/402-c_block.t
deleted file mode 100644
index f993aa4..0000000
--- a/clownfish/compiler/perl/t/core/402-c_block.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::CBlock');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/403-parcel.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/403-parcel.t b/clownfish/compiler/perl/t/core/403-parcel.t
deleted file mode 100644
index 1258f6d..0000000
--- a/clownfish/compiler/perl/t/core/403-parcel.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Parcel');
-
-exit($passed ? 0 : 1);
-


[lucy-commits] [16/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCClass.c b/clownfish/compiler/src/CFCClass.c
deleted file mode 100644
index c2d5a2b..0000000
--- a/clownfish/compiler/src/CFCClass.c
+++ /dev/null
@@ -1,833 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-#define CFC_NEED_SYMBOL_STRUCT_DEF
-#include "CFCSymbol.h"
-#include "CFCClass.h"
-#include "CFCFunction.h"
-#include "CFCMethod.h"
-#include "CFCParcel.h"
-#include "CFCDocuComment.h"
-#include "CFCUtil.h"
-#include "CFCVariable.h"
-#include "CFCFileSpec.h"
-
-typedef struct CFCClassRegEntry {
-    char *key;
-    struct CFCClass *klass;
-} CFCClassRegEntry;
-
-static CFCClassRegEntry *registry = NULL;
-static size_t registry_size = 0;
-static size_t registry_cap  = 0;
-
-// Store a new CFCClass in a registry.
-static void
-S_register(CFCClass *self);
-
-struct CFCClass {
-    CFCSymbol symbol;
-    int tree_grown;
-    CFCDocuComment *docucomment;
-    struct CFCClass *parent;
-    struct CFCClass **children;
-    size_t num_kids;
-    CFCFunction **functions;
-    size_t num_functions;
-    CFCMethod **methods;
-    size_t num_methods;
-    CFCVariable **member_vars;
-    size_t num_member_vars;
-    CFCVariable **inert_vars;
-    size_t num_inert_vars;
-    CFCFileSpec *file_spec;
-    char *parent_class_name;
-    int is_final;
-    int is_inert;
-    char *struct_sym;
-    char *full_struct_sym;
-    char *ivars_struct;
-    char *full_ivars_struct;
-    char *ivars_func;
-    char *full_ivars_func;
-    char *full_ivars_offset;
-    char *short_vtable_var;
-    char *full_vtable_var;
-    char *privacy_symbol;
-    char *include_h;
-};
-
-// Link up parents and kids.
-static void
-S_establish_ancestry(CFCClass *self);
-
-// Pass down member vars to from parent to children.
-static void
-S_bequeath_member_vars(CFCClass *self);
-
-// Pass down methods to from parent to children.
-static void
-S_bequeath_methods(CFCClass *self);
-
-static const CFCMeta CFCCLASS_META = {
-    "Clownfish::CFC::Model::Class",
-    sizeof(CFCClass),
-    (CFCBase_destroy_t)CFCClass_destroy
-};
-
-CFCClass*
-CFCClass_create(struct CFCParcel *parcel, const char *exposure,
-                const char *class_name, const char *cnick,
-                const char *micro_sym, CFCDocuComment *docucomment,
-                CFCFileSpec *file_spec, const char *parent_class_name,
-                int is_final, int is_inert) {
-    CFCClass *self = (CFCClass*)CFCBase_allocate(&CFCCLASS_META);
-    return CFCClass_do_create(self, parcel, exposure, class_name, cnick,
-                              micro_sym, docucomment, file_spec,
-                              parent_class_name, is_final, is_inert);
-}
-
-CFCClass*
-CFCClass_do_create(CFCClass *self, struct CFCParcel *parcel,
-                   const char *exposure, const char *class_name,
-                   const char *cnick, const char *micro_sym,
-                   CFCDocuComment *docucomment, CFCFileSpec *file_spec,
-                   const char *parent_class_name, int is_final, int is_inert) {
-    CFCUTIL_NULL_CHECK(class_name);
-    exposure  = exposure  ? exposure  : "parcel";
-    micro_sym = micro_sym ? micro_sym : "class";
-    parcel    = parcel    ? parcel    : CFCParcel_default_parcel();
-    CFCSymbol_init((CFCSymbol*)self, parcel, exposure, class_name, cnick,
-                   micro_sym);
-    if (!is_inert
-        && !parent_class_name
-        && strcmp(class_name, "Clownfish::Obj") != 0
-       ) {
-        parent_class_name = "Clownfish::Obj";
-    }
-    self->parent     = NULL;
-    self->tree_grown = false;
-    self->children        = (CFCClass**)CALLOCATE(1, sizeof(CFCClass*));
-    self->num_kids        = 0;
-    self->functions       = (CFCFunction**)CALLOCATE(1, sizeof(CFCFunction*));
-    self->num_functions   = 0;
-    self->methods         = (CFCMethod**)CALLOCATE(1, sizeof(CFCMethod*));
-    self->num_methods     = 0;
-    self->member_vars     = (CFCVariable**)CALLOCATE(1, sizeof(CFCVariable*));
-    self->num_member_vars = 0;
-    self->inert_vars      = (CFCVariable**)CALLOCATE(1, sizeof(CFCVariable*));
-    self->num_inert_vars  = 0;
-    self->parent_class_name = CFCUtil_strdup(parent_class_name);
-    self->docucomment
-        = (CFCDocuComment*)CFCBase_incref((CFCBase*)docucomment);
-    self->file_spec = (CFCFileSpec*)CFCBase_incref((CFCBase*)file_spec);
-
-    // Cache several derived symbols.
-    const char *last_colon = strrchr(class_name, ':');
-    self->struct_sym = last_colon
-                       ? CFCUtil_strdup(last_colon + 1)
-                       : CFCUtil_strdup(class_name);
-    const char *prefix = CFCClass_get_prefix(self);
-    size_t struct_sym_len = strlen(self->struct_sym);
-    self->short_vtable_var = (char*)MALLOCATE(struct_sym_len + 1);
-    size_t i;
-    for (i = 0; i < struct_sym_len; i++) {
-        self->short_vtable_var[i] = toupper(self->struct_sym[i]);
-    }
-    self->short_vtable_var[struct_sym_len] = '\0';
-    self->full_struct_sym   = CFCUtil_sprintf("%s%s", prefix, self->struct_sym);
-    self->ivars_struct      = CFCUtil_sprintf("%sIVARS", self->struct_sym);
-    self->full_ivars_struct = CFCUtil_sprintf("%sIVARS", self->full_struct_sym);
-    self->ivars_func        = CFCUtil_sprintf("%s_IVARS", CFCClass_get_cnick(self));
-    self->full_ivars_func   = CFCUtil_sprintf("%s%s_IVARS", prefix,
-                                              CFCClass_get_cnick(self));
-    self->full_ivars_offset = CFCUtil_sprintf("%s_OFFSET", self->full_ivars_func);
-    size_t full_struct_sym_len = strlen(self->full_struct_sym);
-    self->full_vtable_var = (char*)MALLOCATE(full_struct_sym_len + 1);
-    for (i = 0; self->full_struct_sym[i] != '\0'; i++) {
-        self->full_vtable_var[i] = toupper(self->full_struct_sym[i]);
-    }
-    self->full_vtable_var[i] = '\0';
-    self->privacy_symbol = CFCUtil_sprintf("C_%s", self->full_vtable_var);
-
-    // Build the relative path to the autogenerated C header file.
-    if (file_spec) {
-        const char *path_part = CFCFileSpec_get_path_part(self->file_spec);
-        self->include_h = CFCUtil_sprintf("%s.h", path_part);
-    }
-    else {
-        self->include_h = CFCUtil_strdup("class.h");
-    }
-
-    self->is_final    = !!is_final;
-    self->is_inert    = !!is_inert;
-
-    if (file_spec && CFCFileSpec_included(file_spec)) {
-        if (!CFCParcel_included(parcel)) {
-            CFCUtil_die("Class %s from include dir found in parcel %s from"
-                        " source dir",
-                        class_name, CFCParcel_get_name(parcel));
-        }
-    }
-    else {
-        if (CFCParcel_included(parcel)) {
-            CFCUtil_die("Class %s from source dir found in parcel %s from"
-                        " include dir",
-                        class_name, CFCParcel_get_name(parcel));
-        }
-    }
-
-    // Store in registry.
-    S_register(self);
-
-    return self;
-}
-
-void
-CFCClass_destroy(CFCClass *self) {
-    CFCBase_decref((CFCBase*)self->docucomment);
-    CFCBase_decref((CFCBase*)self->parent);
-    for (size_t i = 0; self->children[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->children[i]);
-    }
-    for (size_t i = 0; self->functions[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->functions[i]);
-    }
-    for (size_t i = 0; self->methods[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->methods[i]);
-    }
-    for (size_t i = 0; self->member_vars[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->member_vars[i]);
-    }
-    for (size_t i = 0; self->inert_vars[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->inert_vars[i]);
-    }
-    CFCBase_decref((CFCBase*)self->file_spec);
-    FREEMEM(self->children);
-    FREEMEM(self->functions);
-    FREEMEM(self->methods);
-    FREEMEM(self->member_vars);
-    FREEMEM(self->inert_vars);
-    FREEMEM(self->parent_class_name);
-    FREEMEM(self->struct_sym);
-    FREEMEM(self->ivars_struct);
-    FREEMEM(self->full_ivars_struct);
-    FREEMEM(self->ivars_func);
-    FREEMEM(self->full_ivars_func);
-    FREEMEM(self->full_ivars_offset);
-    FREEMEM(self->short_vtable_var);
-    FREEMEM(self->full_struct_sym);
-    FREEMEM(self->full_vtable_var);
-    FREEMEM(self->privacy_symbol);
-    FREEMEM(self->include_h);
-    CFCSymbol_destroy((CFCSymbol*)self);
-}
-
-static void
-S_register(CFCClass *self) {
-    if (registry_size == registry_cap) {
-        size_t new_cap = registry_cap + 10;
-        registry = (CFCClassRegEntry*)REALLOCATE(
-                       registry,
-                       (new_cap + 1) * sizeof(CFCClassRegEntry));
-        for (size_t i = registry_cap; i <= new_cap; i++) {
-            registry[i].key = NULL;
-            registry[i].klass = NULL;
-        }
-        registry_cap = new_cap;
-    }
-
-    CFCParcel  *parcel     = CFCClass_get_parcel(self);
-    const char *prefix     = CFCParcel_get_prefix(parcel);
-    const char *class_name = CFCClass_get_class_name(self);
-    const char *cnick      = CFCClass_get_cnick(self);
-    const char *key        = self->full_struct_sym;
-
-    for (size_t i = 0; i < registry_size; i++) {
-        CFCClass   *other            = registry[i].klass;
-        CFCParcel  *other_parcel     = CFCClass_get_parcel(other);
-        const char *other_prefix     = CFCParcel_get_prefix(other_parcel);
-        const char *other_class_name = CFCClass_get_class_name(other);
-        const char *other_cnick      = CFCClass_get_cnick(other);
-
-        if (strcmp(class_name, other_class_name) == 0) {
-            CFCUtil_die("Two classes with name %s", class_name);
-        }
-        if (strcmp(registry[i].key, key) == 0) {
-            CFCUtil_die("Class name conflict between %s and %s",
-                        class_name, other_class_name);
-        }
-        if (strcmp(prefix, other_prefix) == 0
-            && strcmp(cnick, other_cnick) == 0
-           ) {
-            CFCUtil_die("Class nickname conflict between %s and %s",
-                        class_name, other_class_name);
-        }
-    }
-
-    registry[registry_size].key   = CFCUtil_strdup(key);
-    registry[registry_size].klass = (CFCClass*)CFCBase_incref((CFCBase*)self);
-    registry_size++;
-}
-
-#define MAX_SINGLETON_LEN 256
-
-CFCClass*
-CFCClass_fetch_singleton(CFCParcel *parcel, const char *class_name) {
-    CFCUTIL_NULL_CHECK(class_name);
-
-    // Build up the key.
-    const char *last_colon = strrchr(class_name, ':');
-    const char *struct_sym = last_colon
-                             ? last_colon + 1
-                             : class_name;
-    const char *prefix = parcel ? CFCParcel_get_prefix(parcel) : "";
-    size_t prefix_len = strlen(prefix);
-    size_t struct_sym_len = strlen(struct_sym);
-    if (prefix_len + struct_sym_len > MAX_SINGLETON_LEN) {
-        CFCUtil_die("names too long: '%s', '%s'", prefix, struct_sym);
-    }
-    char key[MAX_SINGLETON_LEN + 1];
-    sprintf(key, "%s%s", prefix, struct_sym);
-    for (size_t i = 0; i < registry_size; i++) {
-        if (strcmp(registry[i].key, key) == 0) {
-            return registry[i].klass;
-        }
-    }
-    return NULL;
-}
-
-void
-CFCClass_clear_registry(void) {
-    for (size_t i = 0; i < registry_size; i++) {
-        CFCClass *klass = registry[i].klass;
-        if (klass->parent) {
-            // Break circular ref.
-            CFCBase_decref((CFCBase*)klass->parent);
-            klass->parent = NULL;
-        }
-        CFCBase_decref((CFCBase*)klass);
-        FREEMEM(registry[i].key);
-    }
-    FREEMEM(registry);
-    registry_size = 0;
-    registry_cap  = 0;
-    registry      = NULL;
-}
-
-void
-CFCClass_add_child(CFCClass *self, CFCClass *child) {
-    CFCUTIL_NULL_CHECK(child);
-    if (self->tree_grown) {
-        CFCUtil_die("Can't call add_child after grow_tree");
-    }
-    if (self->is_inert) {
-        CFCUtil_die("Can't inherit from inert class %s",
-                    CFCClass_get_class_name(self));
-    }
-    if (child->is_inert) {
-        CFCUtil_die("Inert class %s can't inherit",
-                    CFCClass_get_class_name(child));
-    }
-    self->num_kids++;
-    size_t size = (self->num_kids + 1) * sizeof(CFCClass*);
-    self->children = (CFCClass**)REALLOCATE(self->children, size);
-    self->children[self->num_kids - 1]
-        = (CFCClass*)CFCBase_incref((CFCBase*)child);
-    self->children[self->num_kids] = NULL;
-
-    // Add parcel dependency.
-    CFCParcel *parcel       = CFCClass_get_parcel(self);
-    CFCParcel *child_parcel = CFCClass_get_parcel(child);
-    CFCParcel_add_inherited_parcel(child_parcel, parcel);
-}
-
-void
-CFCClass_add_function(CFCClass *self, CFCFunction *func) {
-    CFCUTIL_NULL_CHECK(func);
-    if (self->tree_grown) {
-        CFCUtil_die("Can't call add_function after grow_tree");
-    }
-    self->num_functions++;
-    size_t size = (self->num_functions + 1) * sizeof(CFCFunction*);
-    self->functions = (CFCFunction**)REALLOCATE(self->functions, size);
-    self->functions[self->num_functions - 1]
-        = (CFCFunction*)CFCBase_incref((CFCBase*)func);
-    self->functions[self->num_functions] = NULL;
-}
-
-void
-CFCClass_add_method(CFCClass *self, CFCMethod *method) {
-    CFCUTIL_NULL_CHECK(method);
-    if (self->tree_grown) {
-        CFCUtil_die("Can't call add_method after grow_tree");
-    }
-    if (self->is_inert) {
-        CFCUtil_die("Can't add_method to an inert class");
-    }
-    self->num_methods++;
-    size_t size = (self->num_methods + 1) * sizeof(CFCMethod*);
-    self->methods = (CFCMethod**)REALLOCATE(self->methods, size);
-    self->methods[self->num_methods - 1]
-        = (CFCMethod*)CFCBase_incref((CFCBase*)method);
-    self->methods[self->num_methods] = NULL;
-}
-
-void
-CFCClass_add_member_var(CFCClass *self, CFCVariable *var) {
-    CFCUTIL_NULL_CHECK(var);
-    if (self->tree_grown) {
-        CFCUtil_die("Can't call add_member_var after grow_tree");
-    }
-    self->num_member_vars++;
-    size_t size = (self->num_member_vars + 1) * sizeof(CFCVariable*);
-    self->member_vars = (CFCVariable**)REALLOCATE(self->member_vars, size);
-    self->member_vars[self->num_member_vars - 1]
-        = (CFCVariable*)CFCBase_incref((CFCBase*)var);
-    self->member_vars[self->num_member_vars] = NULL;
-}
-
-void
-CFCClass_add_inert_var(CFCClass *self, CFCVariable *var) {
-    CFCUTIL_NULL_CHECK(var);
-    if (self->tree_grown) {
-        CFCUtil_die("Can't call add_inert_var after grow_tree");
-    }
-    self->num_inert_vars++;
-    size_t size = (self->num_inert_vars + 1) * sizeof(CFCVariable*);
-    self->inert_vars = (CFCVariable**)REALLOCATE(self->inert_vars, size);
-    self->inert_vars[self->num_inert_vars - 1]
-        = (CFCVariable*)CFCBase_incref((CFCBase*)var);
-    self->inert_vars[self->num_inert_vars] = NULL;
-}
-
-#define MAX_FUNC_LEN 128
-
-static CFCFunction*
-S_find_func(CFCFunction **funcs, const char *sym) {
-    if (!sym) {
-        return NULL;
-    }
-
-    char lcsym[MAX_FUNC_LEN + 1];
-    size_t sym_len = strlen(sym);
-    if (sym_len > MAX_FUNC_LEN) { CFCUtil_die("sym too long: '%s'", sym); }
-    for (size_t i = 0; i <= sym_len; i++) {
-        lcsym[i] = tolower(sym[i]);
-    }
-    for (size_t i = 0; funcs[i] != NULL; i++) {
-        CFCFunction *func = funcs[i];
-        if (strcmp(lcsym, CFCFunction_micro_sym(func)) == 0) {
-            return func;
-        }
-    }
-    return NULL;
-}
-
-CFCFunction*
-CFCClass_function(CFCClass *self, const char *sym) {
-    return S_find_func(self->functions, sym);
-}
-
-CFCMethod*
-CFCClass_method(CFCClass *self, const char *sym) {
-    return (CFCMethod*)S_find_func((CFCFunction**)self->methods, sym);
-}
-
-CFCMethod*
-CFCClass_fresh_method(CFCClass *self, const char *sym) {
-    CFCMethod *method = CFCClass_method(self, sym);
-    if (method) {
-        const char *class_name = CFCClass_get_class_name(self);
-        const char *meth_class_name = CFCMethod_get_class_name(method);
-        if (strcmp(class_name, meth_class_name) == 0) {
-            return method;
-        }
-    }
-    return NULL;
-}
-
-void
-CFCClass_resolve_types(CFCClass *self, CFCClass **classes) {
-    for (size_t i = 0; self->functions[i] != NULL; i++) {
-        CFCFunction_resolve_types(self->functions[i], classes);
-    }
-    for (size_t i = 0; self->methods[i] != NULL; i++) {
-        CFCMethod_resolve_types(self->methods[i], classes);
-    }
-    for (size_t i = 0; self->member_vars[i] != NULL; i++) {
-        CFCVariable_resolve_type(self->member_vars[i], classes);
-    }
-    for (size_t i = 0; self->inert_vars[i] != NULL; i++) {
-        CFCVariable_resolve_type(self->inert_vars[i], classes);
-    }
-}
-
-// Pass down member vars to from parent to children.
-static void
-S_bequeath_member_vars(CFCClass *self) {
-    for (size_t i = 0; self->children[i] != NULL; i++) {
-        CFCClass *child = self->children[i];
-        size_t num_vars = self->num_member_vars + child->num_member_vars;
-        size_t size = (num_vars + 1) * sizeof(CFCVariable*);
-        child->member_vars
-            = (CFCVariable**)REALLOCATE(child->member_vars, size);
-        memmove(child->member_vars + self->num_member_vars,
-                child->member_vars,
-                child->num_member_vars * sizeof(CFCVariable*));
-        memcpy(child->member_vars, self->member_vars,
-               self->num_member_vars * sizeof(CFCVariable*));
-        for (size_t j = 0; self->member_vars[j] != NULL; j++) {
-            CFCBase_incref((CFCBase*)child->member_vars[j]);
-        }
-        child->num_member_vars = num_vars;
-        child->member_vars[num_vars] = NULL;
-        S_bequeath_member_vars(child);
-    }
-}
-
-static void
-S_bequeath_methods(CFCClass *self) {
-    for (size_t child_num = 0; self->children[child_num] != NULL; child_num++) {
-        CFCClass *child = self->children[child_num];
-
-        // Create array of methods, preserving exact order so vtables match up.
-        size_t num_methods = 0;
-        size_t max_methods = self->num_methods + child->num_methods;
-        CFCMethod **methods = (CFCMethod**)MALLOCATE(
-                                  (max_methods + 1) * sizeof(CFCMethod*));
-
-        // Gather methods which child inherits or overrides.
-        for (size_t i = 0; i < self->num_methods; i++) {
-            CFCMethod *method = self->methods[i];
-            const char *macro_sym = CFCMethod_get_macro_sym(method);
-            CFCMethod *child_method = CFCClass_method(child, macro_sym);
-            if (child_method) {
-                CFCMethod_override(child_method, method);
-                methods[num_methods++] = child_method;
-            }
-            else {
-                methods[num_methods++] = method;
-            }
-        }
-
-        // Append novel child methods to array.  Child methods which were just
-        // marked via CFCMethod_override() a moment ago are skipped.
-        for (size_t i = 0; i < child->num_methods; i++) {
-            CFCMethod *method = child->methods[i];
-            if (CFCMethod_novel(method)) {
-                methods[num_methods++] = method;
-            }
-        }
-        methods[num_methods] = NULL;
-
-        // Manage refcounts and assign new array.  Transform to final methods
-        // if child class is a final class.
-        if (child->is_final) {
-            for (size_t i = 0; i < num_methods; i++) {
-                if (CFCMethod_final(methods[i])) {
-                    CFCBase_incref((CFCBase*)methods[i]);
-                }
-                else {
-                    methods[i] = CFCMethod_finalize(methods[i]);
-                }
-            }
-        }
-        else {
-            for (size_t i = 0; i < num_methods; i++) {
-                CFCBase_incref((CFCBase*)methods[i]);
-            }
-        }
-        for (size_t i = 0; i < child->num_methods; i++) {
-            CFCBase_decref((CFCBase*)child->methods[i]);
-        }
-        FREEMEM(child->methods);
-        child->methods     = methods;
-        child->num_methods = num_methods;
-
-        // Pass it all down to the next generation.
-        S_bequeath_methods(child);
-        child->tree_grown = true;
-    }
-}
-
-// Let the children know who their parent class is.
-static void
-S_establish_ancestry(CFCClass *self) {
-    for (size_t i = 0; i < self->num_kids; i++) {
-        CFCClass *child = self->children[i];
-        // This is a circular reference and thus a memory leak, but we don't
-        // care, because we have to have everything in memory at once anyway.
-        CFCClass_set_parent(child, self);
-        S_establish_ancestry(child);
-    }
-}
-
-static size_t
-S_family_tree_size(CFCClass *self) {
-    size_t count = 1; // self
-    for (size_t i = 0; i < self->num_kids; i++) {
-        count += S_family_tree_size(self->children[i]);
-    }
-    return count;
-}
-
-void
-CFCClass_grow_tree(CFCClass *self) {
-    if (self->tree_grown) {
-        CFCUtil_die("Can't call grow_tree more than once");
-    }
-    S_establish_ancestry(self);
-    S_bequeath_member_vars(self);
-    S_bequeath_methods(self);
-    self->tree_grown = 1;
-}
-
-// Return value is valid only so long as object persists (elements are not
-// refcounted).
-CFCClass**
-CFCClass_tree_to_ladder(CFCClass *self) {
-    size_t ladder_len = S_family_tree_size(self);
-    CFCClass **ladder = (CFCClass**)MALLOCATE((ladder_len + 1) * sizeof(CFCClass*));
-    ladder[ladder_len] = NULL;
-    size_t step = 0;
-    ladder[step++] = self;
-    for (size_t i = 0; i < self->num_kids; i++) {
-        CFCClass *child = self->children[i];
-        CFCClass **child_ladder = CFCClass_tree_to_ladder(child);
-        for (size_t j = 0; child_ladder[j] != NULL; j++) {
-            ladder[step++] = child_ladder[j];
-        }
-        FREEMEM(child_ladder);
-    }
-    return ladder;
-}
-
-static CFCSymbol**
-S_fresh_syms(CFCClass *self, CFCSymbol **syms) {
-    const char *class_name = CFCClass_get_class_name(self);
-    size_t count = 0;
-    while (syms[count] != NULL) { count++; }
-    size_t amount = (count + 1) * sizeof(CFCSymbol*);
-    CFCSymbol **fresh = (CFCSymbol**)MALLOCATE(amount);
-    size_t num_fresh = 0;
-    for (size_t i = 0; i < count; i++) {
-        CFCSymbol *sym = syms[i];
-        const char *sym_class_name = CFCSymbol_get_class_name(sym);
-        if (strcmp(sym_class_name, class_name) == 0) {
-            fresh[num_fresh++] = sym;
-        }
-    }
-    fresh[num_fresh] = NULL;
-    return fresh;
-}
-
-CFCMethod**
-CFCClass_fresh_methods(CFCClass *self) {
-    return (CFCMethod**)S_fresh_syms(self, (CFCSymbol**)self->methods);
-}
-
-CFCVariable**
-CFCClass_fresh_member_vars(CFCClass *self) {
-    return (CFCVariable**)S_fresh_syms(self, (CFCSymbol**)self->member_vars);
-}
-
-CFCMethod*
-CFCClass_find_novel_method(CFCClass *self, const char *sym) {
-    if (!self->tree_grown) {
-        CFCUtil_die("Can't call original_method before grow_tree");
-    }
-    CFCClass *ancestor = self;
-    do {
-        CFCMethod *method = CFCClass_method(ancestor, sym);
-        if (method && CFCMethod_novel(method)) {
-            return method;
-        }
-    } while (NULL != (ancestor = CFCClass_get_parent(ancestor)));
-    return NULL;
-}
-
-CFCClass**
-CFCClass_children(CFCClass *self) {
-    return self->children;
-}
-
-CFCFunction**
-CFCClass_functions(CFCClass *self) {
-    return self->functions;
-}
-
-CFCMethod**
-CFCClass_methods(CFCClass *self) {
-    return self->methods;
-}
-
-size_t
-CFCClass_num_methods(CFCClass *self) {
-    return self->num_methods;
-}
-
-CFCVariable**
-CFCClass_member_vars(CFCClass *self) {
-    return self->member_vars;
-}
-
-size_t
-CFCClass_num_member_vars(CFCClass *self) {
-    return self->num_member_vars;
-}
-
-CFCVariable**
-CFCClass_inert_vars(CFCClass *self) {
-    return self->inert_vars;
-}
-
-const char*
-CFCClass_get_cnick(CFCClass *self) {
-    return CFCSymbol_get_class_cnick((CFCSymbol*)self);
-}
-
-void
-CFCClass_set_parent(CFCClass *self, CFCClass *parent) {
-    CFCClass *old_parent = self->parent;
-    self->parent = (CFCClass*)CFCBase_incref((CFCBase*)parent);
-    CFCBase_decref((CFCBase*)old_parent);
-}
-
-CFCClass*
-CFCClass_get_parent(CFCClass *self) {
-    return self->parent;
-}
-
-const char*
-CFCClass_get_path_part(CFCClass *self) {
-    return self->file_spec ? CFCFileSpec_get_path_part(self->file_spec) : NULL;
-}
-
-int
-CFCClass_included(CFCClass *self) {
-    return self->file_spec ? CFCFileSpec_included(self->file_spec) : 0;
-}
-
-const char*
-CFCClass_get_parent_class_name(CFCClass *self) {
-    return self->parent_class_name;
-}
-
-int
-CFCClass_final(CFCClass *self) {
-    return self->is_final;
-}
-
-int
-CFCClass_inert(CFCClass *self) {
-    return self->is_inert;
-}
-
-const char*
-CFCClass_get_struct_sym(CFCClass *self) {
-    return self->struct_sym;
-}
-
-const char*
-CFCClass_full_struct_sym(CFCClass *self) {
-    return self->full_struct_sym;
-}
-
-const char*
-CFCClass_short_ivars_struct(CFCClass *self) {
-    return self->ivars_struct;
-}
-
-const char*
-CFCClass_full_ivars_struct(CFCClass *self) {
-    return self->full_ivars_struct;
-}
-
-const char*
-CFCClass_short_ivars_func(CFCClass *self) {
-    return self->ivars_func;
-}
-
-const char*
-CFCClass_full_ivars_func(CFCClass *self) {
-    return self->full_ivars_func;
-}
-
-const char*
-CFCClass_full_ivars_offset(CFCClass *self) {
-    return self->full_ivars_offset;
-}
-
-const char*
-CFCClass_short_vtable_var(CFCClass *self) {
-    return self->short_vtable_var;
-}
-
-const char*
-CFCClass_full_vtable_var(CFCClass *self) {
-    return self->full_vtable_var;
-}
-
-const char*
-CFCClass_privacy_symbol(CFCClass *self) {
-    return self->privacy_symbol;
-}
-
-const char*
-CFCClass_include_h(CFCClass *self) {
-    return self->include_h;
-}
-
-struct CFCDocuComment*
-CFCClass_get_docucomment(CFCClass *self) {
-    return self->docucomment;
-}
-
-const char*
-CFCClass_get_prefix(CFCClass *self) {
-    return CFCSymbol_get_prefix((CFCSymbol*)self);
-}
-
-const char*
-CFCClass_get_Prefix(CFCClass *self) {
-    return CFCSymbol_get_Prefix((CFCSymbol*)self);
-}
-
-const char*
-CFCClass_get_PREFIX(CFCClass *self) {
-    return CFCSymbol_get_PREFIX((CFCSymbol*)self);
-}
-
-const char*
-CFCClass_get_class_name(CFCClass *self) {
-    return CFCSymbol_get_class_name((CFCSymbol*)self);
-}
-
-CFCParcel*
-CFCClass_get_parcel(CFCClass *self) {
-    return CFCSymbol_get_parcel((CFCSymbol*)self);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCClass.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCClass.h b/clownfish/compiler/src/CFCClass.h
deleted file mode 100644
index 5c52728..0000000
--- a/clownfish/compiler/src/CFCClass.h
+++ /dev/null
@@ -1,305 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::Class - An object representing a single class
- * definition.
- *
- * Clownfish::CFC::Model::Class objects are stored as quasi-singletons, one
- * for each unique parcel/class_name combination.
- */
-
-#ifndef H_CFCCLASS
-#define H_CFCCLASS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-
-typedef struct CFCClass CFCClass;
-struct CFCParcel;
-struct CFCDocuComment;
-struct CFCFunction;
-struct CFCMethod;
-struct CFCVariable;
-struct CFCFileSpec;
-
-/** Create and register a quasi-singleton.  May only be called once for each
- * unique parcel/class_name combination.
- *
- * @param parcel See Clownfish::CFC::Model::Symbol.
- * @param exposure See Clownfish::CFC::Model::Symbol.
- * @param class_name See Clownfish::CFC::Model::Symbol.
- * @param cnick See Clownfish::CFC::Model::Symbol.
- * @param micro_sym Defaults to "class".
- * @param docucomment An optional Clownfish::CFC::Model::DocuComment attached
- * to this class.
- * @param file_spec - Clownfish::CFC::Model::FileSpec of the file in which
- * this class was declared
- * @param docucomment A Clownfish::CFC::Model::DocuComment describing this
- * Class.
- * @param is_inert Should be true if the class is inert, i.e. cannot be
- * instantiated.
- * @param is_final Should be true if the class is final.
- */
-CFCClass*
-CFCClass_create(struct CFCParcel *parcel, const char *exposure,
-                const char *class_name, const char *cnick,
-                const char *micro_sym, struct CFCDocuComment *docucomment,
-                struct CFCFileSpec *file_spec, const char *parent_class_name,
-                int is_final, int is_inert);
-
-CFCClass*
-CFCClass_do_create(CFCClass *self, struct CFCParcel *parcel,
-                   const char *exposure, const char *class_name,
-                   const char *cnick, const char *micro_sym,
-                   struct CFCDocuComment *docucomment,
-                   struct CFCFileSpec *file_spec, const char *parent_class_name,
-                   int is_final, int is_inert);
-
-void
-CFCClass_destroy(CFCClass *self);
-
-/** Retrieve a Class, if one has already been created.
- *
- * @param A Clownfish::CFC::Model::Parcel.
- * @param class_name The name of the Class.
- */
-CFCClass*
-CFCClass_fetch_singleton(struct CFCParcel *parcel, const char *class_name);
-
-/** Empty out the registry, decrementing the refcount of all Class singleton
- * objects.
- */
-void
-CFCClass_clear_registry(void);
-
-/** Add a child class.
- */
-void
-CFCClass_add_child(CFCClass *self, CFCClass *child);
-
-/** Add a Function to the class.  Valid only before CFCClass_grow_tree() is
- * called.
- */
-void
-CFCClass_add_function(CFCClass *self, struct CFCFunction *func);
-
-/** Add a Method to the class.  Valid only before CFCClass_grow_tree() is
- * called.
- */
-void
-CFCClass_add_method(CFCClass *self, struct CFCMethod *method);
-
-/** Add a member variable to the class.  Valid only before
- * CFCClass_grow_tree() is called.
- */
-void
-CFCClass_add_member_var(CFCClass *self, struct CFCVariable *var);
-
-/** Add an inert (class) variable to the class.  Valid only before
- * CFCClass_grow_tree() is called.
- */
-void
-CFCClass_add_inert_var(CFCClass *self, struct CFCVariable *var);
-
-/* Return the inert Function object for the supplied sym, if any.
- */
-struct CFCFunction*
-CFCClass_function(CFCClass *self, const char *sym);
-
-/* Return the Method object for the supplied micro/macro sym, if any.
- */
-struct CFCMethod*
-CFCClass_method(CFCClass *self, const char *sym);
-
-/** Return a Method object if the Method corresponding to the supplied sym is
- * implemented in this class.
- */
-struct CFCMethod*
-CFCClass_fresh_method(CFCClass *self, const char *sym);
-
-/** Traverse all ancestors to find the first class which declared the method
- * and return it.  Cannot be called before grow_tree().
- */
-struct CFCMethod*
-CFCClass_find_novel_method(CFCClass *self, const char *sym);
-
-/** Find the actual class of all object variables without prefix.
- */
-void
-CFCClass_resolve_types(CFCClass *self, CFCClass **classes);
-
-/** Bequeath all inherited methods and members to children.
- */
-void
-CFCClass_grow_tree(CFCClass *self);
-
-/** Return this class and all its child classes as an array, where all
- * children appear after their parent nodes.
- */
-CFCClass**
-CFCClass_tree_to_ladder(CFCClass *self);
-
-/** Return an array of all methods implemented in this class.
- */
-struct CFCMethod**
-CFCClass_fresh_methods(CFCClass *self);
-
-/** Return an array of all member variables declared in this class.
- */
-struct CFCVariable**
-CFCClass_fresh_member_vars(CFCClass *self);
-
-/** Return an array of all child classes.
- */
-CFCClass**
-CFCClass_children(CFCClass *self);
-
-/** Return an array of all (inert) functions.
- */
-struct CFCFunction**
-CFCClass_functions(CFCClass *self);
-
-/** Return an array of all methods.
- */
-struct CFCMethod**
-CFCClass_methods(CFCClass *self);
-
-size_t
-CFCClass_num_methods(CFCClass *self);
-
-/** Return an array of all member variables.
- */
-struct CFCVariable**
-CFCClass_member_vars(CFCClass *self);
-
-size_t
-CFCClass_num_member_vars(CFCClass *self);
-
-/** Return an array of all inert (shared, class) variables.
- */
-struct CFCVariable**
-CFCClass_inert_vars(CFCClass *self);
-
-const char*
-CFCClass_get_cnick(CFCClass *self);
-
-/** Set the parent Class. (Not class name, Class.)
- */
-void
-CFCClass_set_parent(CFCClass *self, CFCClass *parent);
-
-CFCClass*
-CFCClass_get_parent(CFCClass *self);
-
-const char*
-CFCClass_get_path_part(CFCClass *self);
-
-int
-CFCClass_included(CFCClass *self);
-
-const char*
-CFCClass_get_parent_class_name(CFCClass *self);
-
-int
-CFCClass_final(CFCClass *self);
-
-int
-CFCClass_inert(CFCClass *self);
-
-const char*
-CFCClass_get_struct_sym(CFCClass *self);
-
-/** Fully qualified struct symbol, including the parcel prefix.
- */
-const char*
-CFCClass_full_struct_sym(CFCClass *self);
-
-/** IVARS struct name, not including parcel prefix.
- */
-const char*
-CFCClass_short_ivars_struct(CFCClass *self);
-
-/** Fully qualified IVARS struct name including parcel prefix.
- */
-const char*
-CFCClass_full_ivars_struct(CFCClass *self);
-
-/** Name of the function used to access IVARS, not including parcel prefix.
- */
-const char*
-CFCClass_short_ivars_func(CFCClass *self);
-
-/** Fully qualified name of the function used to access IVARS including parcel
- * prefix.
- */
-const char*
-CFCClass_full_ivars_func(CFCClass *self);
-
-/** Fully qualified name of the offset variable at which the IVARS may be
- * found, including parcel prefix.
- */
-const char*
-CFCClass_full_ivars_offset(CFCClass *self);
-
-/** The short name of the global VTable object for this class.
- */
-const char*
-CFCClass_short_vtable_var(CFCClass *self);
-
-/** Fully qualified vtable variable name, including the parcel prefix.
- */
-const char*
-CFCClass_full_vtable_var(CFCClass *self);
-
-/** Access the symbol which unlocks the class struct definition and other
- * private information.
- */
-const char*
-CFCClass_privacy_symbol(CFCClass *self);
-
-/** Return a relative path to a C header file, appropriately formatted for a
- * pound-include directive.
- */
-const char*
-CFCClass_include_h(CFCClass *self);
-
-struct CFCDocuComment*
-CFCClass_get_docucomment(CFCClass *self);
-
-const char*
-CFCClass_get_prefix(CFCClass *self);
-
-const char*
-CFCClass_get_Prefix(CFCClass *self);
-
-const char*
-CFCClass_get_PREFIX(CFCClass *self);
-
-const char*
-CFCClass_get_class_name(CFCClass *self);
-
-struct CFCParcel*
-CFCClass_get_parcel(CFCClass *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCCLASS */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCDocuComment.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCDocuComment.c b/clownfish/compiler/src/CFCDocuComment.c
deleted file mode 100644
index 4a28cf2..0000000
--- a/clownfish/compiler/src/CFCDocuComment.c
+++ /dev/null
@@ -1,265 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <ctype.h>
-#include <string.h>
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCDocuComment.h"
-#include "CFCUtil.h"
-
-struct CFCDocuComment {
-    CFCBase base;
-    char *description;
-    char *brief;
-    char *long_des;
-    char **param_names;
-    char **param_docs;
-    char *retval;
-};
-
-/** Remove comment open, close, and left border from raw comment text.
- */
-static void
-S_strip(char *comment) {
-    size_t len = strlen(comment);
-    char *scratch = (char*)MALLOCATE(len + 1);
-
-    // Establish that comment text begins with "/**" and ends with "*/".
-    if (strstr(comment, "/**") != comment
-        || strstr(comment, "*/") != (comment + len - 2)
-       ) {
-        CFCUtil_die("Malformed comment");
-    }
-
-    // Capture text minus beginning "/**", ending "*/", and left border.
-    size_t i = 3;
-    size_t max = len - 2;
-    while ((isspace(comment[i]) || comment[i] == '*') && i < max) {
-        i++;
-    }
-    size_t j = 0;
-    for (; i < max; i++) {
-        while (comment[i] == '\n' && i < max) {
-            scratch[j++] = comment[i];
-            i++;
-            while (isspace(comment[i]) && comment[i] != '\n' && i < max) {
-                i++;
-            }
-            if (comment[i] == '*') { i++; }
-            if (comment[i] == ' ') { i++; }
-        }
-        if (i < max) {
-            scratch[j++] = comment[i];
-        }
-    }
-
-    // Modify original string in place.
-    for (i = 0; i < j; i++) {
-        comment[i] = scratch[i];
-    }
-    comment[j] = '\0';
-
-    // Clean up.
-    FREEMEM(scratch);
-}
-
-static const CFCMeta CFCDOCUCOMMENT_META = {
-    "Clownfish::CFC::Model::DocuComment",
-    sizeof(CFCDocuComment),
-    (CFCBase_destroy_t)CFCDocuComment_destroy
-};
-
-CFCDocuComment*
-CFCDocuComment_parse(const char *raw_text) {
-    char *text = CFCUtil_strdup(raw_text);
-    CFCDocuComment *self
-        = (CFCDocuComment*)CFCBase_allocate(&CFCDOCUCOMMENT_META);
-
-    // Strip whitespace, comment open, close, and left border.
-    CFCUtil_trim_whitespace(text);
-    S_strip(text);
-
-    // Extract the brief description.
-    char *ptr = text;
-    size_t len = strlen(text);
-    char *limit = strchr(ptr, '@');
-    if (!limit) {
-        limit = text + len;
-    }
-    while (ptr < limit) {
-        if (*ptr == '.'
-            && ((ptr == limit - 1) || isspace(*(ptr + 1)))
-           ) {
-            ptr++;
-            size_t brief_len = ptr - text;
-            self->brief = CFCUtil_strdup(text);
-            self->brief[brief_len] = '\0';
-            break;
-        }
-        ptr++;
-    }
-
-    if (!self->brief) {
-        self->brief = CFCUtil_strdup("");
-    }
-
-    // Extract @param directives.
-    size_t num_params = 0;
-    self->param_names = (char**)CALLOCATE(num_params + 1, sizeof(char*));
-    self->param_docs  = (char**)CALLOCATE(num_params + 1, sizeof(char*));
-
-    char *candidate = strstr(text, "@param");
-    size_t text_len = strlen(text);
-    char *text_limit = text + text_len;
-    while (candidate) {
-        // Extract param name.
-        char *ptr = candidate + sizeof("@param") - 1;
-        if (!isspace(*ptr) || ptr > text_limit) {
-            CFCUtil_die("Malformed @param directive in '%s'", raw_text);
-        }
-        while (isspace(*ptr) && ptr < text_limit) { ptr++; }
-        char *param_name = ptr;
-        while ((isalnum(*ptr) || *ptr == '_') && ptr < text_limit) { ptr++; }
-        size_t param_name_len = ptr - param_name;
-        if (!param_name_len) {
-            CFCUtil_die("Malformed @param directive in '%s'", raw_text);
-        }
-
-        // Extract param description.
-        while (isspace(*ptr) && ptr < text_limit) { ptr++; }
-        char *param_doc = ptr;
-        while (ptr < text_limit) {
-            if (*ptr == '@') { break; }
-            else if (*ptr == '\n' && ptr < text_limit) {
-                ptr++;
-                while (ptr < text_limit && *ptr != '\n' && isspace(*ptr)) {
-                    ptr++;
-                }
-                if (*ptr == '\n' || *ptr == '@') { break; }
-            }
-            else {
-                ptr++;
-            }
-        }
-        size_t param_doc_len = ptr - param_doc;
-
-        num_params++;
-        size_t size = (num_params + 1) * sizeof(char*);
-        self->param_names = (char**)REALLOCATE(self->param_names, size);
-        self->param_docs  = (char**)REALLOCATE(self->param_docs, size);
-        self->param_names[num_params - 1]
-            = CFCUtil_strndup(param_name, param_name_len);
-        self->param_docs[num_params - 1]
-            = CFCUtil_strndup(param_doc, param_doc_len);
-        CFCUtil_trim_whitespace(self->param_names[num_params - 1]);
-        CFCUtil_trim_whitespace(self->param_docs[num_params - 1]);
-        self->param_names[num_params] = NULL;
-        self->param_docs[num_params]  = NULL;
-
-        if (ptr == text_limit) {
-            break;
-        }
-        else if (ptr > text_limit) {
-            CFCUtil_die("Overran end of string while parsing '%s'", raw_text);
-        }
-        candidate = strstr(ptr, "@param");
-    }
-
-    // Extract full description.
-    self->description = CFCUtil_strdup(text);
-
-    char *terminus = strstr(self->description, "@param");
-    if (!terminus) {
-        terminus = strstr(self->description, "@return");
-    }
-    if (terminus) {
-        *terminus = '\0';
-    }
-
-    CFCUtil_trim_whitespace(self->description);
-
-    // Extract long description.
-    self->long_des = CFCUtil_strdup(self->description + strlen(self->brief));
-    CFCUtil_trim_whitespace(self->long_des);
-
-    // Extract @return directive.
-    char *maybe_retval = strstr(text, "@return ");
-    if (maybe_retval) {
-        self->retval = CFCUtil_strdup(maybe_retval + sizeof("@return ") - 1);
-        char *terminus = strchr(self->retval, '@');
-        if (terminus) {
-            *terminus = '\0';
-        }
-        CFCUtil_trim_whitespace(self->retval);
-    }
-
-    FREEMEM(text);
-    return self;
-}
-
-void
-CFCDocuComment_destroy(CFCDocuComment *self) {
-    if (self->param_names) {
-        for (size_t i = 0; self->param_names[i] != NULL; i++) {
-            FREEMEM(self->param_names[i]);
-        }
-        FREEMEM(self->param_names);
-    }
-    if (self->param_docs) {
-        for (size_t i = 0; self->param_docs[i] != NULL; i++) {
-            FREEMEM(self->param_docs[i]);
-        }
-        FREEMEM(self->param_docs);
-    }
-    FREEMEM(self->description);
-    FREEMEM(self->brief);
-    FREEMEM(self->long_des);
-    FREEMEM(self->retval);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-const char*
-CFCDocuComment_get_description(CFCDocuComment *self) {
-    return self->description;
-}
-
-const char*
-CFCDocuComment_get_brief(CFCDocuComment *self) {
-    return self->brief;
-}
-
-const char*
-CFCDocuComment_get_long(CFCDocuComment *self) {
-    return self->long_des;
-}
-
-const char**
-CFCDocuComment_get_param_names(CFCDocuComment *self) {
-    return (const char**)self->param_names;
-}
-
-const char**
-CFCDocuComment_get_param_docs(CFCDocuComment *self) {
-    return (const char**)self->param_docs;
-}
-
-const char*
-CFCDocuComment_get_retval(CFCDocuComment *self) {
-    return self->retval;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCDocuComment.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCDocuComment.h b/clownfish/compiler/src/CFCDocuComment.h
deleted file mode 100644
index 910f191..0000000
--- a/clownfish/compiler/src/CFCDocuComment.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::DocuComment - Formatted comment a la Doxygen.
- */
-
-#ifndef H_CFCDOCUCOMMENT
-#define H_CFCDOCUCOMMENT
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCDocuComment CFCDocuComment;
-
-/** Parse comment text.
- */
-CFCDocuComment*
-CFCDocuComment_parse(const char *raw_text);
-
-void
-CFCDocuComment_destroy(CFCDocuComment *self);
-
-const char*
-CFCDocuComment_get_description(CFCDocuComment *self);
-
-const char*
-CFCDocuComment_get_brief(CFCDocuComment *self);
-
-const char*
-CFCDocuComment_get_long(CFCDocuComment *self);
-
-const char**
-CFCDocuComment_get_param_names(CFCDocuComment *self);
-
-const char**
-CFCDocuComment_get_param_docs(CFCDocuComment *self);
-
-// May be NULL.
-const char*
-CFCDocuComment_get_retval(CFCDocuComment *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCDOCUCOMMENT */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCFile.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCFile.c b/clownfish/compiler/src/CFCFile.c
deleted file mode 100644
index 84065b1..0000000
--- a/clownfish/compiler/src/CFCFile.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCFile.h"
-#include "CFCFileSpec.h"
-#include "CFCUtil.h"
-#include "CFCClass.h"
-
-struct CFCFile {
-    CFCBase base;
-    CFCBase **blocks;
-    CFCClass **classes;
-    CFCFileSpec *spec;
-    int modified;
-    char *guard_name;
-    char *guard_start;
-    char *guard_close;
-};
-
-static const CFCMeta CFCFILE_META = {
-    "Clownfish::CFC::Model::File",
-    sizeof(CFCFile),
-    (CFCBase_destroy_t)CFCFile_destroy
-};
-
-CFCFile*
-CFCFile_new(CFCFileSpec *spec) {
-
-    CFCFile *self = (CFCFile*)CFCBase_allocate(&CFCFILE_META);
-    return CFCFile_init(self, spec);
-}
-
-CFCFile*
-CFCFile_init(CFCFile *self, CFCFileSpec *spec) {
-    CFCUTIL_NULL_CHECK(spec);
-    self->modified   = false;
-    self->spec       = (CFCFileSpec*)CFCBase_incref((CFCBase*)spec);
-    self->blocks     = (CFCBase**)CALLOCATE(1, sizeof(CFCBase*));
-    self->classes    = (CFCClass**)CALLOCATE(1, sizeof(CFCBase*));
-
-    // Derive include guard name, plus C code for opening and closing the
-    // guard.
-    const char *path_part = CFCFileSpec_get_path_part(self->spec);
-    size_t len = strlen(path_part);
-    self->guard_name = (char*)MALLOCATE(len + sizeof("H_") + 1);
-    memcpy(self->guard_name, "H_", 2);
-    size_t i, j;
-    for (i = 0, j = 2; i < len; i++) {
-        char c = path_part[i];
-        if (c == CHY_DIR_SEP_CHAR) {
-            self->guard_name[j++] = '_';
-        }
-        else if (isalnum(c)) {
-            self->guard_name[j++] = toupper(c);
-        }
-    }
-    self->guard_name[j] = '\0';
-    self->guard_start = CFCUtil_sprintf("#ifndef %s\n#define %s 1\n",
-                                        self->guard_name, self->guard_name);
-    self->guard_close = CFCUtil_sprintf("#endif /* %s */\n", self->guard_name);
-
-    return self;
-}
-
-void
-CFCFile_destroy(CFCFile *self) {
-    for (size_t i = 0; self->blocks[i] != NULL; i++) {
-        CFCBase_decref(self->blocks[i]);
-    }
-    FREEMEM(self->blocks);
-    for (size_t i = 0; self->classes[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->classes[i]);
-    }
-    FREEMEM(self->classes);
-    FREEMEM(self->guard_name);
-    FREEMEM(self->guard_start);
-    FREEMEM(self->guard_close);
-    CFCBase_decref((CFCBase*)self->spec);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-void
-CFCFile_add_block(CFCFile *self, CFCBase *block) {
-    CFCUTIL_NULL_CHECK(block);
-    const char *cfc_class = CFCBase_get_cfc_class(block);
-
-    // Add to classes array if the block is a CFCClass.
-    if (strcmp(cfc_class, "Clownfish::CFC::Model::Class") == 0) {
-        size_t num_class_blocks = 0;
-        while (self->classes[num_class_blocks] != NULL) {
-            num_class_blocks++;
-        }
-        num_class_blocks++;
-        size_t size = (num_class_blocks + 1) * sizeof(CFCClass*);
-        self->classes = (CFCClass**)REALLOCATE(self->classes, size);
-        self->classes[num_class_blocks - 1]
-            = (CFCClass*)CFCBase_incref(block);
-        self->classes[num_class_blocks] = NULL;
-    }
-
-    // Add to blocks array.
-    if (strcmp(cfc_class, "Clownfish::CFC::Model::Class") == 0
-        || strcmp(cfc_class, "Clownfish::CFC::Model::Parcel") == 0
-        || strcmp(cfc_class, "Clownfish::CFC::Model::CBlock") == 0
-       ) {
-        size_t num_blocks = 0;
-        while (self->blocks[num_blocks] != NULL) {
-            num_blocks++;
-        }
-        num_blocks++;
-        size_t size = (num_blocks + 1) * sizeof(CFCBase*);
-        self->blocks = (CFCBase**)REALLOCATE(self->blocks, size);
-        self->blocks[num_blocks - 1] = CFCBase_incref(block);
-        self->blocks[num_blocks] = NULL;
-    }
-    else {
-        CFCUtil_die("Wrong kind of object: '%s'", cfc_class);
-    }
-}
-
-static char*
-S_some_path(CFCFile *self, const char *base_dir, const char *ext) {
-    const char *path_part = CFCFileSpec_get_path_part(self->spec);
-    char *buf;
-    if (base_dir) {
-        buf = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s%s", base_dir,
-                              path_part, ext);
-    }
-    else {
-        buf = CFCUtil_sprintf("%s%s", path_part, ext);
-    }
-    for (size_t i = 0; buf[i] != '\0'; i++) {
-        #ifdef _WIN32
-        if (buf[i] == '/') { buf[i] = '\\'; }
-        #else
-        if (buf[i] == '\\') { buf[i] = '/'; }
-        #endif
-    }
-    return buf;
-}
-
-char*
-CFCFile_c_path(CFCFile *self, const char *base_dir) {
-    return S_some_path(self, base_dir, ".c");
-}
-
-char*
-CFCFile_h_path(CFCFile *self, const char *base_dir) {
-    return S_some_path(self, base_dir, ".h");
-}
-
-char*
-CFCFile_cfh_path(CFCFile *self, const char *base_dir) {
-    return S_some_path(self, base_dir, ".cfh");
-}
-
-CFCBase**
-CFCFile_blocks(CFCFile *self) {
-    return self->blocks;
-}
-
-CFCClass**
-CFCFile_classes(CFCFile *self) {
-    return self->classes;
-}
-
-void
-CFCFile_set_modified(CFCFile *self, int modified) {
-    self->modified = !!modified;
-}
-
-int
-CFCFile_get_modified(CFCFile *self) {
-    return self->modified;
-}
-
-const char*
-CFCFile_get_source_dir(CFCFile *self) {
-    return CFCFileSpec_get_source_dir(self->spec);
-}
-
-const char*
-CFCFile_get_path_part(CFCFile *self) {
-    return CFCFileSpec_get_path_part(self->spec);
-}
-
-int
-CFCFile_included(CFCFile *self) {
-    return CFCFileSpec_included(self->spec);
-}
-
-const char*
-CFCFile_guard_name(CFCFile *self) {
-    return self->guard_name;
-}
-
-const char*
-CFCFile_guard_start(CFCFile *self) {
-    return self->guard_start;
-}
-
-const char*
-CFCFile_guard_close(CFCFile *self) {
-    return self->guard_close;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCFile.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCFile.h b/clownfish/compiler/src/CFCFile.h
deleted file mode 100644
index e360605..0000000
--- a/clownfish/compiler/src/CFCFile.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/** Clownfish::CFC::Model::File - Structured representation of the contents of
- * a Clownfish source file.
- *
- * An abstraction representing a file which contains Clownfish code.
- */
-#ifndef H_CFCFILE
-#define H_CFCFILE
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCFile CFCFile;
-struct CFCBase;
-struct CFCClass;
-struct CFCFileSpec;
-
-/**
- * @param spec - A CFCFileSpec object describing the file
-*/
-CFCFile*
-CFCFile_new(struct CFCFileSpec *spec);
-
-CFCFile*
-CFCFile_init(CFCFile *self, struct CFCFileSpec *spec);
-
-void
-CFCFile_destroy(CFCFile *self);
-
-/** Add an element to the blocks array.  The block must be either a
- * Clownfish::CFC::Model::Class, a Clownfish::CFC::Model::Parcel, or a
- * Clownfish::CFC::Model::CBlock.
- */
-void
-CFCFile_add_block(CFCFile *self, CFCBase *block);
-
-/** Given a base directory, return a path name derived from the File's
- * path_part with a ".c" extension.
- */
-char*
-CFCFile_c_path(CFCFile *self, const char *base_dir);
-
-/** As c_path, but with a ".h" extension.
- */
-char*
-CFCFile_h_path(CFCFile *self, const char *base_dir);
-
-/** As c_path, but with a ".cfh" extension.
- */
-char*
-CFCFile_cfh_path(CFCFile *self, const char *base_dir);
-
-/** Return all blocks as an array.
- */
-struct CFCBase**
-CFCFile_blocks(CFCFile *self);
-
-/** Return all Clownfish::CFC::Model::Class blocks from the file as an array.
- */
-struct CFCClass**
-CFCFile_classes(CFCFile *self);
-
-/** Setter for the file's "modified" property, which is initially false.
- */
-void
-CFCFile_set_modified(CFCFile *self, int modified);
-
-int
-CFCFile_get_modified(CFCFile *self);
-
-const char*
-CFCFile_get_source_dir(CFCFile *self);
-
-const char*
-CFCFile_get_path_part(CFCFile *self);
-
-int
-CFCFile_included(CFCFile *self);
-
-/** Return a string used for an include guard in a C header (e.g.
- * "H_CRUSTACEAN_LOBSTER"), unique per file.
- */
-const char*
-CFCFile_guard_name(CFCFile *self);
-
-/** Return a string opening the include guard.
- */
-const char*
-CFCFile_guard_start(CFCFile *self);
-
-/** Return a string closing the include guard.  Other classes count on being
- * able to match this string.
- */
-const char*
-CFCFile_guard_close(CFCFile *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCFILE */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCFileSpec.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCFileSpec.c b/clownfish/compiler/src/CFCFileSpec.c
deleted file mode 100644
index 41e3ba4..0000000
--- a/clownfish/compiler/src/CFCFileSpec.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCFileSpec.h"
-#include "CFCUtil.h"
-#include "CFCClass.h"
-
-struct CFCFileSpec {
-    CFCBase base;
-    char *source_dir;
-    char *path_part;
-    int is_included;
-};
-
-static const CFCMeta CFCFILESPEC_META = {
-    "Clownfish::CFC::Model::FileSpec",
-    sizeof(CFCFileSpec),
-    (CFCBase_destroy_t)CFCFileSpec_destroy
-};
-
-CFCFileSpec*
-CFCFileSpec_new(const char *source_dir, const char *path_part,
-                int is_included) {
-    CFCFileSpec *self = (CFCFileSpec*)CFCBase_allocate(&CFCFILESPEC_META);
-    return CFCFileSpec_init(self, source_dir, path_part, is_included);
-}
-
-CFCFileSpec*
-CFCFileSpec_init(CFCFileSpec *self, const char *source_dir,
-                 const char *path_part, int is_included) {
-    CFCUTIL_NULL_CHECK(source_dir);
-    CFCUTIL_NULL_CHECK(path_part);
-
-    self->source_dir  = CFCUtil_strdup(source_dir);
-    self->path_part   = CFCUtil_strdup(path_part);
-    self->is_included = !!is_included;
-
-    return self;
-}
-
-void
-CFCFileSpec_destroy(CFCFileSpec *self) {
-    FREEMEM(self->source_dir);
-    FREEMEM(self->path_part);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-const char*
-CFCFileSpec_get_source_dir(CFCFileSpec *self) {
-    return self->source_dir;
-}
-
-const char*
-CFCFileSpec_get_path_part(CFCFileSpec *self) {
-    return self->path_part;
-}
-
-int
-CFCFileSpec_included(CFCFileSpec *self) {
-    return self->is_included;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCFileSpec.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCFileSpec.h b/clownfish/compiler/src/CFCFileSpec.h
deleted file mode 100644
index 830a618..0000000
--- a/clownfish/compiler/src/CFCFileSpec.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/** Clownfish::CFC::Model::FileSpec - Specification of an input file
- *
- * This class contains data related to input files that is known before
- * parsing and can be referenced from classes created during parsing like
- * CFCFile or CFCClass.
- */
-#ifndef H_CFCFILESPEC
-#define H_CFCFILESPEC
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCFileSpec CFCFileSpec;
-struct CFCBase;
-struct CFCClass;
-
-/**
- * @param path_part - The path of the file, relative to the source directory
- * and excluding the .cfh extension. Should be "Foo/Bar" if the source file
- * is found at 'Foo/Bar.cfh' within the source directory. That implies that
- * the output C header file should be 'Foo/Bar.h' within the target include
- * directory.
- * @param source_dir The source directory in which the file was found.
- * @param is_included Should be true if the file is from an include dir.
-*/
-CFCFileSpec*
-CFCFileSpec_new(const char *source_dir, const char *path_part,
-                int is_included);
-
-CFCFileSpec*
-CFCFileSpec_init(CFCFileSpec *self, const char *source_dir,
-                 const char *path_part, int is_included);
-
-void
-CFCFileSpec_destroy(CFCFileSpec *self);
-
-const char*
-CFCFileSpec_get_source_dir(CFCFileSpec *self);
-
-const char*
-CFCFileSpec_get_path_part(CFCFileSpec *self);
-
-int
-CFCFileSpec_included(CFCFileSpec *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCFILESPEC */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCFunction.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCFunction.c b/clownfish/compiler/src/CFCFunction.c
deleted file mode 100644
index 6f781f4..0000000
--- a/clownfish/compiler/src/CFCFunction.c
+++ /dev/null
@@ -1,144 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <ctype.h>
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-#define CFC_NEED_FUNCTION_STRUCT_DEF
-#include "CFCFunction.h"
-#include "CFCParcel.h"
-#include "CFCType.h"
-#include "CFCParamList.h"
-#include "CFCDocuComment.h"
-#include "CFCUtil.h"
-
-static const CFCMeta CFCFUNCTION_META = {
-    "Clownfish::CFC::Model::Function",
-    sizeof(CFCFunction),
-    (CFCBase_destroy_t)CFCFunction_destroy
-};
-
-CFCFunction*
-CFCFunction_new(CFCParcel *parcel, const char *exposure,
-                const char *class_name, const char *class_cnick,
-                const char *micro_sym, CFCType *return_type,
-                CFCParamList *param_list, CFCDocuComment *docucomment,
-                int is_inline) {
-    CFCFunction *self = (CFCFunction*)CFCBase_allocate(&CFCFUNCTION_META);
-    return CFCFunction_init(self, parcel, exposure, class_name, class_cnick,
-                            micro_sym, return_type, param_list, docucomment,
-                            is_inline);
-}
-
-static int
-S_validate_micro_sym(const char *micro_sym) {
-    size_t len = strlen(micro_sym);
-    if (!len) { return false; }
-    for (size_t i = 0; i < len; i++) {
-        char c = micro_sym[i];
-        if (!islower(c) && !isdigit(c) && c != '_') { return false; }
-    }
-    return true;
-}
-
-CFCFunction*
-CFCFunction_init(CFCFunction *self, CFCParcel *parcel, const char *exposure,
-                 const char *class_name, const char *class_cnick,
-                 const char *micro_sym, CFCType *return_type,
-                 CFCParamList *param_list, CFCDocuComment *docucomment,
-                 int is_inline) {
-
-    exposure = exposure ? exposure : "parcel";
-    CFCUTIL_NULL_CHECK(class_name);
-    CFCUTIL_NULL_CHECK(return_type);
-    CFCUTIL_NULL_CHECK(param_list);
-    if (!S_validate_micro_sym(micro_sym)) {
-        CFCBase_decref((CFCBase*)self);
-        CFCUtil_die("Invalid micro_sym: '%s'", micro_sym);
-    }
-    CFCSymbol_init((CFCSymbol*)self, parcel, exposure, class_name,
-                   class_cnick, micro_sym);
-    self->return_type = (CFCType*)CFCBase_incref((CFCBase*)return_type);
-    self->param_list  = (CFCParamList*)CFCBase_incref((CFCBase*)param_list);
-    self->docucomment = (CFCDocuComment*)CFCBase_incref((CFCBase*)docucomment);
-    self->is_inline   = is_inline;
-    return self;
-}
-
-void
-CFCFunction_resolve_types(CFCFunction *self, struct CFCClass **classes) {
-    CFCType_resolve(self->return_type, classes);
-    CFCParamList_resolve_types(self->param_list, classes);
-}
-
-void
-CFCFunction_destroy(CFCFunction *self) {
-    CFCBase_decref((CFCBase*)self->return_type);
-    CFCBase_decref((CFCBase*)self->param_list);
-    CFCBase_decref((CFCBase*)self->docucomment);
-    CFCSymbol_destroy((CFCSymbol*)self);
-}
-
-CFCType*
-CFCFunction_get_return_type(CFCFunction *self) {
-    return self->return_type;
-}
-
-CFCParamList*
-CFCFunction_get_param_list(CFCFunction *self) {
-    return self->param_list;
-}
-
-CFCDocuComment*
-CFCFunction_get_docucomment(CFCFunction *self) {
-    return self->docucomment;
-}
-
-int
-CFCFunction_inline(CFCFunction *self) {
-    return self->is_inline;
-}
-
-int
-CFCFunction_void(CFCFunction *self) {
-    return CFCType_is_void(self->return_type);
-}
-
-const char*
-CFCFunction_full_func_sym(CFCFunction *self) {
-    return CFCSymbol_full_sym((CFCSymbol*)self);
-}
-
-const char*
-CFCFunction_short_func_sym(CFCFunction *self) {
-    return CFCSymbol_short_sym((CFCSymbol*)self);
-}
-
-const char*
-CFCFunction_micro_sym(CFCFunction *self) {
-    return CFCSymbol_micro_sym((CFCSymbol*)self);
-}
-
-int
-CFCFunction_public(CFCFunction *self) {
-    return CFCSymbol_public((CFCSymbol*)self);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCFunction.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCFunction.h b/clownfish/compiler/src/CFCFunction.h
deleted file mode 100644
index baab2c7..0000000
--- a/clownfish/compiler/src/CFCFunction.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::Function - Metadata describing a function.
- */
-
-#ifndef H_CFCFUNCTION
-#define H_CFCFUNCTION
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCFunction CFCFunction;
-struct CFCParcel;
-struct CFCType;
-struct CFCDocuComment;
-struct CFCParamList;
-struct CFCClass;
-
-#ifdef CFC_NEED_FUNCTION_STRUCT_DEF
-#define CFC_NEED_SYMBOL_STRUCT_DEF
-#include "CFCSymbol.h"
-struct CFCFunction {
-    CFCSymbol symbol;
-    struct CFCType *return_type;
-    struct CFCParamList *param_list;
-    struct CFCDocuComment *docucomment;
-    int is_inline;
-};
-#endif
-
-/**
- * @param parcel A Clownfish::CFC::Model::Parcel.
- * @param exposure The function's exposure (see
- * L<Clownfish::CFC::Model::Symbol>).
- * @param class_name The full name of the class in whose namespace the
- * function resides.
- * @param class_cnick The C nickname for the class.
- * @param micro_sym The lower case name of the function, without any
- * namespacing prefixes.
- * @param return_type A Clownfish::CFC::Model::Type representing the
- * function's return type.
- * @param param_list A Clownfish::CFC::Model::ParamList representing the
- * function's argument list.
- * @param docucomment A Clownfish::CFC::Model::DocuComment describing the
- * function.
- * @param is_inline Should be true if the function should be inlined by the
- * compiler.
- */
-CFCFunction*
-CFCFunction_new(struct CFCParcel *parcel, const char *exposure,
-                const char *class_name, const char *class_cnick,
-                const char *micro_sym, struct CFCType *return_type,
-                struct CFCParamList *param_list,
-                struct CFCDocuComment *docucomment, int is_inline);
-
-CFCFunction*
-CFCFunction_init(CFCFunction *self, struct CFCParcel *parcel,
-                 const char *exposure, const char *class_name,
-                 const char *class_cnick, const char *micro_sym,
-                 struct CFCType *return_type, struct CFCParamList *param_list,
-                 struct CFCDocuComment *docucomment, int is_inline);
-
-void
-CFCFunction_destroy(CFCFunction *self);
-
-struct CFCType*
-CFCFunction_get_return_type(CFCFunction *self);
-
-struct CFCParamList*
-CFCFunction_get_param_list(CFCFunction *self);
-
-struct CFCDocuComment*
-CFCFunction_get_docucomment(CFCFunction *self);
-
-int
-CFCFunction_inline(CFCFunction *self);
-
-/** Returns true if the function has a void return type, false otherwise.
- */
-int
-CFCFunction_void(CFCFunction *self);
-
-/** A synonym for full_sym().
- */
-const char*
-CFCFunction_full_func_sym(CFCFunction *self);
-
-/** A synonym for short_sym().
- */
-const char*
-CFCFunction_short_func_sym(CFCFunction *self);
-
-const char*
-CFCFunction_micro_sym(CFCFunction *self);
-
-int
-CFCFunction_public(CFCFunction *self);
-
-/** Find the actual class of all object variables without prefix.
- */
-void
-CFCFunction_resolve_types(CFCFunction *self, struct CFCClass **classes);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCFUNCTION */
-


[lucy-commits] [20/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/CBlock.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/CBlock.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/CBlock.pm
deleted file mode 100644
index bb3e6a1..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/CBlock.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::CBlock;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Class.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Class.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Class.pm
deleted file mode 100644
index 8e751b4..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Class.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::Class;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/DocuComment.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/DocuComment.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/DocuComment.pm
deleted file mode 100644
index f6c1904..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/DocuComment.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::DocuComment;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/File.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/File.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/File.pm
deleted file mode 100644
index b2f82ae..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/File.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::File;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/FileSpec.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/FileSpec.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/FileSpec.pm
deleted file mode 100644
index d54dbf1..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/FileSpec.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::FileSpec;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Function.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Function.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Function.pm
deleted file mode 100644
index 163728f..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Function.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::Function;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Hierarchy.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Hierarchy.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Hierarchy.pm
deleted file mode 100644
index 0ee3ea1..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Hierarchy.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::Hierarchy;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Method.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Method.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Method.pm
deleted file mode 100644
index e264a47..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Method.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::Method;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/ParamList.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/ParamList.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/ParamList.pm
deleted file mode 100644
index 8fbb810..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/ParamList.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::ParamList;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Parcel.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Parcel.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Parcel.pm
deleted file mode 100644
index c879ff1..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Parcel.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::Parcel;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Symbol.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Symbol.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Symbol.pm
deleted file mode 100644
index 824c6fa..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Symbol.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::Symbol;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Type.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Type.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Type.pm
deleted file mode 100644
index 92e1b98..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Type.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::Type;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Variable.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Variable.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Variable.pm
deleted file mode 100644
index da535df..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Model/Variable.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Model::Variable;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Parser.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Parser.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Parser.pm
deleted file mode 100644
index 94752cb..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Parser.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Parser;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
deleted file mode 100644
index a007756..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build.pm
+++ /dev/null
@@ -1,679 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-package Clownfish::CFC::Perl::Build;
-use base qw( Clownfish::CFC::Perl::Build::Charmonic );
-our $VERSION = '0.01';
-
-use File::Spec::Functions qw( catdir catfile curdir updir abs2rel rel2abs );
-use File::Path qw( mkpath );
-use Config;
-use Carp;
-
-# Add a custom Module::Build hashref property to pass additional build
-# parameters
-if ( $Module::Build::VERSION <= 0.30 ) {
-    __PACKAGE__->add_property( clownfish_params => {} );
-}
-else {
-    # TODO: add sub for property check
-    __PACKAGE__->add_property(
-        'clownfish_params',
-        default => {},
-    );
-}
-
-=for Rationale
-
-When the distribution tarball for the Perl bindings is built, core/, and any
-other needed files/directories are copied into the perl/ directory within the
-main source directory.  Then the distro is built from the contents of the
-perl/ directory, leaving out all the files in ruby/, etc. However, during
-development, the files are accessed from their original locations.
-
-=cut
-
-my @BASE_PATH;
-push(@BASE_PATH, updir()) unless -e 'core';
-
-my $AUTOGEN_DIR  = 'autogen';
-my $LIB_DIR      = 'lib';
-my $BUILDLIB_DIR = 'buildlib';
-
-sub new {
-    my $self = shift->SUPER::new( @_ );
-
-    my $extra_ccflags = $self->extra_compiler_flags;
-    if ( $self->config('cc') =~ /^cl\b/ ) {
-        # Compile as C++ under MSVC.
-        push @$extra_ccflags, qw(
-            -TP -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-        );
-        # Redefine 'for' to fix broken 'for' scoping under MSVC6.
-        push @$extra_ccflags, '-Dfor="if(0);else for"';
-    }
-    # Define HAS_BOOL, so that the Perl headers don't redefine 'bool'.
-    push @$extra_ccflags, '-DHAS_BOOL';
-    $self->extra_compiler_flags(@$extra_ccflags);
-
-    # TODO: use Charmonizer to determine whether pthreads are userland.
-    if ( $Config{osname} =~ /openbsd/i && $Config{usethreads} ) {
-        my $extra_ldflags = $self->extra_linker_flags;
-        push @$extra_ldflags, '-lpthread';
-        $self->extra_linker_flags(@$extra_ldflags);
-    }
-
-    my $include_dirs = $self->include_dirs;
-    push( @$include_dirs,
-        curdir(), # for ppport.h and charmony.h
-        catdir( $AUTOGEN_DIR, 'include' ),
-    );
-    $self->include_dirs($include_dirs);
-
-    my $cf_source = $self->clownfish_params('source');
-    if ( !defined($cf_source) ) {
-        $cf_source = [];
-    }
-    elsif ( !ref($cf_source) ) {
-        $cf_source = [ $cf_source ];
-    }
-    push( @$cf_source, catdir( $AUTOGEN_DIR, 'source' ) );
-    $self->clownfish_params( source => $cf_source );
-
-    my $cf_include = $self->clownfish_params('include');
-    if ( !defined($cf_include) ) {
-        $cf_include = [];
-    }
-    elsif ( !ref($cf_include) ) {
-        $cf_include = [ $cf_include ];
-    }
-    $self->clownfish_params( include => $cf_include );
-
-    my $autogen_header = $self->clownfish_params('autogen_header');
-    if ( !defined($autogen_header) ) {
-        $self->clownfish_params( autogen_header => <<'END_AUTOGEN' );
-/***********************************************
-
- !!!! DO NOT EDIT !!!!
-
- This file was auto-generated by Build.PL.
-
- ***********************************************/
-
-END_AUTOGEN
-    }
-
-    return $self;
-}
-
-sub cf_base_path {
-    my $self_or_class = shift;
-    return @BASE_PATH;
-}
-
-sub cf_system_include_dirs {
-    my $self_or_class = shift;
-
-    my @include_dirs;
-    for my $location ( qw( site vendor ) ) {
-        my $install_dir = $Config{"install${location}arch"};
-        my $include_dir = catdir( $install_dir, 'Clownfish', '_include' );
-        next unless -d $include_dir;
-        push(@include_dirs, $include_dir);
-    }
-
-    return @include_dirs;
-}
-
-sub cf_linker_flags {
-    my ( $self_or_class, $module_name ) = @_;
-
-    my $dlext = $Config{dlext};
-    # Only needed on Windows
-    return () if $dlext ne 'dll';
-
-    # Find library to link against
-    my @module_parts = split( '::', $module_name );
-    my $class_name   = $module_parts[-1];
-    # Link against import library on MSVC
-    my $ext          = $Config{cc} =~ /^cl\b/ ? 'lib' : $dlext;
-
-    for my $location ( qw( site vendor ) ) {
-        my $install_dir = $Config{"install${location}arch"};
-        my $lib_file = catfile(
-            $install_dir, 'auto', @module_parts, "$class_name.$ext",
-        );
-        return ( $lib_file ) if -f $lib_file;
-    }
-
-    die("No Clownfish library file found for module $module_name");
-}
-
-sub _cfh_filepaths {
-    my $self = shift;
-    my @paths;
-    my $source_dirs = $self->clownfish_params('source');
-    for my $source_dir (@$source_dirs) {
-        next unless -e $source_dir;
-        push @paths, @{ $self->rscan_dir( $source_dir, qr/\.cfh$/ ) };
-    }
-    return \@paths;
-}
-
-sub cf_copy_include_file {
-    my ($self, @path) = @_;
-
-    my $dest_dir     = catdir( $self->blib, 'arch', 'Clownfish', '_include' );
-    my $include_dirs = $self->include_dirs;
-    for my $include_dir (@$include_dirs) {
-        my $file = catfile ( $include_dir, @path );
-        if ( -e $file ) {
-            $self->copy_if_modified(
-                from => $file,
-                to   => catfile( $dest_dir, @path ),
-            );
-            return;
-        }
-    }
-    die( "Clownfish include file " . catfile(@path) . " not found" );
-}
-
-sub ACTION_copy_clownfish_includes {
-    my $self = shift;
-
-    # Copy .cfh files to blib/arch/Clownfish/_include
-    my $inc_dir     = catdir( $self->blib, 'arch', 'Clownfish', '_include' );
-    my $source_dirs = $self->clownfish_params('source');
-
-    for my $source_dir (@$source_dirs) {
-        my $cfh_filepaths = $self->rscan_dir( $source_dir, qr/\.cf[hp]$/ );
-
-        for my $file (@$cfh_filepaths) {
-            my $rel  = abs2rel( $file, $source_dir );
-            my $dest = catfile( $inc_dir, $rel );
-            $self->copy_if_modified( from => $file, to => $dest );
-        }
-    }
-}
-
-sub _compile_clownfish {
-    my $self = shift;
-
-    require Clownfish::CFC::Model::Hierarchy;
-    require Clownfish::CFC::Binding::Perl;
-    require Clownfish::CFC::Binding::Perl::Class;
-
-    # Compile Clownfish.
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(
-        dest => $AUTOGEN_DIR,
-    );
-    my $source_dirs  = $self->clownfish_params('source');
-    my $include_dirs = $self->clownfish_params('include');
-    for my $source_dir (@$source_dirs) {
-        $hierarchy->add_source_dir($source_dir);
-    }
-    for my $include_dir (@$include_dirs) {
-        $hierarchy->add_include_dir($include_dir);
-    }
-    $hierarchy->build;
-
-    # Process all Binding classes in buildlib.
-    my $pm_filepaths = $self->rscan_dir( $BUILDLIB_DIR, qr/\.pm$/ );
-    for my $pm_filepath (@$pm_filepaths) {
-        next unless $pm_filepath =~ /Binding/;
-        require $pm_filepath;
-        my $package_name = $pm_filepath;
-        $package_name =~ s/buildlib\/(.*)\.pm$/$1/;
-        $package_name =~ s/\//::/g;
-        $package_name->bind_all($hierarchy);
-    }
-
-    my $binding = Clownfish::CFC::Binding::Perl->new(
-        hierarchy  => $hierarchy,
-        lib_dir    => $LIB_DIR,
-        boot_class => $self->module_name,
-        header     => $self->clownfish_params('autogen_header'),
-        footer     => '',
-    );
-
-    return ( $hierarchy, $binding );
-}
-
-sub ACTION_pod {
-    my $self = shift;
-    $self->dispatch("clownfish");
-    $self->_write_pod(@_);
-}
-
-sub _write_pod {
-    my ( $self, $binding ) = @_;
-    if ( !$binding ) {
-        ( undef, $binding ) = $self->_compile_clownfish;
-    }
-    print "Writing POD...\n";
-    my $pod_files = $binding->write_pod;
-    $self->add_to_cleanup($_) for @$pod_files;
-}
-
-sub ACTION_clownfish {
-    my $self = shift;
-
-    $self->add_to_cleanup($AUTOGEN_DIR);
-
-    my @module_dir  = split( '::', $self->module_name );
-    my $class_name  = pop(@module_dir);
-    my $xs_filepath = catfile( $LIB_DIR, @module_dir, "$class_name.xs" );
-
-    my $buildlib_pm_filepaths = $self->rscan_dir( $BUILDLIB_DIR, qr/\.pm$/ );
-    my $cfh_filepaths = $self->_cfh_filepaths;
-
-    # XXX joes thinks this is dubious
-    # Don't bother parsing Clownfish files if everything's up to date.
-    return
-        if $self->up_to_date(
-        [ @$cfh_filepaths, @$buildlib_pm_filepaths ],
-        [ $xs_filepath,    $AUTOGEN_DIR, ]
-        );
-
-    # Write out all autogenerated files.
-    print "Parsing Clownfish files...\n";
-    my ( $hierarchy, $perl_binding ) = $self->_compile_clownfish;
-    require Clownfish::CFC::Binding::Core;
-    my $core_binding = Clownfish::CFC::Binding::Core->new(
-        hierarchy => $hierarchy,
-        header    => $self->clownfish_params('autogen_header'),
-        footer    => '',
-    );
-    print "Writing Clownfish autogenerated files...\n";
-    my $modified = $core_binding->write_all_modified;
-    if ($modified) {
-        unlink('typemap');
-        print "Writing typemap...\n";
-        $self->add_to_cleanup('typemap');
-        $perl_binding->write_xs_typemap;
-    }
-
-    # Rewrite XS if either any .cfh files or relevant .pm files were modified.
-    $modified ||=
-        $self->up_to_date( \@$buildlib_pm_filepaths, $xs_filepath )
-        ? 0
-        : 1;
-
-    if ($modified) {
-        $self->add_to_cleanup($xs_filepath);
-        $perl_binding->write_callbacks;
-        $perl_binding->write_boot;
-        $perl_binding->write_hostdefs;
-        $perl_binding->write_bindings;
-        $self->_write_pod($perl_binding);
-    }
-
-    # Touch autogenerated files in case the modifications were inconsequential
-    # and didn't trigger a rewrite, so that we won't have to check them again
-    # next pass.
-    if (!$self->up_to_date(
-            [ @$cfh_filepaths, @$buildlib_pm_filepaths ], $xs_filepath
-        )
-        )
-    {
-        utime( time, time, $xs_filepath );    # touch
-    }
-    if (!$self->up_to_date(
-            [ @$cfh_filepaths, @$buildlib_pm_filepaths ], $AUTOGEN_DIR
-        )
-        )
-    {
-        utime( time, time, $AUTOGEN_DIR );    # touch
-    }
-}
-
-# Write ppport.h, which supplies some XS routines not found in older Perls and
-# allows us to use more up-to-date XS API while still supporting Perls back to
-# 5.8.3.
-#
-# The Devel::PPPort docs recommend that we distribute ppport.h rather than
-# require Devel::PPPort itself, but ppport.h isn't compatible with the Apache
-# license.
-sub ACTION_ppport {
-    my $self = shift;
-    if ( !-e 'ppport.h' ) {
-        require Devel::PPPort;
-        $self->add_to_cleanup('ppport.h');
-        Devel::PPPort::WriteFile();
-    }
-}
-
-sub ACTION_compile_custom_xs {
-    my $self = shift;
-
-    $self->dispatch('ppport');
-
-    require ExtUtils::CBuilder;
-    require ExtUtils::ParseXS;
-
-    my $module_name  = $self->module_name;
-    my @module_parts = split( '::', $module_name );
-    my @module_dir   = @module_parts;
-    my $class_name   = pop(@module_dir);
-
-    my $cbuilder = ExtUtils::CBuilder->new( config => $self->config );
-    my $libdir   = catdir( $LIB_DIR, @module_dir );
-    my $archdir  = catdir( $self->blib, 'arch', 'auto', @module_parts );
-    mkpath( $archdir, 0, 0777 ) unless -d $archdir;
-    my @objects;
-
-    # Compile C source files.
-    my $c_files = [];
-    my $source_dirs = $self->clownfish_params('source');
-    for my $source_dir (@$source_dirs) {
-        push @$c_files, @{ $self->rscan_dir( $source_dir, qr/\.c$/ ) };
-    }
-    # Compile with -fvisibility=hidden on GCC >= 4.0
-    my $extra_cflags = $self->charmony("EXTRA_CFLAGS");
-    if ( $self->config('gccversion') && $Config{dlext} ne 'dll' ) {
-        my @version_nums = split( /\./, $self->config('gccversion') );
-        if ( $version_nums[0] >= 4 ) {
-            $extra_cflags .= ' -fvisibility=hidden';
-        }
-    }
-    for my $c_file (@$c_files) {
-        my $o_file   = $c_file;
-        my $ccs_file = $c_file;
-        $o_file   =~ s/\.c$/$Config{_o}/ or die "no match";
-        $ccs_file =~ s/\.c$/.ccs/        or die "no match";
-        push @objects, $o_file;
-        next if $self->up_to_date( $c_file, $o_file );
-        $self->add_to_cleanup($o_file);
-        $self->add_to_cleanup($ccs_file);
-        $cbuilder->compile(
-            source               => $c_file,
-            extra_compiler_flags => $extra_cflags,
-            include_dirs         => $self->include_dirs,
-            object_file          => $o_file,
-        );
-    }
-
-    # .xs => .c
-    my $xs_filepath         = catfile( $libdir, "$class_name.xs" );
-    my $perl_binding_c_file = catfile( $libdir, "$class_name.c" );
-    $self->add_to_cleanup($perl_binding_c_file);
-    if ( !$self->up_to_date( $xs_filepath, $perl_binding_c_file ) ) {
-        ExtUtils::ParseXS::process_file(
-            filename   => $xs_filepath,
-            prototypes => 0,
-            output     => $perl_binding_c_file,
-        );
-    }
-
-    # .c => .o
-    my $version = $self->dist_version;
-    my $perl_binding_o_file = catfile( $libdir, "$class_name$Config{_o}" );
-    unshift @objects, $perl_binding_o_file;
-    $self->add_to_cleanup($perl_binding_o_file);
-    if ( !$self->up_to_date( $perl_binding_c_file, $perl_binding_o_file ) ) {
-        # Don't use -fvisibility=hidden for XS
-        $cbuilder->compile(
-            source               => $perl_binding_c_file,
-            extra_compiler_flags => $self->extra_compiler_flags,
-            include_dirs         => $self->include_dirs,
-            object_file          => $perl_binding_o_file,
-            # 'defines' is an undocumented parameter to compile(), so we
-            # should officially roll our own variant and generate compiler
-            # flags.  However, that involves writing a bunch of
-            # platform-dependent code, so we'll just take the chance that this
-            # will break.
-            defines => {
-                VERSION    => qq|"$version"|,
-                XS_VERSION => qq|"$version"|,
-            },
-        );
-    }
-
-    # Create .bs bootstrap file, needed by Dynaloader.
-    my $bs_file = catfile( $archdir, "$class_name.bs" );
-    $self->add_to_cleanup($bs_file);
-    if ( !$self->up_to_date( $perl_binding_o_file, $bs_file ) ) {
-        require ExtUtils::Mkbootstrap;
-        ExtUtils::Mkbootstrap::Mkbootstrap($bs_file);
-        if ( !-f $bs_file ) {
-            # Create file in case Mkbootstrap didn't do anything.
-            open( my $fh, '>', $bs_file )
-                or confess "Can't open $bs_file: $!";
-        }
-        utime( (time) x 2, $bs_file );    # touch
-    }
-
-    # Clean up after CBuilder under MSVC.
-    $self->add_to_cleanup('compilet*');
-    $self->add_to_cleanup('*.ccs');
-    $self->add_to_cleanup( catfile( $libdir, "$class_name.ccs" ) );
-    $self->add_to_cleanup( catfile( $libdir, "$class_name.def" ) );
-    $self->add_to_cleanup( catfile( $libdir, "${class_name}_def.old" ) );
-    $self->add_to_cleanup( catfile( $libdir, "$class_name.exp" ) );
-    $self->add_to_cleanup( catfile( $libdir, "$class_name.lib" ) );
-    $self->add_to_cleanup( catfile( $libdir, "$class_name.lds" ) );
-    $self->add_to_cleanup( catfile( $libdir, "$class_name.base" ) );
-
-    # .o => .(a|bundle)
-    my $lib_file = catfile( $archdir, "$class_name.$Config{dlext}" );
-    if ( !$self->up_to_date( [ @objects, $AUTOGEN_DIR ], $lib_file ) ) {
-        $cbuilder->link(
-            module_name        => $module_name,
-            objects            => \@objects,
-            lib_file           => $lib_file,
-            extra_linker_flags => $self->extra_linker_flags,
-        );
-        # Install .lib file on Windows
-        my $implib_file = catfile( $libdir, "$class_name.lib" );
-        if ( -e $implib_file ) {
-            $self->copy_if_modified(
-                from => $implib_file,
-                to   => catfile( $archdir, "$class_name.lib" ),
-            );
-        }
-    }
-}
-
-sub ACTION_code {
-    my $self = shift;
-
-    $self->dispatch('clownfish');
-    $self->dispatch('compile_custom_xs');
-    $self->dispatch('copy_clownfish_includes');
-
-    $self->SUPER::ACTION_code;
-}
-
-# Monkey patch ExtUtils::CBuilder::Platform::Windows::GCC::format_linker_cmd
-# to make extensions work on MinGW.
-#
-# nwellnhof: The original ExtUtils::CBuilder implementation uses dlltool and a
-# strange incremental linking scheme. I think this is only needed for ancient
-# versions of GNU ld. It somehow breaks exporting of symbols via
-# __declspec(dllexport). Starting with version 2.17, one can pass .def files
-# to GNU ld directly, which requires only a single command and gets the
-# exports right.
-{
-    no warnings 'redefine';
-    require ExtUtils::CBuilder::Platform::Windows::GCC;
-    *ExtUtils::CBuilder::Platform::Windows::GCC::format_linker_cmd = sub {
-      my ($self, %spec) = @_;
-      my $cf = $self->{config};
-
-      # The Config.pm variable 'libperl' is hardcoded to the full name
-      # of the perl import library (i.e. 'libperl56.a'). GCC will not
-      # find it unless the 'lib' prefix & the extension are stripped.
-      $spec{libperl} =~ s/^(?:lib)?([^.]+).*$/-l$1/;
-
-      unshift( @{$spec{other_ldflags}}, '-nostartfiles' )
-        if ( $spec{startup} && @{$spec{startup}} );
-
-      # From ExtUtils::MM_Win32:
-      #
-      ## one thing for GCC/Mingw32:
-      ## we try to overcome non-relocateable-DLL problems by generating
-      ##    a (hopefully unique) image-base from the dll's name
-      ## -- BKS, 10-19-1999
-      File::Basename::basename( $spec{output} ) =~ /(....)(.{0,4})/;
-      $spec{image_base} = sprintf( "0x%x0000", unpack('n', $1 ^ $2) );
-
-      %spec = $self->write_linker_script(%spec)
-        if $spec{use_scripts};
-
-      foreach my $path ( @{$spec{libpath}} ) {
-        $path = "-L$path";
-      }
-
-      my @cmds; # Stores the series of commands needed to build the module.
-
-      # split off any -arguments included in ld
-      my @ld = split / (?=-)/, $spec{ld};
-
-      push @cmds, [ grep {defined && length} (
-        @ld                       ,
-        '-o', $spec{output}       ,
-        "-Wl,--image-base,$spec{image_base}" ,
-        @{$spec{lddlflags}}       ,
-        @{$spec{libpath}}         ,
-        @{$spec{startup}}         ,
-        @{$spec{objects}}         ,
-        @{$spec{other_ldflags}}   ,
-        $spec{libperl}            ,
-        @{$spec{perllibs}}        ,
-        $spec{def_file}           ,
-        $spec{map_file} ? ('-Map', $spec{map_file}) : ''
-      ) ];
-
-      return @cmds;
-    };
-}
-
-1;
-
-__END__
-
-=head1 NAME
-
-Clownfish::CFC::Perl::Build - Build Clownfish modules
-
-=head1 DESCRIPTION
-
-Clownfish::CFC::Perl::Build is a subclass of L<Module::Build> which builds
-the Perl bindings for Clownfish modules.
-
-=head1 SYNOPSIS
-
-    use Clownfish::CFC::Perl::Build;
-    use File::Spec::Functions qw( catdir );
-
-    my @cf_base_path    = Clownfish::CFC::Perl::Build->cf_base_path;
-    my @cf_sys_includes = Clownfish::CFC::Perl::Build->cf_system_include_dirs;
-    my @cf_linker_flags = Clownfish::CFC::Perl::Build->cf_linker_flags(
-        'Other::Module',
-    );
-
-    my $builder = Clownfish::CFC::Perl::Build->new(
-        module_name        => 'My::Module',
-        dist_abstract      => 'Do something with this and that',
-        dist_author        => 'The Author <au...@example.com>',
-        dist_version       => '0.1.0',
-        include_dirs       => [ @cf_sys_includes ],
-        extra_linker_flags => [ @cf_linker_flags ],
-        clownfish_params => {
-            source  => [ catdir( @cf_base_path, 'core' ) ],
-            include => [ @cf_sys_includes ],
-        },
-        requires => {
-            'Other::Module' => '0.3.0',
-        },
-        configure_requires => {
-            'Clownfish::CFC::Perl::Build' => 0.01,
-        },
-        build_requires => {
-            'Clownfish::CFC::Perl::Build' => 0.01,
-        },
-    );
-
-    $builder->create_build_script();
-
-=head1 CONSTRUCTOR
-
-=head2 my $builder = Clownfish::CFC::Perl::Build->new(%args);
-
-Creates a new Clownfish::CFC::Perl::Build object. %args can contain all
-arguments that can be passed to L<Module::Build/new>. It accepts an additional
-argument 'clownfish_params', which is a hashref with the following params:
-
-=head3 source
-
-An arrayref of source directories containing the .cfh and .c files of the
-module. Defaults to [ 'core' ] or to [ '../core' ] if 'core' can't
-be found.
-
-=head3 include
-
-An arrayref of include directories containing .cfh files from other Clownfish
-modules needed by the module. Empty by default. Should contain the Clownfish
-system include directories if needed.
-
-=head3 autogen_header
-
-A string that will be prepended to the files generated by the Clownfish
-compiler.
-
-=head1 METHODS
-
-=head2 my @path = Clownfish::CFC::Perl::Build->cf_base_path();
-
-Returns the base path of the source tree where 'core' etc. will be found.
-Currently either () or ('..').
-
-=head1 METHODS
-
-=head2 my @dirs = Clownfish::CFC::Perl::Build->cf_system_include_dirs();
-
-Returns a list of Clownfish include directories of system-wide installations
-of Clownfish modules.
-
-=head2 my @flags = Clownfish::CFC::Perl::Build->cf_linker_flags($module_name);
-
-Returns the linker flags needed to link against Clownfish module named
-$module_name. Should be added to extra_linker_flags for all module
-dependencies.
-
-=head2 $builder->cf_copy_include_file(@path);
-
-Look for a file with path components @path in all of the Module::Build
-include dirs and copy it to blib, so it will be installed in a Clownfish
-system include directory. Typically used for additional .h files that the
-.cfh files need.
-
-=head2 my $value = $builder->clownfish_params($key);
-
-=head2 $builder->clownfish_params($key => $value);
-
-Get or set a Clownfish build param. Supports all the parameters that can be
-passed to L</new>.
-
-=head1 COPYRIGHT
-
-Clownfish is distributed under the Apache License, Version 2.0, as
-described in the file C<LICENSE> included with the distribution.
-
-=cut
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
deleted file mode 100644
index 8c5843c..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ /dev/null
@@ -1,116 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-package Clownfish::CFC::Perl::Build::Charmonic;
-
-use base qw( Module::Build );
-
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-use Carp;
-use Config;
-use Cwd qw( getcwd );
-use File::Spec::Functions qw( catfile curdir );
-
-# Add a custom Module::Build hashref property to pass the following build
-# parameters.
-# charmonizer_c: Charmonizer C file, required
-if ( $Module::Build::VERSION <= 0.30 ) {
-    __PACKAGE__->add_property( charmonizer_params => {} );
-}
-else {
-    __PACKAGE__->add_property(
-        'charmonizer_params',
-        default => {},
-    );
-}
-
-my $CHARMONIZER_EXE_PATH = catfile( curdir(), "charmonizer$Config{_exe}" );
-my $CHARMONY_H_PATH      = 'charmony.h';
-my $CHARMONY_PM_PATH     = 'Charmony.pm';
-
-# Compile and run the charmonizer executable, creating the charmony.h and
-# Charmony.pm files.
-sub ACTION_charmony {
-    my $self = shift;
-    my $charmonizer_c = $self->charmonizer_params('charmonizer_c');
-    $self->add_to_cleanup($CHARMONIZER_EXE_PATH);
-    if ( !$self->up_to_date( $charmonizer_c, $CHARMONIZER_EXE_PATH ) ) {
-        print "\nCompiling $CHARMONIZER_EXE_PATH...\n\n";
-        my $cc = $self->config('cc');
-        my $outflag = $cc =~ /cl\b/ ? "/Fe" : "-o ";
-        system("$cc $charmonizer_c $outflag$CHARMONIZER_EXE_PATH")
-            and die "Failed to compile $CHARMONIZER_EXE_PATH";
-    }
-
-    return if $self->up_to_date( $CHARMONIZER_EXE_PATH, [
-        $CHARMONY_H_PATH, $CHARMONY_PM_PATH,
-    ] );
-    print "\nRunning $CHARMONIZER_EXE_PATH...\n\n";
-
-    $self->add_to_cleanup($CHARMONY_H_PATH);
-    $self->add_to_cleanup($CHARMONY_PM_PATH);
-    # Clean up after charmonizer if it doesn't succeed on its own.
-    $self->add_to_cleanup("_charm*");
-
-    # Prepare arguments to charmonizer.
-    my @command = (
-        $CHARMONIZER_EXE_PATH,
-        '--cc=' . _quotify( $self->config('cc') ),
-        '--enable-c',
-        '--enable-perl',
-    );
-    if ( !$self->config('usethreads') ) {
-        push @command, '--disable-threads';
-    }
-    push @command, ( '--', $self->config('ccflags') );
-    if ( $ENV{CHARM_VALGRIND} ) {
-        unshift @command, "valgrind", "--leak-check=yes";
-    }
-    print join( " ", @command ), $/;
-
-    system(@command) and die "Failed to run $CHARMONIZER_EXE_PATH: $!";
-}
-
-my $config;
-
-sub charmony {
-    my ( undef, $key ) = @_;
-    if (!$config) {
-        eval { require 'Charmony.pm'; };
-        if ( !$@ ) {
-            $config = Charmony->config;
-        }
-    }
-    if ($config) {
-        return $config->{$key};
-    }
-    return;
-}
-
-sub _quotify {
-    my $string = shift;
-    $string =~ s/\\/\\\\/g;
-    $string =~ s/"/\\"/g;
-    return $string =~ /\s/ ? qq|"$string"| : $string;
-}
-
-1;
-
-__END__

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Test.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Test.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Test.pm
deleted file mode 100644
index bebd673..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Test.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Test;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC/Util.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC/Util.pm b/clownfish/compiler/perl/lib/Clownfish/CFC/Util.pm
deleted file mode 100644
index 25d10f6..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC/Util.pm
+++ /dev/null
@@ -1,20 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::CFC::Util;
-use Clownfish::CFC;
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/000-load.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/000-load.t b/clownfish/compiler/perl/t/000-load.t
deleted file mode 100644
index 4f450a2..0000000
--- a/clownfish/compiler/perl/t/000-load.t
+++ /dev/null
@@ -1,39 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More 'no_plan';
-use File::Find 'find';
-
-my @modules;
-
-find(
-    {   no_chdir => 1,
-        wanted   => sub {
-            return unless $File::Find::name =~ /\.pm$/;
-            push @modules, $File::Find::name;
-            }
-    },
-    'lib'
-);
-for (@modules) {
-    s/^.*?Clownfish/Clownfish/;
-    s/\.pm$//;
-    s/\W+/::/g;
-    use_ok($_);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/001-util.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/001-util.t b/clownfish/compiler/perl/t/001-util.t
deleted file mode 100644
index 745bb69..0000000
--- a/clownfish/compiler/perl/t/001-util.t
+++ /dev/null
@@ -1,69 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 15;
-use File::stat qw( stat );
-use Clownfish::CFC::Util qw(
-    slurp_text
-    current
-    verify_args
-    a_isa_b
-    write_if_changed
-);
-
-my $foo_txt = 'foo.txt';
-unlink $foo_txt;
-open( my $fh, '>', $foo_txt ) or die "Can't open '$foo_txt': $!";
-print $fh "foo";
-close $fh or die "Can't close '$foo_txt': $!";
-is( slurp_text($foo_txt), "foo", "slurp_text" );
-
-ok( current( $foo_txt, $foo_txt ), "current" );
-ok( !current( $foo_txt, 't' ), "not current" );
-ok( !current( $foo_txt, "nonexistent_file" ),
-    "not current when dest file mising"
-);
-
-my $one_second_ago = time() - 1;
-utime( $one_second_ago, $one_second_ago, $foo_txt )
-    or die "utime failed";
-write_if_changed( $foo_txt, "foo" );
-is( stat($foo_txt)->mtime, $one_second_ago,
-    "write_if_changed does nothing if contents not changed" );
-write_if_changed( $foo_txt, "foofoo" );
-ok( stat($foo_txt)->mtime != $one_second_ago,
-    "write_if_changed writes if contents changed"
-);
-
-unlink $foo_txt;
-
-my %defaults = ( foo => undef );
-sub test_verify_args { return verify_args( \%defaults, @_ ) }
-
-ok( test_verify_args( foo => 'foofoo' ), "args verified" );
-ok( !test_verify_args('foo'), "odd args fail verification" );
-like( $@, qr/odd/, 'set $@ on odd arg failure' );
-ok( !test_verify_args( bar => 'nope' ), "bad param doesn't verify" );
-like( $@, qr/param/, 'set $@ on invalid param failure' );
-
-my $foo = bless {}, 'Foo';
-ok( a_isa_b( $foo, 'Foo' ), "a_isa_b true" );
-ok( !a_isa_b( $foo,  'Bar' ), "a_isa_b false" );
-ok( !a_isa_b( 'Foo', 'Foo' ), "a_isa_b not blessed" );
-ok( !a_isa_b( undef, 'Foo' ), "a_isa_b undef" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/050-docucomment.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/050-docucomment.t b/clownfish/compiler/perl/t/050-docucomment.t
deleted file mode 100644
index d2be87c..0000000
--- a/clownfish/compiler/perl/t/050-docucomment.t
+++ /dev/null
@@ -1,58 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 10;
-
-BEGIN { use_ok('Clownfish::CFC::Model::DocuComment') }
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-isa_ok( $parser->parse('/** foo. */'), "Clownfish::CFC::Model::DocuComment" );
-
-my $text = <<'END_COMMENT';
-/**
- * Brief description.  Long description.
- *
- * More long description.
- *
- * @param foo A foo.
- * @param bar A bar.
- *
- * @param baz A baz.
- * @return a return value.
- */
-END_COMMENT
-
-my $docucomment = $parser->parse($text);
-
-like(
-    $docucomment->get_description,
-    qr/^Brief.*long description.\s*\Z/ims,
-    "get_description"
-);
-is( $docucomment->get_brief, "Brief description.", "brief" );
-like( $docucomment->get_long, qr/^Long.*long description.\s*\Z/ims, "long" );
-is_deeply( $docucomment->get_param_names, [qw( foo bar baz )],
-    "param names" );
-is( $docucomment->get_param_docs->[0], "A foo.", '@param terminated by @' );
-is( $docucomment->get_param_docs->[1],
-    "A bar.", '@param terminated by empty line' );
-is( $docucomment->get_param_docs->[2],
-    "A baz.", '@param terminated next element, @return' );
-is( $docucomment->get_retval, "a return value.", "get_retval" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/051-symbol.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/051-symbol.t b/clownfish/compiler/perl/t/051-symbol.t
deleted file mode 100644
index 9356696..0000000
--- a/clownfish/compiler/perl/t/051-symbol.t
+++ /dev/null
@@ -1,84 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 40;
-use Clownfish::CFC;
-
-for (qw( foo 1Foo Foo_Bar 1FOOBAR )) {
-    eval { my $thing = new_symbol( class_name => $_ ) };
-    like( $@, qr/class_name/, "Reject invalid class name $_" );
-    my $bogus_middle = "Foo::" . $_ . "::Bar";
-    eval { my $thing = new_symbol( class_name => $bogus_middle ) };
-    like( $@, qr/class_name/, "Reject invalid class name $bogus_middle" );
-}
-
-my @exposures = qw( public private parcel local );
-for my $exposure (@exposures) {
-    my $thing = new_symbol( exposure => $exposure );
-    ok( $thing->$exposure, "exposure $exposure" );
-    my @not_exposures = grep { $_ ne $exposure } @exposures;
-    ok( !$thing->$_, "$exposure means not $_" ) for @not_exposures;
-}
-
-my $foo    = new_symbol( class_name => 'Foo' );
-my $foo_jr = new_symbol( class_name => 'Foo::FooJr' );
-ok( !$foo->equals($foo_jr), "different class_name spoils equals" );
-is( $foo_jr->get_class_name, "Foo::FooJr", "get_class_name" );
-is( $foo_jr->get_class_cnick, "FooJr", "derive class_cnick from class_name" );
-
-my $public_exposure = new_symbol( exposure => 'public' );
-my $parcel_exposure = new_symbol( exposure => 'parcel' );
-ok( !$public_exposure->equals($parcel_exposure),
-    "different exposure spoils equals"
-);
-
-my $lucifer_parcel = Clownfish::CFC::Model::Parcel->new( name => 'Lucifer' );
-$lucifer_parcel->register;
-my $lucifer = new_symbol( parcel => 'Lucifer' );
-ok( $$lucifer_parcel == ${ $lucifer->get_parcel }, "derive parcel" );
-is( $lucifer->get_prefix, "lucifer_", "get_prefix" );
-is( $lucifer->get_Prefix, "Lucifer_", "get_Prefix" );
-is( $lucifer->get_PREFIX, "LUCIFER_", "get_PREFIX" );
-my $luser = new_symbol( parcel => 'Luser' );
-ok( !$lucifer->equals($luser), "different parcel spoils equals" );
-
-for ( qw( 1foo * 0 ), "\x{263a}" ) {
-    eval { my $thing = new_symbol( micro_sym => $_ ); };
-    like( $@, qr/micro_sym/, "reject bad micro_sym" );
-}
-
-my $ooga  = new_symbol( micro_sym => 'ooga' );
-my $booga = new_symbol( micro_sym => 'booga' );
-ok( !$ooga->equals($booga), "Different micro_sym spoils equals()" );
-
-my $eep = new_symbol(
-    parcel     => 'Eep',
-    class_name => "Op::Ork",
-    micro_sym  => 'ah_ah',
-);
-is( $eep->short_sym, "Ork_ah_ah",     "short_sym" );
-is( $eep->full_sym,  "eep_Ork_ah_ah", "full_sym" );
-
-sub new_symbol {
-    return Clownfish::CFC::Model::Symbol->new(
-        micro_sym => 'sym',
-        exposure  => 'parcel',
-        @_
-    );
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/052-version.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/052-version.t b/clownfish/compiler/perl/t/052-version.t
deleted file mode 100644
index 1e96bb8..0000000
--- a/clownfish/compiler/perl/t/052-version.t
+++ /dev/null
@@ -1,41 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 11;
-use Clownfish::CFC;
-
-my $v3_2_1   = Clownfish::CFC::Model::Version->new( vstring => 'v3.2.1' );
-my $v3_2     = Clownfish::CFC::Model::Version->new( vstring => 'v3.2' );
-my $v3_3     = Clownfish::CFC::Model::Version->new( vstring => 'v3.3' );
-my $v3_2_0   = Clownfish::CFC::Model::Version->new( vstring => 'v3.2.0' );
-my $v3_2_1_0 = Clownfish::CFC::Model::Version->new( vstring => 'v3.2.1.0' );
-my $v90210   = Clownfish::CFC::Model::Version->new( vstring => 'v90210' );
-
-is( $v3_2_1->get_major,   3,        'get_major' );
-is( $v90210->get_major,   90210,    'parse big number' );
-is( $v3_2_1->get_vstring, 'v3.2.1', 'get_vstring' );
-
-is( $v3_2_1->compare_to($v3_2_1_0), 0,  "ignore zeroes in compare_to" );
-is( $v3_2_1_0->compare_to($v3_2_1), 0,  "ignore zeroes in compare_to" );
-is( $v3_2_1->compare_to($v3_3),     -1, "compare_to A < B_fewer_digits" );
-is( $v3_3->compare_to($v3_2_1),     1,  "compare_to A_fewer_digits > B" );
-is( $v3_2_1->compare_to($v3_2),     1,  "compare_to A < B_fewer_digits" );
-is( $v3_2->compare_to($v3_2_1),     -1, "compare_to A_fewer_digits > B" );
-is( $v3_2_1->compare_to($v3_2_0),   1,  "compare_to A > B" );
-is( $v3_2_0->compare_to($v3_2_1),   -1, "compare_to A < B" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/100-type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/100-type.t b/clownfish/compiler/perl/t/100-type.t
deleted file mode 100644
index a881883..0000000
--- a/clownfish/compiler/perl/t/100-type.t
+++ /dev/null
@@ -1,42 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 10;
-use Clownfish::CFC::Model::Parcel;
-
-my $neato_parcel = Clownfish::CFC::Model::Parcel->new( name => 'Neato' );
-$neato_parcel->register;
-
-my $type = Clownfish::CFC::Model::Type->new(
-    parcel    => 'Neato',
-    specifier => 'mytype_t'
-);
-is( ${ $type->get_parcel },
-    $$neato_parcel, "constructor changes parcel name to Parcel singleton" );
-
-is( $type->to_c, "mytype_t", "to_c()" );
-ok( !$type->const, "const() is off by default" );
-is( $type->get_specifier, "mytype_t", "get_specifier()" );
-
-ok( !$type->is_object,      "is_object() false by default" );
-ok( !$type->is_integer,     "is_integer() false by default" );
-ok( !$type->is_floating,    "is_floating() false by default" );
-ok( !$type->is_void,        "is_void() false by default" );
-ok( !$type->is_composite,   "is_composite() false by default" );
-ok( !$type->is_string_type, "is_string_type() false by default" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/101-primitive_type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/101-primitive_type.t b/clownfish/compiler/perl/t/101-primitive_type.t
deleted file mode 100644
index 5cad4e7..0000000
--- a/clownfish/compiler/perl/t/101-primitive_type.t
+++ /dev/null
@@ -1,36 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-use Test::More tests => 4;
-use Clownfish::CFC;
-
-my $type = new_primitive_type( specifier => 'hump_t' );
-ok( $type->is_primitive, "is_primitive" );
-
-my $other = new_primitive_type( specifier => 'hump_t' );
-ok( $type->equals($other), "equals()" );
-
-$other = new_primitive_type( specifier => 'dump_t' );
-ok( !$type->equals($other), "equals() spoiled by specifier" );
-
-$other = new_primitive_type( specifier => 'hump_t', const => 1 );
-ok( !$type->equals($other), "equals() spoiled by const" );
-
-sub new_primitive_type {
-    return Clownfish::CFC::Model::Type->new( @_, primitive => 1 );
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/102-integer_type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/102-integer_type.t b/clownfish/compiler/perl/t/102-integer_type.t
deleted file mode 100644
index 132457c..0000000
--- a/clownfish/compiler/perl/t/102-integer_type.t
+++ /dev/null
@@ -1,82 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 87;
-use Clownfish::CFC::Model::Type;
-use Clownfish::CFC::Parser;
-
-my $integer_type = Clownfish::CFC::Model::Type->new_integer(
-    specifier => 'int32_t',
-    const     => 1,
-);
-ok( $integer_type->const, "const" );
-is( $integer_type->get_specifier, "int32_t" );
-like( $integer_type->to_c, qr/const/, "'const' in C representation" );
-
-my $parser = Clownfish::CFC::Parser->new;
-
-my @chy_specifiers = qw(
-    bool
-);
-my @c_specifiers = qw(
-    char
-    short
-    int
-    long
-    size_t
-    int8_t
-    int16_t
-    int32_t
-    int64_t
-    uint8_t
-    uint16_t
-    uint32_t
-    uint64_t
-);
-
-for my $chy_specifier (@chy_specifiers) {
-    my $type = $parser->parse($chy_specifier);
-    isa_ok( $type, "Clownfish::CFC::Model::Type" );
-    ok( $type && $type->is_integer, "parsed Type is_integer()" );
-    $type = $parser->parse("const $chy_specifier");
-    isa_ok( $type, "Clownfish::CFC::Model::Type" );
-    ok( $type && $type->is_integer, "parsed const Type is_integer()" );
-    ok( $type && $type->const,      "parsed const Type is const()" );
-SKIP: {
-        skip( "No way to catch parser exception at present", 1 );
-        my $bogus = $chy_specifier . "oot_toot";
-        ok( !$parser->parse($bogus),
-            "chy_integer_specifier guards against partial word matches" );
-    }
-}
-
-for my $c_specifier (@c_specifiers) {
-    my $type = $parser->parse($c_specifier);
-    isa_ok( $type, "Clownfish::CFC::Model::Type" );
-    ok( $type && $type->is_integer, "parsed Type is_integer()" );
-    $type = $parser->parse("const $c_specifier");
-    isa_ok( $type, "Clownfish::CFC::Model::Type" );
-    ok( $type && $type->is_integer, "parsed const Type is_integer()" );
-    ok( $type && $type->const,      "parsed const Type is const()" );
-SKIP: {
-        skip( "No way to catch parser exception at present", 1 );
-        my $bogus = $c_specifier . "y";
-        ok( !$parser->parse($bogus),
-            "c_integer_specifier guards against partial word matches" );
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/103-float_type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/103-float_type.t b/clownfish/compiler/perl/t/103-float_type.t
deleted file mode 100644
index e690899..0000000
--- a/clownfish/compiler/perl/t/103-float_type.t
+++ /dev/null
@@ -1,48 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 15;
-use Clownfish::CFC::Model::Type;
-use Clownfish::CFC::Parser;
-
-my $float_type = Clownfish::CFC::Model::Type->new_float(
-    specifier => 'float',
-    const     => 1,
-);
-ok( $float_type->const, "const" );
-is( $float_type->get_specifier, "float" );
-like( $float_type->to_c, qr/const/, "'const' in C representation" );
-
-my $parser = Clownfish::CFC::Parser->new;
-
-for my $specifier (qw( float double)) {
-    my $type = $parser->parse($specifier);
-    isa_ok( $type, "Clownfish::CFC::Model::Type" );
-    ok( $type && $type->is_floating, "parsed specifier is_floating()" );
-    $type = $parser->parse("const $specifier");
-    isa_ok( $type, "Clownfish::CFC::Model::Type" );
-    ok( $type && $type->is_floating, "parsed const specifier is_floating()" );
-    ok( $type && $type->const,       "parsed const specifier is_floating()" );
-SKIP: {
-        skip( "No way to catch parser exception at present", 1 );
-        my $bogus = $specifier . "y";
-        ok( !$parser->parse($bogus),
-            "c_float_specifier guards against partial word matches" );
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/104-void_type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/104-void_type.t b/clownfish/compiler/perl/t/104-void_type.t
deleted file mode 100644
index 0d87e2c..0000000
--- a/clownfish/compiler/perl/t/104-void_type.t
+++ /dev/null
@@ -1,52 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 11;
-use Clownfish::CFC::Model::Type;
-use Clownfish::CFC::Parser;
-
-my $void_type = Clownfish::CFC::Model::Type->new_void;
-is( $void_type->get_specifier, "void", "specifier defaults to 'void'" );
-is( $void_type->to_c,          "void", "to_c" );
-ok( $void_type->is_void, "is_void" );
-
-$void_type = Clownfish::CFC::Model::Type->new_void( const => 1 );
-ok( $void_type->const, "const" );
-like( $void_type->to_c, qr/const/, "'const' in C representation" );
-
-my $parser = Clownfish::CFC::Parser->new;
-
-$void_type = $parser->parse('void');
-isa_ok( $void_type, "Clownfish::CFC::Model::Type" );
-ok( $void_type && $void_type->is_void,
-    "Parser calls new_void() when parsing 'void'" );
-my $const_void_type = $parser->parse('const void');
-isa_ok( $const_void_type, "Clownfish::CFC::Model::Type" );
-ok( $const_void_type && $const_void_type->is_void,
-    "Parser calls new_void() when parsing 'const void'"
-);
-ok( $const_void_type && $const_void_type->const,
-    "Parser preserves const when parsing 'const void'"
-);
-
-SKIP: {
-    skip( "No way to catch parser exception at present", 1 );
-    ok( !$parser->parse('voidable'),
-        "void_type_specifier guards against partial word matches" );
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/105-object_type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/105-object_type.t b/clownfish/compiler/perl/t/105-object_type.t
deleted file mode 100644
index 6bf4c65..0000000
--- a/clownfish/compiler/perl/t/105-object_type.t
+++ /dev/null
@@ -1,132 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 54;
-use Clownfish::CFC::Model::Type;
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-
-# Set and leave parcel.
-my $parcel = $parser->parse('parcel Neato;')
-    or die "failed to process parcel_definition";
-
-for my $bad_specifier (qw( foo Foo_Bar FOOBAR 1Foo 1FOO )) {
-    eval {
-        my $type = Clownfish::CFC::Model::Type->new_object(
-            parcel    => 'Neato',
-            specifier => $bad_specifier,
-        );
-    };
-    like( $@, qr/specifier/,
-        "constructor rejects bad specifier $bad_specifier" );
-}
-
-my @specifiers = qw( Foo FooJr FooIII Foo4th );
-my @classes = map { $parser->parse("class $_ {}") } @specifiers;
-
-for my $specifier (@specifiers) {
-    my $type = $parser->parse("$specifier*");
-    $type->resolve(\@classes);
-    is( $type->get_specifier, "neato_$specifier",
-        "object_type_specifier: $specifier" );
-    is( $parser->parse("neato_$specifier*")->get_specifier,
-        "neato_$specifier", "object_type_specifier: neato_$specifier" );
-    ok( $type && $type->is_object, "$specifier*" );
-    $type = $parser->parse("neato_$specifier*");
-    ok( $type && $type->is_object, "neato_$specifier*" );
-    $type = $parser->parse("const $specifier*");
-    ok( $type && $type->is_object && $type->const, "const $specifier*" );
-    $type = $parser->parse("incremented $specifier*");
-    ok( $type && $type->is_object && $type->incremented,
-        "incremented $specifier*" );
-    $type = $parser->parse("decremented $specifier*");
-    ok( $type && $type->is_object && $type->decremented,
-        "decremented $specifier*" );
-    $type = $parser->parse("nullable $specifier*");
-    ok( $type && $type->is_object && $type->nullable,
-        "nullable $specifier*" );
-}
-
-eval { my $type = Clownfish::CFC::Model::Type->new_object };
-like( $@, qr/specifier/i, "specifier required" );
-
-for ( 0, 2 ) {
-    eval {
-        my $type = Clownfish::CFC::Model::Type->new_object(
-            specifier   => 'Foo',
-            indirection => $_,
-        );
-    };
-    like( $@, qr/indirection/i, "invalid indirection of $_" );
-}
-
-my $foo_type = Clownfish::CFC::Model::Type->new_object( specifier => 'Foo' );
-my $another_foo
-    = Clownfish::CFC::Model::Type->new_object( specifier => 'Foo' );
-ok( $foo_type->equals($another_foo), "equals" );
-
-my $bar_type = Clownfish::CFC::Model::Type->new_object( specifier => 'Bar' );
-ok( !$foo_type->equals($bar_type), "different specifier spoils equals" );
-
-my $foreign_foo_class = Clownfish::CFC::Model::Class->create(
-    parcel     => 'Foreign',
-    class_name => 'Foreign::Foo',
-);
-my $foreign_foo = Clownfish::CFC::Model::Type->new_object(
-    specifier => 'Foo',
-    parcel    => 'Foreign',
-);
-$foreign_foo->resolve([ $foreign_foo_class ]);
-ok( !$foo_type->equals($foreign_foo), "different parcel spoils equals" );
-is( $foreign_foo->get_specifier, "foreign_Foo",
-    "prepend parcel prefix to specifier" );
-
-my $incremented_foo = Clownfish::CFC::Model::Type->new_object(
-    specifier   => 'Foo',
-    incremented => 1,
-);
-ok( $incremented_foo->incremented, "incremented" );
-ok( !$foo_type->incremented,       "not incremented" );
-ok( !$foo_type->equals($incremented_foo),
-    "different incremented spoils equals"
-);
-
-my $decremented_foo = Clownfish::CFC::Model::Type->new_object(
-    specifier   => 'Foo',
-    decremented => 1,
-);
-ok( $decremented_foo->decremented, "decremented" );
-ok( !$foo_type->decremented,       "not decremented" );
-ok( !$foo_type->equals($decremented_foo),
-    "different decremented spoils equals"
-);
-
-my $const_foo = Clownfish::CFC::Model::Type->new_object(
-    specifier => 'Foo',
-    const     => 1,
-);
-$const_foo->resolve(\@classes);
-ok( !$foo_type->equals($const_foo), "different const spoils equals" );
-like( $const_foo->to_c, qr/const/, "const included in C representation" );
-
-my $string_type
-    = Clownfish::CFC::Model::Type->new_object( specifier => 'String', );
-ok( !$foo_type->is_string_type,   "Not is_string_type" );
-ok( $string_type->is_string_type, "is_string_type" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/106-va_list_type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/106-va_list_type.t b/clownfish/compiler/perl/t/106-va_list_type.t
deleted file mode 100644
index e20063f..0000000
--- a/clownfish/compiler/perl/t/106-va_list_type.t
+++ /dev/null
@@ -1,37 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 4;
-use Clownfish::CFC::Model::Type;
-use Clownfish::CFC::Parser;
-
-my $va_list_type = Clownfish::CFC::Model::Type->new_va_list;
-is( $va_list_type->get_specifier,
-    "va_list", "specifier defaults to 'va_list'" );
-is( $va_list_type->to_c, "va_list", "to_c" );
-
-my $parser = Clownfish::CFC::Parser->new;
-
-my $type = $parser->parse('va_list');
-ok( $type && $type->is_va_list, "parse va_list" );
-SKIP: {
-    skip( "No way to catch parser exception at present", 1 );
-    ok( !$parser->parse('va_listable'),
-        "va_list_type_specifier guards against partial word matches" );
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/107-arbitrary_type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/107-arbitrary_type.t b/clownfish/compiler/perl/t/107-arbitrary_type.t
deleted file mode 100644
index 7dc0767..0000000
--- a/clownfish/compiler/perl/t/107-arbitrary_type.t
+++ /dev/null
@@ -1,60 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 10;
-use Clownfish::CFC::Model::Type;
-use Clownfish::CFC::Parser;
-
-my $foo_type = Clownfish::CFC::Model::Type->new_arbitrary(
-    parcel    => 'Neato',
-    specifier => "foo_t",
-);
-is( $foo_type->get_specifier, "foo_t", "get_specifier" );
-is( $foo_type->to_c,          "foo_t", "to_c" );
-
-my $compare_t_type = Clownfish::CFC::Model::Type->new_arbitrary(
-    parcel    => 'Neato',
-    specifier => "Sort_compare_t",
-);
-TODO: {
-    local $TODO = "Disabled until parcels get overhauled.";
-    is( $compare_t_type->get_specifier,
-        "neato_Sort_compare_t", "Prepend prefix to specifier" );
-    is( $compare_t_type->to_c, "neato_Sort_compare_t", "to_c" );
-}
-
-my $twin = Clownfish::CFC::Model::Type->new_arbitrary(
-    parcel    => 'Neato',
-    specifier => "foo_t",
-);
-ok( $foo_type->equals($twin), "equals" );
-ok( !$foo_type->equals($compare_t_type),
-    "equals spoiled by different specifier"
-);
-
-my $parser = Clownfish::CFC::Parser->new;
-
-for my $specifier (qw( foo_t Sort_compare_t )) {
-    my $type = $parser->parse($specifier);
-    ok( $type && $type->is_arbitrary, "arbitrary_type '$specifier'" );
-SKIP: {
-        skip( "Can't recover from bad specifier", 1 );
-        ok( !$parser->parse( $specifier . "_y_p_e eep;" ),
-            "arbitrary_type_specifier guards against partial word matches" );
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/108-composite_type.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/108-composite_type.t b/clownfish/compiler/perl/t/108-composite_type.t
deleted file mode 100644
index 8a8369d..0000000
--- a/clownfish/compiler/perl/t/108-composite_type.t
+++ /dev/null
@@ -1,92 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 23;
-use Clownfish::CFC::Model::Type;
-use Clownfish::CFC::Parser;
-
-my $parser = Clownfish::CFC::Parser->new;
-
-my @composite_type_strings = (
-    qw(
-        char*
-        char**
-        char***
-        int32_t*
-        Obj**
-        int8_t[]
-        int8_t[1]
-        neato_method_t[]
-        neato_method_t[1]
-        multi_dimensional_t[1][10]
-        ),
-    'char * * ',
-    'const Obj**',
-    'const void*',
-    'int8_t[ 3 ]',
-);
-
-for my $input (@composite_type_strings) {
-    my $type = $parser->parse($input);
-    ok( $type && $type->is_composite, $input );
-}
-
-eval { my $type = Clownfish::CFC::Model::Type->new_composite };
-like( $@, qr/child/i, "child required" );
-
-my $foo_type = Clownfish::CFC::Model::Type->new_object( specifier => 'Foo' );
-my $composite_type = Clownfish::CFC::Model::Type->new_composite(
-    child       => $foo_type,
-    indirection => 1,
-);
-is( $composite_type->get_specifier,
-    'Foo', "get_specifier delegates to child" );
-
-my $other = Clownfish::CFC::Model::Type->new_composite(
-    child       => $foo_type,
-    indirection => 1,
-);
-ok( $composite_type->equals($other), "equals" );
-ok( $composite_type->is_composite,   "is_composite" );
-
-my $bar_type = Clownfish::CFC::Model::Type->new_object( specifier => 'Bar' );
-my $bar_composite = Clownfish::CFC::Model::Type->new_composite(
-    child       => $bar_type,
-    indirection => 1,
-);
-ok( !$composite_type->equals($bar_composite),
-    "equals spoiled by different child"
-);
-
-my $foo_array = $parser->parse("foo_t[]")
-    or die "Can't parse foo_t[]";
-is( $foo_array->get_array, '[]', "get_array" );
-unlike( $foo_array->to_c, qr/\[\]/, "array subscripts not included by to_c" );
-
-my $foo_array_array = $parser->parse("foo_t[][]")
-    or die "Can't parse foo_t[][]";
-ok( !$foo_array->equals($foo_array_array),
-    "equals spoiled by different array postfixes"
-);
-
-my $foo_star = $parser->parse("foo_t*")
-    or die "Can't parse foo_t*";
-my $foo_star_star = $parser->parse("foo_t**")
-    or die "Can't parse foo_t**";
-ok( !$foo_star->equals($foo_star_star),
-    "equals spoiled by different levels of indirection" );

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/200-function.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/200-function.t b/clownfish/compiler/perl/t/200-function.t
deleted file mode 100644
index 2bedb1d..0000000
--- a/clownfish/compiler/perl/t/200-function.t
+++ /dev/null
@@ -1,60 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 6;
-
-BEGIN { use_ok('Clownfish::CFC::Model::Function') }
-use Clownfish::CFC::Parser;
-use Clownfish::CFC::Model::Parcel;
-
-my $parser = Clownfish::CFC::Parser->new;
-$parser->parse('parcel Neato;')
-    or die "failed to process parcel_definition";
-
-my %args = (
-    parcel      => 'Neato',
-    return_type => $parser->parse('Obj*'),
-    class_name  => 'Neato::Foo',
-    class_cnick => 'Foo',
-    param_list  => $parser->parse('(int32_t some_num)'),
-    micro_sym   => 'return_an_obj',
-);
-
-my $func = Clownfish::CFC::Model::Function->new(%args);
-isa_ok( $func, "Clownfish::CFC::Model::Function" );
-
-eval {
-    my $death
-        = Clownfish::CFC::Model::Function->new( %args, extra_arg => undef );
-};
-like( $@, qr/extra_arg/, "Extra arg kills constructor" );
-
-eval { Clownfish::CFC::Model::Function->new( %args, micro_sym => 'Uh_Oh' ); };
-like( $@, qr/Uh_Oh/, "invalid micro_sym kills constructor" );
-
-$parser->set_class_name("Neato::Obj");
-$parser->set_class_cnick("Obj");
-isa_ok(
-    $parser->parse($_),
-    "Clownfish::CFC::Model::Function",
-    "function declaration: $_"
-    )
-    for (
-    'inert int running_count(int biscuit);',
-    'public inert Hash* init_fave_hash(int32_t num_buckets, bool o_rly);',
-    );


[lucy-commits] [27/54] [abbrv] git commit: refs/heads/sortex_ptr_only - More adjustments for Clownfish removal

Posted by ma...@apache.org.
More adjustments for Clownfish removal


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/4087b617
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/4087b617
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/4087b617

Branch: refs/heads/sortex_ptr_only
Commit: 4087b61762abad37f5c78fbf7bef0dd97771c778
Parents: 6fab33e
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Apr 15 20:52:46 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 15 20:52:46 2014 +0200

----------------------------------------------------------------------
 perl/Build.PL               | 6 ------
 perl/buildlib/Lucy/Build.pm | 3 ---
 2 files changed, 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/4087b617/perl/Build.PL
----------------------------------------------------------------------
diff --git a/perl/Build.PL b/perl/Build.PL
index 2ff802e..756af6f 100644
--- a/perl/Build.PL
+++ b/perl/Build.PL
@@ -31,10 +31,6 @@ my $UTF8PROC_SRC_DIR = catdir( $MODULES_DIR, qw( unicode utf8proc ) );
 my $CORE_SOURCE_DIR  = catdir( @BASE_PATH, 'core' );
 my $XS_SOURCE_DIR    = 'xs';
 
-my $CFR_DIR             = catdir( @BASE_PATH, qw( clownfish runtime ) );
-my $CFR_CORE_SOURCE_DIR = catdir( $CFR_DIR, 'core' );
-my $CFR_XS_SOURCE_DIR   = catdir( $CFR_DIR, qw( perl xs ) );
-
 my $builder = Lucy::Build->new(
     module_name => 'Lucy',
     license     => 'apache',
@@ -69,7 +65,6 @@ my $builder = Lucy::Build->new(
         $SNOWSTEM_INC_DIR,
         $UCD_INC_DIR,
         $UTF8PROC_SRC_DIR,
-        $CFR_XS_SOURCE_DIR,
         @CF_SYS_INCLUDES,
     ],
     clownfish_params => {
@@ -82,7 +77,6 @@ my $builder = Lucy::Build->new(
         ],
         include => [
             @CF_SYS_INCLUDES,
-            $CFR_CORE_SOURCE_DIR,
         ],
     },
     extra_compiler_flags => '-DCFP_LUCY -DCFP_TESTLUCY',

http://git-wip-us.apache.org/repos/asf/lucy/blob/4087b617/perl/buildlib/Lucy/Build.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build.pm b/perl/buildlib/Lucy/Build.pm
index 0d611ef..cf82aa1 100644
--- a/perl/buildlib/Lucy/Build.pm
+++ b/perl/buildlib/Lucy/Build.pm
@@ -89,8 +89,6 @@ sub ACTION_copy_clownfish_includes {
 
     $self->SUPER::ACTION_copy_clownfish_includes;
 
-    $self->cf_copy_include_file( 'charmony.h' );
-    $self->cf_copy_include_file( 'XSBind.h' );
     $self->cf_copy_include_file( qw( Lucy Util ToolSet.h ) );
 }
 
@@ -300,7 +298,6 @@ sub ACTION_dist {
         core
         modules
         devel
-        clownfish
         lemon
         CHANGES
         CONTRIBUTING


[lucy-commits] [36/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Global rename of "cnick" to "nickname"

Posted by ma...@apache.org.
Global rename of "cnick" to "nickname"


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/c3a9a7cc
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/c3a9a7cc
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/c3a9a7cc

Branch: refs/heads/sortex_ptr_only
Commit: c3a9a7cc689123b7415c6b4799cdd809418013fe
Parents: 12104ff
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Apr 23 16:37:40 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Apr 23 16:37:40 2014 +0200

----------------------------------------------------------------------
 core/Lucy/Analysis/SnowballStemmer.cfh             |  2 +-
 core/Lucy/Analysis/SnowballStopFilter.cfh          |  2 +-
 core/Lucy/Index/BackgroundMerger.cfh               |  2 +-
 core/Lucy/Index/DeletionsReader.cfh                |  6 +++---
 core/Lucy/Index/DeletionsWriter.cfh                |  4 ++--
 core/Lucy/Index/DocReader.cfh                      |  2 +-
 core/Lucy/Index/DocVector.cfh                      |  2 +-
 core/Lucy/Index/HighlightReader.cfh                |  6 +++---
 core/Lucy/Index/HighlightWriter.cfh                |  2 +-
 core/Lucy/Index/IndexManager.cfh                   |  2 +-
 core/Lucy/Index/IndexReader.cfh                    |  2 +-
 core/Lucy/Index/Inverter.cfh                       |  2 +-
 core/Lucy/Index/Lexicon.cfh                        |  2 +-
 core/Lucy/Index/LexiconReader.cfh                  |  6 +++---
 core/Lucy/Index/LexiconWriter.cfh                  |  2 +-
 core/Lucy/Index/PolyLexicon.cfh                    |  4 ++--
 core/Lucy/Index/Posting.cfh                        |  4 ++--
 core/Lucy/Index/Posting/MatchPosting.cfh           |  8 ++++----
 core/Lucy/Index/Posting/RawPosting.cfh             |  4 ++--
 core/Lucy/Index/Posting/RichPosting.cfh            |  4 ++--
 core/Lucy/Index/Posting/ScorePosting.cfh           |  4 ++--
 core/Lucy/Index/PostingList.cfh                    |  2 +-
 core/Lucy/Index/PostingListReader.cfh              |  4 ++--
 core/Lucy/Index/PostingListWriter.cfh              |  2 +-
 core/Lucy/Index/PostingPool.cfh                    |  2 +-
 core/Lucy/Index/RawLexicon.cfh                     |  2 +-
 core/Lucy/Index/RawPostingList.cfh                 |  2 +-
 core/Lucy/Index/SegLexicon.cfh                     |  2 +-
 core/Lucy/Index/SegPostingList.cfh                 |  2 +-
 core/Lucy/Index/Segment.cfh                        |  2 +-
 core/Lucy/Index/Similarity.cfh                     |  2 +-
 core/Lucy/Index/SortCache/NumericSortCache.cfh     | 10 +++++-----
 core/Lucy/Index/SortReader.cfh                     |  2 +-
 core/Lucy/Index/TermInfo.cfh                       |  2 +-
 core/Lucy/Index/TermVector.cfh                     |  2 +-
 core/Lucy/Index/ZombieKeyedHash.cfh                |  2 +-
 core/Lucy/Object/BitVector.cfh                     |  2 +-
 core/Lucy/Object/I32Array.cfh                      |  2 +-
 core/Lucy/Plan/Architecture.cfh                    |  2 +-
 core/Lucy/Plan/FieldType.cfh                       |  2 +-
 core/Lucy/Plan/NumericType.cfh                     |  2 +-
 core/Lucy/Search/Collector.cfh                     |  6 +++---
 core/Lucy/Search/Collector/SortCollector.cfh       |  2 +-
 core/Lucy/Search/HitQueue.cfh                      |  2 +-
 core/Lucy/Search/IndexSearcher.cfh                 |  2 +-
 core/Lucy/Search/QueryParser.cfh                   |  2 +-
 core/Lucy/Search/RequiredOptionalMatcher.cfh       |  2 +-
 core/Lucy/Search/RequiredOptionalQuery.cfh         |  4 ++--
 core/Lucy/Store/CompoundFileReader.cfh             |  4 ++--
 core/Lucy/Store/CompoundFileWriter.cfh             |  2 +-
 core/Lucy/Store/DirHandle.cfh                      |  2 +-
 core/Lucy/Store/FSDirHandle.cfh                    |  2 +-
 core/Lucy/Store/FSFileHandle.cfh                   |  2 +-
 core/Lucy/Store/FileHandle.cfh                     |  2 +-
 core/Lucy/Store/Lock.cfh                           |  2 +-
 core/Lucy/Store/LockFactory.cfh                    |  2 +-
 core/Lucy/Store/RAMDirHandle.cfh                   |  2 +-
 core/Lucy/Store/RAMFileHandle.cfh                  |  2 +-
 core/Lucy/Store/SharedLock.cfh                     |  2 +-
 core/Lucy/Test/Analysis/TestSnowballStemmer.cfh    |  2 +-
 core/Lucy/Test/Analysis/TestSnowballStopFilter.cfh |  2 +-
 core/Lucy/Test/Index/TestHighlightWriter.cfh       |  2 +-
 core/Lucy/Test/Index/TestIndexManager.cfh          |  2 +-
 core/Lucy/Test/Index/TestPostingListWriter.cfh     |  2 +-
 core/Lucy/Test/Index/TestSegment.cfh               |  2 +-
 core/Lucy/Test/Object/TestI32Array.cfh             |  2 +-
 core/Lucy/Test/Plan/TestArchitecture.cfh           |  2 +-
 core/Lucy/Test/Plan/TestFieldType.cfh              |  2 +-
 core/Lucy/Test/Search/TestQueryParser.cfh          |  2 +-
 core/Lucy/Test/Search/TestQueryParserLogic.cfh     |  2 +-
 core/Lucy/Test/Search/TestQueryParserSyntax.cfh    |  2 +-
 core/Lucy/Test/Store/TestCompoundFileReader.cfh    |  2 +-
 core/Lucy/Test/Store/TestCompoundFileWriter.cfh    |  2 +-
 core/Lucy/Test/Store/TestFSDirHandle.cfh           |  2 +-
 core/Lucy/Test/Store/TestFSFileHandle.cfh          |  2 +-
 core/Lucy/Test/Store/TestFileHandle.cfh            |  2 +-
 core/Lucy/Test/Store/TestRAMDirHandle.cfh          |  2 +-
 core/Lucy/Test/Store/TestRAMFileHandle.cfh         |  2 +-
 core/Lucy/Test/Util/TestIndexFileNames.cfh         |  2 +-
 core/Lucy/Test/Util/TestMemoryPool.cfh             |  2 +-
 core/Lucy/Test/Util/TestPriorityQueue.cfh          |  4 ++--
 core/Lucy/Util/IndexFileNames.cfh                  |  2 +-
 core/Lucy/Util/MemoryPool.cfh                      |  2 +-
 core/Lucy/Util/PriorityQueue.cfh                   |  2 +-
 core/Lucy/Util/ProcessID.cfh                       |  2 +-
 core/Lucy/Util/SortExternal.cfh                    |  2 +-
 devel/conf/clownfish.vim                           |  2 +-
 87 files changed, 112 insertions(+), 112 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Analysis/SnowballStemmer.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/SnowballStemmer.cfh b/core/Lucy/Analysis/SnowballStemmer.cfh
index 83912da..4fe92a0 100644
--- a/core/Lucy/Analysis/SnowballStemmer.cfh
+++ b/core/Lucy/Analysis/SnowballStemmer.cfh
@@ -25,7 +25,7 @@ parcel Lucy;
  * 'horsing'.
  */
 
-public class Lucy::Analysis::SnowballStemmer cnick SnowStemmer
+public class Lucy::Analysis::SnowballStemmer nickname SnowStemmer
     inherits Lucy::Analysis::Analyzer {
 
     void *snowstemmer;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Analysis/SnowballStopFilter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/SnowballStopFilter.cfh b/core/Lucy/Analysis/SnowballStopFilter.cfh
index cf573bd..6d9f3dc 100644
--- a/core/Lucy/Analysis/SnowballStopFilter.cfh
+++ b/core/Lucy/Analysis/SnowballStopFilter.cfh
@@ -54,7 +54,7 @@ parcel Lucy;
  *     |-----------------------|
  */
 
-public class Lucy::Analysis::SnowballStopFilter cnick SnowStop
+public class Lucy::Analysis::SnowballStopFilter nickname SnowStop
     inherits Lucy::Analysis::Analyzer {
 
     Hash *stoplist;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/BackgroundMerger.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/BackgroundMerger.cfh b/core/Lucy/Index/BackgroundMerger.cfh
index a0936dd..9804de8 100644
--- a/core/Lucy/Index/BackgroundMerger.cfh
+++ b/core/Lucy/Index/BackgroundMerger.cfh
@@ -26,7 +26,7 @@ parcel Lucy;
  * As with L<Indexer|Lucy::Index::Indexer>, see
  * L<Lucy::Docs::FileLocking> if your index is on a shared volume.
  */
-public class Lucy::Index::BackgroundMerger cnick BGMerger
+public class Lucy::Index::BackgroundMerger nickname BGMerger
     inherits Clownfish::Obj {
 
     Schema            *schema;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/DeletionsReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DeletionsReader.cfh b/core/Lucy/Index/DeletionsReader.cfh
index 00d9f44..5e82331 100644
--- a/core/Lucy/Index/DeletionsReader.cfh
+++ b/core/Lucy/Index/DeletionsReader.cfh
@@ -16,7 +16,7 @@
 
 parcel Lucy;
 
-class Lucy::Index::DeletionsReader cnick DelReader
+class Lucy::Index::DeletionsReader nickname DelReader
     inherits Lucy::Index::DataReader {
 
     inert DeletionsReader*
@@ -40,7 +40,7 @@ class Lucy::Index::DeletionsReader cnick DelReader
     Aggregator(DeletionsReader *self, VArray *readers, I32Array *offsets);
 }
 
-class Lucy::Index::PolyDeletionsReader cnick PolyDelReader
+class Lucy::Index::PolyDeletionsReader nickname PolyDelReader
     inherits Lucy::Index::DeletionsReader {
 
     VArray   *readers;
@@ -66,7 +66,7 @@ class Lucy::Index::PolyDeletionsReader cnick PolyDelReader
     Destroy(PolyDeletionsReader *self);
 }
 
-class Lucy::Index::DefaultDeletionsReader cnick DefDelReader
+class Lucy::Index::DefaultDeletionsReader nickname DefDelReader
     inherits Lucy::Index::DeletionsReader {
 
     BitVector *deldocs;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/DeletionsWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DeletionsWriter.cfh b/core/Lucy/Index/DeletionsWriter.cfh
index 755465c..68a2ad5 100644
--- a/core/Lucy/Index/DeletionsWriter.cfh
+++ b/core/Lucy/Index/DeletionsWriter.cfh
@@ -31,7 +31,7 @@ parcel Lucy;
  * merged into new ones.
  */
 
-public abstract class Lucy::Index::DeletionsWriter cnick DelWriter
+public abstract class Lucy::Index::DeletionsWriter nickname DelWriter
     inherits Lucy::Index::DataWriter {
 
     inert DeletionsWriter*
@@ -97,7 +97,7 @@ public abstract class Lucy::Index::DeletionsWriter cnick DelWriter
 
 /** Implements DeletionsWriter using BitVector files.
  */
-class Lucy::Index::DefaultDeletionsWriter cnick DefDelWriter
+class Lucy::Index::DefaultDeletionsWriter nickname DefDelWriter
     inherits Lucy::Index::DeletionsWriter {
 
     VArray        *seg_readers;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/DocReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DocReader.cfh b/core/Lucy/Index/DocReader.cfh
index bf05b4f..b2d5b2f 100644
--- a/core/Lucy/Index/DocReader.cfh
+++ b/core/Lucy/Index/DocReader.cfh
@@ -69,7 +69,7 @@ class Lucy::Index::PolyDocReader inherits Lucy::Index::DocReader {
     Destroy(PolyDocReader *self);
 }
 
-class Lucy::Index::DefaultDocReader cnick DefDocReader
+class Lucy::Index::DefaultDocReader nickname DefDocReader
     inherits Lucy::Index::DocReader {
 
     InStream    *dat_in;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/DocVector.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DocVector.cfh b/core/Lucy/Index/DocVector.cfh
index 8ff0e83..0dde0a1 100644
--- a/core/Lucy/Index/DocVector.cfh
+++ b/core/Lucy/Index/DocVector.cfh
@@ -19,7 +19,7 @@ parcel Lucy;
 /** A collection of TermVectors.
  */
 
-class Lucy::Index::DocVector cnick DocVec
+class Lucy::Index::DocVector nickname DocVec
     inherits Clownfish::Obj {
 
     Hash    *field_bufs;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/HighlightReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/HighlightReader.cfh b/core/Lucy/Index/HighlightReader.cfh
index 2259d7d..8568330 100644
--- a/core/Lucy/Index/HighlightReader.cfh
+++ b/core/Lucy/Index/HighlightReader.cfh
@@ -20,7 +20,7 @@ parcel Lucy;
  *
  * Read segment data used for creating highlighted excerpts.
  */
-class Lucy::Index::HighlightReader cnick HLReader
+class Lucy::Index::HighlightReader nickname HLReader
     inherits Lucy::Index::DataReader {
 
     inert HighlightReader*
@@ -37,7 +37,7 @@ class Lucy::Index::HighlightReader cnick HLReader
     Aggregator(HighlightReader *self, VArray *readers, I32Array *offsets);
 }
 
-class Lucy::Index::PolyHighlightReader cnick PolyHLReader
+class Lucy::Index::PolyHighlightReader nickname PolyHLReader
     inherits Lucy::Index::HighlightReader {
 
     VArray   *readers;
@@ -59,7 +59,7 @@ class Lucy::Index::PolyHighlightReader cnick PolyHLReader
     Destroy(PolyHighlightReader *self);
 }
 
-class Lucy::Index::DefaultHighlightReader cnick DefHLReader
+class Lucy::Index::DefaultHighlightReader nickname DefHLReader
     inherits Lucy::Index::HighlightReader {
 
     InStream *ix_in;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/HighlightWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/HighlightWriter.cfh b/core/Lucy/Index/HighlightWriter.cfh
index b8f8efb..202509d 100644
--- a/core/Lucy/Index/HighlightWriter.cfh
+++ b/core/Lucy/Index/HighlightWriter.cfh
@@ -19,7 +19,7 @@ parcel Lucy;
 /**  Add highlighting data to index.
  */
 
-class Lucy::Index::HighlightWriter cnick HLWriter
+class Lucy::Index::HighlightWriter nickname HLWriter
     inherits Lucy::Index::DataWriter {
 
     OutStream *ix_out;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/IndexManager.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/IndexManager.cfh b/core/Lucy/Index/IndexManager.cfh
index 7dc5e8b..0c5d867 100644
--- a/core/Lucy/Index/IndexManager.cfh
+++ b/core/Lucy/Index/IndexManager.cfh
@@ -26,7 +26,7 @@ parcel Lucy;
  * which cannot change for the life of an index; IndexManager is used for
  * defining rules which may change from process to process.
  */
-public class Lucy::Index::IndexManager cnick IxManager
+public class Lucy::Index::IndexManager nickname IxManager
     inherits Clownfish::Obj {
 
     Folder      *folder;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/IndexReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/IndexReader.cfh b/core/Lucy/Index/IndexReader.cfh
index 1b647e9..80d7584 100644
--- a/core/Lucy/Index/IndexReader.cfh
+++ b/core/Lucy/Index/IndexReader.cfh
@@ -34,7 +34,7 @@ parcel Lucy;
  * L<SegReader|Lucy::Index::SegReader>'s sub-components.
  */
 
-public class Lucy::Index::IndexReader cnick IxReader
+public class Lucy::Index::IndexReader nickname IxReader
     inherits Lucy::Index::DataReader {
 
     Hash            *components;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Inverter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Inverter.cfh b/core/Lucy/Index/Inverter.cfh
index 9dab4e4..1f86238 100644
--- a/core/Lucy/Index/Inverter.cfh
+++ b/core/Lucy/Index/Inverter.cfh
@@ -141,7 +141,7 @@ class Lucy::Index::Inverter inherits Clownfish::Obj {
  * Inverter needs to check certain field characteristics frequently.  Since
  * field definitions are unchanging, we cache them in an InverterEntry object.
  */
-final class Lucy::Index::Inverter::InverterEntry cnick InvEntry
+final class Lucy::Index::Inverter::InverterEntry nickname InvEntry
     inherits Clownfish::Obj {
 
     int32_t      field_num;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Lexicon.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Lexicon.cfh b/core/Lucy/Index/Lexicon.cfh
index 2372d71..4c05e33 100644
--- a/core/Lucy/Index/Lexicon.cfh
+++ b/core/Lucy/Index/Lexicon.cfh
@@ -31,7 +31,7 @@ parcel Lucy;
  *     three
  */
 
-public class Lucy::Index::Lexicon cnick Lex inherits Clownfish::Obj {
+public class Lucy::Index::Lexicon nickname Lex inherits Clownfish::Obj {
 
     String *field;
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/LexiconReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/LexiconReader.cfh b/core/Lucy/Index/LexiconReader.cfh
index cc7e01a..34ce352 100644
--- a/core/Lucy/Index/LexiconReader.cfh
+++ b/core/Lucy/Index/LexiconReader.cfh
@@ -20,7 +20,7 @@ parcel Lucy;
  *
  * LexiconReader reads term dictionary information.
  */
-public abstract class Lucy::Index::LexiconReader cnick LexReader
+public abstract class Lucy::Index::LexiconReader nickname LexReader
     inherits Lucy::Index::DataReader {
 
     inert LexiconReader*
@@ -58,7 +58,7 @@ public abstract class Lucy::Index::LexiconReader cnick LexReader
     Aggregator(LexiconReader *self, VArray *readers, I32Array *offsets);
 }
 
-class Lucy::Index::PolyLexiconReader cnick PolyLexReader
+class Lucy::Index::PolyLexiconReader nickname PolyLexReader
     inherits Lucy::Index::LexiconReader {
 
     VArray   *readers;
@@ -83,7 +83,7 @@ class Lucy::Index::PolyLexiconReader cnick PolyLexReader
     Destroy(PolyLexiconReader *self);
 }
 
-class Lucy::Index::DefaultLexiconReader cnick DefLexReader
+class Lucy::Index::DefaultLexiconReader nickname DefLexReader
     inherits Lucy::Index::LexiconReader {
 
     VArray *lexicons;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/LexiconWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/LexiconWriter.cfh b/core/Lucy/Index/LexiconWriter.cfh
index b015a6d..06eedda 100644
--- a/core/Lucy/Index/LexiconWriter.cfh
+++ b/core/Lucy/Index/LexiconWriter.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** Writer for a term dictionary.
  */
-class Lucy::Index::LexiconWriter cnick LexWriter
+class Lucy::Index::LexiconWriter nickname LexWriter
     inherits Lucy::Index::DataWriter {
 
     TermStepper      *term_stepper;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/PolyLexicon.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PolyLexicon.cfh b/core/Lucy/Index/PolyLexicon.cfh
index 11b6d17..2700753 100644
--- a/core/Lucy/Index/PolyLexicon.cfh
+++ b/core/Lucy/Index/PolyLexicon.cfh
@@ -21,7 +21,7 @@ parcel Lucy;
  * Interleaves the output of multiple SegLexicons.
  */
 
-class Lucy::Index::PolyLexicon cnick PolyLex
+class Lucy::Index::PolyLexicon nickname PolyLex
     inherits Lucy::Index::Lexicon {
 
     Obj            *term;
@@ -54,7 +54,7 @@ class Lucy::Index::PolyLexicon cnick PolyLex
     Destroy(PolyLexicon *self);
 }
 
-class Lucy::Index::SegLexQueue cnick SegLexQ
+class Lucy::Index::SegLexQueue nickname SegLexQ
     inherits Lucy::Util::PriorityQueue {
 
     inert incremented SegLexQueue*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Posting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting.cfh b/core/Lucy/Index/Posting.cfh
index ac081fa..0adb476 100644
--- a/core/Lucy/Index/Posting.cfh
+++ b/core/Lucy/Index/Posting.cfh
@@ -27,7 +27,7 @@ parcel Lucy;
  * posting format, and
  * L<ScorePosting|Lucy::Index::Posting::ScorePosting>, the default.
  */
-class Lucy::Index::Posting cnick Post inherits Lucy::Util::Stepper {
+class Lucy::Index::Posting nickname Post inherits Lucy::Util::Stepper {
 
     int32_t doc_id;
 
@@ -64,7 +64,7 @@ class Lucy::Index::Posting cnick Post inherits Lucy::Util::Stepper {
                  Compiler *compiler, bool need_score);
 }
 
-abstract class Lucy::Index::Posting::PostingWriter cnick PostWriter
+abstract class Lucy::Index::Posting::PostingWriter nickname PostWriter
     inherits Lucy::Index::DataWriter {
 
     int32_t field_num;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Posting/MatchPosting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/MatchPosting.cfh b/core/Lucy/Index/Posting/MatchPosting.cfh
index dcedd14..a92dd3d 100644
--- a/core/Lucy/Index/Posting/MatchPosting.cfh
+++ b/core/Lucy/Index/Posting/MatchPosting.cfh
@@ -23,7 +23,7 @@ parcel Lucy;
  * category, but don't want the match to contribute to the document score, use
  * MatchPosting for the field.
  */
-class Lucy::Index::Posting::MatchPosting cnick MatchPost
+class Lucy::Index::Posting::MatchPosting nickname MatchPost
     inherits Lucy::Index::Posting {
 
     Similarity *sim;
@@ -62,7 +62,7 @@ class Lucy::Index::Posting::MatchPosting cnick MatchPost
                  Compiler *compiler, bool need_score);
 }
 
-class Lucy::Index::Posting::MatchPostingMatcher cnick MatchPostMatcher
+class Lucy::Index::Posting::MatchPostingMatcher nickname MatchPostMatcher
     inherits Lucy::Search::TermMatcher {
 
     inert MatchPostingMatcher*
@@ -73,7 +73,7 @@ class Lucy::Index::Posting::MatchPostingMatcher cnick MatchPostMatcher
     Score(MatchPostingMatcher *self);
 }
 
-class Lucy::Index::Posting::MatchPostingWriter cnick MatchPostWriter
+class Lucy::Index::Posting::MatchPostingWriter nickname MatchPostWriter
     inherits Lucy::Index::Posting::PostingWriter {
 
     OutStream *outstream;
@@ -101,7 +101,7 @@ class Lucy::Index::Posting::MatchPostingWriter cnick MatchPostWriter
 }
 
 class Lucy::Index::Posting::MatchPosting::MatchTermInfoStepper
-    cnick MatchTInfoStepper inherits Lucy::Index::TermStepper {
+    nickname MatchTInfoStepper inherits Lucy::Index::TermStepper {
 
     int32_t skip_interval;
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Posting/RawPosting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RawPosting.cfh b/core/Lucy/Index/Posting/RawPosting.cfh
index e82c390..b57c285 100644
--- a/core/Lucy/Index/Posting/RawPosting.cfh
+++ b/core/Lucy/Index/Posting/RawPosting.cfh
@@ -36,7 +36,7 @@ parcel Lucy;
  * file once the after the doc id is written.
  */
 
-class Lucy::Index::RawPosting cnick RawPost
+class Lucy::Index::RawPosting nickname RawPost
     inherits Lucy::Index::Posting {
 
     uint32_t  freq;
@@ -65,7 +65,7 @@ class Lucy::Index::RawPosting cnick RawPost
     Destroy(RawPosting *self);
 }
 
-class Lucy::Index::Posting::RawPostingWriter cnick RawPostWriter
+class Lucy::Index::Posting::RawPostingWriter nickname RawPostWriter
     inherits Lucy::Index::Posting::PostingWriter {
 
     OutStream *outstream;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Posting/RichPosting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RichPosting.cfh b/core/Lucy/Index/Posting/RichPosting.cfh
index 34e9035..df75449 100644
--- a/core/Lucy/Index/Posting/RichPosting.cfh
+++ b/core/Lucy/Index/Posting/RichPosting.cfh
@@ -28,7 +28,7 @@ parcel Lucy;
  * boost based on the visual size and weight of the marked up text: H1
  * blocks get the greatest weight, H2 blocks almost as much, etc.
  */
-class Lucy::Index::Posting::RichPosting cnick RichPost
+class Lucy::Index::Posting::RichPosting nickname RichPost
     inherits Lucy::Index::Posting::ScorePosting {
 
     float  *prox_boosts;
@@ -60,7 +60,7 @@ class Lucy::Index::Posting::RichPosting cnick RichPost
                  Compiler *compiler, bool need_score);
 }
 
-class Lucy::Index::Posting::RichPostingMatcher cnick RichPostMatcher
+class Lucy::Index::Posting::RichPostingMatcher nickname RichPostMatcher
     inherits Lucy::Index::Posting::ScorePostingMatcher {
 
     inert RichPostingMatcher*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Posting/ScorePosting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/ScorePosting.cfh b/core/Lucy/Index/Posting/ScorePosting.cfh
index 754123f..5ed29e7 100644
--- a/core/Lucy/Index/Posting/ScorePosting.cfh
+++ b/core/Lucy/Index/Posting/ScorePosting.cfh
@@ -22,7 +22,7 @@ parcel Lucy;
  * term-document pairing used by MatchPosting is supplemented by additional
  * frequency, position, and weighting information.
  */
-class Lucy::Index::Posting::ScorePosting cnick ScorePost
+class Lucy::Index::Posting::ScorePosting nickname ScorePost
     inherits Lucy::Index::Posting::MatchPosting {
 
     float     weight;
@@ -63,7 +63,7 @@ class Lucy::Index::Posting::ScorePosting cnick ScorePost
     Get_Prox(ScorePosting *self);
 }
 
-class Lucy::Index::Posting::ScorePostingMatcher cnick ScorePostMatcher
+class Lucy::Index::Posting::ScorePostingMatcher nickname ScorePostMatcher
     inherits Lucy::Search::TermMatcher {
 
     float *score_cache;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/PostingList.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingList.cfh b/core/Lucy/Index/PostingList.cfh
index ac7d834..04c8a5b 100644
--- a/core/Lucy/Index/PostingList.cfh
+++ b/core/Lucy/Index/PostingList.cfh
@@ -24,7 +24,7 @@ parcel Lucy;
  * See L<Lucy::Docs::IRTheory> for definitions of "posting" and "posting
  * list".
  */
-public class Lucy::Index::PostingList cnick PList
+public class Lucy::Index::PostingList nickname PList
     inherits Lucy::Search::Matcher {
 
     public inert PostingList*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/PostingListReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingListReader.cfh b/core/Lucy/Index/PostingListReader.cfh
index 9aef573..0f93526 100644
--- a/core/Lucy/Index/PostingListReader.cfh
+++ b/core/Lucy/Index/PostingListReader.cfh
@@ -21,7 +21,7 @@ parcel Lucy;
  * PostingListReaders produce L<PostingList|Lucy::Index::PostingList>
  * objects which convey document matching information.
  */
-public class Lucy::Index::PostingListReader cnick PListReader
+public class Lucy::Index::PostingListReader nickname PListReader
     inherits Lucy::Index::DataReader {
 
     inert PostingListReader*
@@ -50,7 +50,7 @@ public class Lucy::Index::PostingListReader cnick PListReader
     Aggregator(PostingListReader *self, VArray *readers, I32Array *offsets);
 }
 
-class Lucy::Index::DefaultPostingListReader cnick DefPListReader
+class Lucy::Index::DefaultPostingListReader nickname DefPListReader
     inherits Lucy::Index::PostingListReader {
 
     LexiconReader *lex_reader;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/PostingListWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingListWriter.cfh b/core/Lucy/Index/PostingListWriter.cfh
index f967259..f70e5ca 100644
--- a/core/Lucy/Index/PostingListWriter.cfh
+++ b/core/Lucy/Index/PostingListWriter.cfh
@@ -22,7 +22,7 @@ parcel Lucy;
  * data to LexiconWriter.
  */
 
-class Lucy::Index::PostingListWriter cnick PListWriter
+class Lucy::Index::PostingListWriter nickname PListWriter
     inherits Lucy::Index::DataWriter {
 
     LexiconWriter   *lex_writer;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/PostingPool.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.cfh b/core/Lucy/Index/PostingPool.cfh
index 590680c..be1d26a 100644
--- a/core/Lucy/Index/PostingPool.cfh
+++ b/core/Lucy/Index/PostingPool.cfh
@@ -19,7 +19,7 @@ parcel Lucy;
 /**
  * External sorter for raw postings.
  */
-class Lucy::Index::PostingPool cnick PostPool
+class Lucy::Index::PostingPool nickname PostPool
     inherits Lucy::Util::SortExternal {
 
     Schema            *schema;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/RawLexicon.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/RawLexicon.cfh b/core/Lucy/Index/RawLexicon.cfh
index b0a8b3a..2dcaf7c 100644
--- a/core/Lucy/Index/RawLexicon.cfh
+++ b/core/Lucy/Index/RawLexicon.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** Private scan-only Lexicon helper class.
  */
-class Lucy::Index::RawLexicon cnick RawLex
+class Lucy::Index::RawLexicon nickname RawLex
     inherits Lucy::Index::Lexicon {
 
     InStream      *instream;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/RawPostingList.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/RawPostingList.cfh b/core/Lucy/Index/RawPostingList.cfh
index 0ba119c..4936920 100644
--- a/core/Lucy/Index/RawPostingList.cfh
+++ b/core/Lucy/Index/RawPostingList.cfh
@@ -16,7 +16,7 @@
 
 parcel Lucy;
 
-class Lucy::Index::RawPostingList cnick RawPList
+class Lucy::Index::RawPostingList nickname RawPList
     inherits Lucy::Index::PostingList {
 
     Posting       *posting;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/SegLexicon.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SegLexicon.cfh b/core/Lucy/Index/SegLexicon.cfh
index dd25b05..d152d5c 100644
--- a/core/Lucy/Index/SegLexicon.cfh
+++ b/core/Lucy/Index/SegLexicon.cfh
@@ -19,7 +19,7 @@ parcel Lucy;
 /** Single-segment Lexicon.
  */
 
-class Lucy::Index::SegLexicon cnick SegLex
+class Lucy::Index::SegLexicon nickname SegLex
     inherits Lucy::Index::Lexicon {
 
     Segment         *segment;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/SegPostingList.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SegPostingList.cfh b/core/Lucy/Index/SegPostingList.cfh
index 8209fb4..bf2cc3f 100644
--- a/core/Lucy/Index/SegPostingList.cfh
+++ b/core/Lucy/Index/SegPostingList.cfh
@@ -19,7 +19,7 @@ parcel Lucy;
 /** Single-segment PostingList.
  */
 
-class Lucy::Index::SegPostingList cnick SegPList
+class Lucy::Index::SegPostingList nickname SegPList
     inherits Lucy::Index::PostingList {
 
     PostingListReader *plist_reader;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Segment.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Segment.cfh b/core/Lucy/Index/Segment.cfh
index a1438a3..527bae0 100644
--- a/core/Lucy/Index/Segment.cfh
+++ b/core/Lucy/Index/Segment.cfh
@@ -31,7 +31,7 @@ parcel Lucy;
  * storing metadata themselves.
  */
 
-public class Lucy::Index::Segment cnick Seg inherits Clownfish::Obj {
+public class Lucy::Index::Segment nickname Seg inherits Clownfish::Obj {
 
     String      *name;
     int64_t      count;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/Similarity.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Similarity.cfh b/core/Lucy/Index/Similarity.cfh
index ca523aa..4798fb3 100644
--- a/core/Lucy/Index/Similarity.cfh
+++ b/core/Lucy/Index/Similarity.cfh
@@ -33,7 +33,7 @@ parcel Lucy;
  * scores from multiple fields.
  */
 
-public class Lucy::Index::Similarity cnick Sim inherits Clownfish::Obj {
+public class Lucy::Index::Similarity nickname Sim inherits Clownfish::Obj {
 
     float  *norm_decoder;
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/SortCache/NumericSortCache.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortCache/NumericSortCache.cfh b/core/Lucy/Index/SortCache/NumericSortCache.cfh
index 3d23200..70d8950 100644
--- a/core/Lucy/Index/SortCache/NumericSortCache.cfh
+++ b/core/Lucy/Index/SortCache/NumericSortCache.cfh
@@ -16,7 +16,7 @@
 
 parcel Lucy;
 
-class Lucy::Index::SortCache::NumericSortCache cnick NumSortCache
+class Lucy::Index::SortCache::NumericSortCache nickname NumSortCache
     inherits Lucy::Index::SortCache {
 
     InStream  *ord_in;
@@ -31,7 +31,7 @@ class Lucy::Index::SortCache::NumericSortCache cnick NumSortCache
     Destroy(NumericSortCache *self);
 }
 
-class Lucy::Index::SortCache::Float64SortCache cnick F64SortCache
+class Lucy::Index::SortCache::Float64SortCache nickname F64SortCache
     inherits Lucy::Index::SortCache::NumericSortCache {
 
     public inert incremented Float64SortCache*
@@ -48,7 +48,7 @@ class Lucy::Index::SortCache::Float64SortCache cnick F64SortCache
     Value(Float64SortCache *self, int32_t ord);
 }
 
-class Lucy::Index::SortCache::Float32SortCache cnick F32SortCache
+class Lucy::Index::SortCache::Float32SortCache nickname F32SortCache
     inherits Lucy::Index::SortCache::NumericSortCache {
 
     public inert incremented Float32SortCache*
@@ -65,7 +65,7 @@ class Lucy::Index::SortCache::Float32SortCache cnick F32SortCache
     Value(Float32SortCache *self, int32_t ord);
 }
 
-class Lucy::Index::SortCache::Int32SortCache cnick I32SortCache
+class Lucy::Index::SortCache::Int32SortCache nickname I32SortCache
     inherits Lucy::Index::SortCache::NumericSortCache {
 
     public inert incremented Int32SortCache*
@@ -82,7 +82,7 @@ class Lucy::Index::SortCache::Int32SortCache cnick I32SortCache
     Value(Int32SortCache *self, int32_t ord);
 }
 
-class Lucy::Index::SortCache::Int64SortCache cnick I64SortCache
+class Lucy::Index::SortCache::Int64SortCache nickname I64SortCache
     inherits Lucy::Index::SortCache::NumericSortCache {
 
     public inert incremented Int64SortCache*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/SortReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortReader.cfh b/core/Lucy/Index/SortReader.cfh
index db433c0..34e5f99 100644
--- a/core/Lucy/Index/SortReader.cfh
+++ b/core/Lucy/Index/SortReader.cfh
@@ -37,7 +37,7 @@ abstract class Lucy::Index::SortReader
 
 }
 
-class Lucy::Index::DefaultSortReader cnick DefSortReader
+class Lucy::Index::DefaultSortReader nickname DefSortReader
     inherits Lucy::Index::SortReader {
 
     Hash *caches;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/TermInfo.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/TermInfo.cfh b/core/Lucy/Index/TermInfo.cfh
index 89cb29b..85c64c5 100644
--- a/core/Lucy/Index/TermInfo.cfh
+++ b/core/Lucy/Index/TermInfo.cfh
@@ -26,7 +26,7 @@ parcel Lucy;
  * .lexx stream; it is a filepointer to a locations in the main .lex file.
  */
 
-class Lucy::Index::TermInfo cnick TInfo inherits Clownfish::Obj {
+class Lucy::Index::TermInfo nickname TInfo inherits Clownfish::Obj {
 
     int32_t doc_freq;
     int64_t post_filepos;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/TermVector.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/TermVector.cfh b/core/Lucy/Index/TermVector.cfh
index aed47df..3173d42 100644
--- a/core/Lucy/Index/TermVector.cfh
+++ b/core/Lucy/Index/TermVector.cfh
@@ -19,7 +19,7 @@ parcel Lucy;
 /** Term freq and positional data.
  */
 
-class Lucy::Index::TermVector cnick TV
+class Lucy::Index::TermVector nickname TV
     inherits Clownfish::Obj {
 
     String *field;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Index/ZombieKeyedHash.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/ZombieKeyedHash.cfh b/core/Lucy/Index/ZombieKeyedHash.cfh
index e31b2c6..a82dcbc 100644
--- a/core/Lucy/Index/ZombieKeyedHash.cfh
+++ b/core/Lucy/Index/ZombieKeyedHash.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** Hash which creates keys allocated from a MemoryPool rather than malloc.
  */
-class Lucy::Index::SortFieldWriter::ZombieKeyedHash cnick ZKHash
+class Lucy::Index::SortFieldWriter::ZombieKeyedHash nickname ZKHash
     inherits Clownfish::Hash {
 
     MemoryPool *mem_pool;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Object/BitVector.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Object/BitVector.cfh b/core/Lucy/Object/BitVector.cfh
index e0ade93..0079904 100644
--- a/core/Lucy/Object/BitVector.cfh
+++ b/core/Lucy/Object/BitVector.cfh
@@ -21,7 +21,7 @@ parcel Lucy;
  * BitVector is a growable array of bits.  All bits are initially zero.
  */
 
-public class Lucy::Object::BitVector cnick BitVec
+public class Lucy::Object::BitVector nickname BitVec
     inherits Clownfish::Obj {
 
     uint32_t  cap;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Object/I32Array.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Object/I32Array.cfh b/core/Lucy/Object/I32Array.cfh
index 78650d6..63be523 100644
--- a/core/Lucy/Object/I32Array.cfh
+++ b/core/Lucy/Object/I32Array.cfh
@@ -16,7 +16,7 @@
 
 parcel Lucy;
 
-class Lucy::Object::I32Array cnick I32Arr inherits Clownfish::Obj {
+class Lucy::Object::I32Array nickname I32Arr inherits Clownfish::Obj {
     int32_t  *ints;
     uint32_t  size;
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Plan/Architecture.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/Architecture.cfh b/core/Lucy/Plan/Architecture.cfh
index 7aafa7b..d35f5bf 100644
--- a/core/Lucy/Plan/Architecture.cfh
+++ b/core/Lucy/Plan/Architecture.cfh
@@ -25,7 +25,7 @@ parcel Lucy;
  * L<SegWriter|Lucy::Index::SegWriter> and
  * L<SegReader|Lucy::Index::SegReader>.
  */
-public class Lucy::Plan::Architecture cnick Arch inherits Clownfish::Obj {
+public class Lucy::Plan::Architecture nickname Arch inherits Clownfish::Obj {
 
     public inert incremented Architecture*
     new();

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Plan/FieldType.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/FieldType.cfh b/core/Lucy/Plan/FieldType.cfh
index 94859c5..e645b78 100644
--- a/core/Lucy/Plan/FieldType.cfh
+++ b/core/Lucy/Plan/FieldType.cfh
@@ -69,7 +69,7 @@ __END_C__
  * and scoring behavior for the field.  It is required if the field is
  * <code>indexed</code>.
  */
-public abstract class Lucy::Plan::FieldType cnick FType
+public abstract class Lucy::Plan::FieldType nickname FType
     inherits Clownfish::Obj {
 
     float         boost;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Plan/NumericType.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Plan/NumericType.cfh b/core/Lucy/Plan/NumericType.cfh
index 5565341..8c83b4a 100644
--- a/core/Lucy/Plan/NumericType.cfh
+++ b/core/Lucy/Plan/NumericType.cfh
@@ -16,7 +16,7 @@
 
 parcel Lucy;
 
-class Lucy::Plan::NumericType cnick NumType inherits Lucy::Plan::FieldType {
+class Lucy::Plan::NumericType nickname NumType inherits Lucy::Plan::FieldType {
 
     public inert NumericType*
     init(NumericType *self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Search/Collector.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Collector.cfh b/core/Lucy/Search/Collector.cfh
index abeafeb..97c83f0 100644
--- a/core/Lucy/Search/Collector.cfh
+++ b/core/Lucy/Search/Collector.cfh
@@ -28,7 +28,7 @@ parcel Lucy;
  * collector must take the updated information into account.
  */
 
-public abstract class Lucy::Search::Collector cnick Coll
+public abstract class Lucy::Search::Collector nickname Coll
     inherits Clownfish::Obj {
 
     SegReader *reader;
@@ -80,7 +80,7 @@ public abstract class Lucy::Search::Collector cnick Coll
  * L<BitVector|Lucy::Object::BitVector>.  It is useful for recording the
  * entire set of documents which matches a query.
  */
-public class Lucy::Search::Collector::BitCollector cnick BitColl
+public class Lucy::Search::Collector::BitCollector nickname BitColl
     inherits Lucy::Search::Collector {
 
     BitVector    *bit_vec;
@@ -105,7 +105,7 @@ public class Lucy::Search::Collector::BitCollector cnick BitColl
     Need_Score(BitCollector *self);
 }
 
-class Lucy::Search::Collector::OffsetCollector cnick OffsetColl
+class Lucy::Search::Collector::OffsetCollector nickname OffsetColl
     inherits Lucy::Search::Collector {
 
     int32_t    offset;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Search/Collector/SortCollector.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/Collector/SortCollector.cfh b/core/Lucy/Search/Collector/SortCollector.cfh
index dd89e9b..f4e8346 100644
--- a/core/Lucy/Search/Collector/SortCollector.cfh
+++ b/core/Lucy/Search/Collector/SortCollector.cfh
@@ -21,7 +21,7 @@ parcel Lucy;
  * A SortCollector sorts hits according to a SortSpec, keeping the highest
  * ranking N documents in a priority queue.
  */
-class Lucy::Search::Collector::SortCollector cnick SortColl
+class Lucy::Search::Collector::SortCollector nickname SortColl
     inherits Lucy::Search::Collector {
 
     uint32_t        wanted;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Search/HitQueue.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/HitQueue.cfh b/core/Lucy/Search/HitQueue.cfh
index fa8a049..d76e6b8 100644
--- a/core/Lucy/Search/HitQueue.cfh
+++ b/core/Lucy/Search/HitQueue.cfh
@@ -22,7 +22,7 @@ parcel Lucy;
  * float to the top of the queue and poor matches fall out the bottom.
  */
 
-class Lucy::Search::HitQueue cnick HitQ
+class Lucy::Search::HitQueue nickname HitQ
     inherits Lucy::Util::PriorityQueue {
 
     FieldType     **field_types;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Search/IndexSearcher.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/IndexSearcher.cfh b/core/Lucy/Search/IndexSearcher.cfh
index 18f5ab1..2f74b25 100644
--- a/core/Lucy/Search/IndexSearcher.cfh
+++ b/core/Lucy/Search/IndexSearcher.cfh
@@ -26,7 +26,7 @@ parcel Lucy;
  * L<Snapshot|Lucy::Index::Snapshot> of the index.  If an index is
  * modified, a new IndexSearcher must be opened to access the changes.
  */
-public class Lucy::Search::IndexSearcher cnick IxSearcher
+public class Lucy::Search::IndexSearcher nickname IxSearcher
     inherits Lucy::Search::Searcher {
 
     IndexReader       *reader;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Search/QueryParser.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/QueryParser.cfh b/core/Lucy/Search/QueryParser.cfh
index 50329fa..89618f0 100644
--- a/core/Lucy/Search/QueryParser.cfh
+++ b/core/Lucy/Search/QueryParser.cfh
@@ -40,7 +40,7 @@ parcel Lucy;
  *
  *
  */
-public class Lucy::Search::QueryParser cnick QParser
+public class Lucy::Search::QueryParser nickname QParser
     inherits Clownfish::Obj {
 
     Schema     *schema;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Search/RequiredOptionalMatcher.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/RequiredOptionalMatcher.cfh b/core/Lucy/Search/RequiredOptionalMatcher.cfh
index 84fb254..4a86d93 100644
--- a/core/Lucy/Search/RequiredOptionalMatcher.cfh
+++ b/core/Lucy/Search/RequiredOptionalMatcher.cfh
@@ -19,7 +19,7 @@ parcel Lucy;
 /** Intersect required and optional Matchers.
  */
 
-class Lucy::Search::RequiredOptionalMatcher cnick ReqOptMatcher
+class Lucy::Search::RequiredOptionalMatcher nickname ReqOptMatcher
     inherits Lucy::Search::PolyMatcher {
 
     Matcher      *req_matcher;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Search/RequiredOptionalQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Search/RequiredOptionalQuery.cfh b/core/Lucy/Search/RequiredOptionalQuery.cfh
index d136b68..9dc20f7 100644
--- a/core/Lucy/Search/RequiredOptionalQuery.cfh
+++ b/core/Lucy/Search/RequiredOptionalQuery.cfh
@@ -23,7 +23,7 @@ parcel Lucy;
  * its score is passed along; when both match, the scores are summed.
  */
 
-public class Lucy::Search::RequiredOptionalQuery cnick ReqOptQuery
+public class Lucy::Search::RequiredOptionalQuery nickname ReqOptQuery
     inherits Lucy::Search::PolyQuery {
 
     inert incremented RequiredOptionalQuery*
@@ -64,7 +64,7 @@ public class Lucy::Search::RequiredOptionalQuery cnick ReqOptQuery
     Equals(RequiredOptionalQuery *self, Obj *other);
 }
 
-class Lucy::Search::RequiredOptionalCompiler cnick ReqOptCompiler
+class Lucy::Search::RequiredOptionalCompiler nickname ReqOptCompiler
     inherits Lucy::Search::PolyCompiler {
 
     inert incremented RequiredOptionalCompiler*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/CompoundFileReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileReader.cfh b/core/Lucy/Store/CompoundFileReader.cfh
index e7cafc4..425dce0 100644
--- a/core/Lucy/Store/CompoundFileReader.cfh
+++ b/core/Lucy/Store/CompoundFileReader.cfh
@@ -30,7 +30,7 @@ parcel Lucy;
  * available filehandles.
  */
 
-class Lucy::Store::CompoundFileReader cnick CFReader
+class Lucy::Store::CompoundFileReader nickname CFReader
     inherits Lucy::Store::Folder {
 
     Folder       *real_folder;
@@ -88,7 +88,7 @@ class Lucy::Store::CompoundFileReader cnick CFReader
 
 /** DirHandle for CompoundFileReader.
  */
-class Lucy::Store::CFReaderDirHandle cnick CFReaderDH
+class Lucy::Store::CFReaderDirHandle nickname CFReaderDH
     inherits Lucy::Store::DirHandle {
 
     CompoundFileReader *cf_reader;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/CompoundFileWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileWriter.cfh b/core/Lucy/Store/CompoundFileWriter.cfh
index 9ead6de..fe77743 100644
--- a/core/Lucy/Store/CompoundFileWriter.cfh
+++ b/core/Lucy/Store/CompoundFileWriter.cfh
@@ -29,7 +29,7 @@ parcel Lucy;
  * Any given directory may only be consolidated once.
  */
 
-class Lucy::Store::CompoundFileWriter cnick CFWriter
+class Lucy::Store::CompoundFileWriter nickname CFWriter
     inherits Clownfish::Obj {
 
     Folder      *folder;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/DirHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/DirHandle.cfh b/core/Lucy/Store/DirHandle.cfh
index 436c450..e8924d8 100644
--- a/core/Lucy/Store/DirHandle.cfh
+++ b/core/Lucy/Store/DirHandle.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** Iterate over the files in a directory.
  */
-abstract class Lucy::Store::DirHandle cnick DH
+abstract class Lucy::Store::DirHandle nickname DH
     inherits Clownfish::Obj {
 
     String   *dir;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/FSDirHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSDirHandle.cfh b/core/Lucy/Store/FSDirHandle.cfh
index e0e2d61..7e35405 100644
--- a/core/Lucy/Store/FSDirHandle.cfh
+++ b/core/Lucy/Store/FSDirHandle.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** File system DirHandle.
  */
-class Lucy::Store::FSDirHandle cnick FSDH
+class Lucy::Store::FSDirHandle nickname FSDH
     inherits Lucy::Store::DirHandle {
 
     void    *sys_dirhandle;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/FSFileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FSFileHandle.cfh b/core/Lucy/Store/FSFileHandle.cfh
index cbe6a7d..25a3a65 100644
--- a/core/Lucy/Store/FSFileHandle.cfh
+++ b/core/Lucy/Store/FSFileHandle.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** File system FileHandle.
  */
-class Lucy::Store::FSFileHandle cnick FSFH
+class Lucy::Store::FSFileHandle nickname FSFH
     inherits Lucy::Store::FileHandle {
 
     int      fd;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/FileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/FileHandle.cfh b/core/Lucy/Store/FileHandle.cfh
index 01b3691..72d1c2c 100644
--- a/core/Lucy/Store/FileHandle.cfh
+++ b/core/Lucy/Store/FileHandle.cfh
@@ -32,7 +32,7 @@ parcel Lucy;
  *       already exists.
  */
 
-abstract class Lucy::Store::FileHandle cnick FH
+abstract class Lucy::Store::FileHandle nickname FH
     inherits Clownfish::Obj {
 
     String *path;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/Lock.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/Lock.cfh b/core/Lucy/Store/Lock.cfh
index 08dc94b..33f2bde 100644
--- a/core/Lucy/Store/Lock.cfh
+++ b/core/Lucy/Store/Lock.cfh
@@ -110,7 +110,7 @@ public abstract class Lucy::Store::Lock inherits Clownfish::Obj {
     Destroy(Lock *self);
 }
 
-class Lucy::Store::LockFileLock cnick LFLock
+class Lucy::Store::LockFileLock nickname LFLock
     inherits Lucy::Store::Lock {
 
     String *link_path;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/LockFactory.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/LockFactory.cfh b/core/Lucy/Store/LockFactory.cfh
index d9ab93d..5cf8232 100644
--- a/core/Lucy/Store/LockFactory.cfh
+++ b/core/Lucy/Store/LockFactory.cfh
@@ -24,7 +24,7 @@ parcel Lucy;
  * alternatives such as flock() are possible.
  */
 
-public class Lucy::Store::LockFactory cnick LockFact
+public class Lucy::Store::LockFactory nickname LockFact
     inherits Clownfish::Obj {
 
     Folder  *folder;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/RAMDirHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/RAMDirHandle.cfh b/core/Lucy/Store/RAMDirHandle.cfh
index 2d097eb..2d9e545 100644
--- a/core/Lucy/Store/RAMDirHandle.cfh
+++ b/core/Lucy/Store/RAMDirHandle.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** DirHandle for RAMFolder.
  */
-class Lucy::Store::RAMDirHandle cnick RAMDH
+class Lucy::Store::RAMDirHandle nickname RAMDH
     inherits Lucy::Store::DirHandle {
 
     RAMFolder *folder;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/RAMFileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/RAMFileHandle.cfh b/core/Lucy/Store/RAMFileHandle.cfh
index c7660e1..51469f6 100644
--- a/core/Lucy/Store/RAMFileHandle.cfh
+++ b/core/Lucy/Store/RAMFileHandle.cfh
@@ -21,7 +21,7 @@ parcel Lucy;
  * RAM-based implementation of FileHandle, to be used in conjunction with
  * RAMFolder.
  */
-class Lucy::Store::RAMFileHandle cnick RAMFH
+class Lucy::Store::RAMFileHandle nickname RAMFH
     inherits Lucy::Store::FileHandle {
 
     RAMFile *ram_file;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Store/SharedLock.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/SharedLock.cfh b/core/Lucy/Store/SharedLock.cfh
index a9b741c..df08809 100644
--- a/core/Lucy/Store/SharedLock.cfh
+++ b/core/Lucy/Store/SharedLock.cfh
@@ -38,7 +38,7 @@ parcel Lucy;
  * SharedLock is considered fully released when no lock files with a given
  * lock name are left.
  */
-class Lucy::Store::SharedLock cnick ShLock
+class Lucy::Store::SharedLock nickname ShLock
     inherits Lucy::Store::LockFileLock {
 
     inert incremented SharedLock*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh b/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh
index 6260b13..7c37248 100644
--- a/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh
+++ b/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Analysis::TestSnowballStemmer cnick TestSnowStemmer
+class Lucy::Test::Analysis::TestSnowballStemmer nickname TestSnowStemmer
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestSnowballStemmer*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Analysis/TestSnowballStopFilter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Analysis/TestSnowballStopFilter.cfh b/core/Lucy/Test/Analysis/TestSnowballStopFilter.cfh
index 63494f2..c916694 100644
--- a/core/Lucy/Test/Analysis/TestSnowballStopFilter.cfh
+++ b/core/Lucy/Test/Analysis/TestSnowballStopFilter.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Analysis::TestSnowballStopFilter cnick TestSnowStop
+class Lucy::Test::Analysis::TestSnowballStopFilter nickname TestSnowStop
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestSnowballStopFilter*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Index/TestHighlightWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Index/TestHighlightWriter.cfh b/core/Lucy/Test/Index/TestHighlightWriter.cfh
index cb8ce9f..aad78d7 100644
--- a/core/Lucy/Test/Index/TestHighlightWriter.cfh
+++ b/core/Lucy/Test/Index/TestHighlightWriter.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Index::TestHighlightWriter cnick TestHLWriter
+class Lucy::Test::Index::TestHighlightWriter nickname TestHLWriter
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestHighlightWriter*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Index/TestIndexManager.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Index/TestIndexManager.cfh b/core/Lucy/Test/Index/TestIndexManager.cfh
index 5b2c2e1..fc0557e 100644
--- a/core/Lucy/Test/Index/TestIndexManager.cfh
+++ b/core/Lucy/Test/Index/TestIndexManager.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Index::TestIndexManager cnick TestIxManager
+class Lucy::Test::Index::TestIndexManager nickname TestIxManager
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestIndexManager*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Index/TestPostingListWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Index/TestPostingListWriter.cfh b/core/Lucy/Test/Index/TestPostingListWriter.cfh
index 14ef955..b9c106c 100644
--- a/core/Lucy/Test/Index/TestPostingListWriter.cfh
+++ b/core/Lucy/Test/Index/TestPostingListWriter.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Index::TestPostingListWriter cnick TestPListWriter
+class Lucy::Test::Index::TestPostingListWriter nickname TestPListWriter
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestPostingListWriter*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Index/TestSegment.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Index/TestSegment.cfh b/core/Lucy/Test/Index/TestSegment.cfh
index 609a961..c3101d6 100644
--- a/core/Lucy/Test/Index/TestSegment.cfh
+++ b/core/Lucy/Test/Index/TestSegment.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Index::TestSegment cnick TestSeg
+class Lucy::Test::Index::TestSegment nickname TestSeg
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestSegment*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Object/TestI32Array.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Object/TestI32Array.cfh b/core/Lucy/Test/Object/TestI32Array.cfh
index c6411aa..dceba6b 100644
--- a/core/Lucy/Test/Object/TestI32Array.cfh
+++ b/core/Lucy/Test/Object/TestI32Array.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Object::TestI32Array cnick TestI32Arr
+class Lucy::Test::Object::TestI32Array nickname TestI32Arr
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestI32Array*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Plan/TestArchitecture.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Plan/TestArchitecture.cfh b/core/Lucy/Test/Plan/TestArchitecture.cfh
index 9d227e1..d86b1b8 100644
--- a/core/Lucy/Test/Plan/TestArchitecture.cfh
+++ b/core/Lucy/Test/Plan/TestArchitecture.cfh
@@ -20,7 +20,7 @@ parcel TestLucy;
  * Returns absurdly low values for Index_Interval() and Skip_Interval().
  */
 
-class Lucy::Test::Plan::TestArchitecture cnick TestArch
+class Lucy::Test::Plan::TestArchitecture nickname TestArch
     inherits Lucy::Plan::Architecture {
 
     inert incremented TestArchitecture*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Plan/TestFieldType.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Plan/TestFieldType.cfh b/core/Lucy/Test/Plan/TestFieldType.cfh
index 473e5a0..a82c640 100644
--- a/core/Lucy/Test/Plan/TestFieldType.cfh
+++ b/core/Lucy/Test/Plan/TestFieldType.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Plan::TestFieldType cnick TestFType
+class Lucy::Test::Plan::TestFieldType nickname TestFType
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestFieldType*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Search/TestQueryParser.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestQueryParser.cfh b/core/Lucy/Test/Search/TestQueryParser.cfh
index c5296e5..76ed047 100644
--- a/core/Lucy/Test/Search/TestQueryParser.cfh
+++ b/core/Lucy/Test/Search/TestQueryParser.cfh
@@ -19,7 +19,7 @@ parcel TestLucy;
 /** Test case object for QueryParser unit tests.
  */
 
-class Lucy::Test::Search::TestQueryParser cnick TestQP
+class Lucy::Test::Search::TestQueryParser nickname TestQP
     inherits Clownfish::Obj {
 
     String  *query_string;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Search/TestQueryParserLogic.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestQueryParserLogic.cfh b/core/Lucy/Test/Search/TestQueryParserLogic.cfh
index 45052b6..a0b1a75 100644
--- a/core/Lucy/Test/Search/TestQueryParserLogic.cfh
+++ b/core/Lucy/Test/Search/TestQueryParserLogic.cfh
@@ -19,7 +19,7 @@ parcel TestLucy;
 /** Tests for logical structure of Query objects output by QueryParser.
  */
 
-class Lucy::Test::Search::TestQueryParserLogic cnick TestQPLogic
+class Lucy::Test::Search::TestQueryParserLogic nickname TestQPLogic
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestQueryParserLogic*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Search/TestQueryParserSyntax.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestQueryParserSyntax.cfh b/core/Lucy/Test/Search/TestQueryParserSyntax.cfh
index 893dc06..dee071c 100644
--- a/core/Lucy/Test/Search/TestQueryParserSyntax.cfh
+++ b/core/Lucy/Test/Search/TestQueryParserSyntax.cfh
@@ -19,7 +19,7 @@ parcel TestLucy;
 /** Tests for logical structure of Query objects output by QueryParser.
  */
 
-class Lucy::Test::Search::TestQueryParserSyntax cnick TestQPSyntax
+class Lucy::Test::Search::TestQueryParserSyntax nickname TestQPSyntax
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestQueryParserSyntax*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Store/TestCompoundFileReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileReader.cfh b/core/Lucy/Test/Store/TestCompoundFileReader.cfh
index 24f976b..69af74d 100644
--- a/core/Lucy/Test/Store/TestCompoundFileReader.cfh
+++ b/core/Lucy/Test/Store/TestCompoundFileReader.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Store::TestCompoundFileReader cnick TestCFReader
+class Lucy::Test::Store::TestCompoundFileReader nickname TestCFReader
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestCompoundFileReader*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Store/TestCompoundFileWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileWriter.cfh b/core/Lucy/Test/Store/TestCompoundFileWriter.cfh
index 7f01e8f..051ad65 100644
--- a/core/Lucy/Test/Store/TestCompoundFileWriter.cfh
+++ b/core/Lucy/Test/Store/TestCompoundFileWriter.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Store::TestCompoundFileWriter cnick TestCFWriter
+class Lucy::Test::Store::TestCompoundFileWriter nickname TestCFWriter
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestCompoundFileWriter*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Store/TestFSDirHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSDirHandle.cfh b/core/Lucy/Test/Store/TestFSDirHandle.cfh
index 69247b3..9b10d79 100644
--- a/core/Lucy/Test/Store/TestFSDirHandle.cfh
+++ b/core/Lucy/Test/Store/TestFSDirHandle.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Store::TestFSDirHandle cnick TestFSDH
+class Lucy::Test::Store::TestFSDirHandle nickname TestFSDH
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestFSDirHandle*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Store/TestFSFileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFileHandle.cfh b/core/Lucy/Test/Store/TestFSFileHandle.cfh
index a9676a2..b9825b8 100644
--- a/core/Lucy/Test/Store/TestFSFileHandle.cfh
+++ b/core/Lucy/Test/Store/TestFSFileHandle.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Store::TestFSFileHandle cnick TestFSFH
+class Lucy::Test::Store::TestFSFileHandle nickname TestFSFH
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestFSFileHandle*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Store/TestFileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFileHandle.cfh b/core/Lucy/Test/Store/TestFileHandle.cfh
index e7bd28b..1c97c5f 100644
--- a/core/Lucy/Test/Store/TestFileHandle.cfh
+++ b/core/Lucy/Test/Store/TestFileHandle.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Store::TestFileHandle cnick TestFH
+class Lucy::Test::Store::TestFileHandle nickname TestFH
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestFileHandle*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Store/TestRAMDirHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMDirHandle.cfh b/core/Lucy/Test/Store/TestRAMDirHandle.cfh
index 31e242a..4adfb31 100644
--- a/core/Lucy/Test/Store/TestRAMDirHandle.cfh
+++ b/core/Lucy/Test/Store/TestRAMDirHandle.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Store::TestRAMDirHandle cnick TestRAMDH
+class Lucy::Test::Store::TestRAMDirHandle nickname TestRAMDH
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestRAMDirHandle*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Store/TestRAMFileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFileHandle.cfh b/core/Lucy/Test/Store/TestRAMFileHandle.cfh
index a795d23..d5418cf 100644
--- a/core/Lucy/Test/Store/TestRAMFileHandle.cfh
+++ b/core/Lucy/Test/Store/TestRAMFileHandle.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Store::TestRAMFileHandle cnick TestRAMFH
+class Lucy::Test::Store::TestRAMFileHandle nickname TestRAMFH
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestRAMFileHandle*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Util/TestIndexFileNames.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestIndexFileNames.cfh b/core/Lucy/Test/Util/TestIndexFileNames.cfh
index e098c72..c5ec962 100644
--- a/core/Lucy/Test/Util/TestIndexFileNames.cfh
+++ b/core/Lucy/Test/Util/TestIndexFileNames.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Util::TestIndexFileNames cnick TestIxFileNames
+class Lucy::Test::Util::TestIndexFileNames nickname TestIxFileNames
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestIndexFileNames*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Util/TestMemoryPool.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestMemoryPool.cfh b/core/Lucy/Test/Util/TestMemoryPool.cfh
index f7ba344..f3d2433 100644
--- a/core/Lucy/Test/Util/TestMemoryPool.cfh
+++ b/core/Lucy/Test/Util/TestMemoryPool.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Util::TestMemoryPool cnick TestMemPool
+class Lucy::Test::Util::TestMemoryPool nickname TestMemPool
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestMemoryPool*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Test/Util/TestPriorityQueue.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestPriorityQueue.cfh b/core/Lucy/Test/Util/TestPriorityQueue.cfh
index 296c2f7..4f434f1 100644
--- a/core/Lucy/Test/Util/TestPriorityQueue.cfh
+++ b/core/Lucy/Test/Util/TestPriorityQueue.cfh
@@ -16,7 +16,7 @@
 
 parcel TestLucy;
 
-class Lucy::Test::Util::NumPriorityQueue cnick NumPriQ
+class Lucy::Test::Util::NumPriorityQueue nickname NumPriQ
     inherits Lucy::Util::PriorityQueue {
 
     inert incremented NumPriorityQueue*
@@ -26,7 +26,7 @@ class Lucy::Test::Util::NumPriorityQueue cnick NumPriQ
     Less_Than(NumPriorityQueue *self, Obj *a, Obj *b);
 }
 
-class Lucy::Test::Util::TestPriorityQueue cnick TestPriQ
+class Lucy::Test::Util::TestPriorityQueue nickname TestPriQ
     inherits Clownfish::TestHarness::TestBatch {
 
     inert incremented TestPriorityQueue*

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Util/IndexFileNames.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/IndexFileNames.cfh b/core/Lucy/Util/IndexFileNames.cfh
index 3e7ee7f..d74f37b 100644
--- a/core/Lucy/Util/IndexFileNames.cfh
+++ b/core/Lucy/Util/IndexFileNames.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** Utilities for parsing, interpreting and generating index file names.
  */
-inert class Lucy::Util::IndexFileNames cnick IxFileNames {
+inert class Lucy::Util::IndexFileNames nickname IxFileNames {
 
     /** Skip past the first instance of an underscore in the String, then
      * attempt to decode a base 36 number.  For example, "snapshot_5.json"

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Util/MemoryPool.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/MemoryPool.cfh b/core/Lucy/Util/MemoryPool.cfh
index 02af3f2..8301464 100644
--- a/core/Lucy/Util/MemoryPool.cfh
+++ b/core/Lucy/Util/MemoryPool.cfh
@@ -26,7 +26,7 @@ parcel Lucy;
  * class to specific applications.
  */
 
-class Lucy::Util::MemoryPool cnick MemPool
+class Lucy::Util::MemoryPool nickname MemPool
     inherits Clownfish::Obj {
 
     uint32_t     arena_size;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Util/PriorityQueue.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/PriorityQueue.cfh b/core/Lucy/Util/PriorityQueue.cfh
index 86acd8d..2480bb5 100644
--- a/core/Lucy/Util/PriorityQueue.cfh
+++ b/core/Lucy/Util/PriorityQueue.cfh
@@ -24,7 +24,7 @@ parcel Lucy;
  * Subclasses must define the abstract method Less_Than.
  */
 
-class Lucy::Util::PriorityQueue cnick PriQ
+class Lucy::Util::PriorityQueue nickname PriQ
     inherits Clownfish::Obj {
     uint32_t   size;
     uint32_t   max_size;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Util/ProcessID.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/ProcessID.cfh b/core/Lucy/Util/ProcessID.cfh
index 7dbc9b1..9b917de 100644
--- a/core/Lucy/Util/ProcessID.cfh
+++ b/core/Lucy/Util/ProcessID.cfh
@@ -18,7 +18,7 @@ parcel Lucy;
 
 /** Provide platform-compatible process ID functions.
  */
-inert class Lucy::Util::ProcessID cnick PID {
+inert class Lucy::Util::ProcessID nickname PID {
 
     /** Return the ID for the current process.
      */

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index cb5779e..c414140 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -46,7 +46,7 @@ __END_C__
  * SortExternal object then interleaves multiple sorted streams to produce a
  * single unified stream of sorted values.
  */
-abstract class Lucy::Util::SortExternal cnick SortEx
+abstract class Lucy::Util::SortExternal nickname SortEx
     inherits Clownfish::Obj {
 
     uint8_t       *cache;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c3a9a7cc/devel/conf/clownfish.vim
----------------------------------------------------------------------
diff --git a/devel/conf/clownfish.vim b/devel/conf/clownfish.vim
index 9cff03b..bfe37f3 100644
--- a/devel/conf/clownfish.vim
+++ b/devel/conf/clownfish.vim
@@ -32,7 +32,7 @@ syn keyword cfishType void
 syn keyword cfishType class
 syn keyword cfishType parcel
 
-syn keyword cfishAttribute inherits cnick
+syn keyword cfishAttribute inherits nickname
 
 syn keyword cfishModifier public private
 syn keyword cfishModifier abstract inert const final


[lucy-commits] [23/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/common/charmonizer.c b/clownfish/compiler/common/charmonizer.c
deleted file mode 100644
index f1466ba..0000000
--- a/clownfish/compiler/common/charmonizer.c
+++ /dev/null
@@ -1,7284 +0,0 @@
-/* This is an auto-generated file -- do not edit directly. */
-
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/Defines.h"
-/* Charmonizer/Core/Defines.h -- Universal definitions.
- */
-#ifndef H_CHAZ_DEFINES
-#define H_CHAZ_DEFINES 1
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-#define CHAZ_QUOTE(x) #x "\n"
-
-#endif /* H_CHAZ_DEFINES */
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/SharedLibrary.h"
-/* Charmonizer/Core/SharedLibrary.h
- */
-
-#ifndef H_CHAZ_SHARED_LIB
-#define H_CHAZ_SHARED_LIB
-
-typedef struct chaz_SharedLib chaz_SharedLib;
-
-chaz_SharedLib*
-chaz_SharedLib_new(const char *name, const char *version,
-                   const char *major_version);
-
-void
-chaz_SharedLib_destroy(chaz_SharedLib *flags);
-
-const char*
-chaz_SharedLib_get_name(chaz_SharedLib *lib);
-
-const char*
-chaz_SharedLib_get_version(chaz_SharedLib *lib);
-
-const char*
-chaz_SharedLib_get_major_version(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_filename(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_major_version_filename(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_no_version_filename(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_implib_filename(chaz_SharedLib *lib);
-
-char*
-chaz_SharedLib_export_filename(chaz_SharedLib *lib);
-
-#endif /* H_CHAZ_SHARED_LIB */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/CFlags.h"
-/* Charmonizer/Core/CFlags.h
- */
-
-#ifndef H_CHAZ_CFLAGS
-#define H_CHAZ_CFLAGS
-
-#define CHAZ_CFLAGS_STYLE_POSIX  1
-#define CHAZ_CFLAGS_STYLE_GNU    2
-#define CHAZ_CFLAGS_STYLE_MSVC   3
-
-typedef struct chaz_CFlags chaz_CFlags;
-
-chaz_CFlags*
-chaz_CFlags_new(int style);
-
-void
-chaz_CFlags_destroy(chaz_CFlags *flags);
-
-const char*
-chaz_CFlags_get_string(chaz_CFlags *flags);
-
-void
-chaz_CFlags_append(chaz_CFlags *flags, const char *string);
-
-void
-chaz_CFlags_clear(chaz_CFlags *flags);
-
-void
-chaz_CFlags_set_output_obj(chaz_CFlags *flags, const char *filename);
-
-void
-chaz_CFlags_set_output_exe(chaz_CFlags *flags, const char *filename);
-
-void
-chaz_CFlags_add_define(chaz_CFlags *flags, const char *name,
-                       const char *value);
-
-void
-chaz_CFlags_add_include_dir(chaz_CFlags *flags, const char *dir);
-
-void
-chaz_CFlags_enable_optimization(chaz_CFlags *flags);
-
-void
-chaz_CFlags_disable_strict_aliasing(chaz_CFlags *flags);
-
-void
-chaz_CFlags_set_warnings_as_errors(chaz_CFlags *flags);
-
-void
-chaz_CFlags_compile_shared_library(chaz_CFlags *flags);
-
-void
-chaz_CFlags_hide_symbols(chaz_CFlags *flags);
-
-void
-chaz_CFlags_link_shared_library(chaz_CFlags *flags);
-
-void
-chaz_CFlags_set_shared_library_version(chaz_CFlags *flags,
-                                       chaz_SharedLib *lib);
-
-void
-chaz_CFlags_set_link_output(chaz_CFlags *flags, const char *filename);
-
-void
-chaz_CFlags_add_library_path(chaz_CFlags *flags, const char *directory);
-
-void
-chaz_CFlags_add_library(chaz_CFlags *flags, chaz_SharedLib *lib);
-
-void
-chaz_CFlags_add_external_library(chaz_CFlags *flags, const char *library);
-
-void
-chaz_CFlags_enable_code_coverage(chaz_CFlags *flags);
-
-#endif /* H_CHAZ_CFLAGS */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/Compiler.h"
-/* Charmonizer/Core/Compiler.h
- */
-
-#ifndef H_CHAZ_COMPILER
-#define H_CHAZ_COMPILER
-
-#include <stddef.h>
-/* #include "Charmonizer/Core/Defines.h" */
-/* #include "Charmonizer/Core/CFlags.h" */
-
-/* Attempt to compile and link an executable.  Return true if the executable
- * file exists after the attempt.
- */
-int
-chaz_CC_compile_exe(const char *source_path, const char *exe_path,
-                    const char *code);
-
-/* Attempt to compile an object file.  Return true if the object file
- * exists after the attempt.
- */
-int
-chaz_CC_compile_obj(const char *source_path, const char *obj_path,
-                    const char *code);
-
-/* Attempt to compile the supplied source code and return true if the
- * effort succeeds.
- */
-int
-chaz_CC_test_compile(const char *source);
-
-/* Attempt to compile the supplied source code.  If successful, capture the
- * output of the program and return a pointer to a newly allocated buffer.
- * If the compilation fails, return NULL.  The length of the captured
- * output will be placed into the integer pointed to by [output_len].
- */
-char*
-chaz_CC_capture_output(const char *source, size_t *output_len);
-
-/** Initialize the compiler environment.
- */
-void
-chaz_CC_init(const char *cc_command, const char *cflags);
-
-/* Clean up the environment.
- */
-void
-chaz_CC_clean_up(void);
-
-/* Accessor for the compiler executable's string representation.
- */
-const char*
-chaz_CC_get_cc(void);
-
-/* Accessor for `cflags`.
- */
-const char*
-chaz_CC_get_cflags(void);
-
-/* Accessor for `extra_cflags`.
- */
-chaz_CFlags*
-chaz_CC_get_extra_cflags(void);
-
-/* Accessor for `temp_cflags`.
- */
-chaz_CFlags*
-chaz_CC_get_temp_cflags(void);
-
-/* Return a new CFlags object.
- */
-chaz_CFlags*
-chaz_CC_new_cflags(void);
-
-/* Return the extension for a compiled object.
- */
-const char*
-chaz_CC_obj_ext(void);
-
-int
-chaz_CC_gcc_version_num(void);
-
-const char*
-chaz_CC_gcc_version(void);
-
-int
-chaz_CC_msvc_version_num(void);
-
-const char*
-chaz_CC_link_command(void);
-
-#endif /* H_CHAZ_COMPILER */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriter.h"
-/* Charmonizer/Core/ConfWriter.h -- Write to a config file.
- */
-
-#ifndef H_CHAZ_CONFWRITER
-#define H_CHAZ_CONFWRITER 1
-
-#include <stddef.h>
-#include <stdarg.h>
-/* #include "Charmonizer/Core/Defines.h" */
-
-struct chaz_ConfWriter;
-
-/* Initialize elements needed by ConfWriter.  Must be called before anything
- * else, but after os and compiler are initialized.
- */
-void
-chaz_ConfWriter_init(void);
-
-/* Close the include guard on charmony.h, then close the file.  Delete temp
- * files and perform any other needed cleanup.
- */
-void
-chaz_ConfWriter_clean_up(void);
-
-/* Print output to charmony.h.
- */
-void
-chaz_ConfWriter_append_conf(const char *fmt, ...);
-
-/* Add a pound-define.
- */
-void
-chaz_ConfWriter_add_def(const char *sym, const char *value);
-
-/* Add a globally scoped pound-define.
- */
-void
-chaz_ConfWriter_add_global_def(const char *sym, const char *value);
-
-/* Add a typedef.
- */
-void
-chaz_ConfWriter_add_typedef(const char *type, const char *alias);
-
-/* Add a globally scoped typedef.
- */
-void
-chaz_ConfWriter_add_global_typedef(const char *type, const char *alias);
-
-/* Pound-include a system header (within angle brackets).
- */
-void
-chaz_ConfWriter_add_sys_include(const char *header);
-
-/* Pound-include a locally created header (within quotes).
- */
-void
-chaz_ConfWriter_add_local_include(const char *header);
-
-/* Print a "chapter heading" comment in the conf file when starting a module.
- */
-void
-chaz_ConfWriter_start_module(const char *module_name);
-
-/* Leave a little whitespace at the end of each module.
- */
-void
-chaz_ConfWriter_end_module(void);
-
-void
-chaz_ConfWriter_add_writer(struct chaz_ConfWriter *writer);
-
-typedef void
-(*chaz_ConfWriter_clean_up_t)(void);
-typedef void
-(*chaz_ConfWriter_vappend_conf_t)(const char *fmt, va_list args); 
-typedef void
-(*chaz_ConfWriter_add_def_t)(const char *sym, const char *value);
-typedef void
-(*chaz_ConfWriter_add_global_def_t)(const char *sym, const char *value);
-typedef void
-(*chaz_ConfWriter_add_typedef_t)(const char *type, const char *alias);
-typedef void
-(*chaz_ConfWriter_add_global_typedef_t)(const char *type, const char *alias);
-typedef void
-(*chaz_ConfWriter_add_sys_include_t)(const char *header);
-typedef void
-(*chaz_ConfWriter_add_local_include_t)(const char *header);
-typedef void
-(*chaz_ConfWriter_start_module_t)(const char *module_name);
-typedef void
-(*chaz_ConfWriter_end_module_t)(void);
-typedef struct chaz_ConfWriter {
-    chaz_ConfWriter_clean_up_t           clean_up;
-    chaz_ConfWriter_vappend_conf_t       vappend_conf;
-    chaz_ConfWriter_add_def_t            add_def;
-    chaz_ConfWriter_add_global_def_t     add_global_def;
-    chaz_ConfWriter_add_typedef_t        add_typedef;
-    chaz_ConfWriter_add_global_typedef_t add_global_typedef;
-    chaz_ConfWriter_add_sys_include_t    add_sys_include;
-    chaz_ConfWriter_add_local_include_t  add_local_include;
-    chaz_ConfWriter_start_module_t       start_module;
-    chaz_ConfWriter_end_module_t         end_module;
-} chaz_ConfWriter;
-
-#endif /* H_CHAZ_CONFWRITER */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriterC.h"
-/* Charmonizer/Core/ConfWriterC.h -- Write to a C header file.
- */
-
-#ifndef H_CHAZ_CONFWRITERC
-#define H_CHAZ_CONFWRITERC 1
-
-/* Enable writing config to a C header file.
- */
-void
-chaz_ConfWriterC_enable(void);
-
-#endif /* H_CHAZ_CONFWRITERC */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriterPerl.h"
-/* Charmonizer/Core/ConfWriterPerl.h -- Write to a Perl module file.
- */
-
-#ifndef H_CHAZ_CONFWRITERPERL
-#define H_CHAZ_CONFWRITERPERL 1
-
-/* Enable writing config to a Perl module file.
- */
-void
-chaz_ConfWriterPerl_enable(void);
-
-#endif /* H_CHAZ_CONFWRITERPERL */
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriterPython.h"
-/* Charmonizer/Core/ConfWriterPython.h -- Write to a Python module file.
- */
-
-#ifndef H_CHAZ_CONFWRITERPYTHON
-#define H_CHAZ_CONFWRITERPYTHON 1
-
-/* Enable writing config to a Python module file.
- */
-void
-chaz_ConfWriterPython_enable(void);
-
-#endif /* H_CHAZ_CONFWRITERPYTHON */
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/ConfWriterRuby.h"
-/* Charmonizer/Core/ConfWriterRuby.h -- Write to a Ruby module file.
- */
-
-#ifndef H_CHAZ_CONFWRITERRUBY
-#define H_CHAZ_CONFWRITERRUBY 1
-
-/* Enable writing config to a Ruby module file.
- */
-void
-chaz_ConfWriterRuby_enable(void);
-
-#endif /* H_CHAZ_CONFWRITERRUBY */
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/HeaderChecker.h"
-/* Charmonizer/Probe/HeaderChecker.h
- */
-
-#ifndef H_CHAZ_HEAD_CHECK
-#define H_CHAZ_HEAD_CHECK
-
-/* #include "Charmonizer/Core/Defines.h" */
-
-/* Bootstrap the HeadCheck.  Call this before anything else.
- */
-void
-chaz_HeadCheck_init(void);
-
-/* Check for a particular header and return true if it's available.  The
- * test-compile is only run the first time a given request is made.
- */
-int
-chaz_HeadCheck_check_header(const char *header_name);
-
-/* Attempt to compile a file which pulls in all the headers specified by name
- * in a null-terminated array.  If the compile succeeds, add them all to the
- * internal register and return true.
- */
-int
-chaz_HeadCheck_check_many_headers(const char **header_names);
-
-/* Return true if the member is present in the struct. */
-int
-chaz_HeadCheck_contains_member(const char *struct_name, const char *member,
-                               const char *includes);
-
-#endif /* H_CHAZ_HEAD_CHECK */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/Make.h"
-/* Charmonizer/Core/Make.h
- */
-
-#ifndef H_CHAZ_MAKE
-#define H_CHAZ_MAKE
-
-/* #include "Charmonizer/Core/CFlags.h" */
-/* #include "Charmonizer/Core/SharedLib.h" */
-
-typedef struct chaz_MakeFile chaz_MakeFile;
-typedef struct chaz_MakeVar chaz_MakeVar;
-typedef struct chaz_MakeRule chaz_MakeRule;
-
-typedef void (*chaz_Make_list_files_callback_t)(const char *dir, char *file,
-                                                void *context);
-
-/** Initialize the environment.
- */
-void
-chaz_Make_init(void);
-
-/** Clean up the environment.
- */
-void
-chaz_Make_clean_up(void);
-
-/** Return the name of the detected 'make' executable.
- */
-const char*
-chaz_Make_get_make(void);
-
-/** Return the type of shell used by the detected 'make' executable.
- */
-int
-chaz_Make_shell_type(void);
-
-/** Recursively list files in a directory. For every file a callback is called
- * with the filename and a context variable.
- *
- * @param dir Directory to search in.
- * @param ext File extension to search for.
- * @param callback Callback to call for every matching file.
- * @param context Context variable to pass to callback.
- */
-void
-chaz_Make_list_files(const char *dir, const char *ext,
-                     chaz_Make_list_files_callback_t callback, void *context);
-
-/** MakeFile constructor.
- */
-chaz_MakeFile*
-chaz_MakeFile_new();
-
-/** MakeFile destructor.
- */
-void
-chaz_MakeFile_destroy(chaz_MakeFile *makefile);
-
-/** Add a variable to a makefile.
- *
- * @param makefile The makefile.
- * @param name Name of the variable.
- * @param value Value of the variable. Can be NULL if you want add content
- * later.
- * @return a MakeVar.
- */
-chaz_MakeVar*
-chaz_MakeFile_add_var(chaz_MakeFile *makefile, const char *name,
-                      const char *value);
-
-/** Add a rule to a makefile.
- *
- * @param makefile The makefile.
- * @param target The first target of the rule. Can be NULL if you want to add
- * targets later.
- * @param prereq The first prerequisite of the rule. Can be NULL if you want to
- * add prerequisites later.
- * @return a MakeRule.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_rule(chaz_MakeFile *makefile, const char *target,
-                       const char *prereq);
-
-/** Return the rule for the 'clean' target.
- *
- * @param makefile The makefile.
- */
-chaz_MakeRule*
-chaz_MakeFile_clean_rule(chaz_MakeFile *makefile);
-
-/** Return the rule for the 'distclean' target.
- *
- * @param makefile The makefile.
- */
-chaz_MakeRule*
-chaz_MakeFile_distclean_rule(chaz_MakeFile *makefile);
-
-/** Add a rule to link an executable. The executable will also be added to the
- * list of files to clean.
- *
- * @param makefile The makefile.
- * @param exe The name of the executable.
- * @param sources The list of source files.
- * @param link_flags Additional link flags.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_exe(chaz_MakeFile *makefile, const char *exe,
-                      const char *sources, chaz_CFlags *link_flags);
-
-/** Add a rule to compile and link an executable. The executable will also be
- * added to the list of files to clean.
- *
- * @param makefile The makefile.
- * @param exe The name of the executable.
- * @param sources The list of source files.
- * @param cflags Additional compiler flags.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_compiled_exe(chaz_MakeFile *makefile, const char *exe,
-                               const char *sources, chaz_CFlags *cflags);
-
-/** Add a rule to link a shared library. The shared library will also be added
- * to the list of files to clean.
- *
- * @param makefile The makefile.
- * @param lib The shared library.
- * @param sources The list of source files.
- * @param link_flags Additional link flags.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, chaz_SharedLib *lib,
-                             const char *sources, chaz_CFlags *link_flags);
-
-/** Add a rule to build the lemon parser generator.
- *
- * @param makefile The makefile.
- * @param dir The lemon directory.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_lemon_exe(chaz_MakeFile *makefile, const char *dir);
-
-/** Add a rule for a lemon grammar.
- *
- * @param makefile The makefile.
- * @param base_name The filename of the grammar without extension.
- */
-chaz_MakeRule*
-chaz_MakeFile_add_lemon_grammar(chaz_MakeFile *makefile,
-                                const char *base_name);
-
-/** Write the makefile to a file named 'Makefile' in the current directory.
- *
- * @param makefile The makefile.
- */
-void
-chaz_MakeFile_write(chaz_MakeFile *makefile);
-
-/** Append content to a makefile variable. The new content will be separated
- * from the existing content with whitespace.
- *
- * @param var The variable.
- * @param element The additional content.
- */
-void
-chaz_MakeVar_append(chaz_MakeVar *var, const char *element);
-
-/** Add another target to a makefile rule.
- *
- * @param rule The rule.
- * @param target The additional rule.
- */
-void
-chaz_MakeRule_add_target(chaz_MakeRule *rule, const char *target);
-
-/** Add another prerequisite to a makefile rule.
- *
- * @param rule The rule.
- * @param prereq The additional prerequisite.
- */
-void
-chaz_MakeRule_add_prereq(chaz_MakeRule *rule, const char *prereq);
-
-/** Add a command to a rule.
- *
- * @param rule The rule.
- * @param command The additional command.
- */
-void
-chaz_MakeRule_add_command(chaz_MakeRule *rule, const char *command);
-
-/** Add a command to remove one or more files.
- *
- * @param rule The rule.
- * @param files The list of files.
- */
-void
-chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files);
-
-/** Add a command to remove one or more directories.
- *
- * @param rule The rule.
- * @param dirs The list of directories.
- */
-void
-chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char *dirs);
-
-/** Add one or more commands to call another makefile recursively.
- *
- * @param rule The rule.
- * @param dir The directory in which to call the makefile.
- * @param target The target to call. Pass NULL for the default target.
- */
-void
-chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
-                               const char *target);
-
-#endif /* H_CHAZ_MAKE */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/OperatingSystem.h"
-/* Charmonizer/Core/OperatingSystem.h - abstract an operating system down to a few
- * variables.
- */
-
-#ifndef H_CHAZ_OPER_SYS
-#define H_CHAZ_OPER_SYS
-
-#define CHAZ_OS_POSIX    1
-#define CHAZ_OS_CMD_EXE  2
-
-/* Safely remove a file named [name]. Needed because of Windows quirks.
- * Returns true on success, false on failure.
- */
-int
-chaz_OS_remove(const char *name);
-
-/* Invoke a command and attempt to suppress output from both stdout and stderr
- * (as if they had been sent to /dev/null).  If it's not possible to run the
- * command quietly, run it anyway.
- */
-int
-chaz_OS_run_quietly(const char *command);
-
-/* Capture both stdout and stderr for a command to the supplied filepath.
- */
-int
-chaz_OS_run_redirected(const char *command, const char *path);
-
-/* Run a command beginning with the name of an executable in the current
- * working directory and capture both stdout and stderr to the supplied
- * filepath.
- */
-int
-chaz_OS_run_local_redirected(const char *command, const char *path);
-
-/* Run a command and return the output from stdout.
- */
-char*
-chaz_OS_run_and_capture(const char *command, size_t *output_len);
-
-/* Attempt to create a directory.
- */
-void
-chaz_OS_mkdir(const char *filepath);
-
-/* Attempt to remove a directory, which must be empty.
- */
-void
-chaz_OS_rmdir(const char *filepath);
-
-/* Return the operating system name.
- */
-const char*
-chaz_OS_name(void);
-
-int
-chaz_OS_is_darwin(void);
-
-int
-chaz_OS_is_cygwin(void);
-
-/* Return the extension for an executable on this system.
- */
-const char*
-chaz_OS_exe_ext(void);
-
-/* Return the extension for a shared object on this system.
- */
-const char*
-chaz_OS_shared_lib_ext(void);
-
-/* Return the equivalent of /dev/null on this system.
- */
-const char*
-chaz_OS_dev_null(void);
-
-/* Return the directory separator on this system.
- */
-const char*
-chaz_OS_dir_sep(void);
-
-/* Return the shell type of this system.
- */
-int
-chaz_OS_shell_type(void);
-
-/* Initialize the Charmonizer/Core/OperatingSystem module.
- */
-void
-chaz_OS_init(void);
-
-#endif /* H_CHAZ_COMPILER */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Core/Util.h"
-/* Chaz/Core/Util.h -- miscellaneous utilities.
- */
-
-#ifndef H_CHAZ_UTIL
-#define H_CHAZ_UTIL 1
-
-#include <stdio.h>
-#include <stddef.h>
-#include <stdarg.h>
-
-extern int chaz_Util_verbosity;
-
-/* Open a file (truncating if necessary) and write [content] to it.  Util_die() if
- * an error occurs.
- */
-void
-chaz_Util_write_file(const char *filename, const char *content);
-
-/* Read an entire file into memory.
- */
-char*
-chaz_Util_slurp_file(const char *file_path, size_t *len_ptr);
-
-/* Return a newly allocated copy of a NULL-terminated string.
- */
-char*
-chaz_Util_strdup(const char *string);
-
-/* Join a NULL-terminated list of strings using a separator.
- */
-char*
-chaz_Util_join(const char *sep, ...);
-
-/* Get the length of a file (may overshoot on text files under DOS).
- */
-long
-chaz_Util_flength(void *file);
-
-/* Print an error message to stderr and exit.
- */
-void
-chaz_Util_die(const char *format, ...);
-
-/* Print an error message to stderr.
- */
-void
-chaz_Util_warn(const char *format, ...);
-
-/* Attept to delete a file.  Return true if the file is gone, whether or not
- * it was there to begin with.  Issue a warning and return false if the file
- * still exists.
- */
-int
-chaz_Util_remove_and_verify(const char *file_path);
-
-/* Attempt to open a file for reading, then close it immediately.
- */
-int
-chaz_Util_can_open_file(const char *file_path);
-
-#endif /* H_CHAZ_UTIL */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe.h"
-#ifndef H_CHAZ
-#define H_CHAZ 1
-
-#include <stddef.h>
-#include <stdio.h>
-
-#define CHAZ_PROBE_MAX_CC_LEN 100
-#define CHAZ_PROBE_MAX_CFLAGS_LEN 2000
-
-struct chaz_CLIArgs {
-    char cc[CHAZ_PROBE_MAX_CC_LEN + 1];
-    char cflags[CHAZ_PROBE_MAX_CFLAGS_LEN + 1];
-    int  charmony_h;
-    int  charmony_pm;
-    int  charmony_py;
-    int  charmony_rb;
-    int  verbosity;
-    int  write_makefile;
-    int  code_coverage;
-};
-
-/* Parse command line arguments, initializing and filling in the supplied
- * `args` struct.
- *
- *     APP_NAME --cc=CC_COMMAND
- *              [--enable-c]
- *              [--enable-perl]
- *              [--enable-python]
- *              [--enable-ruby]
- *              [-- [CFLAGS]]
- *
- * @return true if argument parsing proceeds without incident, false if
- * unexpected arguments are encountered or values are missing or invalid.
- */
-int
-chaz_Probe_parse_cli_args(int argc, const char *argv[],
-                          struct chaz_CLIArgs *args);
-
-/* Exit after printing usage instructions to stderr.
- */
-void
-chaz_Probe_die_usage(void);
-
-/* Set up the Charmonizer environment.
- *
- * If the environment variable CHARM_VERBOSITY has been set, it will be
- * processed at this time:
- *
- *      0 - silent
- *      1 - normal
- *      2 - debugging
- */
-void
-chaz_Probe_init(struct chaz_CLIArgs *args);
-
-/* Clean up the Charmonizer environment -- deleting tempfiles, etc.  This
- * should be called only after everything else finishes.
- */
-void
-chaz_Probe_clean_up(void);
-
-/* Return an integer version of the GCC version number which is
- * (10000 * __GNU_C__ + 100 * __GNUC_MINOR__ + __GNUC_PATCHLEVEL__).
- */
-int
-chaz_Probe_gcc_version_num(void);
-
-/* If the compiler is GCC (or claims compatibility), return an X.Y.Z string
- * version of the GCC version; otherwise, return NULL.
- */
-const char*
-chaz_Probe_gcc_version(void);
-
-/* Return the integer version of MSVC defined by _MSC_VER
- */
-int
-chaz_Probe_msvc_version_num(void);
-
-#endif /* Include guard. */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/AtomicOps.h"
-/* Charmonizer/Probe/AtomicOps.h
- */
-
-#ifndef H_CHAZ_ATOMICOPS
-#define H_CHAZ_ATOMICOPS
-
-#include <stdio.h>
-
-/* Run the AtomicOps module.
- *
- * These following symbols will be defined if the associated headers are
- * available:
- *
- * HAS_LIBKERN_OSATOMIC_H  <libkern/OSAtomic.h> (Mac OS X)
- * HAS_SYS_ATOMIC_H        <sys/atomic.h>       (Solaris)
- * HAS_INTRIN_H            <intrin.h>           (Windows)
- *
- * This symbol is defined if OSAtomicCompareAndSwapPtr is available:
- *
- * HAS_OSATOMIC_CAS_PTR
- */
-void chaz_AtomicOps_run(void);
-
-#endif /* H_CHAZ_ATOMICOPS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Booleans.h"
-/* Charmonizer/Probe/Booleans.h -- bool type.
- *
- * If stdbool.h is is available, it will be pound-included in the configuration
- * header.  If it is not, the following typedef will be defined:
- *
- * bool
- *
- * These symbols will be defined if they are not already:
- *
- * true
- * false
- */
-
-#ifndef H_CHAZ_BOOLEANS
-#define H_CHAZ_BOOLEANS
-
-#include <stdio.h>
-
-/* Run the Booleans module.
- */
-void chaz_Booleans_run(void);
-
-#endif /* H_CHAZ_BOOLEANS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/BuildEnv.h"
-/* Charmonizer/Probe/BuildEnv.h -- Build environment.
- *
- * Capture various information about the build environment, including the C
- * compiler's interface, the shell, the operating system, etc.
- *
- * The following symbols will be defined:
- *
- * CC - String representation of the C compiler executable.
- * CFLAGS - C compiler flags.
- * EXTRA_CFLAGS - Extra C compiler flags.
- */
-
-#ifndef H_CHAZ_BUILDENV
-#define H_CHAZ_BUILDENV
-
-#include <stdio.h>
-
-/* Run the BuildEnv module.
- */
-void chaz_BuildEnv_run(void);
-
-#endif /* H_CHAZ_BUILDENV */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/DirManip.h"
-/* Charmonizer/Probe/DirManip.h
- */
-
-#ifndef H_CHAZ_DIRMANIP
-#define H_CHAZ_DIRMANIP
-
-/* The DirManip module exports or aliases symbols related to directory and file
- * manipulation.
- *
- * Defined if the header files dirent.h and direct.h are available, respectively:
- *
- * HAS_DIRENT_H
- * HAS_DIRECT_H
- *
- * Defined if struct dirent has these members.
- *
- * HAS_DIRENT_D_NAMLEN
- * HAS_DIRENT_D_TYPE
- *
- * The "makedir" macro will be aliased to the POSIX-specified two-argument
- * "mkdir" interface:
- *
- * makedir
- *
- * On some systems, the second argument to makedir will be ignored, in which
- * case this symbol will be true; otherwise, it will be false: (TODO: This
- * isn't verified and may sometimes be incorrect.)
- *
- * MAKEDIR_MODE_IGNORED
- *
- * String representing the system's directory separator:
- *
- * DIR_SEP
- *
- * True if the remove() function removes directories, false otherwise:
- *
- * REMOVE_ZAPS_DIRS
- */
-void chaz_DirManip_run(void);
-
-#endif /* H_CHAZ_DIR_SEP */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Floats.h"
-/* Charmonizer/Probe/Floats.h -- floating point types.
- *
- * The following symbols will be created if the platform supports IEEE 754
- * floating point types:
- *
- * F32_NAN
- * F32_INF
- * F32_NEGINF
- * F64_NAN
- * F64_INF
- * F64_NEGINF
- *
- * TODO: Actually test to see whether IEEE 754 is supported, rather than just
- * lying about it.
- */
-
-#ifndef H_CHAZ_FLOATS
-#define H_CHAZ_FLOATS
-
-/* Run the Floats module.
- */
-void
-chaz_Floats_run(void);
-
-/* Return the name of the math library to link against or NULL.
- */
-const char*
-chaz_Floats_math_library(void);
-
-#endif /* H_CHAZ_FLOATS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/FuncMacro.h"
-/* Charmonizer/Probe/FuncMacro.h
- */
-
-#ifndef H_CHAZ_FUNC_MACRO
-#define H_CHAZ_FUNC_MACRO
-
-#include <stdio.h>
-
-/* Run the FuncMacro module.
- *
- * If __func__ successfully resolves, this will be defined:
- *
- * HAS_ISO_FUNC_MACRO
- *
- * If __FUNCTION__ successfully resolves, this will be defined:
- *
- * HAS_GNUC_FUNC_MACRO
- *
- * If one or the other succeeds, these will be defined:
- *
- * HAS_FUNC_MACRO
- * FUNC_MACRO
- *
- * The "inline" keyword will also be probed for.  If it is available, the
- * following macro will be defined to "inline", otherwise it will be defined
- * to nothing.
- *
- * INLINE
- */
-void chaz_FuncMacro_run(void);
-
-#endif /* H_CHAZ_FUNC_MACRO */
-
-
-
-
-/***************************************************************************/
-
-#line 20 "src/Charmonizer/Probe/Headers.h"
-/* Charmonizer/Probe/Headers.h
- */
-
-#ifndef H_CHAZ_HEADERS
-#define H_CHAZ_HEADERS
-
-#include <stdio.h>
-/* #include "Charmonizer/Core/Defines.h" */
-
-/* Check whether a particular header file is available.  The test-compile is
- * only run the first time a given request is made.
- */
-int
-chaz_Headers_check(const char *header_name);
-
-/* Run the Headers module.
- *
- * Exported symbols:
- *
- * If HAS_C89 is declared, this system has all the header files described in
- * Ansi C 1989.  HAS_C90 is a synonym.  (It would be surprising if they are
- * not defined, because Charmonizer itself assumes C89.)
- *
- * HAS_C89
- * HAS_C90
- *
- * One symbol is exported for each C89 header file:
- *
- * HAS_ASSERT_H
- * HAS_CTYPE_H
- * HAS_ERRNO_H
- * HAS_FLOAT_H
- * HAS_LIMITS_H
- * HAS_LOCALE_H
- * HAS_MATH_H
- * HAS_SETJMP_H
- * HAS_SIGNAL_H
- * HAS_STDARG_H
- * HAS_STDDEF_H
- * HAS_STDIO_H
- * HAS_STDLIB_H
- * HAS_STRING_H
- * HAS_TIME_H
- *
- * One symbol is exported for every POSIX header present, and HAS_POSIX is
- * exported if they're all there.
- *
- * HAS_POSIX
- *
- * HAS_CPIO_H
- * HAS_DIRENT_H
- * HAS_FCNTL_H
- * HAS_GRP_H
- * HAS_PWD_H
- * HAS_SYS_STAT_H
- * HAS_SYS_TIMES_H
- * HAS_SYS_TYPES_H
- * HAS_SYS_UTSNAME_H
- * HAS_WAIT_H
- * HAS_TAR_H
- * HAS_TERMIOS_H
- * HAS_UNISTD_H
- * HAS_UTIME_H
- *
- * If pthread.h is available, this will be exported:
- *
- * HAS_PTHREAD_H
- */
-void
-chaz_Headers_run(void);
-
-#endif /* H_CHAZ_HEADERS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Integers.h"
-/* Charmonizer/Probe/Integers.h -- info about integer types and sizes.
- *
- * One or the other of these will be defined, depending on whether the
- * processor is big-endian or little-endian.
- *
- * BIG_END
- * LITTLE_END
- *
- * These will always be defined:
- *
- * SIZEOF_CHAR
- * SIZEOF_SHORT
- * SIZEOF_INT
- * SIZEOF_LONG
- * SIZEOF_PTR
- *
- * If long longs are available these symbols will be defined:
- *
- * HAS_LONG_LONG
- * SIZEOF_LONG_LONG
- *
- * Similarly, with the __int64 type (the sizeof is included for completeness):
- *
- * HAS___INT64
- * SIZEOF___INT64
- *
- * If the inttypes.h or stdint.h header files are available, these may be
- * defined:
- *
- * HAS_INTTYPES_H
- * HAS_STDINT_H
- *
- * If stdint.h is is available, it will be pound-included in the configuration
- * header.  If it is not, the following typedefs and macros will be defined if
- * possible:
- *
- * int8_t
- * int16_t
- * int32_t
- * int64_t
- * uint8_t
- * uint16_t
- * uint32_t
- * uint64_t
- * INT8_MAX
- * INT16_MAX
- * INT32_MAX
- * INT64_MAX
- * INT8_MIN
- * INT16_MIN
- * INT32_MIN
- * INT64_MIN
- * UINT8_MAX
- * UINT16_MAX
- * UINT32_MAX
- * UINT64_MAX
- * SIZE_MAX
- * INT32_C
- * INT64_C
- * UINT32_C
- * UINT64_C
- *
- * If inttypes.h is is available, it will be pound-included in the
- * configuration header.  If it is not, the following macros will be defined if
- * possible:
- *
- * PRId64
- * PRIu64
- *
- * Availability of integer types is indicated by which of these are defined:
- *
- * HAS_INT8_T
- * HAS_INT16_T
- * HAS_INT32_T
- * HAS_INT64_T
- *
- * If 64-bit integers are available, this macro will promote pointers to i64_t
- * safely.
- *
- * PTR_TO_I64(ptr)
- */
-
-#ifndef H_CHAZ_INTEGERS
-#define H_CHAZ_INTEGERS
-
-#include <stdio.h>
-
-/* Run the Integers module.
- */
-void chaz_Integers_run(void);
-
-#endif /* H_CHAZ_INTEGERS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/LargeFiles.h"
-/* Charmonizer/Probe/LargeFiles.h
- */
-
-#ifndef H_CHAZ_LARGE_FILES
-#define H_CHAZ_LARGE_FILES
-
-#include <stdio.h>
-
-/* The LargeFiles module attempts to detect these symbols or alias them to
- * synonyms:
- *
- * off64_t
- * fopen64
- * ftello64
- * fseeko64
- * lseek64
- * pread64
- *
- * If off64_t or its equivalent is available, this will be defined:
- *
- * HAS_64BIT_OFFSET_TYPE
- *
- * If 64-bit variants of fopen, ftell, and fseek are available, this will be
- * defined:
- *
- * HAS_64BIT_STDIO
- *
- * If 64-bit variants of pread and lseek are available, then corresponding
- * symbols will be defined:
- *
- * HAS_64BIT_PREAD
- * HAS_64BIT_LSEEK
- *
- * Use of the off64_t symbol may require sys/types.h.
- */
-void chaz_LargeFiles_run(void);
-
-#endif /* H_CHAZ_LARGE_FILES */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Memory.h"
-/* Charmonizer/Probe/Memory.h
- */
-
-#ifndef H_CHAZ_MEMORY
-#define H_CHAZ_MEMORY
-
-/* The Memory module attempts to detect these symbols or alias them to
- * synonyms:
- *
- * alloca
- *
- * These following symbols will be defined if the associated headers are
- * available:
- *
- * HAS_SYS_MMAN_H          <sys/mman.h>
- * HAS_ALLOCA_H            <alloca.h>
- * HAS_MALLOC_H            <malloc.h>
- *
- * Defined if alloca() is available via stdlib.h:
- *
- * ALLOCA_IN_STDLIB_H
- */
-void chaz_Memory_run(void);
-
-#endif /* H_CHAZ_MEMORY */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/RegularExpressions.h"
-/* Charmonizer/Probe/RegularExpressions.h -- regular expressions.
- */
-
-#ifndef H_CHAZ_REGULAREXPRESSIONS
-#define H_CHAZ_REGULAREXPRESSIONS
-
-/* Run the RegularExpressions module.
- */
-void chaz_RegularExpressions_run(void);
-
-#endif /* H_CHAZ_REGULAREXPRESSIONS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/Strings.h"
-/* Charmonizer/Probe/Strings.h
- */
-
-#ifndef H_CHAZ_STRINGS
-#define H_CHAZ_STRINGS
-
-/* The Strings module attempts to detect whether snprintf works as specified
- * by the C99 standard. It also looks for system-specific functions which can
- * be used to emulate snprintf.
- */
-void chaz_Strings_run(void);
-
-#endif /* H_CHAZ_STRINGS */
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/SymbolVisibility.h"
-/* Charmonizer/Probe/SymbolVisibility.h
- */
-
-#ifndef H_CHAZ_SYMBOLVISIBILITY
-#define H_CHAZ_SYMBOLVISIBILITY
-
-void chaz_SymbolVisibility_run(void);
-
-#endif /* H_CHAZ_SYMBOLVISIBILITY */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/UnusedVars.h"
-/* Charmonizer/Probe/UnusedVars.h
- */
-
-#ifndef H_CHAZ_UNUSED_VARS
-#define H_CHAZ_UNUSED_VARS
-
-#include <stdio.h>
-
-/* Run the UnusedVars module.
- *
- * These symbols are exported:
- *
- * UNUSED_VAR(var)
- * UNREACHABLE_RETURN(type)
- *
- */
-void chaz_UnusedVars_run(void);
-
-#endif /* H_CHAZ_UNUSED_VARS */
-
-
-
-
-/***************************************************************************/
-
-#line 21 "src/Charmonizer/Probe/VariadicMacros.h"
-/* Charmonizer/Probe/VariadicMacros.h
- */
-
-#ifndef H_CHAZ_VARIADIC_MACROS
-#define H_CHAZ_VARIADIC_MACROS
-
-#include <stdio.h>
-
-/* Run the VariadicMacros module.
- *
- * If your compiler supports ISO-style variadic macros, this will be defined:
- *
- * HAS_ISO_VARIADIC_MACROS
- *
- * If your compiler supports GNU-style variadic macros, this will be defined:
- *
- * HAS_GNUC_VARIADIC_MACROS
- *
- * If you have at least one of the above, this will be defined:
- *
- * HAS_VARIADIC_MACROS
- */
-void chaz_VariadicMacros_run(void);
-
-#endif /* H_CHAZ_VARIADIC_MACROS */
-
-
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/SharedLibrary.c"
-#include <string.h>
-#include <stdlib.h>
-/* #include "Charmonizer/Core/SharedLib.h" */
-/* #include "Charmonizer/Core/Compiler.h" */
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/OperatingSystem.h" */
-
-struct chaz_SharedLib {
-    char *name;
-    char *version;
-    char *major_version;
-};
-
-static char*
-S_build_filename(chaz_SharedLib *lib, const char *version, const char *ext);
-
-static const char*
-S_get_prefix(void);
-
-chaz_SharedLib*
-chaz_SharedLib_new(const char *name, const char *version,
-                   const char *major_version) {
-    chaz_SharedLib *lib = (chaz_SharedLib*)malloc(sizeof(chaz_SharedLib));
-    lib->name          = chaz_Util_strdup(name);
-    lib->version       = chaz_Util_strdup(version);
-    lib->major_version = chaz_Util_strdup(major_version);
-    return lib;
-}
-
-void
-chaz_SharedLib_destroy(chaz_SharedLib *lib) {
-    free(lib->name);
-    free(lib->version);
-    free(lib->major_version);
-    free(lib);
-}
-
-const char*
-chaz_SharedLib_get_name(chaz_SharedLib *lib) {
-    return lib->name;
-}
-
-const char*
-chaz_SharedLib_get_version(chaz_SharedLib *lib) {
-    return lib->version;
-}
-
-const char*
-chaz_SharedLib_get_major_version(chaz_SharedLib *lib) {
-    return lib->major_version;
-}
-
-char*
-chaz_SharedLib_filename(chaz_SharedLib *lib) {
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-
-    if (strcmp(shlib_ext, ".dll") == 0) {
-        return S_build_filename(lib, lib->major_version, shlib_ext);
-    }
-    else {
-        return S_build_filename(lib, lib->version, shlib_ext);
-    }
-}
-
-char*
-chaz_SharedLib_major_version_filename(chaz_SharedLib *lib) {
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-
-    return S_build_filename(lib, lib->major_version, shlib_ext);
-}
-
-char*
-chaz_SharedLib_no_version_filename(chaz_SharedLib *lib) {
-    const char *prefix    = S_get_prefix();
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-
-    return chaz_Util_join("", prefix, lib->name, shlib_ext, NULL);
-}
-
-char*
-chaz_SharedLib_implib_filename(chaz_SharedLib *lib) {
-    return S_build_filename(lib, lib->major_version, ".lib");
-}
-
-char*
-chaz_SharedLib_export_filename(chaz_SharedLib *lib) {
-    return S_build_filename(lib, lib->major_version, ".exp");
-}
-
-static char*
-S_build_filename(chaz_SharedLib *lib, const char *version, const char *ext) {
-    const char *prefix    = S_get_prefix();
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-
-    if (strcmp(shlib_ext, ".dll") == 0) {
-        return chaz_Util_join("", prefix, lib->name, "-", version, ext, NULL);
-    }
-    else if (strcmp(shlib_ext, ".dylib") == 0) {
-        return chaz_Util_join("", prefix, lib->name, ".", version, ext, NULL);
-    }
-    else {
-        return chaz_Util_join("", prefix, lib->name, ext, ".", version, NULL);
-    }
-}
-
-static const char*
-S_get_prefix() {
-    if (chaz_CC_msvc_version_num()) {
-        return "";
-    }
-    else if (chaz_OS_is_cygwin()) {
-        return "cyg";
-    }
-    else {
-        return "lib";
-    }
-}
-
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/CFlags.c"
-#include <string.h>
-#include <stdlib.h>
-/* #include "Charmonizer/Core/CFlags.h" */
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/OperatingSystem.h" */
-/* #include "Charmonizer/Core/SharedLibrary.h" */
-
-struct chaz_CFlags {
-    int   style;
-    char *string;
-};
-
-chaz_CFlags*
-chaz_CFlags_new(int style) {
-    chaz_CFlags *flags = (chaz_CFlags*)malloc(sizeof(chaz_CFlags));
-    flags->style  = style;
-    flags->string = chaz_Util_strdup("");
-    return flags;
-}
-
-void
-chaz_CFlags_destroy(chaz_CFlags *flags) {
-    free(flags->string);
-    free(flags);
-}
-
-const char*
-chaz_CFlags_get_string(chaz_CFlags *flags) {
-    return flags->string;
-}
-
-void
-chaz_CFlags_append(chaz_CFlags *flags, const char *string) {
-    char *new_string;
-    if (flags->string[0] == '\0') {
-        new_string = chaz_Util_strdup(string);
-    }
-    else {
-        new_string = chaz_Util_join(" ", flags->string, string, NULL);
-    }
-    free(flags->string);
-    flags->string = new_string;
-}
-
-void
-chaz_CFlags_clear(chaz_CFlags *flags) {
-    if (flags->string[0] != '\0') {
-        free(flags->string);
-        flags->string = chaz_Util_strdup("");
-    }
-}
-
-void
-chaz_CFlags_set_output_obj(chaz_CFlags *flags, const char *filename) {
-    const char *output;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        output = "/c /Fo";
-    }
-    else {
-        /* POSIX */
-        output = "-c -o ";
-    }
-    string = chaz_Util_join("", output, filename, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_set_output_exe(chaz_CFlags *flags, const char *filename) {
-    const char *output;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        output = "/Fe";
-    }
-    else {
-        /* POSIX */
-        output = "-o ";
-    }
-    string = chaz_Util_join("", output, filename, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_add_define(chaz_CFlags *flags, const char *name,
-                       const char *value) {
-    const char *define;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        define = "/D";
-    }
-    else {
-        /* POSIX */
-        define = "-D ";
-    }
-    if (value) {
-        string = chaz_Util_join("", define, name, "=", value, NULL);
-    }
-    else {
-        string = chaz_Util_join("", define, name, NULL);
-    }
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_add_include_dir(chaz_CFlags *flags, const char *dir) {
-    const char *include;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC)  {
-        include = "/I ";
-    }
-    else {
-        /* POSIX */
-        include = "-I ";
-    }
-    string = chaz_Util_join("", include, dir, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_enable_optimization(chaz_CFlags *flags) {
-    const char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = "/O2";
-    }
-    else if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        string = "-O2";
-    }
-    else {
-        /* POSIX */
-        string = "-O 1";
-    }
-    chaz_CFlags_append(flags, string);
-}
-
-void
-chaz_CFlags_enable_debugging(chaz_CFlags *flags) {
-    if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        chaz_CFlags_append(flags, "-g");
-    }
-}
-
-void
-chaz_CFlags_disable_strict_aliasing(chaz_CFlags *flags) {
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        return;
-    }
-    else if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        chaz_CFlags_append(flags, "-fno-strict-aliasing");
-    }
-    else {
-        chaz_Util_die("Don't know how to disable strict aliasing with '%s'",
-                      chaz_CC_get_cc());
-    }
-}
-
-void
-chaz_CFlags_set_warnings_as_errors(chaz_CFlags *flags) {
-    const char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = "/WX";
-    }
-    else if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        string = "-Werror";
-    }
-    else {
-        chaz_Util_die("Don't know how to set warnings as errors with '%s'",
-                      chaz_CC_get_cc());
-    }
-    chaz_CFlags_append(flags, string);
-}
-
-void
-chaz_CFlags_compile_shared_library(chaz_CFlags *flags) {
-    const char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = "/MD";
-    }
-    else if (flags->style != CHAZ_CFLAGS_STYLE_GNU) {
-        const char *shlib_ext = chaz_OS_shared_lib_ext();
-        if (strcmp(shlib_ext, ".dylib") == 0) {
-            string = "-fno-common";
-        }
-        else if (strcmp(shlib_ext, ".so") == 0) {
-            string = "-fPIC";
-        }
-    }
-    else {
-        return;
-    }
-    chaz_CFlags_append(flags, string);
-}
-
-void
-chaz_CFlags_hide_symbols(chaz_CFlags *flags) {
-    if (flags->style == CHAZ_CFLAGS_STYLE_GNU
-        && strcmp(chaz_OS_shared_lib_ext(), ".dll") != 0) {
-        chaz_CFlags_append(flags, "-fvisibility=hidden");
-    }
-}
-
-void
-chaz_CFlags_link_shared_library(chaz_CFlags *flags) {
-    const char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = "/DLL";
-    }
-    else if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        if (strcmp(chaz_OS_shared_lib_ext(), ".dylib") == 0) {
-            string = "-dynamiclib";
-        }
-        else {
-            string = "-shared";
-        }
-    }
-    else {
-        chaz_Util_die("Don't know how to link a shared library with '%s'",
-                      chaz_CC_get_cc());
-    }
-    chaz_CFlags_append(flags, string);
-}
-
-void
-chaz_CFlags_set_shared_library_version(chaz_CFlags *flags,
-                                       chaz_SharedLib *lib) {
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
-    char       *string;
-
-    if (flags->style != CHAZ_CFLAGS_STYLE_GNU
-        || strcmp(shlib_ext, ".dll") == 0) {
-        return;
-    }
-
-    if (strcmp(chaz_OS_shared_lib_ext(), ".dylib") == 0) {
-        const char *version = chaz_SharedLib_get_version(lib);
-        string = chaz_Util_join(" ", "-current_version", version, NULL);
-    }
-    else {
-        char *soname = chaz_SharedLib_major_version_filename(lib);
-        string = chaz_Util_join("", "-Wl,-soname,", soname, NULL);
-        free(soname);
-    }
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_set_link_output(chaz_CFlags *flags, const char *filename) {
-    const char *output;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        output = "/OUT:";
-    }
-    else {
-        output = "-o ";
-    }
-    string = chaz_Util_join("", output, filename, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_add_library_path(chaz_CFlags *flags, const char *directory) {
-    const char *lib_path;
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        if (strcmp(directory, ".") == 0) {
-            /* The MS linker searches the current directory by default. */
-            return;
-        }
-        else {
-            lib_path = "/LIBPATH:";
-        }
-    }
-    else {
-        lib_path = "-L ";
-    }
-    string = chaz_Util_join("", lib_path, directory, NULL);
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_add_library(chaz_CFlags *flags, chaz_SharedLib *lib) {
-    char *filename;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        filename = chaz_SharedLib_implib_filename(lib);
-    }
-    else {
-        filename = chaz_SharedLib_filename(lib);
-    }
-    chaz_CFlags_append(flags, filename);
-    free(filename);
-}
-
-void
-chaz_CFlags_add_external_library(chaz_CFlags *flags, const char *library) {
-    char *string;
-    if (flags->style == CHAZ_CFLAGS_STYLE_MSVC) {
-        string = chaz_Util_join("", library, ".lib", NULL);
-    }
-    else {
-        string = chaz_Util_join(" ", "-l", library, NULL);
-    }
-    chaz_CFlags_append(flags, string);
-    free(string);
-}
-
-void
-chaz_CFlags_enable_code_coverage(chaz_CFlags *flags) {
-    if (flags->style == CHAZ_CFLAGS_STYLE_GNU) {
-        chaz_CFlags_append(flags, "--coverage");
-    }
-    else {
-        chaz_Util_die("Don't know how to enable code coverage with '%s'",
-                      chaz_CC_get_cc());
-    }
-}
-
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/Compiler.c"
-#include <string.h>
-#include <stdlib.h>
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/Compiler.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-/* #include "Charmonizer/Core/OperatingSystem.h" */
-
-/* Detect macros which may help to identify some compilers.
- */
-static void
-chaz_CC_detect_known_compilers(void);
-
-/* Temporary files. */
-#define CHAZ_CC_TRY_SOURCE_PATH  "_charmonizer_try.c"
-#define CHAZ_CC_TRY_BASENAME     "_charmonizer_try"
-#define CHAZ_CC_TARGET_PATH      "_charmonizer_target"
-
-/* Static vars. */
-static struct {
-    char     *cc_command;
-    char     *cflags;
-    char     *try_exe_name;
-    char      obj_ext[10];
-    char      gcc_version_str[30];
-    int       cflags_style;
-    int       intval___GNUC__;
-    int       intval___GNUC_MINOR__;
-    int       intval___GNUC_PATCHLEVEL__;
-    int       intval__MSC_VER;
-    int       intval___clang__;
-    chaz_CFlags *extra_cflags;
-    chaz_CFlags *temp_cflags;
-} chaz_CC = {
-    NULL, NULL, NULL,
-    "", "",
-    0, 0, 0, 0, 0, 0,
-    NULL, NULL
-};
-
-void
-chaz_CC_init(const char *compiler_command, const char *compiler_flags) {
-    const char *code = "int main() { return 0; }\n";
-    int compile_succeeded = 0;
-
-    if (chaz_Util_verbosity) { printf("Creating compiler object...\n"); }
-
-    /* Assign, init. */
-    chaz_CC.cc_command   = chaz_Util_strdup(compiler_command);
-    chaz_CC.cflags       = chaz_Util_strdup(compiler_flags);
-    chaz_CC.extra_cflags = NULL;
-    chaz_CC.temp_cflags  = NULL;
-
-    /* Set names for the targets which we "try" to compile. */
-    chaz_CC.try_exe_name
-        = chaz_Util_join("", CHAZ_CC_TRY_BASENAME, chaz_OS_exe_ext(), NULL);
-
-    /* If we can't compile anything, game over. */
-    if (chaz_Util_verbosity) {
-        printf("Trying to compile a small test file...\n");
-    }
-    /* Try MSVC argument style. */
-    strcpy(chaz_CC.obj_ext, ".obj");
-    chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_MSVC;
-    compile_succeeded = chaz_CC_test_compile(code);
-    if (!compile_succeeded) {
-        /* Try POSIX argument style. */
-        strcpy(chaz_CC.obj_ext, ".o");
-        chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_POSIX;
-        compile_succeeded = chaz_CC_test_compile(code);
-    }
-    if (!compile_succeeded) {
-        chaz_Util_die("Failed to compile a small test file");
-    }
-
-    chaz_CC_detect_known_compilers();
-
-    if (chaz_CC.intval___GNUC__) {
-        chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_GNU;
-    }
-    else if (chaz_CC.intval__MSC_VER) {
-        chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_MSVC;
-    }
-    else {
-        chaz_CC.cflags_style = CHAZ_CFLAGS_STYLE_POSIX;
-    }
-    chaz_CC.extra_cflags = chaz_CFlags_new(chaz_CC.cflags_style);
-    chaz_CC.temp_cflags  = chaz_CFlags_new(chaz_CC.cflags_style);
-}
-
-static const char chaz_CC_detect_macro_code[] =
-    CHAZ_QUOTE(  #include <stdio.h>             )
-    CHAZ_QUOTE(  int main() {                   )
-    CHAZ_QUOTE(  #ifndef %s                     )
-    CHAZ_QUOTE(  #error "nope"                  )
-    CHAZ_QUOTE(  #endif                         )
-    CHAZ_QUOTE(      printf("%%d", %s);         )
-    CHAZ_QUOTE(      return 0;                  )
-    CHAZ_QUOTE(  }                              );
-
-static int
-chaz_CC_detect_macro(const char *macro) {
-    size_t size = sizeof(chaz_CC_detect_macro_code)
-                  + (strlen(macro) * 2)
-                  + 20;
-    char *code = (char*)malloc(size);
-    int retval = 0;
-    char *output;
-    size_t len;
-    sprintf(code, chaz_CC_detect_macro_code, macro, macro);
-    output = chaz_CC_capture_output(code, &len);
-    if (output) {
-        retval = atoi(output);
-        free(output);
-    }
-    free(code);
-    return retval;
-}
-
-static void
-chaz_CC_detect_known_compilers(void) {
-    chaz_CC.intval___GNUC__  = chaz_CC_detect_macro("__GNUC__");
-    if (chaz_CC.intval___GNUC__) {
-        chaz_CC.intval___GNUC_MINOR__
-            = chaz_CC_detect_macro("__GNUC_MINOR__");
-        chaz_CC.intval___GNUC_PATCHLEVEL__
-            = chaz_CC_detect_macro("__GNUC_PATCHLEVEL__");
-        sprintf(chaz_CC.gcc_version_str, "%d.%d.%d", chaz_CC.intval___GNUC__,
-                chaz_CC.intval___GNUC_MINOR__,
-                chaz_CC.intval___GNUC_PATCHLEVEL__);
-    }
-    chaz_CC.intval__MSC_VER  = chaz_CC_detect_macro("_MSC_VER");
-    chaz_CC.intval___clang__ = chaz_CC_detect_macro("__clang__");
-}
-
-void
-chaz_CC_clean_up(void) {
-    free(chaz_CC.cc_command);
-    free(chaz_CC.cflags);
-    free(chaz_CC.try_exe_name);
-    chaz_CFlags_destroy(chaz_CC.extra_cflags);
-    chaz_CFlags_destroy(chaz_CC.temp_cflags);
-}
-
-int
-chaz_CC_compile_exe(const char *source_path, const char *exe_name,
-                    const char *code) {
-    chaz_CFlags *local_cflags = chaz_CFlags_new(chaz_CC.cflags_style);
-    const char *extra_cflags_string = "";
-    const char *temp_cflags_string  = "";
-    const char *local_cflags_string;
-    char *exe_file = chaz_Util_join("", exe_name, chaz_OS_exe_ext(), NULL);
-    char *command;
-    int result;
-
-    /* Write the source file. */
-    chaz_Util_write_file(source_path, code);
-
-    /* Prepare and run the compiler command. */
-    if (chaz_CC.extra_cflags) {
-        extra_cflags_string = chaz_CFlags_get_string(chaz_CC.extra_cflags);
-    }
-    if (chaz_CC.temp_cflags) {
-        temp_cflags_string = chaz_CFlags_get_string(chaz_CC.temp_cflags);
-    }
-    chaz_CFlags_set_output_exe(local_cflags, exe_file);
-    local_cflags_string = chaz_CFlags_get_string(local_cflags);
-    command = chaz_Util_join(" ", chaz_CC.cc_command, chaz_CC.cflags,
-                             source_path, extra_cflags_string,
-                             temp_cflags_string, local_cflags_string, NULL);
-    if (chaz_Util_verbosity < 2) {
-        chaz_OS_run_quietly(command);
-    }
-    else {
-        system(command);
-    }
-
-    if (chaz_CC.intval__MSC_VER) {
-        /* Zap MSVC junk. */
-        size_t  junk_buf_size = strlen(exe_file) + 4;
-        char   *junk          = (char*)malloc(junk_buf_size);
-        sprintf(junk, "%s.obj", exe_name);
-        chaz_Util_remove_and_verify(junk);
-        sprintf(junk, "%s.ilk", exe_name);
-        chaz_Util_remove_and_verify(junk);
-        sprintf(junk, "%s.pdb", exe_name);
-        chaz_Util_remove_and_verify(junk);
-        free(junk);
-    }
-
-    /* See if compilation was successful.  Remove the source file. */
-    result = chaz_Util_can_open_file(exe_file);
-    if (!chaz_Util_remove_and_verify(source_path)) {
-        chaz_Util_die("Failed to remove '%s'", source_path);
-    }
-
-    chaz_CFlags_destroy(local_cflags);
-    free(command);
-    free(exe_file);
-    return result;
-}
-
-int
-chaz_CC_compile_obj(const char *source_path, const char *obj_name,
-                    const char *code) {
-    chaz_CFlags *local_cflags = chaz_CFlags_new(chaz_CC.cflags_style);
-    const char *extra_cflags_string = "";
-    const char *temp_cflags_string  = "";
-    const char *local_cflags_string;
-    char *obj_file = chaz_Util_join("", obj_name, chaz_CC.obj_ext, NULL);
-    char *command;
-    int result;
-
-    /* Write the source file. */
-    chaz_Util_write_file(source_path, code);
-
-    /* Prepare and run the compiler command. */
-    if (chaz_CC.extra_cflags) {
-        extra_cflags_string = chaz_CFlags_get_string(chaz_CC.extra_cflags);
-    }
-    if (chaz_CC.temp_cflags) {
-        temp_cflags_string = chaz_CFlags_get_string(chaz_CC.temp_cflags);
-    }
-    chaz_CFlags_set_output_obj(local_cflags, obj_file);
-    local_cflags_string = chaz_CFlags_get_string(local_cflags);
-    command = chaz_Util_join(" ", chaz_CC.cc_command, chaz_CC.cflags,
-                             source_path, extra_cflags_string,
-                             temp_cflags_string, local_cflags_string, NULL);
-    if (chaz_Util_verbosity < 2) {
-        chaz_OS_run_quietly(command);
-    }
-    else {
-        system(command);
-    }
-
-    /* See if compilation was successful.  Remove the source file. */
-    result = chaz_Util_can_open_file(obj_file);
-    if (!chaz_Util_remove_and_verify(source_path)) {
-        chaz_Util_die("Failed to remove '%s'", source_path);
-    }
-
-    chaz_CFlags_destroy(local_cflags);
-    free(command);
-    free(obj_file);
-    return result;
-}
-
-int
-chaz_CC_test_compile(const char *source) {
-    int compile_succeeded;
-    char *try_obj_name
-        = chaz_Util_join("", CHAZ_CC_TRY_BASENAME, chaz_CC.obj_ext, NULL);
-    if (!chaz_Util_remove_and_verify(try_obj_name)) {
-        chaz_Util_die("Failed to delete file '%s'", try_obj_name);
-    }
-    compile_succeeded = chaz_CC_compile_obj(CHAZ_CC_TRY_SOURCE_PATH,
-                                            CHAZ_CC_TRY_BASENAME, source);
-    chaz_Util_remove_and_verify(try_obj_name);
-    free(try_obj_name);
-    return compile_succeeded;
-}
-
-char*
-chaz_CC_capture_output(const char *source, size_t *output_len) {
-    char *captured_output = NULL;
-    int compile_succeeded;
-
-    /* Clear out previous versions and test to make sure removal worked. */
-    if (!chaz_Util_remove_and_verify(chaz_CC.try_exe_name)) {
-        chaz_Util_die("Failed to delete file '%s'", chaz_CC.try_exe_name);
-    }
-    if (!chaz_Util_remove_and_verify(CHAZ_CC_TARGET_PATH)) {
-        chaz_Util_die("Failed to delete file '%s'", CHAZ_CC_TARGET_PATH);
-    }
-
-    /* Attempt compilation; if successful, run app and slurp output. */
-    compile_succeeded = chaz_CC_compile_exe(CHAZ_CC_TRY_SOURCE_PATH,
-                                            CHAZ_CC_TRY_BASENAME, source);
-    if (compile_succeeded) {
-        chaz_OS_run_local_redirected(chaz_CC.try_exe_name,
-                                     CHAZ_CC_TARGET_PATH);
-        captured_output = chaz_Util_slurp_file(CHAZ_CC_TARGET_PATH,
-                                               output_len);
-    }
-    else {
-        *output_len = 0;
-    }
-
-    /* Remove all the files we just created. */
-    chaz_Util_remove_and_verify(CHAZ_CC_TRY_SOURCE_PATH);
-    chaz_Util_remove_and_verify(chaz_CC.try_exe_name);
-    chaz_Util_remove_and_verify(CHAZ_CC_TARGET_PATH);
-
-    return captured_output;
-}
-
-const char*
-chaz_CC_get_cc(void) {
-    return chaz_CC.cc_command;
-}
-
-const char*
-chaz_CC_get_cflags(void) {
-    return chaz_CC.cflags;
-}
-
-chaz_CFlags*
-chaz_CC_get_extra_cflags(void) {
-    return chaz_CC.extra_cflags;
-}
-
-chaz_CFlags*
-chaz_CC_get_temp_cflags(void) {
-    return chaz_CC.temp_cflags;
-}
-
-chaz_CFlags*
-chaz_CC_new_cflags(void) {
-    return chaz_CFlags_new(chaz_CC.cflags_style);
-}
-
-const char*
-chaz_CC_obj_ext(void) {
-    return chaz_CC.obj_ext;
-}
-
-int
-chaz_CC_gcc_version_num(void) {
-    return 10000 * chaz_CC.intval___GNUC__
-           + 100 * chaz_CC.intval___GNUC_MINOR__
-           + chaz_CC.intval___GNUC_PATCHLEVEL__;
-}
-
-const char*
-chaz_CC_gcc_version(void) {
-    return chaz_CC.intval___GNUC__ ? chaz_CC.gcc_version_str : NULL;
-}
-
-int
-chaz_CC_msvc_version_num(void) {
-    return chaz_CC.intval__MSC_VER;
-}
-
-const char*
-chaz_CC_link_command() {
-    if (chaz_CC.intval__MSC_VER) {
-        return "link";
-    }
-    else {
-        return chaz_CC.cc_command;
-    }
-}
-
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/ConfWriter.c"
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-#include <stdarg.h>
-#include <stdio.h>
-
-#define CW_MAX_WRITERS 10
-static struct {
-    chaz_ConfWriter *writers[CW_MAX_WRITERS];
-    size_t num_writers;
-} chaz_CW;
-
-void
-chaz_ConfWriter_init(void) {
-    chaz_CW.num_writers = 0;
-    return;
-}
-
-void
-chaz_ConfWriter_clean_up(void) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->clean_up();
-    }
-}
-
-void
-chaz_ConfWriter_append_conf(const char *fmt, ...) {
-    va_list args;
-    size_t i;
-    
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        va_start(args, fmt);
-        chaz_CW.writers[i]->vappend_conf(fmt, args);
-        va_end(args);
-    }
-}
-
-void
-chaz_ConfWriter_add_def(const char *sym, const char *value) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_def(sym, value);
-    }
-}
-
-void
-chaz_ConfWriter_add_global_def(const char *sym, const char *value) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_global_def(sym, value);
-    }
-}
-
-void
-chaz_ConfWriter_add_typedef(const char *type, const char *alias) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_typedef(type, alias);
-    }
-}
-
-void
-chaz_ConfWriter_add_global_typedef(const char *type, const char *alias) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_global_typedef(type, alias);
-    }
-}
-
-void
-chaz_ConfWriter_add_sys_include(const char *header) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_sys_include(header);
-    }
-}
-
-void
-chaz_ConfWriter_add_local_include(const char *header) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->add_local_include(header);
-    }
-}
-
-void
-chaz_ConfWriter_start_module(const char *module_name) {
-    size_t i;
-    if (chaz_Util_verbosity > 0) {
-        printf("Running %s module...\n", module_name);
-    }
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->start_module(module_name);
-    }
-}
-
-void
-chaz_ConfWriter_end_module(void) {
-    size_t i;
-    for (i = 0; i < chaz_CW.num_writers; i++) {
-        chaz_CW.writers[i]->end_module();
-    }
-}
-
-void
-chaz_ConfWriter_add_writer(chaz_ConfWriter *writer) {
-    chaz_CW.writers[chaz_CW.num_writers] = writer;
-    chaz_CW.num_writers++;
-}
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/ConfWriterC.c"
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-/* #include "Charmonizer/Core/ConfWriterC.h" */
-/* #include "Charmonizer/Core/OperatingSystem.h" */
-/* #include "Charmonizer/Core/Compiler.h" */
-#include <ctype.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-typedef enum chaz_ConfElemType {
-    CHAZ_CONFELEM_DEF,
-    CHAZ_CONFELEM_GLOBAL_DEF,
-    CHAZ_CONFELEM_TYPEDEF,
-    CHAZ_CONFELEM_GLOBAL_TYPEDEF,
-    CHAZ_CONFELEM_SYS_INCLUDE,
-    CHAZ_CONFELEM_LOCAL_INCLUDE
-} chaz_ConfElemType;
-
-typedef struct chaz_ConfElem {
-    char *str1;
-    char *str2;
-    chaz_ConfElemType type;
-} chaz_ConfElem;
-
-/* Static vars. */
-static struct {
-    FILE          *fh;
-    char          *MODULE_NAME;
-    chaz_ConfElem *defs;
-    size_t         def_cap;
-    size_t         def_count;
-} chaz_ConfWriterC = { NULL, NULL, 0, 0 };
-static chaz_ConfWriter CWC_conf_writer;
-
-/* Open the charmony.h file handle.  Print supplied text to it, if non-null.
- * Print an explanatory comment and open the include guard.
- */
-static void
-chaz_ConfWriterC_open_charmony_h(const char *charmony_start);
-
-/* Push a new elem onto the def list. */
-static void
-chaz_ConfWriterC_push_def_list_item(const char *str1, const char *str2,
-                     chaz_ConfElemType type);
-
-/* Free the def list. */
-static void
-chaz_ConfWriterC_clear_def_list(void);
-
-static void
-chaz_ConfWriterC_clean_up(void);
-static void
-chaz_ConfWriterC_vappend_conf(const char *fmt, va_list args);
-static void
-chaz_ConfWriterC_add_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterC_add_global_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterC_add_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterC_add_global_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterC_add_sys_include(const char *header);
-static void
-chaz_ConfWriterC_add_local_include(const char *header);
-static void
-chaz_ConfWriterC_start_module(const char *module_name);
-static void
-chaz_ConfWriterC_end_module(void);
-
-void
-chaz_ConfWriterC_enable(void) {
-    CWC_conf_writer.clean_up           = chaz_ConfWriterC_clean_up;
-    CWC_conf_writer.vappend_conf       = chaz_ConfWriterC_vappend_conf;
-    CWC_conf_writer.add_def            = chaz_ConfWriterC_add_def;
-    CWC_conf_writer.add_global_def     = chaz_ConfWriterC_add_global_def;
-    CWC_conf_writer.add_typedef        = chaz_ConfWriterC_add_typedef;
-    CWC_conf_writer.add_global_typedef = chaz_ConfWriterC_add_global_typedef;
-    CWC_conf_writer.add_sys_include    = chaz_ConfWriterC_add_sys_include;
-    CWC_conf_writer.add_local_include  = chaz_ConfWriterC_add_local_include;
-    CWC_conf_writer.start_module       = chaz_ConfWriterC_start_module;
-    CWC_conf_writer.end_module         = chaz_ConfWriterC_end_module;
-    chaz_ConfWriterC_open_charmony_h(NULL);
-    chaz_ConfWriter_add_writer(&CWC_conf_writer);
-    return;
-}
-
-static void
-chaz_ConfWriterC_open_charmony_h(const char *charmony_start) {
-    /* Open the filehandle. */
-    chaz_ConfWriterC.fh = fopen("charmony.h", "w+");
-    if (chaz_ConfWriterC.fh == NULL) {
-        chaz_Util_die("Can't open 'charmony.h': %s", strerror(errno));
-    }
-
-    /* Print supplied text (if any) along with warning, open include guard. */
-    if (charmony_start != NULL) {
-        fwrite(charmony_start, sizeof(char), strlen(charmony_start),
-               chaz_ConfWriterC.fh);
-    }
-    fprintf(chaz_ConfWriterC.fh,
-            "/* Header file auto-generated by Charmonizer. \n"
-            " * DO NOT EDIT THIS FILE!!\n"
-            " */\n\n"
-            "#ifndef H_CHARMONY\n"
-            "#define H_CHARMONY 1\n\n"
-           );
-}
-
-static void
-chaz_ConfWriterC_clean_up(void) {
-    /* Write the last bit of charmony.h and close. */
-    fprintf(chaz_ConfWriterC.fh, "#endif /* H_CHARMONY */\n\n");
-    if (fclose(chaz_ConfWriterC.fh)) {
-        chaz_Util_die("Couldn't close 'charmony.h': %s", strerror(errno));
-    }
-}
-
-static void
-chaz_ConfWriterC_vappend_conf(const char *fmt, va_list args) {
-    vfprintf(chaz_ConfWriterC.fh, fmt, args);
-}
-
-static int
-chaz_ConfWriterC_sym_is_uppercase(const char *sym) {
-    return isupper(sym[0]);
-}
-
-static char*
-chaz_ConfWriterC_uppercase_string(const char *src) {
-    char *retval = chaz_Util_strdup(src);
-    size_t i;
-    for (i = 0; retval[i]; ++i) {
-        retval[i] = toupper(retval[i]);
-    }
-    return retval;
-}
-
-static void
-chaz_ConfWriterC_add_def(const char *sym, const char *value) {
-    chaz_ConfWriterC_push_def_list_item(sym, value, CHAZ_CONFELEM_DEF);
-}
-
-static void
-chaz_ConfWriterC_append_def_to_conf(const char *sym, const char *value) {
-    if (value) {
-        if (chaz_ConfWriterC_sym_is_uppercase(sym)) {
-            fprintf(chaz_ConfWriterC.fh, "#define CHY_%s %s\n", sym, value);
-        }
-        else {
-            fprintf(chaz_ConfWriterC.fh, "#define chy_%s %s\n", sym, value);
-        }
-    }
-    else {
-        if (chaz_ConfWriterC_sym_is_uppercase(sym)) {
-            fprintf(chaz_ConfWriterC.fh, "#define CHY_%s\n", sym);
-        }
-        else {
-            fprintf(chaz_ConfWriterC.fh, "#define chy_%s\n", sym);
-        }
-    }
-}
-
-static void
-chaz_ConfWriterC_add_global_def(const char *sym, const char *value) {
-    chaz_ConfWriterC_push_def_list_item(sym, value, CHAZ_CONFELEM_GLOBAL_DEF);
-}
-
-static void
-chaz_ConfWriterC_append_global_def_to_conf(const char *sym,
-                                           const char *value) {
-    char *name_end = strchr(sym, '(');
-    if (name_end == NULL) {
-        if (strcmp(sym, value) == 0) { return; }
-        fprintf(chaz_ConfWriterC.fh, "#ifndef %s\n", sym);
-    }
-    else {
-        size_t  name_len = (size_t)(name_end - sym);
-        char   *name     = chaz_Util_strdup(sym);
-        name[name_len] = '\0';
-        fprintf(chaz_ConfWriterC.fh, "#ifndef %s\n", name);
-        free(name);
-    }
-    if (value) {
-        fprintf(chaz_ConfWriterC.fh, "  #define %s %s\n", sym, value);
-    }
-    else {
-        fprintf(chaz_ConfWriterC.fh, "  #define %s\n", sym);
-    }
-    fprintf(chaz_ConfWriterC.fh, "#endif\n");
-}
-
-static void
-chaz_ConfWriterC_add_typedef(const char *type, const char *alias) {
-    chaz_ConfWriterC_push_def_list_item(alias, type, CHAZ_CONFELEM_TYPEDEF);
-}
-
-static void
-chaz_ConfWriterC_append_typedef_to_conf(const char *type, const char *alias) {
-    if (chaz_ConfWriterC_sym_is_uppercase(alias)) {
-        fprintf(chaz_ConfWriterC.fh, "typedef %s CHY_%s;\n", type, alias);
-    }
-    else {
-        fprintf(chaz_ConfWriterC.fh, "typedef %s chy_%s;\n", type, alias);
-    }
-}
-
-static void
-chaz_ConfWriterC_add_global_typedef(const char *type, const char *alias) {
-    chaz_ConfWriterC_push_def_list_item(alias, type,
-            CHAZ_CONFELEM_GLOBAL_TYPEDEF);
-}
-
-static void
-chaz_ConfWriterC_append_global_typedef_to_conf(const char *type,
-                                               const char *alias) {
-    if (strcmp(type, alias) == 0) { return; }
-    fprintf(chaz_ConfWriterC.fh, "typedef %s %s;\n", type, alias);
-}
-
-static void
-chaz_ConfWriterC_add_sys_include(const char *header) {
-    chaz_ConfWriterC_push_def_list_item(header, NULL,
-                                        CHAZ_CONFELEM_SYS_INCLUDE);
-}
-
-static void
-chaz_ConfWriterC_append_sys_include_to_conf(const char *header) {
-    fprintf(chaz_ConfWriterC.fh, "#include <%s>\n", header);
-}
-
-static void
-chaz_ConfWriterC_add_local_include(const char *header) {
-    chaz_ConfWriterC_push_def_list_item(header, NULL,
-                                        CHAZ_CONFELEM_LOCAL_INCLUDE);
-}
-
-static void
-chaz_ConfWriterC_append_local_include_to_conf(const char *header) {
-    fprintf(chaz_ConfWriterC.fh, "#include \"%s\"\n", header);
-}
-
-static void
-chaz_ConfWriterC_start_module(const char *module_name) {
-    fprintf(chaz_ConfWriterC.fh, "\n/* %s */\n", module_name);
-    chaz_ConfWriterC.MODULE_NAME
-        = chaz_ConfWriterC_uppercase_string(module_name);
-}
-
-static void
-chaz_ConfWriterC_end_module(void) {
-    size_t num_globals = 0;
-    size_t i;
-    chaz_ConfElem *defs = chaz_ConfWriterC.defs;
-    for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-        switch (defs[i].type) {
-            case CHAZ_CONFELEM_GLOBAL_DEF:
-                ++num_globals;
-            /* fall through */
-            case CHAZ_CONFELEM_DEF:
-                chaz_ConfWriterC_append_def_to_conf(defs[i].str1,
-                                                    defs[i].str2);
-                break;
-            case CHAZ_CONFELEM_GLOBAL_TYPEDEF: {
-                char *sym = chaz_ConfWriterC_uppercase_string(defs[i].str1);
-                chaz_ConfWriterC_append_def_to_conf(sym, defs[i].str2);
-                free(sym);
-                ++num_globals;
-            }
-            /* fall through */
-            case CHAZ_CONFELEM_TYPEDEF:
-                chaz_ConfWriterC_append_typedef_to_conf(defs[i].str2,
-                                                        defs[i].str1);
-                break;
-            case CHAZ_CONFELEM_SYS_INCLUDE:
-                ++num_globals;
-                break;
-            case CHAZ_CONFELEM_LOCAL_INCLUDE:
-                chaz_ConfWriterC_append_local_include_to_conf(defs[i].str1);
-                break;
-            default:
-                chaz_Util_die("Internal error: bad element type %d",
-                              (int)defs[i].type);
-        }
-    }
-
-    /* Write out short names. */
-    fprintf(chaz_ConfWriterC.fh,
-        "\n#if defined(CHY_USE_SHORT_NAMES) "
-        "|| defined(CHAZ_USE_SHORT_NAMES)\n"
-    );
-    for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-        switch (defs[i].type) {
-            case CHAZ_CONFELEM_DEF:
-            case CHAZ_CONFELEM_TYPEDEF:
-                {
-                    const char *sym = defs[i].str1;
-                    const char *value = defs[i].str2;
-                    if (!value || strcmp(sym, value) != 0) {
-                        const char *prefix
-                            = chaz_ConfWriterC_sym_is_uppercase(sym)
-                              ? "CHY_" : "chy_";
-                        fprintf(chaz_ConfWriterC.fh, "  #define %s %s%s\n",
-                                sym, prefix, sym);
-                    }
-                }
-                break;
-            case CHAZ_CONFELEM_GLOBAL_DEF:
-            case CHAZ_CONFELEM_GLOBAL_TYPEDEF:
-            case CHAZ_CONFELEM_SYS_INCLUDE:
-            case CHAZ_CONFELEM_LOCAL_INCLUDE:
-                /* no-op */
-                break;
-            default:
-                chaz_Util_die("Internal error: bad element type %d",
-                              (int)defs[i].type);
-        }
-    }
-
-    fprintf(chaz_ConfWriterC.fh, "#endif /* USE_SHORT_NAMES */\n");
-
-    /* Write out global definitions and system includes. */
-    if (num_globals) {
-        fprintf(chaz_ConfWriterC.fh, "\n#ifdef CHY_EMPLOY_%s\n\n",
-                chaz_ConfWriterC.MODULE_NAME);
-        for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-            switch (defs[i].type) {
-                case CHAZ_CONFELEM_GLOBAL_DEF:
-                    chaz_ConfWriterC_append_global_def_to_conf(defs[i].str1,
-                                                               defs[i].str2);
-                    break;
-                case CHAZ_CONFELEM_GLOBAL_TYPEDEF:
-                    chaz_ConfWriterC_append_global_typedef_to_conf(
-                            defs[i].str2, defs[i].str1);
-                    break;
-                case CHAZ_CONFELEM_SYS_INCLUDE:
-                    chaz_ConfWriterC_append_sys_include_to_conf(defs[i].str1);
-                    break;
-                case CHAZ_CONFELEM_DEF:
-                case CHAZ_CONFELEM_TYPEDEF:
-                case CHAZ_CONFELEM_LOCAL_INCLUDE:
-                    /* no-op */
-                    break;
-                default:
-                    chaz_Util_die("Internal error: bad element type %d",
-                                  (int)defs[i].type);
-            }
-        }
-        fprintf(chaz_ConfWriterC.fh, "\n#endif /* EMPLOY_%s */\n",
-                chaz_ConfWriterC.MODULE_NAME);
-    }
-
-    fprintf(chaz_ConfWriterC.fh, "\n");
-
-    free(chaz_ConfWriterC.MODULE_NAME);
-    chaz_ConfWriterC_clear_def_list();
-}
-
-static void
-chaz_ConfWriterC_push_def_list_item(const char *str1, const char *str2,
-                     chaz_ConfElemType type) {
-    if (chaz_ConfWriterC.def_count >= chaz_ConfWriterC.def_cap) { 
-        size_t amount;
-        chaz_ConfWriterC.def_cap += 10;
-        amount = chaz_ConfWriterC.def_cap * sizeof(chaz_ConfElem);
-        chaz_ConfWriterC.defs
-            = (chaz_ConfElem*)realloc(chaz_ConfWriterC.defs, amount);
-    }
-    chaz_ConfWriterC.defs[chaz_ConfWriterC.def_count].str1
-        = str1 ? chaz_Util_strdup(str1) : NULL;
-    chaz_ConfWriterC.defs[chaz_ConfWriterC.def_count].str2
-        = str2 ? chaz_Util_strdup(str2) : NULL;
-    chaz_ConfWriterC.defs[chaz_ConfWriterC.def_count].type = type;
-    chaz_ConfWriterC.def_count++;
-}
-
-static void
-chaz_ConfWriterC_clear_def_list(void) {
-    size_t i;
-    for (i = 0; i < chaz_ConfWriterC.def_count; i++) {
-        free(chaz_ConfWriterC.defs[i].str1);
-        free(chaz_ConfWriterC.defs[i].str2);
-    }
-    free(chaz_ConfWriterC.defs);
-    chaz_ConfWriterC.defs      = NULL;
-    chaz_ConfWriterC.def_cap   = 0;
-    chaz_ConfWriterC.def_count = 0;
-}
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/ConfWriterPerl.c"
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-/* #include "Charmonizer/Core/ConfWriterPerl.h" */
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Static vars. */
-static struct {
-    FILE *fh;
-} chaz_CWPerl = { NULL };
-static chaz_ConfWriter CWPerl_conf_writer;
-
-/* Open the Charmony.pm file handle.
- */
-static void
-chaz_ConfWriterPerl_open_config_pm(void);
-
-static void
-chaz_ConfWriterPerl_clean_up(void);
-static void
-chaz_ConfWriterPerl_vappend_conf(const char *fmt, va_list args);
-static void
-chaz_ConfWriterPerl_add_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterPerl_add_global_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterPerl_add_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterPerl_add_global_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterPerl_add_sys_include(const char *header);
-static void
-chaz_ConfWriterPerl_add_local_include(const char *header);
-static void
-chaz_ConfWriterPerl_start_module(const char *module_name);
-static void
-chaz_ConfWriterPerl_end_module(void);
-
-void
-chaz_ConfWriterPerl_enable(void) {
-    CWPerl_conf_writer.clean_up           = chaz_ConfWriterPerl_clean_up;
-    CWPerl_conf_writer.vappend_conf       = chaz_ConfWriterPerl_vappend_conf;
-    CWPerl_conf_writer.add_def            = chaz_ConfWriterPerl_add_def;
-    CWPerl_conf_writer.add_global_def     = chaz_ConfWriterPerl_add_global_def;
-    CWPerl_conf_writer.add_typedef        = chaz_ConfWriterPerl_add_typedef;
-    CWPerl_conf_writer.add_global_typedef = chaz_ConfWriterPerl_add_global_typedef;
-    CWPerl_conf_writer.add_sys_include    = chaz_ConfWriterPerl_add_sys_include;
-    CWPerl_conf_writer.add_local_include  = chaz_ConfWriterPerl_add_local_include;
-    CWPerl_conf_writer.start_module       = chaz_ConfWriterPerl_start_module;
-    CWPerl_conf_writer.end_module         = chaz_ConfWriterPerl_end_module;
-    chaz_ConfWriterPerl_open_config_pm();
-    chaz_ConfWriter_add_writer(&CWPerl_conf_writer);
-    return;
-}
-
-static void
-chaz_ConfWriterPerl_open_config_pm(void) {
-    /* Open the filehandle. */
-    chaz_CWPerl.fh = fopen("Charmony.pm", "w+");
-    if (chaz_CWPerl.fh == NULL) {
-        chaz_Util_die("Can't open 'Charmony.pm': %s", strerror(errno));
-    }
-
-    /* Start the module. */
-    fprintf(chaz_CWPerl.fh,
-            "# Auto-generated by Charmonizer. \n"
-            "# DO NOT EDIT THIS FILE!!\n"
-            "\n"
-            "package Charmony;\n"
-            "use strict;\n"
-            "use warnings;\n"
-            "\n"
-            "my %%defs;\n"
-            "\n"
-            "sub config { \\%%defs }\n"
-            "\n"
-           );
-}
-
-static void
-chaz_ConfWriterPerl_clean_up(void) {
-    /* Write the last bit of Charmony.pm and close. */
-    fprintf(chaz_CWPerl.fh, "\n1;\n\n");
-    if (fclose(chaz_CWPerl.fh)) {
-        chaz_Util_die("Couldn't close 'Charmony.pm': %s", strerror(errno));
-    }
-}
-
-static void
-chaz_ConfWriterPerl_vappend_conf(const char *fmt, va_list args) {
-    (void)fmt;
-    (void)args;
-}
-
-static char*
-chaz_ConfWriterPerl_quotify(const char *string, char *buf, size_t buf_size) {
-    char *quoted = buf;
-
-    /* Don't bother with undef values here. */
-    if (!string) {
-        return NULL;
-    }
-
-    /* Allocate memory if necessary. */
-    {
-        const char *ptr;
-        size_t space = 3; /* Quotes plus NUL termination. */
-        for (ptr = string; *ptr; ptr++) {
-            if (*ptr == '\'' || *ptr == '\\') {
-                space += 2;
-            }
-            else {
-                space += 1;
-            }
-        }
-        if (space > buf_size) {
-            quoted = (char*)malloc(space);
-        }
-    }
-
-    /* Perform copying and escaping */
-    {
-        const char *ptr;
-        size_t pos = 0;
-        quoted[pos++] = '\'';
-        for (ptr = string; *ptr; ptr++) {
-            if (*ptr == '\'' || *ptr == '\\') {
-                quoted[pos++] = '\\';
-            }
-            quoted[pos++] = *ptr;
-        }
-        quoted[pos++] = '\'';
-        quoted[pos++] = '\0';
-    }
-
-    return quoted;
-}
-
-#define CFPERL_MAX_BUF 100
-static void
-chaz_ConfWriterPerl_add_def(const char *sym, const char *value) {
-    char sym_buf[CFPERL_MAX_BUF + 1];
-    char value_buf[CFPERL_MAX_BUF + 1];
-    char *quoted_sym;
-    char *quoted_value;
-
-    /* Quote key. */
-    if (!sym) {
-        chaz_Util_die("Can't handle NULL key");
-    }
-    quoted_sym = chaz_ConfWriterPerl_quotify(sym, sym_buf, CFPERL_MAX_BUF);
-
-    /* Quote value or use "undef". */
-    if (!value) {
-        strcpy(value_buf, "undef");
-        quoted_value = value_buf;
-    }
-    else {
-        quoted_value = chaz_ConfWriterPerl_quotify(value, value_buf,
-                                                CFPERL_MAX_BUF);
-    }
-
-    fprintf(chaz_CWPerl.fh, "$defs{%s} = %s;\n", quoted_sym, quoted_value);
-
-    if (quoted_sym   != sym_buf)   { free(quoted_sym);   }
-    if (quoted_value != value_buf) { free(quoted_value); }
-}
-
-static void
-chaz_ConfWriterPerl_add_global_def(const char *sym, const char *value) {
-    (void)sym;
-    (void)value;
-}
-
-static void
-chaz_ConfWriterPerl_add_typedef(const char *type, const char *alias) {
-    (void)type;
-    (void)alias;
-}
-
-static void
-chaz_ConfWriterPerl_add_global_typedef(const char *type, const char *alias) {
-    (void)type;
-    (void)alias;
-}
-
-static void
-chaz_ConfWriterPerl_add_sys_include(const char *header) {
-    (void)header;
-}
-
-static void
-chaz_ConfWriterPerl_add_local_include(const char *header) {
-    (void)header;
-}
-
-static void
-chaz_ConfWriterPerl_start_module(const char *module_name) {
-    fprintf(chaz_CWPerl.fh, "# %s\n", module_name);
-}
-
-static void
-chaz_ConfWriterPerl_end_module(void) {
-    fprintf(chaz_CWPerl.fh, "\n");
-}
-
-
-/***************************************************************************/
-
-#line 17 "src/Charmonizer/Core/ConfWriterPython.c"
-/* #include "Charmonizer/Core/Util.h" */
-/* #include "Charmonizer/Core/ConfWriter.h" */
-/* #include "Charmonizer/Core/ConfWriterPython.h" */
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* Static vars. */
-static struct {
-    FILE *fh;
-} chaz_CWPython = { NULL };
-static chaz_ConfWriter CWPython_conf_writer;
-
-/* Open the charmony.py file handle.
- */
-static void
-chaz_ConfWriterPython_open_config_py(void);
-
-static void
-chaz_ConfWriterPython_clean_up(void);
-static void
-chaz_ConfWriterPython_vappend_conf(const char *fmt, va_list args);
-static void
-chaz_ConfWriterPython_add_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterPython_add_global_def(const char *sym, const char *value);
-static void
-chaz_ConfWriterPython_add_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterPython_add_global_typedef(const char *type, const char *alias);
-static void
-chaz_ConfWriterPython_add_sys_include(const char *header);
-static void
-chaz_ConfWriterPython_add_local_include(const char *header);
-static void
-chaz_ConfWriterPython_start_module(const char *module_name);
-static void
-chaz_ConfWriterPython_end_module(void);
-
-void
-chaz_ConfWriterPython_enable(void) {
-    CWPython_conf_writer.clean_up           = chaz_ConfWriterPython_clean_up;
-    CWPython_conf_writer.vappend_conf       = chaz_ConfWriterPython_vappend_conf;
-    CWPython_conf_writer.add_def            = chaz_ConfWriterPython_add_def;
-    CWPython_conf_writer.add_global_def     = chaz_ConfWriterPython_add_global_def;
-    CWPython_conf_writer.add_typedef        = chaz_ConfWriterPython_add_typedef;
-    CWPython_conf_writer.add_global_typedef = chaz_ConfWriterPython_add_global_typedef;
-    CWPython_conf_writer.add_sys_include    = chaz_ConfWriterPython_add_sys_include;
-    CWPython_conf_writer.add_local_include  = chaz_ConfWriterPython_add_local_include;
-    CWPython_conf_writer.start_module       = chaz_ConfWriterPython_start_module;
-    CWPython_conf_writer.end_module         = chaz_ConfWriterPython_end_module;
-    chaz_ConfWriterPython_open_config_py();
-    chaz_ConfWriter_add_writer(&CWPython_conf_writer);
-    return;
-}
-
-static void
-chaz_ConfWriterPython_open_config_py(void) {
-    /* Open the filehandle. */
-    chaz_CWPython.fh = fopen("charmony.py", "w+");
-    if (chaz_CWPython.fh == NULL) {
-        chaz_Util_die("Can't open 'charmony.py': %s", strerror(errno));
-    }
-
-    /* Start the module. */
-    fprintf(chaz_CWPython.fh,
-            "# Auto-generated by Charmonizer. \n"
-            "# DO NOT EDIT THIS FILE!!\n"
-            "\n"
-            "class Charmony(object):\n"
-            "    @classmethod\n"
-            "    def config(cls):\n"
-            "        return cls.defs\n"
-            "\n"
-            "    defs = {}\n"
-            "\n"
-           );
-}
-
-static void
-chaz_ConfWriterPython_clean_up(void) {
-    /* No more code necessary to finish charmony.py, so just close. */
-    if (fclose(chaz_CWPython.fh)) {
-        chaz_Util_die("Couldn't close 'charmony.py': %s", strerror(errno));
-    }
-}
-
-static void
-chaz_ConfWriterPython_vappend_conf(const char *fmt, va_list args) {
-    (void)fmt;
-    (void)args;
-}
-
-static char*
-chaz_ConfWriterPython_quotify(const char *string, char *buf, size_t buf_size) {
-    char *quoted = buf;
-
-    /* Don't bother with NULL values here. */
-    if (!string) {
-        return NULL;
-    }
-
-    /* Allocate memory if necessary. */
-    {
-        const char *ptr;
-        size_t space = 3; /* Quotes plus NUL termination. */
-        for (ptr = string; *ptr; ptr++) {
-            if (*ptr == '\'' || *ptr == '\\') {
-                space += 2;
-            }
-            else {
-                space += 1;
-            }
-        }
-        if (space > buf_size) {
-            quoted = (char*)malloc(space);
-        }
-    }
-
-    /* Perform copying and escaping */
-    {
-        const char *ptr;
-        size_t pos = 0;
-        quoted[pos++] = '\'';
-        for (ptr = string; *ptr; ptr++) {
-            if (*ptr == '\'' || *ptr == '\\') {
-                quoted[pos++] = '\\';
-            }
-            quoted[pos++] = *ptr;
-        }
-        quoted[pos++] = '\'';
-        quoted[pos++] = '\0';
-    }
-
-    return quoted;
-}
-
-#define CFPYTHON_MAX_BUF 100
-static void
-chaz_ConfWriterPython_add_def(const char *sym, const char *value) {
-    char sym_buf[CFPYTHON_MAX_BUF + 1];
-    char value_buf[CFPYTHON_MAX_BUF + 1];
-    char *quoted_sym;
-    char *quoted_value;
-
-    /* Quote key. */
-    if (!sym) {
-        chaz_Util_die("Can't handle NULL key");
-    }
-    quoted_sym = chaz_ConfWriterPython_quotify(sym, sym_buf, CFPYTHON_MAX_BUF);
-
-    /* Quote value or use "None". */
-    if (!value) {
-        strcpy(value_buf, "None");
-        quoted_value = value_buf;
-    }
-    else {
-        quoted_value = chaz_ConfWriterPython_quotify(value, value_buf,
-                                                     CFPYTHON_MAX_BUF);
-    }
-
-    fprintf(chaz_CWPython.fh, "    defs[%s] = %s\n", quoted_sym, quoted_value);
-
-    if (quoted_sym   != sym_buf)   { free(quoted_sym);   }
-    if (quoted_value != value_buf) { free(quoted_value); }
-}
-
-static void
-chaz_ConfWriterPython_add_global_def(const char *sym, const char *value) {
-    (void)sym;
-    (void)value;
-}
-
-static void
-chaz_ConfWriterPython_add_typedef(const char *type, const char *alias) {
-    (void)type;
-    (void)alias;
-}
-
-static void
-chaz_ConfWriterPython_add_global_typedef(const char *type, const char *alias) {
-    (void)type;
-    (void)alias;
-}
-
-static void
-chaz_ConfWriterPython_add_sys_include(const char *header) {
-    (void)header;
-}
-
-static void
-chaz_ConfWriterPython_add_local_include(const char *header) {
-    (void)header;
-}
-
-static void
-chaz_ConfW

<TRUNCATED>

[lucy-commits] [11/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCRuby.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCRuby.c b/clownfish/compiler/src/CFCRuby.c
deleted file mode 100644
index b69b9d2..0000000
--- a/clownfish/compiler/src/CFCRuby.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCHierarchy.h"
-#include "CFCParcel.h"
-#include "CFCRuby.h"
-#include "CFCUtil.h"
-
-struct CFCRuby {
-    CFCBase base;
-    CFCParcel *parcel;
-    CFCHierarchy *hierarchy;
-    char *lib_dir;
-    char *boot_class;
-    char *header;
-    char *footer;
-    char *boot_h_file;
-    char *boot_c_file;
-    char *boot_h_path;
-    char *boot_c_path;
-    char *boot_func;
-};
-
-// Modify a string in place, swapping out "::" for the supplied character.
-static void
-S_replace_double_colons(char *text, char replacement);
-
-static const CFCMeta CFCRUBY_META = {
-    "Clownfish::CFC::Binding::Ruby",
-    sizeof(CFCRuby),
-    (CFCBase_destroy_t)CFCRuby_destroy
-};
-
-CFCRuby*
-CFCRuby_new(CFCParcel *parcel, CFCHierarchy *hierarchy, const char *lib_dir,
-            const char *boot_class, const char *header, const char *footer) {
-    CFCRuby *self = (CFCRuby*)CFCBase_allocate(&CFCRUBY_META);
-    return CFCRuby_init(self, parcel, hierarchy, lib_dir, boot_class, header,
-                        footer);
-}
-
-CFCRuby*
-CFCRuby_init(CFCRuby *self, CFCParcel *parcel, CFCHierarchy *hierarchy,
-             const char *lib_dir, const char *boot_class, const char *header,
-             const char *footer) {
-    CFCUTIL_NULL_CHECK(parcel);
-    CFCUTIL_NULL_CHECK(hierarchy);
-    CFCUTIL_NULL_CHECK(lib_dir);
-    CFCUTIL_NULL_CHECK(boot_class);
-    CFCUTIL_NULL_CHECK(header);
-    CFCUTIL_NULL_CHECK(footer);
-    self->parcel     = (CFCParcel*)CFCBase_incref((CFCBase*)parcel);
-    self->hierarchy  = (CFCHierarchy*)CFCBase_incref((CFCBase*)hierarchy);
-    self->lib_dir    = CFCUtil_strdup(lib_dir);
-    self->boot_class = CFCUtil_strdup(boot_class);
-    self->header     = CFCUtil_strdup(header);
-    self->footer     = CFCUtil_strdup(footer);
-
-    const char *prefix   = CFCParcel_get_prefix(parcel);
-    const char *inc_dest = CFCHierarchy_get_include_dest(hierarchy);
-    const char *src_dest = CFCHierarchy_get_source_dest(hierarchy);
-    self->boot_h_file = CFCUtil_sprintf("%sboot.h", prefix);
-    self->boot_c_file = CFCUtil_sprintf("%sboot.c", prefix);
-    self->boot_h_path = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s", inc_dest,
-                                        self->boot_h_file);
-    self->boot_c_path = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s", src_dest,
-                                        self->boot_c_file);
-    self->boot_func = CFCUtil_sprintf("%s%s_bootstrap", prefix, boot_class);
-
-    for (int i = 0; self->boot_func[i] != 0; i++) {
-        if (!isalnum(self->boot_func[i])) {
-            self->boot_func[i] = '_';
-        }
-    }
-
-    return self;
-}
-
-void
-CFCRuby_destroy(CFCRuby *self) {
-    CFCBase_decref((CFCBase*)self->parcel);
-    CFCBase_decref((CFCBase*)self->hierarchy);
-    FREEMEM(self->lib_dir);
-    FREEMEM(self->boot_class);
-    FREEMEM(self->header);
-    FREEMEM(self->footer);
-    FREEMEM(self->boot_h_file);
-    FREEMEM(self->boot_c_file);
-    FREEMEM(self->boot_h_path);
-    FREEMEM(self->boot_c_path);
-    FREEMEM(self->boot_func);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-static void
-S_replace_double_colons(char *text, char replacement) {
-    size_t pos = 0;
-    for (char *ptr = text; *ptr != '\0'; ptr++) {
-        if (strncmp(ptr, "::", 2) == 0) {
-            text[pos++] = replacement;
-            ptr++;
-        }
-        else {
-            text[pos++] = *ptr;
-        }
-    }
-    text[pos] = '\0';
-}
-
-static void
-S_write_boot_h(CFCRuby *self) {
-    char *guard = CFCUtil_cat(CFCUtil_strdup(""), self->boot_class,
-                              "_BOOT", NULL);
-    S_replace_double_colons(guard, '_');
-    for (char *ptr = guard; *ptr != '\0'; ptr++) {
-        if (isalpha(*ptr)) {
-            *ptr = toupper(*ptr);
-        }
-    }
-
-    const char pattern[] = 
-        "%s\n"
-        "\n"
-        "#ifndef %s\n"
-        "#define %s 1\n"
-        "\n"
-        "void\n"
-        "%s();\n"
-        "\n"
-        "#endif /* %s */\n"
-        "\n"
-        "%s\n";
-
-    size_t size = sizeof(pattern)
-                  + strlen(self->header)
-                  + strlen(guard)
-                  + strlen(guard)
-                  + strlen(self->boot_func)
-                  + strlen(guard)
-                  + strlen(self->footer)
-                  + 20;
-    char *content = (char*)MALLOCATE(size);
-    sprintf(content, pattern, self->header, guard, guard, self->boot_func,
-            guard, self->footer);
-    CFCUtil_write_file(self->boot_h_path, content, strlen(content));
-
-    FREEMEM(content);
-    FREEMEM(guard);
-}
-
-static void
-S_write_boot_c(CFCRuby *self) {
-    CFCClass **ordered   = CFCHierarchy_ordered_classes(self->hierarchy);
-    char *pound_includes = CFCUtil_strdup("");
-    const char *prefix   = CFCParcel_get_prefix(self->parcel);
-
-    for (size_t i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        if (CFCClass_included(klass)) { continue; }
-
-        const char *include_h  = CFCClass_include_h(klass);
-        pound_includes = CFCUtil_cat(pound_includes, "#include \"",
-                                     include_h, "\"\n", NULL);
-
-        if (CFCClass_inert(klass)) { continue; }
-
-        CFCClass *parent = CFCClass_get_parent(klass);
-        if (parent) {
-            /* Need to implement */
-        }
-    }
-
-    const char pattern[] =
-        "%s\n"
-        "\n"
-        "#include \"charmony.h\"\n"
-        "#include \"%s\"\n"
-        "#include \"%sparcel.h\"\n"
-        "#include \"Clownfish/String.h\"\n"
-        "#include \"Clownfish/VTable.h\"\n"
-        "%s\n"
-        "\n"
-        "void\n"
-        "%s() {\n"
-        "    %sbootstrap_parcel();\n"
-        "\n"
-        "    cfish_StackString *alias = CFISH_SSTR_WRAP_UTF8(\"\", 0);\n"
-        "}\n"
-        "\n"
-        "%s\n"
-        "\n";
-
-    char *content
-        = CFCUtil_sprintf(pattern, self->header, self->boot_h_file, prefix,
-                          pound_includes, self->boot_func, prefix,
-                          self->footer);
-    CFCUtil_write_file(self->boot_c_path, content, strlen(content));
-
-    FREEMEM(content);
-    FREEMEM(pound_includes);
-    FREEMEM(ordered);
-}
-
-void
-CFCRuby_write_boot(CFCRuby *self) {
-    S_write_boot_h(self);
-    S_write_boot_c(self);
-}
-
-void
-CFCRuby_write_hostdefs(CFCRuby *self) {
-    const char pattern[] =
-        "%s\n"
-        "\n"
-        "#ifndef H_CFISH_HOSTDEFS\n"
-        "#define H_CFISH_HOSTDEFS 1\n"
-        "\n"
-        "/* Refcount / host object */\n"
-        "typedef union {\n"
-        "    size_t  count;\n"
-        "    void   *host_obj;\n"
-        "} cfish_ref_t;\n"
-        "\n"
-        "#define CFISH_OBJ_HEAD\\\n"
-        "   cfish_ref_t ref;\n"
-        "\n"
-        "#endif /* H_CFISH_HOSTDEFS */\n"
-        "\n"
-        "%s\n";
-    char *content
-        = CFCUtil_sprintf(pattern, self->header, self->footer);
-
-    // Unlink then write file.
-    const char *inc_dest = CFCHierarchy_get_include_dest(self->hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "cfish_hostdefs.h",
-                                     inc_dest);
-    remove(filepath);
-    CFCUtil_write_file(filepath, content, strlen(content));
-    FREEMEM(filepath);
-
-    FREEMEM(content);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCRuby.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCRuby.h b/clownfish/compiler/src/CFCRuby.h
deleted file mode 100644
index ebe2cfa..0000000
--- a/clownfish/compiler/src/CFCRuby.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCRUBY
-#define H_CFCRUBY
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCRuby CFCRuby;
-struct CFCParcel;
-struct CFCHierarchy;
-
-/** Clownfish::CFC::Binding::Ruby - Perl bindings for a
- * Clownfish::CFC::Model::Hierarchy.
- * 
- * Clownfish::CFC::Binding::Ruby presents an interface for auto-generating XS
- * and Perl code to bind C code for a Clownfish class hierarchy to Perl.
- * 
- * In theory this module could be much more flexible and its API could be more
- * elegant.  There are many ways which you could walk the parsed parcels,
- * classes, methods, etc. in a Clownfish::CFC::Model::Hierarchy and generate
- * binding code.  However, our needs are very limited, so we are content with
- * a "one size fits one" solution.
- * 
- * In particular, this module assumes that the XS bindings for all classes in
- * the hierarchy should be assembled into a single shared object which belongs
- * to the primary, "boot" class.  There's no reason why it could not write one
- * .xs file per class, or one per parcel, instead.
- * 
- * The files written by this class are derived from the name of the boot class.
- * If it is "Crustacean", the following files will be generated.
- * 
- *     # Generated by write_bindings()
- *     $lib_dir/Crustacean.xs
- * 
- *     # Generated by write_boot()
- *     $hierarchy_dest_dir/crust_boot.h
- *     $hierarchy_dest_dir/crust_boot.c
- */
-
-/** 
- * @param parcel The L<Clownfish::CFC::Model::Parcel> to which the
- * C<boot_class> belongs.
- * @param hierarchy A Clownfish::CFC::Model::Hierarchy.
- * @param lib_dir location of the Perl lib directory to which files will be
- * written.
- * @param boot_class The name of the main class, which will own the shared
- * object.
- * @param header Text which will be prepended to generated C/XS files --
- * typically, an "autogenerated file" warning.
- * @param footer Text to be appended to the end of generated C/XS files --
- * typically copyright information.
- */
-CFCRuby*
-CFCRuby_new(struct CFCParcel *parcel, struct CFCHierarchy *hierarchy,
-            const char *lib_dir, const char *boot_class, const char *header,
-            const char *footer);
-
-CFCRuby*
-CFCRuby_init(CFCRuby *self, struct CFCParcel *parcel,
-             struct CFCHierarchy *hierarchy, const char *lib_dir,
-             const char *boot_class, const char *header, const char *footer);
-
-void
-CFCRuby_destroy(CFCRuby *self);
-
-/** Write out "boot" files to the Hierarchy's "dest_dir" which contain code
- * for bootstrapping Clownfish classes.
- */
-void
-CFCRuby_write_boot(CFCRuby *self);
-
-/** Write out cfish_hostdefs.h file.
- */
-void
-CFCRuby_write_hostdefs(CFCRuby *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPERL */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCSymbol.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCSymbol.c b/clownfish/compiler/src/CFCSymbol.c
deleted file mode 100644
index 4d06677..0000000
--- a/clownfish/compiler/src/CFCSymbol.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <ctype.h>
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-#define CFC_NEED_SYMBOL_STRUCT_DEF
-#include "CFCSymbol.h"
-#include "CFCParcel.h"
-#include "CFCUtil.h"
-
-static const CFCMeta CFCSYMBOL_META = {
-    "Clownfish::CFC::Model::Symbol",
-    sizeof(CFCSymbol),
-    (CFCBase_destroy_t)CFCSymbol_destroy
-};
-
-CFCSymbol*
-CFCSymbol_new(struct CFCParcel *parcel, const char *exposure,
-              const char *class_name, const char *class_cnick,
-              const char *micro_sym) {
-    CFCSymbol *self = (CFCSymbol*)CFCBase_allocate(&CFCSYMBOL_META);
-    return CFCSymbol_init(self, parcel, exposure, class_name, class_cnick,
-                          micro_sym);
-}
-
-static int
-S_validate_exposure(const char *exposure) {
-    if (!exposure) { return false; }
-    if (strcmp(exposure, "public")
-        && strcmp(exposure, "parcel")
-        && strcmp(exposure, "private")
-        && strcmp(exposure, "local")
-       ) {
-        return false;
-    }
-    return true;
-}
-
-static int
-S_validate_class_name(const char *class_name) {
-    // The last component must contain lowercase letters (for now).
-    const char *last_colon = strrchr(class_name, ':');
-    const char *substring = last_colon ? last_colon + 1 : class_name;
-    for (;;substring++) {
-        if (*substring == 0)          { return false; }
-        else if (*substring == ':')   { return false; }
-        else if (islower(*substring)) { break; }
-    }
-
-    // Must be UpperCamelCase, separated by "::".
-    const char *ptr = class_name;
-    if (!isupper(*ptr)) { return false; }
-    while (*ptr != 0) {
-        if (*ptr == 0) { break; }
-        else if (*ptr == ':') {
-            ptr++;
-            if (*ptr != ':') { return false; }
-            ptr++;
-            if (!isupper(*ptr)) { return false; }
-            ptr++;
-        }
-        else if (!isalnum(*ptr)) { return false; }
-        else { ptr++; }
-    }
-
-    return true;
-}
-
-int
-CFCSymbol_validate_class_name_component(const char *name) {
-    if (!name || !strlen(name)) { return false; }
-    if (!S_validate_class_name(name)) { return false; }
-    if (strchr(name, ':') != NULL) { return false; }
-    return true;
-}
-
-static int
-S_validate_class_cnick(const char *class_cnick) {
-    // Allow all caps.
-    const char *ptr;
-    for (ptr = class_cnick; ; ptr++) {
-        if (*ptr == 0) {
-            if (strlen(class_cnick)) { return true; }
-            else { break; }
-        }
-        else if (!isupper(*ptr)) { break; }
-    }
-
-    // Same as one component of a class name.
-    return CFCSymbol_validate_class_name_component(class_cnick);
-}
-
-static int
-S_validate_identifier(const char *identifier) {
-    const char *ptr = identifier;
-    if (!isalpha(*ptr) && *ptr != '_') { return false; }
-    for (; *ptr != 0; ptr++) {
-        if (!isalnum(*ptr) && *ptr != '_') { return false; }
-    }
-    return true;
-}
-
-CFCSymbol*
-CFCSymbol_init(CFCSymbol *self, struct CFCParcel *parcel,
-               const char *exposure, const char *class_name,
-               const char *class_cnick, const char *micro_sym) {
-    // Validate.
-    CFCUTIL_NULL_CHECK(parcel);
-    if (!S_validate_exposure(exposure)) {
-        CFCBase_decref((CFCBase*)self);
-        CFCUtil_die("Invalid exposure: '%s'", exposure ? exposure : "[NULL]");
-    }
-    if (class_name && !S_validate_class_name(class_name)) {
-        CFCBase_decref((CFCBase*)self);
-        CFCUtil_die("Invalid class_name: '%s'", class_name);
-    }
-    if (!micro_sym || !S_validate_identifier(micro_sym)) {
-        CFCBase_decref((CFCBase*)self);
-        CFCUtil_die("Invalid micro_sym: '%s'",  micro_sym ? micro_sym : "[NULL]");
-    }
-
-    // Derive class_cnick if necessary, then validate.
-    const char *real_cnick = NULL;
-    if (class_name) {
-        if (class_cnick) {
-            real_cnick = class_cnick;
-        }
-        else {
-            const char *last_colon = strrchr(class_name, ':');
-            real_cnick = last_colon ? last_colon + 1 : class_name;
-        }
-    }
-    else if (class_cnick) {
-        // Sanity check class_cnick without class_name.
-        CFCBase_decref((CFCBase*)self);
-        CFCUtil_die("Can't supply class_cnick without class_name");
-    }
-    else {
-        real_cnick = NULL;
-    }
-    if (real_cnick && !S_validate_class_cnick(real_cnick)) {
-        CFCBase_decref((CFCBase*)self);
-        CFCUtil_die("Invalid class_cnick: '%s'", real_cnick);
-    }
-
-    // Assign.
-    self->parcel      = (CFCParcel*)CFCBase_incref((CFCBase*)parcel);
-    self->exposure    = CFCUtil_strdup(exposure);
-    self->class_name  = CFCUtil_strdup(class_name);
-    self->class_cnick = CFCUtil_strdup(real_cnick);
-    self->micro_sym   = CFCUtil_strdup(micro_sym);
-
-    // Derive short_sym and full_sym.
-    char *cnick = self->class_cnick ? self->class_cnick : "";
-    self->short_sym = CFCUtil_sprintf("%s_%s", cnick, micro_sym);
-    self->full_sym
-        = CFCUtil_sprintf("%s%s", CFCParcel_get_prefix(self->parcel),
-                          self->short_sym);
-
-    return self;
-}
-
-void
-CFCSymbol_destroy(CFCSymbol *self) {
-    CFCBase_decref((CFCBase*)self->parcel);
-    FREEMEM(self->exposure);
-    FREEMEM(self->class_name);
-    FREEMEM(self->class_cnick);
-    FREEMEM(self->micro_sym);
-    FREEMEM(self->short_sym);
-    FREEMEM(self->full_sym);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-int
-CFCSymbol_equals(CFCSymbol *self, CFCSymbol *other) {
-    if (strcmp(self->micro_sym, other->micro_sym) != 0) { return false; }
-    if (!CFCParcel_equals(self->parcel, other->parcel)) { return false; }
-    if (strcmp(self->exposure, other->exposure) != 0) { return false; }
-    if (self->class_name) {
-        if (!other->class_name) { return false; }
-        if (strcmp(self->class_name, other->class_name) != 0) {
-            return false;
-        }
-    }
-    else if (other->class_name) {
-        return false;
-    }
-    return true;
-}
-
-int
-CFCSymbol_public(CFCSymbol *self) {
-    return !strcmp(self->exposure, "public");
-}
-
-int
-CFCSymbol_parcel(CFCSymbol *self) {
-    return !strcmp(self->exposure, "parcel");
-}
-
-int
-CFCSymbol_private(CFCSymbol *self) {
-    return !strcmp(self->exposure, "private");
-}
-
-int
-CFCSymbol_local(CFCSymbol *self) {
-    return !strcmp(self->exposure, "local");
-}
-
-const char*
-CFCSymbol_full_sym(CFCSymbol *self) {
-    return self->full_sym;
-}
-
-const char*
-CFCSymbol_short_sym(CFCSymbol *self) {
-    return self->short_sym;
-}
-
-struct CFCParcel*
-CFCSymbol_get_parcel(CFCSymbol *self) {
-    return self->parcel;
-}
-
-const char*
-CFCSymbol_get_class_name(CFCSymbol *self) {
-    return self->class_name;
-}
-
-const char*
-CFCSymbol_get_class_cnick(CFCSymbol *self) {
-    return self->class_cnick;
-}
-
-const char*
-CFCSymbol_get_exposure(CFCSymbol *self) {
-    return self->exposure;
-}
-
-const char*
-CFCSymbol_micro_sym(CFCSymbol *self) {
-    return self->micro_sym;
-}
-
-const char*
-CFCSymbol_get_prefix(CFCSymbol *self) {
-    return CFCParcel_get_prefix(self->parcel);
-}
-
-const char*
-CFCSymbol_get_Prefix(CFCSymbol *self) {
-    return CFCParcel_get_Prefix(self->parcel);
-}
-
-const char*
-CFCSymbol_get_PREFIX(CFCSymbol *self) {
-    return CFCParcel_get_PREFIX(self->parcel);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCSymbol.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCSymbol.h b/clownfish/compiler/src/CFCSymbol.h
deleted file mode 100644
index 2777c2c..0000000
--- a/clownfish/compiler/src/CFCSymbol.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::Symbol - Base class for Clownfish symbols.
- *
- * Clownfish::CFC::Model::Symbol serves as a parent class for entities which
- * may live in the global namespace, such as classes, functions, methods, and
- * variables.
- */
-
-#ifndef H_CFCSYMBOL
-#define H_CFCSYMBOL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCSymbol CFCSymbol;
-struct CFCParcel;
-
-#ifdef CFC_NEED_SYMBOL_STRUCT_DEF
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-struct CFCSymbol {
-    CFCBase base;
-    struct CFCParcel *parcel;
-    char *exposure;
-    char *class_name;
-    char *class_cnick;
-    char *micro_sym;
-    char *short_sym;
-    char *full_sym;
-};
-#endif
-
-/** Return true if the supplied string is comprised solely of alphanumeric
- * characters, begins with an uppercase letter, and contains at least one
- * lower case letter.
- */
-int
-CFCSymbol_validate_class_name_component(const char *name);
-
-/**
- * @param parcel A Clownfish::CFC::Model::Parcel.  If not supplied, will be
- * assigned to the default Parcel.
- * @param exposure The scope in which the symbol is exposed.  Must be
- * 'public', 'parcel', 'private', or 'local'.
- * @param class_name A optional class name, consisting of one or more
- * components separated by "::".  Each component must start with a capital
- * letter, contain at least one lower-case letter, and consist entirely of the
- * characters [A-Za-z0-9].
- * @param class_cnick The C nickname associated with the supplied class
- * name.  If not supplied, will be derived if possible from C<class_name> by
- * extracting the last class name component.
- * @param micro_sym The local identifier for the symbol.
- */
-CFCSymbol*
-CFCSymbol_new(struct CFCParcel *parcel, const char *exposure, const char *class_name,
-              const char *class_cnick, const char *micro_sym);
-
-CFCSymbol*
-CFCSymbol_init(CFCSymbol *self, struct CFCParcel *parcel, const char *exposure,
-               const char *class_name, const char *class_cnick,
-               const char *micro_sym);
-
-void
-CFCSymbol_destroy(CFCSymbol *self);
-
-/** Return true if the symbols are "equal", false otherwise.
- */
-int
-CFCSymbol_equals(CFCSymbol *self, CFCSymbol *other);
-
-struct CFCParcel*
-CFCSymbol_get_parcel(CFCSymbol *self);
-
-// May be NULL.
-const char*
-CFCSymbol_get_class_name(CFCSymbol *self);
-
-// May be NULL.
-const char*
-CFCSymbol_get_class_cnick(CFCSymbol *self);
-
-const char*
-CFCSymbol_get_exposure(CFCSymbol *self);
-
-/** Return true if the Symbol's exposure is "public".
- */
-int
-CFCSymbol_public(CFCSymbol *self);
-
-/** Return true if the Symbol's exposure is "parcel".
- */
-int
-CFCSymbol_parcel(CFCSymbol *self);
-
-/** Return true if the Symbol's exposure is "private".
- */
-int
-CFCSymbol_private(CFCSymbol *self);
-
-/** Return true if the Symbol's exposure is "local".
- */
-int
-CFCSymbol_local(CFCSymbol *self);
-
-/** Accessor for the Symbol's micro_sym.
- */
-const char*
-CFCSymbol_micro_sym(CFCSymbol *self);
-
-/** Returns the C representation for the symbol minus the parcel's prefix,
- * e.g.  "Lobster_average_lifespan".
- */
-const char*
-CFCSymbol_short_sym(CFCSymbol *self);
-
-/** Returns the fully qualified C representation for the symbol, e.g.
- * "crust_Lobster_average_lifespan".
- */
-const char*
-CFCSymbol_full_sym(CFCSymbol *self);
-
-/** Get the Symbol's all-lowercase prefix, delegating to <code>parcel</code>.
- */
-const char*
-CFCSymbol_get_prefix(CFCSymbol *self);
-
-/** Get the Symbol's Titlecase prefix, delegating to <code>parcel</code>.
- */
-const char*
-CFCSymbol_get_Prefix(CFCSymbol *self);
-
-/** Get the Symbol's all-uppercase prefix, delegating to <code>parcel</code>.
- */
-const char*
-CFCSymbol_get_PREFIX(CFCSymbol *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCSYMBOL */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTest.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTest.c b/clownfish/compiler/src/CFCTest.c
deleted file mode 100644
index 21cff48..0000000
--- a/clownfish/compiler/src/CFCTest.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#define CFC_USE_TEST_MACROS
-#include "CFCTest.h"
-#include "CFCBase.h"
-#include "CFCParser.h"
-#include "CFCUtil.h"
-
-typedef struct CFCTestFormatter {
-    void (*batch_prologue)(const CFCTestBatch *batch);
-    void (*vtest_result)(int pass, int test_num, const char *fmt,
-                         va_list args);
-    void (*test_comment)(const char *fmt, ...);
-    void (*batch_comment)(const char *fmt, ...);
-    void (*summary)(const CFCTest *test);
-} CFCTestFormatter;
-
-struct CFCTest {
-    CFCBase base;
-    const CFCTestFormatter *formatter;
-    int num_tests;
-    int num_tests_failed;
-    int num_batches;
-    int num_batches_failed;
-    int num_tests_in_batch;
-    int num_failed_in_batch;
-};
-
-static int
-S_do_run_batch(CFCTest *self, const CFCTestBatch *batch);
-
-static void
-S_vtest_true(CFCTest *self, int cond, const char *fmt, va_list args);
-
-static void
-S_format_cfish_batch_prologue(const CFCTestBatch *batch);
-
-static void
-S_format_cfish_vtest_result(int pass, int test_num, const char *fmt,
-                            va_list args);
-
-static void
-S_format_cfish_test_comment(const char *fmt, ...);
-
-static void
-S_format_cfish_batch_comment(const char *fmt, ...);
-
-static void
-S_format_cfish_summary(const CFCTest *test);
-
-static void
-S_format_tap_batch_prologue(const CFCTestBatch *batch);
-
-static void
-S_format_tap_vtest_result(int pass, int test_num, const char *fmt,
-                          va_list args);
-
-static void
-S_format_tap_test_comment(const char *fmt, ...);
-
-static void
-S_format_tap_batch_comment(const char *fmt, ...);
-
-static void
-S_format_tap_summary(const CFCTest *test);
-
-static const CFCMeta CFCTEST_META = {
-    "Clownfish::CFC::Test",
-    sizeof(CFCTest),
-    (CFCBase_destroy_t)CFCTest_destroy
-};
-
-static const CFCTestFormatter S_formatter_cfish = {
-    S_format_cfish_batch_prologue,
-    S_format_cfish_vtest_result,
-    S_format_cfish_test_comment,
-    S_format_cfish_batch_comment,
-    S_format_cfish_summary
-};
-
-static const CFCTestFormatter S_formatter_tap = {
-    S_format_tap_batch_prologue,
-    S_format_tap_vtest_result,
-    S_format_tap_test_comment,
-    S_format_tap_batch_comment,
-    S_format_tap_summary
-};
-
-static const CFCTestBatch *const S_batches[] = {
-    &CFCTEST_BATCH_UTIL,
-    &CFCTEST_BATCH_DOCU_COMMENT,
-    &CFCTEST_BATCH_SYMBOL,
-    &CFCTEST_BATCH_VERSION,
-    &CFCTEST_BATCH_TYPE,
-    &CFCTEST_BATCH_FUNCTION,
-    &CFCTEST_BATCH_METHOD,
-    &CFCTEST_BATCH_VARIABLE,
-    &CFCTEST_BATCH_PARAM_LIST,
-    &CFCTEST_BATCH_FILE_SPEC,
-    &CFCTEST_BATCH_CLASS,
-    &CFCTEST_BATCH_C_BLOCK,
-    &CFCTEST_BATCH_PARCEL,
-    &CFCTEST_BATCH_FILE,
-    &CFCTEST_BATCH_HIERARCHY,
-    &CFCTEST_BATCH_PARSER,
-    NULL
-};
-
-CFCTest*
-CFCTest_new(const char *formatter_name) {
-    CFCTest *self = (CFCTest*)CFCBase_allocate(&CFCTEST_META);
-    return CFCTest_init(self, formatter_name);
-}
-
-CFCTest*
-CFCTest_init(CFCTest *self, const char *formatter_name) {
-    if (strcmp(formatter_name, "clownfish") == 0) {
-        self->formatter = &S_formatter_cfish;
-    }
-    else if (strcmp(formatter_name, "tap") == 0) {
-        self->formatter = &S_formatter_tap;
-    }
-    else {
-        CFCUtil_die("Unknown formatter name '%s'", formatter_name);
-    }
-
-    self->num_tests           = 0;
-    self->num_tests_failed    = 0;
-    self->num_batches         = 0;
-    self->num_batches_failed  = 0;
-    self->num_tests_in_batch  = 0;
-    self->num_failed_in_batch = 0;
-
-    return self;
-}
-
-void
-CFCTest_destroy(CFCTest *self) {
-    CFCBase_destroy((CFCBase*)self);
-}
-
-int
-CFCTest_run_all(CFCTest *self) {
-    int failed = 0;
-
-    for (int i = 0; S_batches[i]; ++i) {
-        if (!S_do_run_batch(self, S_batches[i])) { failed = 1; }
-    }
-
-    return !failed;
-}
-
-int
-CFCTest_run_batch(CFCTest *self, const char *name) {
-    for (int i = 0; S_batches[i]; ++i) {
-        const CFCTestBatch *batch = S_batches[i];
-        if (strcmp(batch->name, name) == 0) {
-            return S_do_run_batch(self, batch);
-        }
-    }
-
-    CFCUtil_die("Test batch '%s' not found", name);
-    return 0;
-}
-
-static int
-S_do_run_batch(CFCTest *self, const CFCTestBatch *batch) {
-    self->formatter->batch_prologue(batch);
-
-    batch->run(self);
-
-    int failed = 0;
-    void (*comment)(const char *fmt, ...) = self->formatter->batch_comment;
-
-    if (self->num_failed_in_batch > 0) {
-        failed = 1;
-        comment("%d/%d tests failed.\n", self->num_failed_in_batch,
-                self->num_tests_in_batch);
-    }
-    if (self->num_tests_in_batch != batch->num_planned) {
-        failed = 1;
-        comment("Bad plan: You planned %d tests but ran %d.\n",
-                batch->num_planned, self->num_tests_in_batch);
-    }
-
-    if (failed) {
-        self->num_batches_failed += 1;
-    }
-
-    self->num_batches += 1;
-    self->num_tests_in_batch  = 0;
-    self->num_failed_in_batch = 0;
-
-    return !failed;
-}
-
-void
-CFCTest_test_true(CFCTest *self, int cond, const char *fmt, ...) {
-    va_list args;
-    va_start(args, fmt);
-    S_vtest_true(self, cond, fmt, args);
-    va_end(args);
-}
-
-void
-CFCTest_test_string_equals(CFCTest *self, const char *result,
-                           const char *expected, const char *fmt, ...) {
-    int cond = (strcmp(result, expected) == 0);
-
-    va_list args;
-    va_start(args, fmt);
-    S_vtest_true(self, cond, fmt, args);
-    va_end(args);
-
-    if (!cond) {
-        self->formatter->test_comment("Expected '%s', got '%s'.\n",
-                                      expected, result);
-    }
-}
-
-void
-CFCTest_test_int_equals(CFCTest *self, long result, long expected,
-                        const char *fmt, ...) {
-    int cond = (result == expected);
-
-    va_list args;
-    va_start(args, fmt);
-    S_vtest_true(self, cond, fmt, args);
-    va_end(args);
-
-    if (!cond) {
-        self->formatter->test_comment("Expected '%ld', got '%ld'.\n",
-                                      expected, result);
-    }
-}
-
-void
-CFCTest_skip(CFCTest *self, int num) {
-    self->num_tests          += num;
-    self->num_tests_in_batch += num;
-}
-
-int
-CFCTest_finish(CFCTest *self) {
-    self->formatter->summary(self);
-
-    return self->num_batches != 0 && self->num_batches_failed == 0;
-}
-
-static void
-S_vtest_true(CFCTest *self, int cond, const char *fmt, va_list args) {
-    self->num_tests          += 1;
-    self->num_tests_in_batch += 1;
-
-    if (!cond) {
-        self->num_tests_failed    += 1;
-        self->num_failed_in_batch += 1;
-    }
-
-    self->formatter->vtest_result(cond, self->num_tests_in_batch, fmt, args);
-}
-
-static void
-S_format_cfish_batch_prologue(const CFCTestBatch *batch) {
-    printf("Testing %s...\n", batch->name);
-}
-
-static void
-S_format_cfish_vtest_result(int pass, int test_num, const char *fmt,
-                            va_list args) {
-    if (!pass) {
-        printf("  Failed test %d: ", test_num);
-        vprintf(fmt, args);
-        printf("\n");
-    }
-    else if (getenv("CFCTEST_VERBOSE")) {
-        printf("  Passed test %d: ", test_num);
-        vprintf(fmt, args);
-        printf("\n");
-    }
-}
-
-static void
-S_format_cfish_test_comment(const char *fmt, ...) {
-    printf("    ");
-
-    va_list args;
-    va_start(args, fmt);
-    vprintf(fmt, args);
-    va_end(args);
-}
-
-static void
-S_format_cfish_batch_comment(const char *fmt, ...) {
-    printf("  ");
-
-    va_list args;
-    va_start(args, fmt);
-    vprintf(fmt, args);
-    va_end(args);
-}
-
-static void
-S_format_cfish_summary(const CFCTest *test) {
-    if (test->num_batches == 0) {
-        printf("No tests planned or run.\n");
-    }
-    else if (test->num_batches_failed == 0) {
-        printf("%d batches passed. %d tests passed.\n",
-               test->num_batches, test->num_tests);
-        printf("Result: PASS\n");
-    }
-    else {
-        printf("%d/%d batches failed. %d/%d tests failed.\n",
-               test->num_batches_failed, test->num_batches,
-               test->num_tests_failed, test->num_tests);
-        printf("Result: FAIL\n");
-    }
-}
-
-static void
-S_format_tap_batch_prologue(const CFCTestBatch *batch) {
-    printf("1..%d\n", batch->num_planned);
-}
-
-static void
-S_format_tap_vtest_result(int pass, int test_num, const char *fmt,
-                          va_list args) {
-    const char *result = pass ? "ok" : "not ok";
-    printf("%s %d - ", result, test_num);
-    vprintf(fmt, args);
-    printf("\n");
-}
-
-static void
-S_format_tap_test_comment(const char *fmt, ...) {
-    printf("#   ");
-
-    va_list args;
-    va_start(args, fmt);
-    vprintf(fmt, args);
-    va_end(args);
-}
-
-static void
-S_format_tap_batch_comment(const char *fmt, ...) {
-    printf("# ");
-
-    va_list args;
-    va_start(args, fmt);
-    vprintf(fmt, args);
-    va_end(args);
-}
-
-static void
-S_format_tap_summary(const CFCTest *test) {
-    (void)test; // unused
-}
-
-struct CFCParcel*
-CFCTest_parse_parcel(CFCTest *test, CFCParser *parser, const char *src) {
-    CFCBase *result = CFCParser_parse(parser, src);
-    OK(test, result != NULL, "parse '%s'", src);
-    STR_EQ(test, CFCBase_get_cfc_class(result),
-           "Clownfish::CFC::Model::Parcel", "result class of '%s'", src);
-    return (struct CFCParcel*)result;
-}
-
-struct CFCType*
-CFCTest_parse_type(CFCTest *test, CFCParser *parser, const char *src) {
-    CFCBase *result = CFCParser_parse(parser, src);
-    OK(test, result != NULL, "parse '%s'", src);
-    STR_EQ(test, CFCBase_get_cfc_class(result),
-           "Clownfish::CFC::Model::Type", "result class of '%s'", src);
-    return (struct CFCType*)result;
-}
-
-struct CFCVariable*
-CFCTest_parse_variable(CFCTest *test, CFCParser *parser, const char *src) {
-    CFCBase *result = CFCParser_parse(parser, src);
-    OK(test, result != NULL, "parse '%s'", src);
-    STR_EQ(test, CFCBase_get_cfc_class(result),
-           "Clownfish::CFC::Model::Variable", "result class of '%s'", src);
-    return (struct CFCVariable*)result;
-}
-
-struct CFCParamList*
-CFCTest_parse_param_list(CFCTest *test, CFCParser *parser, const char *src) {
-    CFCBase *result = CFCParser_parse(parser, src);
-    OK(test, result != NULL, "parse '%s'", src);
-    STR_EQ(test, CFCBase_get_cfc_class(result),
-           "Clownfish::CFC::Model::ParamList", "result class of '%s'", src);
-    return (struct CFCParamList*)result;
-}
-
-struct CFCFunction*
-CFCTest_parse_function(CFCTest *test, CFCParser *parser, const char *src) {
-    CFCBase *result = CFCParser_parse(parser, src);
-    OK(test, result != NULL, "parse '%s'", src);
-    STR_EQ(test, CFCBase_get_cfc_class(result),
-           "Clownfish::CFC::Model::Function", "result class of '%s'", src);
-    return (struct CFCFunction*)result;
-}
-
-struct CFCMethod*
-CFCTest_parse_method(CFCTest *test, CFCParser *parser, const char *src) {
-    CFCBase *result = CFCParser_parse(parser, src);
-    OK(test, result != NULL, "parse '%s'", src);
-    STR_EQ(test, CFCBase_get_cfc_class(result),
-           "Clownfish::CFC::Model::Method", "result class of '%s'", src);
-    return (struct CFCMethod*)result;
-}
-
-struct CFCClass*
-CFCTest_parse_class(CFCTest *test, CFCParser *parser, const char *src) {
-    CFCBase *result = CFCParser_parse(parser, src);
-    OK(test, result != NULL, "parse class");
-    STR_EQ(test, CFCBase_get_cfc_class(result),
-           "Clownfish::CFC::Model::Class", "result class");
-    return (struct CFCClass*)result;
-}
-
-time_t
-CFCTest_get_file_mtime(const char *path) {
-    struct stat buf;
-    if (stat(path, &buf)) {
-        CFCUtil_die("Can't stat '%s': %s", path, strerror(errno));
-    }
-    return buf.st_mtime;
-}
-
-#if defined(CHY_HAS_UTIME_H)
-
-#include <utime.h>
-
-void
-CFCTest_set_file_times(const char *path, time_t time) {
-    struct utimbuf buf;
-    buf.actime  = time;
-    buf.modtime = time;
-    if (utime(path, &buf)) {
-        CFCUtil_die("Can't set file time of '%s': %s", path, strerror(errno));
-    }
-}
-
-#elif defined(CHY_HAS_WINDOWS_H)
-
-#include <windows.h>
-
-void
-CFCTest_set_file_times(const char *path, time_t time) {
-    HANDLE handle = CreateFile(path, GENERIC_WRITE, FILE_SHARE_READ, NULL,
-                               OPEN_EXISTING, 0, NULL);
-    if (handle == INVALID_HANDLE_VALUE) {
-        CFCUtil_die("Can't open '%s': %u", path, GetLastError());
-    }
-    uint64_t ticks = 10000000 * (UINT64_C(11644473600) + time);
-    FILETIME file_time;
-    file_time.dwLowDateTime  = (DWORD)ticks;
-    file_time.dwHighDateTime = (DWORD)(ticks >> 32);
-    if (!SetFileTime(handle, &file_time, &file_time, &file_time)) {
-        CFCUtil_die("Can't set file time of '%s': %u", path, GetLastError());
-    }
-    CloseHandle(handle);
-}
-
-#else
-
-#error Need either utime.h or windows.h
-
-#endif
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTest.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTest.h b/clownfish/compiler/src/CFCTest.h
deleted file mode 100644
index dbb3a17..0000000
--- a/clownfish/compiler/src/CFCTest.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Test - An object to collect results from test runs and
- * print summaries in multiple formats.
- */
-
-#ifndef H_CFCTEST
-#define H_CFCTEST
-
-#include <time.h>
-
-#ifdef CFC_USE_TEST_MACROS
-  #define OK      CFCTest_test_true
-  #define STR_EQ  CFCTest_test_string_equals
-  #define INT_EQ  CFCTest_test_int_equals
-#endif
-
-typedef struct CFCTest CFCTest;
-
-typedef struct CFCTestBatch {
-    const char *name;
-    int num_planned;
-    void (*run)(CFCTest *test);
-} CFCTestBatch;
-
-struct CFCClass;
-struct CFCFunction;
-struct CFCMethod;
-struct CFCParamList;
-struct CFCParcel;
-struct CFCParser;
-struct CFCType;
-struct CFCVariable;
-
-/** Create a new test object.
- *
- * @param formatter_name Name of the built-in formatter that should be used
- * to create the output. Supported values are "tap" for TAP output and
- * "clownfish" for the generic Clownfish format.
- * @return a new test object.
- */
-CFCTest*
-CFCTest_new(const char *formatter_name);
-
-CFCTest*
-CFCTest_init(CFCTest *self, const char *formatter_name);
-
-void
-CFCTest_destroy(CFCTest *self);
-
-/** Run all test batches.
- *
- * @return true if all tests were successful.
- */
-int
-CFCTest_run_all(CFCTest *self);
-
-/** Run a test batch by name.
- *
- * @param name Name of the test batch.
- * @return true if all tests in the batch were successful.
- */
-int
-CFCTest_run_batch(CFCTest *self, const char *name);
-
-/* Collect result of a test.
- *
- * @param cond Test condition. True if the test succeeded, false if it failed.
- * @param fmt printf-like format string describing the test.
- */
-void
-CFCTest_test_true(CFCTest *self, int cond, const char *fmt, ...);
-
-/* Test strings for equality and collect result.
- *
- * @param result Result string to be tested.
- * @param expected Expected result string.
- * @param fmt printf-like format string describing the test.
- */
-void
-CFCTest_test_string_equals(CFCTest *self, const char *result,
-                           const char *expected, const char *fmt, ...);
-
-/* Test integers for equality and collect result.
- *
- * @param result Result integer to be tested.
- * @param expected Expected result integer.
- * @param fmt printf-like format string describing the test.
- */
-void
-CFCTest_test_int_equals(CFCTest *self, long result, long expected,
-                        const char *fmt, ...);
-
-/* Skip tests.
- *
- * @param num Number of tests to skip.
- */
-void
-CFCTest_skip(CFCTest *self, int num);
-
-/* Finish testing.
- *
- * @return true if tests were run and all tests were successful.
- */
-int
-CFCTest_finish(CFCTest *self);
-
-/* Utility functions for tests. */
-
-struct CFCParcel*
-CFCTest_parse_parcel(CFCTest *test, struct CFCParser *parser, const char *src);
-
-struct CFCType*
-CFCTest_parse_type(CFCTest *test, struct CFCParser *parser, const char *src);
-
-struct CFCVariable*
-CFCTest_parse_variable(CFCTest *test, struct CFCParser *parser,
-                       const char *src);
-
-struct CFCParamList*
-CFCTest_parse_param_list(CFCTest *test, struct CFCParser *parser,
-                         const char *src);
-
-struct CFCFunction*
-CFCTest_parse_function(CFCTest *test, struct CFCParser *parser,
-                       const char *src);
-
-struct CFCMethod*
-CFCTest_parse_method(CFCTest *test, struct CFCParser *parser, const char *src);
-
-struct CFCClass*
-CFCTest_parse_class(CFCTest *test, struct CFCParser *parser, const char *src);
-
-time_t
-CFCTest_get_file_mtime(const char *path);
-
-void
-CFCTest_set_file_times(const char *path, time_t time);
-
-/* Test batch structs. */
-
-extern const CFCTestBatch CFCTEST_BATCH_CLASS;
-extern const CFCTestBatch CFCTEST_BATCH_C_BLOCK;
-extern const CFCTestBatch CFCTEST_BATCH_DOCU_COMMENT;
-extern const CFCTestBatch CFCTEST_BATCH_FILE;
-extern const CFCTestBatch CFCTEST_BATCH_FILE_SPEC;
-extern const CFCTestBatch CFCTEST_BATCH_FUNCTION;
-extern const CFCTestBatch CFCTEST_BATCH_HIERARCHY;
-extern const CFCTestBatch CFCTEST_BATCH_METHOD;
-extern const CFCTestBatch CFCTEST_BATCH_PARAM_LIST;
-extern const CFCTestBatch CFCTEST_BATCH_PARCEL;
-extern const CFCTestBatch CFCTEST_BATCH_PARSER;
-extern const CFCTestBatch CFCTEST_BATCH_SYMBOL;
-extern const CFCTestBatch CFCTEST_BATCH_TYPE;
-extern const CFCTestBatch CFCTEST_BATCH_UTIL;
-extern const CFCTestBatch CFCTEST_BATCH_VARIABLE;
-extern const CFCTestBatch CFCTEST_BATCH_VERSION;
-
-#endif /* H_CFCTEST */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestCBlock.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestCBlock.c b/clownfish/compiler/src/CFCTestCBlock.c
deleted file mode 100644
index 6061d44..0000000
--- a/clownfish/compiler/src/CFCTestCBlock.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCCBlock.h"
-#include "CFCParser.h"
-#include "CFCTest.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_C_BLOCK = {
-    "Clownfish::CFC::Model::CBlock",
-    4,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-
-    {
-        CFCCBlock *block = CFCCBlock_new("int foo;");
-        STR_EQ(test, CFCCBlock_get_contents(block), "int foo;",
-               "get_contents");
-        CFCBase_decref((CFCBase*)block);
-    }
-
-    {
-        const char *cblock_string =
-            " __C__\n"
-            "#define FOO_BAR 1\n"
-            "__END_C__  ";
-        CFCBase *result = CFCParser_parse(parser, cblock_string);
-        OK(test, result != NULL, "parse cblock");
-        STR_EQ(test, CFCBase_get_cfc_class(result),
-               "Clownfish::CFC::Model::CBlock", "result class of cblock");
-        CFCCBlock *block = (CFCCBlock*)result;
-        STR_EQ(test, CFCCBlock_get_contents(block), "#define FOO_BAR 1\n",
-               "parse embed_c");
-        CFCBase_decref((CFCBase*)block);
-    }
-
-    CFCBase_decref((CFCBase*)parser);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestClass.c b/clownfish/compiler/src/CFCTestClass.c
deleted file mode 100644
index e33d454..0000000
--- a/clownfish/compiler/src/CFCTestClass.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCFileSpec.h"
-#include "CFCFunction.h"
-#include "CFCMethod.h"
-#include "CFCParamList.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCSymbol.h"
-#include "CFCTest.h"
-#include "CFCType.h"
-#include "CFCUtil.h"
-#include "CFCVariable.h"
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-static void
-S_run_tests(CFCTest *test);
-
-static int
-S_has_symbol(CFCSymbol **symbols, const char *micro_sym);
-
-const CFCTestBatch CFCTEST_BATCH_CLASS = {
-    "Clownfish::CFC::Model::Class",
-    83,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-
-    CFCParcel *neato = CFCParcel_new("Neato", NULL, NULL, false);
-    CFCFileSpec *file_spec = CFCFileSpec_new(".", "Foo/FooJr", 0);
-    CFCClass *thing_class
-        = CFCTest_parse_class(test, parser, "class Thing {}");
-    CFCClass *widget_class
-        = CFCTest_parse_class(test, parser, "class Widget {}");
-
-    CFCVariable *thing;
-    CFCVariable *widget;
-    CFCFunction *tread_water;
-
-    {
-        CFCType *thing_type = CFCTest_parse_type(test, parser, "Thing*");
-        thing = CFCVariable_new(neato, NULL, "Foo", NULL, "thing",
-                                thing_type, 0);
-
-        CFCType *widget_type = CFCTest_parse_type(test, parser, "Widget*");
-        widget = CFCVariable_new(NULL, NULL, "Widget", NULL, "widget",
-                                 widget_type, 0);
-
-        CFCType *return_type = CFCTest_parse_type(test, parser, "void");
-        CFCParamList *param_list
-            = CFCTest_parse_param_list(test, parser, "()");
-        tread_water
-            = CFCFunction_new(neato, NULL, "Foo", NULL, "tread_water",
-                              return_type, param_list, NULL, 0);
-
-        CFCBase_decref((CFCBase*)thing_type);
-        CFCBase_decref((CFCBase*)widget_type);
-        CFCBase_decref((CFCBase*)return_type);
-        CFCBase_decref((CFCBase*)param_list);
-    }
-
-    CFCClass *foo
-        = CFCClass_create(neato, NULL, "Foo", NULL, NULL, NULL, NULL, NULL,
-                          0, 0);
-    CFCClass_add_function(foo, tread_water);
-    CFCClass_add_member_var(foo, thing);
-    CFCClass_add_inert_var(foo, widget);
-
-    {
-        CFCClass *should_be_foo = CFCClass_fetch_singleton(neato, "Foo");
-        OK(test, should_be_foo == foo, "fetch_singleton");
-    }
-
-    CFCClass *foo_jr
-        = CFCClass_create(neato, NULL, "Foo::FooJr", NULL, NULL, NULL, NULL,
-                          "Foo", 0, 0);
-    STR_EQ(test, CFCClass_get_struct_sym(foo_jr), "FooJr",
-           "get_struct_sym");
-    STR_EQ(test, CFCClass_full_struct_sym(foo_jr), "neato_FooJr",
-           "full_struct_sym");
-
-    CFCClass *final_foo
-        = CFCClass_create(neato, NULL, "Foo::FooJr::FinalFoo", NULL, NULL, NULL,
-                          file_spec, "Foo::FooJr", 1, 0);
-    OK(test, CFCClass_final(final_foo), "final");
-    STR_EQ(test, CFCClass_include_h(final_foo), "Foo/FooJr.h",
-           "include_h uses path_part");
-    STR_EQ(test, CFCClass_get_parent_class_name(final_foo), "Foo::FooJr",
-           "get_parent_class_name");
-
-    {
-        CFCParcel *parsed_neato
-            = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-        CFCBase_decref((CFCBase*)parsed_neato);
-    }
-
-    CFCParser_set_class_name(parser, "Foo");
-    CFCMethod *do_stuff
-        = CFCTest_parse_method(test, parser, "void Do_Stuff(Foo *self);");
-    CFCClass_add_method(foo, do_stuff);
-
-    CFCClass *class_list[6] = {
-        foo, foo_jr, final_foo, thing_class, widget_class, NULL
-    };
-    CFCClass_resolve_types(foo, class_list);
-    CFCClass_resolve_types(foo_jr, class_list);
-    CFCClass_resolve_types(final_foo, class_list);
-
-    CFCClass_add_child(foo, foo_jr);
-    CFCClass_add_child(foo_jr, final_foo);
-    CFCClass_grow_tree(foo);
-
-    OK(test, CFCClass_get_parent(foo_jr) == foo, "grow_tree, one level" );
-    OK(test, CFCClass_get_parent(final_foo) == foo_jr,
-       "grow_tree, two levels");
-    OK(test, CFCClass_fresh_method(foo, "Do_Stuff") == do_stuff,
-       "fresh_method");
-    OK(test, CFCClass_method(foo_jr, "Do_Stuff") == do_stuff,
-       "inherited method");
-    OK(test, CFCClass_fresh_method(foo_jr, "Do_Stuff") == NULL,
-       "inherited method not 'fresh'");
-    OK(test, CFCMethod_final(CFCClass_method(final_foo, "Do_Stuff")),
-       "Finalize inherited method");
-    OK(test, !CFCMethod_final(CFCClass_method(foo_jr, "Do_Stuff")),
-       "Don't finalize method in parent");
-
-    {
-        CFCVariable **inert_vars = CFCClass_inert_vars(foo);
-        OK(test, inert_vars[0] == widget, "inert_vars[0]");
-        OK(test, inert_vars[1] == NULL, "inert_vars[1]");
-
-        CFCFunction **functions = CFCClass_functions(foo);
-        OK(test, functions[0] == tread_water, "functions[0]");
-        OK(test, functions[1] == NULL, "functions[1]");
-
-        CFCMethod **methods = CFCClass_methods(foo);
-        OK(test, methods[0] == do_stuff, "methods[0]");
-        OK(test, methods[1] == NULL, "methods[1]");
-
-        CFCMethod **fresh_methods = CFCClass_fresh_methods(foo);
-        OK(test, fresh_methods[0] == do_stuff, "fresh_methods[0]");
-        OK(test, fresh_methods[1] == NULL, "fresh_methods[1]");
-
-        CFCVariable **fresh_member_vars = CFCClass_fresh_member_vars(foo);
-        OK(test, fresh_member_vars[0] == thing, "fresh_member_vars[0]");
-        OK(test, fresh_member_vars[1] == NULL, "fresh_member_vars[1]");
-
-        FREEMEM(fresh_methods);
-        FREEMEM(fresh_member_vars);
-    }
-
-    {
-        CFCVariable **member_vars = CFCClass_member_vars(foo_jr);
-        OK(test, member_vars[0] == thing, "member_vars[0]");
-        OK(test, member_vars[1] == NULL, "member_vars[1]");
-
-        CFCFunction **functions = CFCClass_functions(foo_jr);
-        OK(test, functions[0] == NULL, "functions[0]");
-
-        CFCVariable **fresh_member_vars = CFCClass_fresh_member_vars(foo_jr);
-        OK(test, fresh_member_vars[0] == NULL, "fresh_member_vars[0]");
-
-        CFCVariable **inert_vars = CFCClass_inert_vars(foo_jr);
-        OK(test, inert_vars[0] == NULL, "inert_vars[0]");
-
-        FREEMEM(fresh_member_vars);
-    }
-
-    {
-        CFCMethod **fresh_methods = CFCClass_fresh_methods(final_foo);
-        OK(test, fresh_methods[0] == NULL, "fresh_methods[0]");
-        FREEMEM(fresh_methods);
-    }
-
-    {
-        CFCClass **ladder = CFCClass_tree_to_ladder(foo);
-        OK(test, ladder[0] == foo, "ladder[0]");
-        OK(test, ladder[1] == foo_jr, "ladder[1]");
-        OK(test, ladder[2] == final_foo, "ladder[2]");
-        OK(test, ladder[3] == NULL, "ladder[3]");
-        FREEMEM(ladder);
-    }
-
-    {
-        CFCClass *final_class
-            = CFCTest_parse_class(test, parser, "final class Iamfinal { }");
-        OK(test, CFCClass_final(final_class), "class modifer: final");
-        CFCClass *inert_class
-            = CFCTest_parse_class(test, parser, "inert class Iaminert { }");
-        OK(test, CFCClass_inert(inert_class), "class modifer: inert");
-
-        CFCBase_decref((CFCBase*)final_class);
-        CFCBase_decref((CFCBase*)inert_class);
-    }
-
-    {
-        static const char *names[2] = { "Fooble", "Foo::FooJr::FooIII" };
-        for (int i = 0; i < 2; ++i) {
-            const char *name = names[i];
-            char *class_src
-                = CFCUtil_sprintf("class Fu::%s inherits %s { }", name, name);
-            CFCClass *klass = CFCTest_parse_class(test, parser, class_src);
-            STR_EQ(test, CFCClass_get_parent_class_name(klass), name,
-                   "class_inheritance: %s", name);
-            FREEMEM(class_src);
-            CFCBase_decref((CFCBase*)klass);
-        }
-    }
-
-    {
-        const char *class_src =
-            "public class Foo::Foodie cnick Foodie inherits Foo {\n"
-            "    int num;\n"
-            "}\n";
-        CFCClass *klass = CFCTest_parse_class(test, parser, class_src);
-        CFCSymbol **member_vars = (CFCSymbol**)CFCClass_member_vars(klass);
-        OK(test, S_has_symbol(member_vars, "num"),
-           "parsed member var");
-
-        CFCBase_decref((CFCBase*)klass);
-    }
-
-    {
-        const char *class_src =
-            "/**\n"
-            " * Bow wow.\n"
-            " *\n"
-            " * Wow wow wow.\n"
-            " */\n"
-            "public class Animal::Dog inherits Animal {\n"
-            "    public inert Dog* init(Dog *self, String *name,\n"
-            "                           String *fave_food);\n"
-            "    inert uint32_t count();\n"
-            "    inert uint64_t num_dogs;\n"
-            "    public inert Dog *top_dog;\n"
-            "\n"
-            "    String  *name;\n"
-            "    bool     likes_to_go_fetch;\n"
-            "    ChewToy *squishy;\n"
-            "    Owner   *mom;\n"
-            "\n"
-            "    void               Destroy(Dog *self);\n"
-            "    public String*     Bark(Dog *self);\n"
-            "    public void        Eat(Dog *self);\n"
-            "    public void        Bite(Dog *self, Enemy *enemy);\n"
-            "    public Thing      *Fetch(Dog *self, Thing *thing);\n"
-            "    public final void  Bury(Dog *self, Bone *bone);\n"
-            "    public abstract incremented nullable Thing*\n"
-            "    Scratch(Dog *self);\n"
-            "\n"
-            "    int32_t[1]  flexible_array_at_end_of_struct;\n"
-            "}\n";
-        CFCClass *klass = CFCTest_parse_class(test, parser, class_src);
-
-        CFCSymbol **inert_vars  = (CFCSymbol**)CFCClass_inert_vars(klass);
-        CFCSymbol **member_vars = (CFCSymbol**)CFCClass_member_vars(klass);
-        CFCSymbol **functions   = (CFCSymbol**)CFCClass_functions(klass);
-        CFCSymbol **methods     = (CFCSymbol**)CFCClass_methods(klass);
-        OK(test, S_has_symbol(inert_vars, "num_dogs"), "parsed inert var");
-        OK(test, S_has_symbol(inert_vars, "top_dog"), "parsed public inert var");
-        OK(test, S_has_symbol(member_vars, "mom"), "parsed member var");
-        OK(test, S_has_symbol(member_vars, "squishy"), "parsed member var");
-        OK(test, S_has_symbol(functions, "init"), "parsed function");
-        OK(test, S_has_symbol(methods, "destroy"), "parsed parcel method");
-        OK(test, S_has_symbol(methods, "bury"), "parsed public method");
-        OK(test, S_has_symbol(methods, "scratch"),
-           "parsed public abstract nullable method");
-
-        CFCMethod *scratch = CFCClass_method(klass, "scratch");
-        OK(test, scratch != NULL, "find method 'scratch'");
-        OK(test, CFCType_nullable(CFCMethod_get_return_type(scratch)),
-           "public abstract incremented nullable flagged as nullable");
-
-        int num_public_methods = 0;
-        for (int i = 0; methods[i]; ++i) {
-            if (CFCSymbol_public(methods[i])) { ++num_public_methods; }
-        }
-        INT_EQ(test, num_public_methods, 6, "pass acl to Method constructor");
-
-        CFCBase_decref((CFCBase*)klass);
-    }
-
-    {
-        const char *class_src =
-            "inert class Rigor::Mortis cnick Mort {\n"
-            "    inert void lie_still();\n"
-            "}\n";
-        CFCClass *klass = CFCTest_parse_class(test, parser, class_src);
-        OK(test, CFCClass_inert(klass),
-           "inert modifier parsed and passed to constructor");
-
-        CFCBase_decref((CFCBase*)klass);
-    }
-
-    {
-        const char *class_src =
-            "final class Ultimo {\n"
-            "    /** Throws an error.\n"
-            "     */\n"
-            "    void Say_Never(Ultimo *self);\n"
-            "}\n";
-        CFCClass *klass = CFCTest_parse_class(test, parser, class_src);
-        OK(test, CFCClass_final(klass), "final class_declaration");
-        CFCBase_decref((CFCBase*)klass);
-    }
-
-    CFCBase_decref((CFCBase*)parser);
-    CFCBase_decref((CFCBase*)neato);
-    CFCBase_decref((CFCBase*)file_spec);
-    CFCBase_decref((CFCBase*)thing_class);
-    CFCBase_decref((CFCBase*)widget_class);
-    CFCBase_decref((CFCBase*)thing);
-    CFCBase_decref((CFCBase*)widget);
-    CFCBase_decref((CFCBase*)tread_water);
-    CFCBase_decref((CFCBase*)foo);
-    CFCBase_decref((CFCBase*)foo_jr);
-    CFCBase_decref((CFCBase*)final_foo);
-    CFCBase_decref((CFCBase*)do_stuff);
-
-    CFCClass_clear_registry();
-    CFCParcel_reap_singletons();
-}
-
-static int
-S_has_symbol(CFCSymbol **symbols, const char *micro_sym) {
-    for (int i = 0; symbols[i]; ++i) {
-        if (strcmp(CFCSymbol_micro_sym(symbols[i]), micro_sym) == 0) {
-            return 1;
-        }
-    }
-
-    return 0;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestDocuComment.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestDocuComment.c b/clownfish/compiler/src/CFCTestDocuComment.c
deleted file mode 100644
index dba5f3c..0000000
--- a/clownfish/compiler/src/CFCTestDocuComment.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCDocuComment.h"
-#include "CFCParser.h"
-#include "CFCTest.h"
-#include "CFCUtil.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_DOCU_COMMENT = {
-    "Clownfish::CFC::Model::DocuComment",
-    15,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCDocuComment *docucomment;
-
-    docucomment = CFCDocuComment_parse("/** foo. */");
-    OK(test, docucomment != NULL, "parse");
-    CFCBase_decref((CFCBase*)docucomment);
-
-    CFCParser *parser = CFCParser_new();
-    const char *text =
-        "/**\n"
-        " * Brief description.  Long description.\n"
-        " *\n"
-        " * More long description.\n"
-        " *\n"
-        " * @param foo A foo.\n"
-        " * @param bar A bar.\n"
-        " *\n"
-        " * @param baz A baz.\n"
-        " * @return a return value.\n"
-        " */\n";
-    CFCBase *result = CFCParser_parse(parser, text);
-    OK(test, result != NULL, "parse with CFCParser");
-    const char *klass = CFCBase_get_cfc_class(result);
-    STR_EQ(test, klass, "Clownfish::CFC::Model::DocuComment", "result class");
-    docucomment = (CFCDocuComment*)result;
-
-    const char *brief_desc = CFCDocuComment_get_brief(docucomment);
-    const char *brief_expect = "Brief description.";
-    STR_EQ(test, brief_desc, brief_expect, "brief description");
-
-    const char *long_desc = CFCDocuComment_get_long(docucomment);
-    const char *long_expect =
-        "Long description.\n"
-        "\n"
-        "More long description.";
-    STR_EQ(test, long_desc, long_expect, "long description");
-
-    const char *description = CFCDocuComment_get_description(docucomment);
-    char *desc_expect = CFCUtil_sprintf("%s  %s", brief_expect, long_expect);
-    STR_EQ(test, description, desc_expect, "description");
-    FREEMEM(desc_expect);
-
-    const char **param_names = CFCDocuComment_get_param_names(docucomment);
-    int num_param_names = 0;
-    for (const char **p = param_names; *p; ++p) { ++num_param_names; }
-    INT_EQ(test, num_param_names, 3, "number of param names");
-    const char *param_names_expect[3] = { "foo", "bar", "baz" };
-    for (int i = 0; i < 3; ++i) {
-        STR_EQ(test, param_names[i], param_names_expect[i],
-               "param name %d", i);
-    }
-
-    const char **param_docs = CFCDocuComment_get_param_docs(docucomment);
-    int num_param_docs = 0;
-    for (const char **p = param_docs; *p; ++p) { ++num_param_docs; }
-    INT_EQ(test, num_param_docs, 3, "number of param docs");
-    const char *param_docs_expect[3] = { "A foo.", "A bar.", "A baz." };
-    const char *param_docs_test[3] = {
-        "@param terminated by @",
-        "@param terminated by empty line",
-        "@param terminated next element, @return"
-    };
-    for (int i = 0; i < 3; ++i) {
-        STR_EQ(test, param_docs[i], param_docs_expect[i], param_docs_test[i]);
-    }
-
-    const char *retval = CFCDocuComment_get_retval(docucomment);
-    const char *retval_expect = "a return value.";
-    STR_EQ(test, retval, retval_expect, "retval");
-
-    CFCBase_decref((CFCBase*)docucomment);
-    CFCBase_decref((CFCBase*)parser);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestFile.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestFile.c b/clownfish/compiler/src/CFCTestFile.c
deleted file mode 100644
index ad1cd5c..0000000
--- a/clownfish/compiler/src/CFCTestFile.c
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCFile.h"
-#include "CFCFileSpec.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCTest.h"
-#include "CFCType.h"
-#include "CFCUtil.h"
-#include "CFCVariable.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_FILE = {
-    "Clownfish::CFC::Model::File",
-    21,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-#define STUFF_THING "Stuff" CHY_DIR_SEP "Thing"
-
-    CFCParser *parser = CFCParser_new();
-    CFCFileSpec *file_spec = CFCFileSpec_new(".", STUFF_THING, 0);
-
-    {
-        const char *string =
-            "parcel Stuff;\n"
-            "class Stuff::Thing {\n"
-            "    Foo *foo;\n"
-            "    Bar *bar;\n"
-            "}\n"
-            "class Foo {}\n"
-            "class Bar {}\n"
-            "__C__\n"
-            "int foo;\n"
-            "__END_C__\n";
-        CFCFile *file = CFCParser_parse_file(parser, string, file_spec);
-
-        STR_EQ(test, CFCFile_get_source_dir(file), ".", "get_source_dir");
-        STR_EQ(test, CFCFile_get_path_part(file), STUFF_THING,
-               "get_path_part");
-        OK(test, !CFCFile_included(file), "included");
-
-        STR_EQ(test, CFCFile_guard_name(file), "H_STUFF_THING", "guard_name");
-        STR_EQ(test, CFCFile_guard_start(file),
-               "#ifndef H_STUFF_THING\n#define H_STUFF_THING 1\n",
-               "guard_start");
-        STR_EQ(test, CFCFile_guard_close(file), "#endif /* H_STUFF_THING */\n",
-               "guard_close");
-
-        OK(test, !CFCFile_get_modified(file), "modified false at start");
-        CFCFile_set_modified(file, 1);
-        OK(test, CFCFile_get_modified(file), "set_modified, get_modified");
-
-#define PATH_TO_STUFF_THING \
-    "path" CHY_DIR_SEP \
-    "to" CHY_DIR_SEP \
-    "Stuff" CHY_DIR_SEP \
-    "Thing"
-
-        char *cfh_path = CFCFile_cfh_path(file, "path/to");
-        STR_EQ(test, cfh_path, PATH_TO_STUFF_THING ".cfh", "cfh_path");
-        FREEMEM(cfh_path);
-        char *c_path = CFCFile_c_path(file, "path/to");
-        STR_EQ(test, c_path, PATH_TO_STUFF_THING ".c", "c_path");
-        FREEMEM(c_path);
-        char *h_path = CFCFile_h_path(file, "path/to");
-        STR_EQ(test, h_path, PATH_TO_STUFF_THING ".h", "h_path");
-        FREEMEM(h_path);
-
-        CFCClass **classes = CFCFile_classes(file);
-        OK(test,
-           classes[0] != NULL && classes[1] != NULL && classes[2] != NULL
-           && classes[3] == NULL,
-           "classes() filters blocks");
-        CFCVariable **member_vars = CFCClass_member_vars(classes[0]);
-        CFCType *foo_type = CFCVariable_get_type(member_vars[0]);
-        CFCType_resolve(foo_type, classes);
-        STR_EQ(test, CFCType_get_specifier(foo_type), "stuff_Foo",
-               "file production picked up parcel def");
-        CFCType *bar_type = CFCVariable_get_type(member_vars[1]);
-        CFCType_resolve(bar_type, classes);
-        STR_EQ(test, CFCType_get_specifier(bar_type), "stuff_Bar",
-               "parcel def is sticky");
-
-        CFCBase **blocks = CFCFile_blocks(file);
-        STR_EQ(test, CFCBase_get_cfc_class(blocks[0]),
-               "Clownfish::CFC::Model::Parcel", "blocks[0]");
-        STR_EQ(test, CFCBase_get_cfc_class(blocks[1]),
-               "Clownfish::CFC::Model::Class", "blocks[1]");
-        STR_EQ(test, CFCBase_get_cfc_class(blocks[2]),
-               "Clownfish::CFC::Model::Class", "blocks[2]");
-        STR_EQ(test, CFCBase_get_cfc_class(blocks[3]),
-               "Clownfish::CFC::Model::Class", "blocks[3]");
-        STR_EQ(test, CFCBase_get_cfc_class(blocks[4]),
-               "Clownfish::CFC::Model::CBlock", "blocks[4]");
-        OK(test, blocks[5] == NULL, "blocks[5]");
-
-        CFCBase_decref((CFCBase*)file);
-
-        CFCClass_clear_registry();
-    }
-
-    {
-        const char *string =
-            "class Stuff::Thing {\n"
-            "    Foo *foo;\n"
-            "    Bar *bar;\n"
-            "}\n";
-        CFCFile *file = CFCParser_parse_file(parser, string, file_spec);
-        CFCClass **classes = CFCFile_classes(file);
-        CFCVariable **member_vars = CFCClass_member_vars(classes[0]);
-        CFCType *foo_type = CFCVariable_get_type(member_vars[0]);
-        STR_EQ(test, CFCType_get_specifier(foo_type), "Foo",
-               "file production resets parcel");
-
-        CFCBase_decref((CFCBase*)file);
-
-        CFCClass_clear_registry();
-    }
-
-    CFCBase_decref((CFCBase*)file_spec);
-    CFCBase_decref((CFCBase*)parser);
-
-    CFCParcel_reap_singletons();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestFileSpec.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestFileSpec.c b/clownfish/compiler/src/CFCTestFileSpec.c
deleted file mode 100644
index 7fdb2d8..0000000
--- a/clownfish/compiler/src/CFCTestFileSpec.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCFileSpec.h"
-#include "CFCTest.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_FILE_SPEC = {
-    "Clownfish::CFC::Model::FileSpec",
-    4,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    {
-        CFCFileSpec *file_spec
-            = CFCFileSpec_new("Clownfish/_include", "Stuff/Thing", 0);
-        STR_EQ(test, CFCFileSpec_get_source_dir(file_spec),
-               "Clownfish/_include", "get_source_dir");
-        STR_EQ(test, CFCFileSpec_get_path_part(file_spec),
-               "Stuff/Thing", "get_path_part");
-        OK(test, !CFCFileSpec_included(file_spec), "not included");
-
-        CFCBase_decref((CFCBase*)file_spec);
-    }
-
-    {
-        CFCFileSpec *file_spec
-            = CFCFileSpec_new("Clownfish/_include", "Stuff/Thing", 1);
-        OK(test, CFCFileSpec_included(file_spec), "included");
-
-        CFCBase_decref((CFCBase*)file_spec);
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestFunction.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestFunction.c b/clownfish/compiler/src/CFCTestFunction.c
deleted file mode 100644
index 4cd6967..0000000
--- a/clownfish/compiler/src/CFCTestFunction.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCFunction.h"
-#include "CFCParamList.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCTest.h"
-#include "CFCType.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_FUNCTION = {
-    "Clownfish::CFC::Model::Function",
-    11,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-    CFCParcel *neato_parcel
-        = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-
-    {
-        CFCType *return_type = CFCTest_parse_type(test, parser, "Obj*");
-        CFCParamList *param_list
-            = CFCTest_parse_param_list(test, parser, "(int32_t some_num)");
-        CFCFunction *func
-            = CFCFunction_new(neato_parcel, NULL, "Neato::Foo", "Foo",
-                              "return_an_obj", return_type, param_list,
-                              NULL, 0);
-        OK(test, func != NULL, "new");
-
-        CFCBase_decref((CFCBase*)return_type);
-        CFCBase_decref((CFCBase*)param_list);
-        CFCBase_decref((CFCBase*)func);
-    }
-
-    {
-        CFCParser_set_class_name(parser, "Neato::Obj");
-        CFCParser_set_class_cnick(parser, "Obj");
-        static const char *func_strings[2] = {
-            "inert int running_count(int biscuit);",
-            "public inert Hash* init_fave_hash(int32_t num_buckets,"
-            " bool o_rly);"
-        };
-        for (int i = 0; i < 2; ++i) {
-            CFCFunction *func
-                = CFCTest_parse_function(test, parser, func_strings[i]);
-            CFCBase_decref((CFCBase*)func);
-        }
-    }
-
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)parser);
-
-    CFCParcel_reap_singletons();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestHierarchy.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestHierarchy.c b/clownfish/compiler/src/CFCTestHierarchy.c
deleted file mode 100644
index 8941fe2..0000000
--- a/clownfish/compiler/src/CFCTestHierarchy.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <stdio.h>
-#include <string.h>
-
-/* For rmdir */
-#ifdef CHY_HAS_UNISTD_H
-  #include <unistd.h>
-#endif
-#ifdef CHY_HAS_DIRECT_H
-  #include <direct.h>
-#endif
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCFile.h"
-#include "CFCHierarchy.h"
-#include "CFCParcel.h"
-#include "CFCTest.h"
-#include "CFCUtil.h"
-
-#define T_CFBASE          "t" CHY_DIR_SEP "cfbase"
-#define T_CFEXT           "t" CHY_DIR_SEP "cfext"
-#define T_CFDEST          "t" CHY_DIR_SEP "cfdest"
-#define T_CFDEST_INCLUDE  T_CFDEST CHY_DIR_SEP "include"
-#define T_CFDEST_SOURCE   T_CFDEST CHY_DIR_SEP "source"
-
-static void
-S_run_tests(CFCTest *test);
-
-static void
-S_run_basic_tests(CFCTest *test);
-
-static void
-S_run_include_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_HIERARCHY = {
-    "Clownfish::CFC::Model::Hierarchy",
-    39,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    S_run_basic_tests(test);
-    S_run_include_tests(test);
-}
-
-static void
-S_run_basic_tests(CFCTest *test) {
-    CFCHierarchy *hierarchy = CFCHierarchy_new(T_CFDEST);
-    STR_EQ(test, CFCHierarchy_get_dest(hierarchy), T_CFDEST, "get_dest");
-    STR_EQ(test, CFCHierarchy_get_include_dest(hierarchy), T_CFDEST_INCLUDE,
-           "get_include_dest");
-    STR_EQ(test, CFCHierarchy_get_source_dest(hierarchy), T_CFDEST_SOURCE,
-           "get_source_dest");
-
-    CFCHierarchy_add_source_dir(hierarchy, T_CFBASE);
-    const char **source_dirs = CFCHierarchy_get_source_dirs(hierarchy);
-    STR_EQ(test, source_dirs[0], T_CFBASE, "source_dirs[0]");
-    OK(test, source_dirs[1] == NULL, "source_dirs[1]");
-
-    CFCHierarchy_build(hierarchy);
-
-    CFCFile **files = CFCHierarchy_files(hierarchy);
-    CFCFile *animal;
-    CFCFile *dog;
-    CFCFile *util;
-    for (int i = 0; i < 3; ++i) {
-        CFCFile *file = files[i];
-        OK(test, file != NULL, "files[%d]", i);
-        OK(test, !CFCFile_get_modified(file), "start off not modified");
-
-        CFCBase **blocks = CFCFile_blocks(file);
-        for (int j = 0; blocks[j]; ++j) {
-            CFCBase *block = blocks[j];
-            const char *cfc_class_name = CFCBase_get_cfc_class(block);
-            if (strcmp(cfc_class_name, "Clownfish::CFC::Model::Class") == 0) {
-                CFCClass *klass = (CFCClass*)block;
-                const char *class_name = CFCClass_get_class_name(klass);
-                if (strcmp(class_name, "Animal") == 0) {
-                    animal = file;
-                }
-                else if (strcmp(class_name, "Animal::Dog") == 0) {
-                    dog = file;
-                }
-                else if (strcmp(class_name, "Animal::Util") == 0) {
-                    util = file;
-                }
-            }
-        }
-    }
-    OK(test, files[3] == NULL, "recursed and found all three files");
-
-    {
-        CFCClass **ordered_classes = CFCHierarchy_ordered_classes(hierarchy);
-        OK(test, ordered_classes[0] != NULL, "ordered_classes[0]");
-        OK(test, ordered_classes[1] != NULL, "ordered_classes[1]");
-        OK(test, ordered_classes[2] != NULL, "ordered_classes[2]");
-        OK(test, ordered_classes[3] != NULL, "ordered_classes[3]");
-        OK(test, ordered_classes[4] == NULL, "all classes");
-        FREEMEM(ordered_classes);
-    }
-
-    // Generate fake C files, with times set to two seconds ago.
-    time_t now       = time(NULL);
-    time_t past_time = now - 2;
-    static const char *const h_paths[] = {
-        T_CFDEST_INCLUDE CHY_DIR_SEP "Animal.h",
-        T_CFDEST_INCLUDE CHY_DIR_SEP "Animal" CHY_DIR_SEP "Dog.h",
-        T_CFDEST_INCLUDE CHY_DIR_SEP "Animal" CHY_DIR_SEP "Util.h"
-    };
-    OK(test, CFCUtil_make_path(T_CFDEST_INCLUDE CHY_DIR_SEP "Animal"),
-       "make_path");
-    for (int i = 0; i < 3; ++i) {
-        const char *h_path  = h_paths[i];
-        const char *content = "#include <stdio.h>\n";
-        CFCUtil_write_file(h_path, content, strlen(content));
-        CFCTest_set_file_times(h_path, past_time);
-    }
-
-    char *cfh_path = CFCFile_cfh_path(animal, T_CFBASE);
-    CFCTest_set_file_times(cfh_path, now);
-    FREEMEM(cfh_path);
-
-    CFCHierarchy_propagate_modified(hierarchy, 0);
-
-    OK(test, CFCFile_get_modified(animal), "Animal modified");
-    OK(test, CFCFile_get_modified(dog),
-       "Parent's modification propagates to child's file");
-    OK(test, !CFCFile_get_modified(util),
-       "Modification doesn't propagate to inert class");
-
-    for (int i = 0; i < 3; ++i) {
-        remove(h_paths[i]);
-    }
-    rmdir(T_CFDEST_INCLUDE CHY_DIR_SEP "Animal");
-    rmdir(T_CFDEST_INCLUDE);
-    rmdir(T_CFDEST_SOURCE);
-    rmdir(T_CFDEST);
-
-    CFCBase_decref((CFCBase*)hierarchy);
-    CFCClass_clear_registry();
-    CFCParcel_reap_singletons();
-}
-
-static void
-S_run_include_tests(CFCTest *test) {
-    {
-        CFCHierarchy *hierarchy = CFCHierarchy_new(T_CFDEST);
-        CFCHierarchy_add_source_dir(hierarchy, T_CFEXT);
-        CFCHierarchy_add_include_dir(hierarchy, T_CFBASE);
-        const char **include_dirs = CFCHierarchy_get_include_dirs(hierarchy);
-        STR_EQ(test, include_dirs[0], T_CFBASE, "include_dirs[0]");
-        OK(test, include_dirs[1] == NULL, "include_dirs[1]");
-
-        CFCHierarchy_build(hierarchy);
-
-        CFCClass **classes    = CFCHierarchy_ordered_classes(hierarchy);
-        CFCClass  *rottweiler = NULL;;
-        int num_classes;
-        int num_source_classes = 0;
-        for (num_classes = 0; classes[num_classes]; ++num_classes) {
-            CFCClass *klass = classes[num_classes];
-            int expect_included = 1;
-            const char *class_name = CFCClass_get_class_name(klass);
-            if (strcmp(class_name, "Animal::Rottweiler") == 0) {
-                rottweiler      = klass;
-                expect_included = 0;
-                ++num_source_classes;
-            }
-            INT_EQ(test, CFCClass_included(klass), expect_included,
-                   "included");
-        }
-        INT_EQ(test, num_classes, 5, "class count");
-        INT_EQ(test, num_source_classes, 1, "source class count");
-        STR_EQ(test, CFCClass_get_class_name(CFCClass_get_parent(rottweiler)),
-               "Animal::Dog", "parent of included class");
-
-        FREEMEM(classes);
-        CFCBase_decref((CFCBase*)hierarchy);
-        CFCClass_clear_registry();
-        CFCParcel_reap_singletons();
-    }
-
-    {
-        CFCHierarchy *hierarchy = CFCHierarchy_new(T_CFDEST);
-        CFCHierarchy_add_source_dir(hierarchy, T_CFBASE);
-        CFCHierarchy_add_source_dir(hierarchy, T_CFEXT);
-
-        CFCHierarchy_build(hierarchy);
-
-        CFCClass **classes    = CFCHierarchy_ordered_classes(hierarchy);
-        CFCClass  *rottweiler = NULL;;
-        int num_classes;
-        for (num_classes = 0; classes[num_classes]; ++num_classes) {
-            CFCClass *klass = classes[num_classes];
-            const char *class_name = CFCClass_get_class_name(klass);
-            if (strcmp(class_name, "Animal::Rottweiler") == 0) {
-                rottweiler = klass;
-            }
-            OK(test, !CFCClass_included(klass), "not included");
-        }
-        INT_EQ(test, num_classes, 5, "class count");
-        OK(test, rottweiler != NULL, "found rottweiler");
-        STR_EQ(test, CFCClass_get_class_name(CFCClass_get_parent(rottweiler)),
-               "Animal::Dog", "parent of class from second source");
-
-        FREEMEM(classes);
-        CFCBase_decref((CFCBase*)hierarchy);
-        CFCClass_clear_registry();
-        CFCParcel_reap_singletons();
-    }
-
-    rmdir(T_CFDEST_INCLUDE);
-    rmdir(T_CFDEST_SOURCE);
-    rmdir(T_CFDEST);
-}
-


[lucy-commits] [50/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Purge some obsolete code from SortExternal.

Posted by ma...@apache.org.
Purge some obsolete code from SortExternal.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/79f4ca56
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/79f4ca56
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/79f4ca56

Branch: refs/heads/sortex_ptr_only
Commit: 79f4ca56a4509cece13bdd241685cc8bd2ef425d
Parents: 7677ad4
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jan 8 18:12:09 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 14:17:18 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Util/SortExternal.cfh          | 11 -----------
 perl/buildlib/Lucy/Build/Binding/Util.pm | 12 ------------
 2 files changed, 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/79f4ca56/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index cfc0591..a813459 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -16,17 +16,6 @@
 
 parcel Lucy;
 
-__C__
-#include <stddef.h>
-#include "Clownfish/Obj.h"
-#include "Clownfish/Util/SortUtils.h"
-
-#define LUCY_SORTEX_DEFAULT_MEM_THRESHOLD 0x1000000
-#ifdef LUCY_USE_SHORT_NAMES
-  #define SORTEX_DEFAULT_MEM_THRESHOLD LUCY_SORTEX_DEFAULT_MEM_THRESHOLD
-#endif
-__END_C__
-
 /** Abstract external sorter.
  *
  * SortExternal objects are sort pools which allow you to sort large amounts

http://git-wip-us.apache.org/repos/asf/lucy/blob/79f4ca56/perl/buildlib/Lucy/Build/Binding/Util.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build/Binding/Util.pm b/perl/buildlib/Lucy/Build/Binding/Util.pm
index 5bd6ed9..4ef7dbe 100644
--- a/perl/buildlib/Lucy/Build/Binding/Util.pm
+++ b/perl/buildlib/Lucy/Build/Binding/Util.pm
@@ -179,22 +179,10 @@ END_XS_CODE
 }
 
 sub bind_sortexternal {
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Lucy    PACKAGE = Lucy::Util::SortExternal
-
-IV
-_DEFAULT_MEM_THRESHOLD()
-CODE:
-    RETVAL = LUCY_SORTEX_DEFAULT_MEM_THRESHOLD;
-OUTPUT: RETVAL
-END_XS_CODE
-
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel     => "Lucy",
         class_name => "Lucy::Util::SortExternal",
     );
-    $binding->append_xs($xs_code);
-
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 


[lucy-commits] [22/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/clownfish/compiler/common/charmonizer.main b/clownfish/compiler/common/charmonizer.main
deleted file mode 100644
index 1803a3b..0000000
--- a/clownfish/compiler/common/charmonizer.main
+++ /dev/null
@@ -1,286 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* Source fragment for Lucy's charmonizer.c.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "Charmonizer/Probe.h"
-#include "Charmonizer/Probe/Integers.h"
-
-typedef struct SourceFileContext {
-    chaz_MakeVar *common_objs;
-    chaz_MakeVar *test_cfc_objs;
-} SourceFileContext;
-
-static void
-S_add_compiler_flags(struct chaz_CLIArgs *args) {
-    chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-
-    if (chaz_Probe_gcc_version_num()) {
-        if (getenv("LUCY_VALGRIND")) {
-            chaz_CFlags_append(extra_cflags, "-fno-inline-functions");
-        }
-        else if (getenv("LUCY_DEBUG")) {
-            chaz_CFlags_append(extra_cflags,
-                "-DLUCY_DEBUG -pedantic -Wall -Wextra -Wno-variadic-macros"
-            );
-        }
-        if (args->charmony_pm) {
-            chaz_CFlags_append(extra_cflags, "-DPERL_GCC_PEDANTIC");
-        }
-
-        /* Tell GCC explicitly to run with maximum options. */
-        chaz_CFlags_append(extra_cflags, "-std=gnu99 -D_GNU_SOURCE");
-    }
-    else if (chaz_Probe_msvc_version_num()) {
-        /* Compile as C++ under MSVC. */
-        chaz_CFlags_append(extra_cflags, "/TP");
-
-        /* Thwart stupid warnings. */
-        chaz_CFlags_append(extra_cflags, "/D_CRT_SECURE_NO_WARNINGS");
-        chaz_CFlags_append(extra_cflags, "/D_SCL_SECURE_NO_WARNINGS");
-
-        if (chaz_Probe_msvc_version_num() < 1300) {
-            /* Redefine 'for' to fix broken 'for' scoping under MSVC6. */
-            chaz_CFlags_append(extra_cflags, "/Dfor=\"if(0);else for\"");
-        }
-    }
-}
-
-static void
-S_source_file_callback(const char *dir, char *file, void *context) {
-    SourceFileContext *sfc = (SourceFileContext*)context;
-    const char *dir_sep = chaz_OS_dir_sep();
-    const char *obj_ext = chaz_CC_obj_ext();
-    size_t file_len = strlen(file);
-    char *obj_file;
-
-    if (strcmp(file, "CFCParseHeader.c") == 0) { return; }
-
-    /* Strip extension */
-    if (file_len <= 2 || memcmp(file + file_len - 2, ".c", 2) != 0) {
-        chaz_Util_warn("Unexpected source file name: %s", file);
-        return;
-    }
-    file[file_len-2] = '\0';
-
-    obj_file = chaz_Util_join("", dir, dir_sep, file, obj_ext, NULL);
-    if (strlen(file) >= 7 && memcmp(file, "CFCTest", 7) == 0) {
-        chaz_MakeVar_append(sfc->test_cfc_objs, obj_file);
-    }
-    else {
-        chaz_MakeVar_append(sfc->common_objs, obj_file);
-    }
-
-    free(obj_file);
-}
-
-static void
-S_write_makefile(struct chaz_CLIArgs *args) {
-    SourceFileContext sfc;
-
-    const char *base_dir = "..";
-    const char *dir_sep  = chaz_OS_dir_sep();
-    const char *exe_ext  = chaz_OS_exe_ext();
-    const char *obj_ext  = chaz_CC_obj_ext();
-
-    char *lemon_dir    = chaz_Util_join(dir_sep, base_dir, "..", "..", "lemon",
-                                        NULL);
-    char *src_dir      = chaz_Util_join(dir_sep, base_dir, "src", NULL);
-    char *include_dir  = chaz_Util_join(dir_sep, base_dir, "include", NULL);
-    char *parse_header = chaz_Util_join(dir_sep, src_dir, "CFCParseHeader",
-                                        NULL);
-    char *cfc_exe      = chaz_Util_join("", "cfc", exe_ext, NULL);
-    char *test_cfc_exe = chaz_Util_join("", "t", dir_sep, "test_cfc", exe_ext,
-                                        NULL);
-
-    char *scratch;
-
-    chaz_MakeFile *makefile;
-    chaz_MakeVar  *var;
-    chaz_MakeRule *rule;
-    chaz_MakeRule *clean_rule;
-
-    chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-    chaz_CFlags *makefile_cflags;
-    chaz_CFlags *link_flags;
-
-    printf("Creating Makefile...\n");
-
-    makefile = chaz_MakeFile_new();
-
-    /* Directories */
-
-    chaz_MakeFile_add_var(makefile, "BASE_DIR", base_dir);
-
-    /* C compiler */
-
-    chaz_MakeFile_add_var(makefile, "CC", chaz_CC_get_cc());
-
-    makefile_cflags = chaz_CC_new_cflags();
-
-    chaz_CFlags_enable_optimization(makefile_cflags);
-    chaz_CFlags_add_include_dir(makefile_cflags, ".");
-    chaz_CFlags_add_include_dir(makefile_cflags, include_dir);
-    chaz_CFlags_add_include_dir(makefile_cflags, src_dir);
-    if (args->code_coverage) {
-        chaz_CFlags_enable_code_coverage(makefile_cflags);
-    }
-
-    var = chaz_MakeFile_add_var(makefile, "CFLAGS", NULL);
-    chaz_MakeVar_append(var, chaz_CFlags_get_string(extra_cflags));
-    chaz_MakeVar_append(var, chaz_CFlags_get_string(makefile_cflags));
-    chaz_MakeVar_append(var, chaz_CC_get_cflags());
-
-    chaz_CFlags_destroy(makefile_cflags);
-
-    /* Object files */
-
-    sfc.common_objs   = chaz_MakeFile_add_var(makefile, "COMMON_OBJS", NULL);
-    sfc.test_cfc_objs = chaz_MakeFile_add_var(makefile, "TEST_CFC_OBJS", NULL);
-
-    chaz_Make_list_files(src_dir, "c", S_source_file_callback, &sfc);
-
-    scratch = chaz_Util_join("", parse_header, obj_ext, NULL);
-    chaz_MakeVar_append(sfc.common_objs, scratch);
-    free(scratch);
-
-    scratch = chaz_Util_join("", "t", dir_sep, "test_cfc", obj_ext, NULL);
-    chaz_MakeVar_append(sfc.test_cfc_objs, scratch);
-    free(scratch);
-
-    scratch = chaz_Util_join("", "cfc", obj_ext, NULL);
-    chaz_MakeFile_add_var(makefile, "CFC_OBJS", scratch);
-    free(scratch);
-
-    /* Rules */
-
-    chaz_MakeFile_add_rule(makefile, "all", cfc_exe);
-
-    chaz_MakeFile_add_lemon_exe(makefile, lemon_dir);
-    chaz_MakeFile_add_lemon_grammar(makefile, parse_header);
-
-    /*
-     * The dependency is actually on CFCParseHeader.h, but make doesn't cope
-     * well with multiple output files.
-     */
-    scratch = chaz_Util_join(".", parse_header, "c", NULL);
-    chaz_MakeFile_add_rule(makefile, "$(COMMON_OBJS)", scratch);
-    free(scratch);
-
-    link_flags = chaz_CC_new_cflags();
-    if (chaz_CC_msvc_version_num()) {
-        chaz_CFlags_append(link_flags, "/nologo");
-    }
-    if (args->code_coverage) {
-        chaz_CFlags_enable_code_coverage(link_flags);
-    }
-    chaz_MakeFile_add_exe(makefile, cfc_exe, "$(COMMON_OBJS) $(CFC_OBJS)",
-                          link_flags);
-    chaz_MakeFile_add_exe(makefile, test_cfc_exe,
-                          "$(COMMON_OBJS) $(TEST_CFC_OBJS)", link_flags);
-    chaz_CFlags_destroy(link_flags);
-
-    rule = chaz_MakeFile_add_rule(makefile, "test", test_cfc_exe);
-    chaz_MakeRule_add_command(rule, test_cfc_exe);
-
-    if (args->code_coverage) {
-        rule = chaz_MakeFile_add_rule(makefile, "coverage", test_cfc_exe);
-        chaz_MakeRule_add_command(rule,
-                                  "lcov"
-                                  " --zerocounters"
-                                  " --directory $(BASE_DIR)");
-        chaz_MakeRule_add_command(rule, test_cfc_exe);
-        chaz_MakeRule_add_command(rule,
-                                  "lcov"
-                                  " --capture"
-                                  " --directory $(BASE_DIR)"
-                                  " --base-directory ."
-                                  " --rc lcov_branch_coverage=1"
-                                  " --output-file cfc.info");
-        chaz_MakeRule_add_command(rule,
-                                  "genhtml"
-                                  " --branch-coverage"
-                                  " --output-directory coverage"
-                                  " cfc.info");
-    }
-
-    clean_rule = chaz_MakeFile_clean_rule(makefile);
-
-    chaz_MakeRule_add_rm_command(clean_rule, "$(COMMON_OBJS)");
-    chaz_MakeRule_add_rm_command(clean_rule, "$(CFC_OBJS)");
-    chaz_MakeRule_add_rm_command(clean_rule, "$(TEST_CFC_OBJS)");
-
-    if (args->code_coverage) {
-        chaz_MakeRule_add_rm_command(clean_rule, "cfc.info");
-        chaz_MakeRule_add_recursive_rm_command(clean_rule, "coverage");
-    }
-
-    chaz_MakeFile_write(makefile);
-
-    chaz_MakeFile_destroy(makefile);
-    free(lemon_dir);
-    free(src_dir);
-    free(include_dir);
-    free(parse_header);
-    free(cfc_exe);
-    free(test_cfc_exe);
-}
-
-int main(int argc, const char **argv) {
-    /* Initialize. */
-    struct chaz_CLIArgs args;
-    {
-        int result = chaz_Probe_parse_cli_args(argc, argv, &args);
-        if (!result) {
-            chaz_Probe_die_usage();
-        }
-        chaz_Probe_init(&args);
-        S_add_compiler_flags(&args);
-    }
-
-    /* Define stdint types in charmony.h. */
-    chaz_ConfWriter_append_conf("#define CHY_EMPLOY_INTEGERTYPES\n\n");
-    chaz_ConfWriter_append_conf("#define CHY_EMPLOY_INTEGERLITERALS\n\n");
-
-    /* Run probe modules. */
-    chaz_BuildEnv_run();
-    chaz_DirManip_run();
-    chaz_Headers_run();
-    chaz_AtomicOps_run();
-    chaz_FuncMacro_run();
-    chaz_Booleans_run();
-    chaz_Integers_run();
-    chaz_Strings_run();
-    chaz_Memory_run();
-    chaz_SymbolVisibility_run();
-    chaz_UnusedVars_run();
-    chaz_VariadicMacros_run();
-
-    if (args.write_makefile) {
-        S_write_makefile(&args);
-    }
-
-    /* Clean up. */
-    chaz_Probe_clean_up();
-
-    return 0;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/include/CFC.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/include/CFC.h b/clownfish/compiler/include/CFC.h
deleted file mode 100644
index 9a13607..0000000
--- a/clownfish/compiler/include/CFC.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "CFCBase.h"
-#include "CFCCBlock.h"
-#include "CFCClass.h"
-#include "CFCDocuComment.h"
-#include "CFCFile.h"
-#include "CFCFileSpec.h"
-#include "CFCFunction.h"
-#include "CFCHierarchy.h"
-#include "CFCMethod.h"
-#include "CFCMemPool.h"
-#include "CFCParamList.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCSymbol.h"
-#include "CFCTest.h"
-#include "CFCType.h"
-#include "CFCUtil.h"
-#include "CFCVariable.h"
-#include "CFCVersion.h"
-
-#include "CFCBindCore.h"
-#include "CFCBindAliases.h"
-#include "CFCBindClass.h"
-#include "CFCBindFile.h"
-#include "CFCBindFunction.h"
-#include "CFCBindMethod.h"
-
-#include "CFCPerl.h"
-#include "CFCPerlSub.h"
-#include "CFCPerlMethod.h"
-#include "CFCPerlClass.h"
-#include "CFCPerlConstructor.h"
-#include "CFCPerlPod.h"
-#include "CFCPerlTypeMap.h"
-
-#include "CFCRuby.h"
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/.gitignore
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/.gitignore b/clownfish/compiler/perl/.gitignore
deleted file mode 100644
index 5517019..0000000
--- a/clownfish/compiler/perl/.gitignore
+++ /dev/null
@@ -1,9 +0,0 @@
-/Build
-/Charmony.pm
-/MYMETA.json
-/MYMETA.yml
-/_build/
-/blib/
-/charmonizer
-/charmony.h
-/lib/Clownfish/CFC.c

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/Build.PL
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/Build.PL b/clownfish/compiler/perl/Build.PL
deleted file mode 100644
index 842a4e1..0000000
--- a/clownfish/compiler/perl/Build.PL
+++ /dev/null
@@ -1,50 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use 5.008003;
-use strict;
-use warnings;
-use lib 'buildlib';
-use Clownfish::CFC::Build;
-use File::Spec::Functions qw( updir catdir curdir );
-
-my $builder = Clownfish::CFC::Build->new(
-    module_name => 'Clownfish::CFC',
-    license     => 'apache',
-    dist_author =>
-        'The Apache Lucy Project <dev at lucy dot apache dot org>',
-    dist_version_from => 'lib/Clownfish/CFC.pm',
-    build_requires    => {
-        'ExtUtils::CBuilder' => 0.18,
-        'ExtUtils::ParseXS'  => 2.16,
-        'Devel::PPPort'      => 3.13,
-    },
-    include_dirs   => [
-        curdir(), # for charmony.h
-        catdir( updir(), 'include' ),
-    ],
-    c_source       => catdir( updir(),   'src' ),
-    add_to_cleanup => [
-        qw(
-            MANIFEST.bak
-            perltidy.ERR
-            *.pdb
-            *.manifest
-            ),
-    ],
-);
-
-$builder->create_build_script();
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/MANIFEST
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/MANIFEST b/clownfish/compiler/perl/MANIFEST
deleted file mode 100644
index b156cfa..0000000
--- a/clownfish/compiler/perl/MANIFEST
+++ /dev/null
@@ -1,7 +0,0 @@
-# If you opened this file because "./Build distclean" spawned numerous
-# about files not present in MANIFEST, the solution is to run "./Build
-# realclean" instead.
-#
-# We do not maintain MANIFEST during development; if necessary, it will be
-# autogenerated when we build the CPAN tarball.
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build.pm b/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build.pm
deleted file mode 100644
index 4ba1a6b..0000000
--- a/clownfish/compiler/perl/buildlib/Clownfish/CFC/Build.pm
+++ /dev/null
@@ -1,150 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-package Clownfish::CFC::Build;
-
-# In order to find Clownfish::CFC::Perl::Build::Charmonic, look in 'lib'
-# and cleanup @INC afterwards.
-use lib 'lib';
-use base qw( Clownfish::CFC::Perl::Build::Charmonic );
-no lib 'lib';
-
-use File::Spec::Functions qw( catfile updir catdir );
-use Config;
-use Cwd qw( getcwd );
-use Carp;
-
-my $base_dir = catdir( updir(), updir(), updir() );
-my $COMMON_SOURCE_DIR = catdir( updir(), 'common' );
-my $CHARMONIZER_C     = catfile( $COMMON_SOURCE_DIR, 'charmonizer.c' );
-my $PPPORT_H_PATH = catfile( updir(), qw( include ppport.h ) );
-my $LEMON_DIR = catdir( $base_dir, 'lemon' );
-my $LEMON_EXE_PATH = catfile( $LEMON_DIR, "lemon$Config{_exe}" );
-my $CFC_SOURCE_DIR = catdir( updir(), 'src' );
-
-sub new {
-    my ( $class, %args ) = @_;
-    return $class->SUPER::new(
-        %args,
-        recursive_test_files => 1,
-        charmonizer_params   => {
-            charmonizer_c => $CHARMONIZER_C,
-        },
-    );
-}
-
-sub _run_make {
-    my ( $self, %params ) = @_;
-    my @command           = @{ $params{args} };
-    my $dir               = $params{dir};
-    my $current_directory = getcwd();
-    chdir $dir if $dir;
-    unshift @command, 'CC=' . $self->config('cc');
-    if ( $self->config('cc') =~ /^cl\b/ ) {
-        unshift @command, "-f", "Makefile.MSVC";
-    }
-    elsif ( $^O =~ /mswin/i ) {
-        unshift @command, "-f", "Makefile.MinGW";
-    }
-    unshift @command, "$Config{make}";
-    system(@command) and confess("$Config{make} failed");
-    chdir $current_directory if $dir;
-}
-
-# Write ppport.h, which supplies some XS routines not found in older Perls and
-# allows us to use more up-to-date XS API while still supporting Perls back to
-# 5.8.3.
-#
-# The Devel::PPPort docs recommend that we distribute ppport.h rather than
-# require Devel::PPPort itself, but ppport.h isn't compatible with the Apache
-# license.
-sub ACTION_ppport {
-    my $self = shift;
-    if ( !-e $PPPORT_H_PATH ) {
-        require Devel::PPPort;
-        $self->add_to_cleanup($PPPORT_H_PATH);
-        Devel::PPPort::WriteFile($PPPORT_H_PATH);
-    }
-}
-
-# Build the Lemon parser generator.
-sub ACTION_lemon {
-    my $self = shift;
-    print "Building the Lemon parser generator...\n\n";
-    $self->_run_make(
-        dir  => $LEMON_DIR,
-        args => [],
-    );
-}
-
-# Run all .y files through lemon.
-sub ACTION_parsers {
-    my $self = shift;
-    $self->dispatch('lemon');
-    my $y_files = $self->rscan_dir( $CFC_SOURCE_DIR, qr/\.y$/ );
-    for my $y_file (@$y_files) {
-        my $c_file = $y_file;
-        my $h_file = $y_file;
-        $c_file =~ s/\.y$/.c/ or die "no match";
-        $h_file =~ s/\.y$/.h/ or die "no match";
-        next if $self->up_to_date( $y_file, $c_file );
-        $self->add_to_cleanup( $c_file, $h_file );
-        my $lemon_report_file = $y_file;
-        $lemon_report_file =~ s/\.y$/.out/ or die "no match";
-        $self->add_to_cleanup($lemon_report_file);
-        system( $LEMON_EXE_PATH, '-c', $y_file ) and die "lemon failed";
-    }
-}
-
-# Run all .l files through flex.
-sub ACTION_lexers {
-    my $self = shift;
-    my $l_files = $self->rscan_dir( $CFC_SOURCE_DIR, qr/\.l$/ );
-    # Rerun flex if lemon file changes.
-    my $y_files = $self->rscan_dir( $CFC_SOURCE_DIR, qr/\.y$/ );
-    for my $l_file (@$l_files) {
-        my $c_file = $l_file;
-        my $h_file = $l_file;
-        $c_file =~ s/\.l$/.c/ or die "no match";
-        $h_file =~ s/\.l$/.h/ or die "no match";
-        next
-            if $self->up_to_date( [ $l_file, @$y_files ],
-            [ $c_file, $h_file ] );
-        system( 'flex', '--nounistd', '-o', $c_file, "--header-file=$h_file", $l_file )
-            and die "flex failed";
-    }
-}
-
-sub ACTION_code {
-    my $self = shift;
-
-    $self->dispatch('charmony');
-    $self->dispatch('ppport');
-    $self->dispatch('parsers');
-
-    my @flags = $self->split_like_shell($self->charmony("EXTRA_CFLAGS"));
-    # The flag for the MSVC6 hack contains spaces. Make sure it stays quoted.
-    @flags = map { /\s/ ? qq{"$_"} : $_ } @flags;
-
-    $self->extra_compiler_flags( '-DCFCPERL', @flags );
-
-    $self->SUPER::ACTION_code;
-}
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish.pod
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish.pod b/clownfish/compiler/perl/lib/Clownfish.pod
deleted file mode 100644
index 6e86f9e..0000000
--- a/clownfish/compiler/perl/lib/Clownfish.pod
+++ /dev/null
@@ -1,187 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-=head1 NAME
-
-Clownfish - A small OO language that forms symbiotic relationships with "host"
-languages.
-
-=head1 PRIVATE API
-
-Clownfish is an Apache Lucy implementation detail.  This documentation is partial --
-enough for the curious hacker, but not a full API.
-
-=head1 DESCRIPTION
-
-=head2 Overview.
-
-Clownfish is a small language for declaring an object oriented interface and a
-compiler which allows classes to be implemented either in C, in a "host"
-language, or a combination of both. 
-
-=head2 Why use Clownfish?
-
-=over
-
-=item *
-
-Clownfish-based projects give users the ability to write full subclasses
-in any "host" language for which a binding has been prepared.
-
-=item *
-
-Pure C Clownfish class implementations are very fast.
-
-=item *
-
-Users can perform rapid prototyping in their language of choice, then port
-their classes to C either for speed or to make them available across multiple
-language platforms.
-
-=item *
-
-=back
-
-=head2 Object Model
-
-Clownfish is single-inheritance and class based -- a minimalist design which
-makes it as compatible as possible with a broad range of hosts.
-
-Subclasses may be created either at compile time or at run time.
-
-=back
-
-=head2 C method invocation syntax.
-
-Methods are differentiated from functions via capitalization:
-Boat_capsize() is a function, Boat_Capsize() is a method.
-
-    // Base method.
-    void
-    Boat_capsize(Boat *self)
-    {
-        self->upside_down = true;
-    }
-
-    // Implementing function, in Boat/Battleship.c
-    void
-    Battleship_capsize(Battleship *self) 
-    {
-        // Superclass method invocation.
-        Boat_capsize_t capsize = SUPER_METHOD_PTR(BATTLESHIP, Battleship_Capsize);
-        capsize((Boat*)self);  
-
-        // Subclass-specific behavior.
-        Battleship_Sink(self);
-    }
-
-    // Implementing function, in Boat/RubberDinghy.c
-    void
-    RubDing_capsize(RubberDinghy *self) 
-    {
-        // Superclass method invocation.
-        Boat_capsize_t capsize = SUPER_METHOD_PTR(RUBBERDINGHY, RubDing_Capsize);
-        capsize((Boat*)self);  
-
-        // Subclass-specific behavior.
-        RubDing_Drift(self);
-    }
-
-=head2 Class declaration syntax
-
-    [final] [inert] class CLASSNAME [cnick CNICK] [inherits PARENT] {
-    
-        [declarations]
-    
-    }
-
-Example:
-
-    class Boat::RubberDinghy cnick RubDing inherits Boat {
-        
-        public inert incremented RubberDinghy*
-        new();
-        
-        void 
-        Capsize(RubberDinghy *self);
-    }
-
-=over
-
-=item * B<CLASSNAME> - The name of this class.  The last string of characters
-will be used as the object's C struct name.
-
-=item * B<CNICK> - A recognizable abbreviation of the class name, used as a
-prefix for every function and method.
-
-=item * B<PARENT> - The full name of the parent class.
-
-=back
-
-=head2 Memory management
-
-At present, memory is managed via a reference counting scheme, but this is not
-inherently part of Clownfish.
-
-=head2 Namespaces, parcels, prefixes, and "short names"
-
-There are two levels of namespacing in Clownfish: parcels and classes.
-
-Clownfish classes intended to be published as a single unit may be grouped
-together using a "parcel".  Parcel directives need to go at the top of each
-class file.
-
-    parcel Crustacean cnick Crust;
-
-All symbols generated by Clownfish for classes within a parcel will be
-prefixed by varying capitalizations of the parcel's C-nickname or "cnick" in
-order to avoid namespace collisions with other projects.
-
-Within a parcel, the last part of each class name must be unique.
-
-    class Crustacean::Lobster::Claw { ... }
-    class Crustacean::Crab::Claw    { ... } // Illegal, "Claw" already used
-
-"Short names" -- names minus the parcel prefix -- will be auto-generated for
-all class symbols.  When there is no danger of namespace collision, typically
-because no third-party non-system libraries are being pound-included, the
-short names can be used after a USE_SHORT_NAMES directive:
-
-    #define CRUST_USE_SHORT_NAMES
-
-The USE_SHORT_NAMES directives do not affect class prefixes, only parcel
-prefixes.
-
-    // No short names.
-    crust_LobsterClaw *claw = crust_LobClaw_new();
-    
-    // With short names.
-    #define CRUST_USE_SHORT_NAMES
-    LobsterClaw *claw = LobClaw_new();
-
-=head2 Inclusion
-
-C header code generated by the Clownfish compiler is written to a file with
-whose name is the same as the .cfh file, but with an extension of ".h".  C
-code should pound-include "Crustacean/Lobster.h" for a class defined in
-"Crustacean/Lobster.cfh".
-
-=head1 COPYRIGHT 
- 
-Clownfish is distributed under the Apache License, Version 2.0, as 
-described in the file C<LICENSE> included with the distribution. 
-
-=cut
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/lib/Clownfish/CFC.pm
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/lib/Clownfish/CFC.pm b/clownfish/compiler/perl/lib/Clownfish/CFC.pm
deleted file mode 100644
index c918155..0000000
--- a/clownfish/compiler/perl/lib/Clownfish/CFC.pm
+++ /dev/null
@@ -1,900 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-package Clownfish::CFC;
-our $VERSION = '0.01';
-
-END {
-    Clownfish::CFC::Model::Class->_clear_registry();
-    Clownfish::CFC::Model::Parcel->reap_singletons();
-}
-
-use XSLoader;
-BEGIN { XSLoader::load( 'Clownfish::CFC', '0.01' ) }
-
-{
-    package Clownfish::CFC::Util;
-    use base qw( Exporter );
-    use Scalar::Util qw( blessed );
-    use Carp;
-    use Fcntl;
-
-    BEGIN {
-        our @EXPORT_OK = qw(
-            slurp_text
-            current
-            strip_c_comments
-            verify_args
-            a_isa_b
-            write_if_changed
-            trim_whitespace
-            is_dir
-            make_dir
-            make_path
-        );
-    }
-
-    # Verify that named parameters exist in a defaults hash.  Returns false
-    # and sets $@ if a problem is detected.
-    sub verify_args {
-        my $defaults = shift;    # leave the rest of @_ intact
-
-        # Verify that args came in pairs.
-        if ( @_ % 2 ) {
-            my ( $package, $filename, $line ) = caller(1);
-            $@
-                = "Parameter error: odd number of args at $filename line $line\n";
-            return 0;
-        }
-
-        # Verify keys, ignore values.
-        while (@_) {
-            my ( $var, undef ) = ( shift, shift );
-            next if exists $defaults->{$var};
-            my ( $package, $filename, $line ) = caller(1);
-            $@ = "Invalid parameter: '$var' at $filename line $line\n";
-            return 0;
-        }
-
-        return 1;
-    }
-
-    sub a_isa_b {
-        my ( $thing, $class ) = @_;
-        return 0 unless blessed($thing);
-        return $thing->isa($class);
-    }
-}
-
-{
-    package Clownfish::CFC::Base;
-}
-
-{
-    package Clownfish::CFC::Model::CBlock;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    our %new_PARAMS = ( contents => undef, );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        confess("Missing required param 'contents'")
-            unless defined $args{contents};
-        return _new( $args{contents} );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::Class;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Model::Symbol' }
-    use Carp;
-    use Config;
-    use Clownfish::CFC::Util qw(
-        verify_args
-        a_isa_b
-    );
-
-    our %create_PARAMS = (
-        file_spec         => undef,
-        class_name        => undef,
-        cnick             => undef,
-        parent_class_name => undef,
-        docucomment       => undef,
-        inert             => undef,
-        final             => undef,
-        parcel            => undef,
-        exposure          => 'parcel',
-    );
-
-    our %fetch_singleton_PARAMS = (
-        parcel     => undef,
-        class_name => undef,
-    );
-
-    sub fetch_singleton {
-        my ( undef, %args ) = @_;
-        verify_args( \%fetch_singleton_PARAMS, %args ) or confess $@;
-        # Maybe prepend parcel prefix.
-        my $parcel = $args{parcel};
-        if ( defined $parcel ) {
-            $parcel = Clownfish::CFC::Model::Parcel->acquire($parcel);
-        }
-        return _fetch_singleton( $parcel, $args{class_name} );
-    }
-
-    sub new {
-        confess(
-            "The constructor for Clownfish::CFC::Model::Class is create()");
-    }
-
-    sub create {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%create_PARAMS, %args ) or confess $@;
-        $args{parcel}
-            = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
-        return _create(
-            @args{
-                qw( parcel exposure class_name cnick micro_sym docucomment
-                    file_spec parent_class_name final inert)
-                }
-        );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::DocuComment;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-}
-
-{
-    package Clownfish::CFC::Model::File;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    our %new_PARAMS = ( spec => undef );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        return _new( $args{spec} );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::FileSpec;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    our %new_PARAMS = (
-        source_dir  => undef,
-        path_part   => undef,
-        is_included => 0,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        return _new( @args{ qw( source_dir path_part is_included ) } );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::Function;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Model::Symbol' }
-    use Carp;
-    use Clownfish::CFC::Util qw( verify_args a_isa_b );
-
-    my %new_PARAMS = (
-        return_type => undef,
-        class_name  => undef,
-        class_cnick => undef,
-        param_list  => undef,
-        micro_sym   => undef,
-        docucomment => undef,
-        parcel      => undef,
-        inline      => undef,
-        exposure    => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        $args{inline} ||= 0;
-        $args{parcel}
-            = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
-        return _new(
-            @args{
-                qw( parcel exposure class_name class_cnick micro_sym
-                    return_type param_list docucomment inline )
-                }
-        );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::Hierarchy;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Carp;
-    use Clownfish::CFC::Util qw( verify_args );
-
-    our %new_PARAMS = (
-        dest => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        return _new( @args{qw( dest )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::Method;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Model::Function' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    my %new_PARAMS = (
-        return_type => undef,
-        class_name  => undef,
-        class_cnick => undef,
-        param_list  => undef,
-        macro_sym   => undef,
-        docucomment => undef,
-        parcel      => undef,
-        abstract    => undef,
-        final       => undef,
-        exposure    => 'parcel',
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        $args{abstract} ||= 0;
-        $args{parcel}
-            = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
-        $args{final} ||= 0;
-        return _new(
-            @args{
-                qw( parcel exposure class_name class_cnick macro_sym
-                    return_type param_list docucomment final abstract )
-                }
-        );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::ParamList;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    our %new_PARAMS = ( variadic => undef, );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        my $variadic = delete $args{variadic} || 0;
-        return _new($variadic);
-    }
-}
-
-{
-    package Clownfish::CFC::Model::Parcel;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Scalar::Util qw( blessed );
-    use Carp;
-
-    our %new_PARAMS = (
-        name        => undef,
-        cnick       => undef,
-        version     => undef,
-        is_included => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        return _new( @args{qw( name cnick version is_included )} );
-    }
-
-    our %new_from_json_PARAMS = (
-        json        => undef,
-        is_included => undef,
-    );
-
-    sub new_from_json {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_from_json_PARAMS, %args ) or confess $@;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        return _new_from_json( @args{qw( json is_included )} );
-    }
-
-    our %new_from_file_PARAMS = (
-        path        => undef,
-        is_included => undef,
-    );
-
-    sub new_from_file {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_from_file_PARAMS, %args ) or confess $@;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        return _new_from_file( @args{qw( path is_included )} );
-    }
-
-#    $parcel = Clownfish::CFC::Model::Parcel->acquire($parcel_name_or_parcel_object);
-#
-# Aquire a parcel one way or another.  If the supplied argument is a
-# Parcel, return it.  If it's not defined, return the default Parcel.  If
-# it's a name, fetch an existing Parcel or register a new one.
-    sub acquire {
-        my ( undef, $thing ) = @_;
-        if ( !defined $thing ) {
-            return Clownfish::CFC::Model::Parcel->default_parcel;
-        }
-        elsif ( blessed($thing) ) {
-            confess("Not a Clownfish::CFC::Model::Parcel")
-                unless $thing->isa('Clownfish::CFC::Model::Parcel');
-            return $thing;
-        }
-        else {
-            my $parcel = Clownfish::CFC::Model::Parcel->fetch($thing);
-            if ( !$parcel ) {
-                $parcel
-                    = Clownfish::CFC::Model::Parcel->new( name => $thing, );
-                $parcel->register;
-            }
-            return $parcel;
-        }
-    }
-}
-
-{
-    package Clownfish::CFC::Parser;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-}
-
-{
-    package Clownfish::CFC::Parser;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-}
-
-{
-    package Clownfish::CFC::Model::Symbol;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    my %new_PARAMS = (
-        parcel      => undef,
-        exposure    => undef,
-        class_name  => undef,
-        class_cnick => undef,
-        micro_sym   => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        $args{parcel}
-            = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
-        return _new(
-            @args{qw( parcel exposure class_name class_cnick micro_sym )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::Type;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args a_isa_b );
-    use Scalar::Util qw( blessed );
-    use Carp;
-
-    our %new_PARAMS = (
-        const       => undef,
-        specifier   => undef,
-        indirection => undef,
-        parcel      => undef,
-        void        => undef,
-        object      => undef,
-        primitive   => undef,
-        integer     => undef,
-        floating    => undef,
-        string_type => undef,
-        va_list     => undef,
-        arbitrary   => undef,
-        composite   => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        my $package = ref($either) || $either;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-
-        my $flags = 0;
-        $flags |= CONST       if $args{const};
-        $flags |= NULLABLE    if $args{nullable};
-        $flags |= VOID        if $args{void};
-        $flags |= OBJECT      if $args{object};
-        $flags |= PRIMITIVE   if $args{primitive};
-        $flags |= INTEGER     if $args{integer};
-        $flags |= FLOATING    if $args{floating};
-        $flags |= STRING_TYPE if $args{string_type};
-        $flags |= VA_LIST     if $args{va_list};
-        $flags |= ARBITRARY   if $args{arbitrary};
-        $flags |= COMPOSITE   if $args{composite};
-
-        my $parcel
-            = $args{parcel}
-            ? Clownfish::CFC::Model::Parcel->acquire( $args{parcel} )
-            : $args{parcel};
-
-        my $indirection = $args{indirection} || 0;
-        my $specifier   = $args{specifier}   || '';
-
-        return _new( $flags, $parcel, $specifier, $indirection );
-    }
-
-    our %new_integer_PARAMS = (
-        const     => undef,
-        specifier => undef,
-    );
-
-    sub new_integer {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_integer_PARAMS, %args ) or confess $@;
-        my $flags = 0;
-        $flags |= CONST if $args{const};
-        return _new_integer( $flags, $args{specifier} );
-    }
-
-    our %new_float_PARAMS = (
-        const     => undef,
-        specifier => undef,
-    );
-
-    sub new_float {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_float_PARAMS, %args ) or confess $@;
-        my $flags = 0;
-        $flags |= CONST if $args{const};
-        return _new_float( $flags, $args{specifier} );
-    }
-
-    our %new_object_PARAMS = (
-        const       => undef,
-        specifier   => undef,
-        indirection => 1,
-        parcel      => undef,
-        incremented => 0,
-        decremented => 0,
-        nullable    => 0,
-    );
-
-    sub new_object {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_object_PARAMS, %args ) or confess $@;
-        my $flags = 0;
-        $flags |= INCREMENTED if $args{incremented};
-        $flags |= DECREMENTED if $args{decremented};
-        $flags |= NULLABLE    if $args{nullable};
-        $flags |= CONST       if $args{const};
-        $args{indirection} = 1 unless defined $args{indirection};
-        my $parcel = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
-        my $package = ref($either) || $either;
-        confess("Missing required param 'specifier'")
-            unless defined $args{specifier};
-        return _new_object( $flags, $parcel, $args{specifier},
-            $args{indirection} );
-    }
-
-    our %new_composite_PARAMS = (
-        child       => undef,
-        indirection => undef,
-        array       => undef,
-        nullable    => undef,
-    );
-
-    sub new_composite {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_composite_PARAMS, %args ) or confess $@;
-        my $flags = 0;
-        $flags |= NULLABLE if $args{nullable};
-        my $indirection = $args{indirection} || 0;
-        my $array = defined $args{array} ? $args{array} : "";
-        return _new_composite( $flags, $args{child}, $indirection, $array );
-    }
-
-    our %new_void_PARAMS = ( const => undef, );
-
-    sub new_void {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_void_PARAMS, %args ) or confess $@;
-        return _new_void( !!$args{const} );
-    }
-
-    sub new_va_list {
-        my $either = shift;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( {}, @_ ) or confess $@;
-        return _new_va_list();
-    }
-
-    our %new_arbitrary_PARAMS = (
-        parcel    => undef,
-        specifier => undef,
-    );
-
-    sub new_arbitrary {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_arbitrary_PARAMS, %args ) or confess $@;
-        my $parcel = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
-        return _new_arbitrary( $parcel, $args{specifier} );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::Variable;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Model::Symbol' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    our %new_PARAMS = (
-        type        => undef,
-        micro_sym   => undef,
-        parcel      => undef,
-        exposure    => 'local',
-        class_name  => undef,
-        class_cnick => undef,
-        inert       => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        $args{exposure} ||= 'local';
-        $args{parcel}
-            = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
-        return _new(
-            @args{
-                qw( parcel exposure class_name class_cnick micro_sym type inert )
-                }
-        );
-    }
-}
-
-{
-    package Clownfish::CFC::Model::Version;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    our %new_PARAMS = (
-        vstring => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        return _new( $args{vstring} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Core;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    our %new_PARAMS = (
-        hierarchy => undef,
-        header    => undef,
-        footer    => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        return _new( @args{qw( hierarchy header footer )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Core::Class;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( a_isa_b verify_args );
-    use Carp;
-
-    our %new_PARAMS = ( client => undef, );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        return _new( $args{client} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Core::File;
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    my %write_h_PARAMS = (
-        file   => undef,
-        dest   => undef,
-        header => undef,
-        footer => undef,
-    );
-
-    sub write_h {
-        my ( undef, %args ) = @_;
-        verify_args( \%write_h_PARAMS, %args ) or confess $@;
-        _write_h( @args{qw( file dest header footer )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Core::Method;
-
-    sub method_def {
-        my ( undef, %args ) = @_;
-        return _method_def( @args{qw( method class )} );
-    }
-
-    sub callback_obj_def {
-        my ( undef, %args ) = @_;
-        return _callback_obj_def( @args{qw( method offset )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Perl;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Carp;
-    use Clownfish::CFC::Util qw( verify_args a_isa_b );
-
-    our %new_PARAMS = (
-        hierarchy  => undef,
-        lib_dir    => undef,
-        boot_class => undef,
-        header     => undef,
-        footer     => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        return _new(
-            @args{qw( hierarchy lib_dir boot_class header footer )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Perl::Class;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Carp;
-    use Clownfish::CFC::Util qw( verify_args );
-
-    our %new_PARAMS = (
-        parcel     => undef,
-        class_name => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        $args{parcel}
-            = Clownfish::CFC::Model::Parcel->acquire( $args{parcel} );
-        return _new( @args{qw( parcel class_name )} );
-    }
-
-    our %bind_method_PARAMS = (
-        alias  => undef,
-        method => undef,
-    );
-
-    sub bind_method {
-        my ( $self, %args ) = @_;
-        verify_args( \%bind_method_PARAMS, %args ) or confess $@;
-        _bind_method( $self, @args{qw( alias method )} );
-    }
-
-    our %bind_constructor_PARAMS = (
-        alias       => undef,
-        initializer => undef,
-    );
-
-    sub bind_constructor {
-        my ( $self, %args ) = @_;
-        verify_args( \%bind_constructor_PARAMS, %args ) or confess $@;
-        _bind_constructor( $self, @args{qw( alias initializer )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Perl::Constructor;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Binding::Perl::Subroutine' }
-    use Carp;
-    use Clownfish::CFC::Util qw( verify_args );
-
-    our %new_PARAMS = (
-        class       => undef,
-        alias       => undef,
-        initializer => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess $@ unless verify_args( \%new_PARAMS, %args );
-        return _new( @args{qw( class alias initializer )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Perl::Method;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Binding::Perl::Subroutine' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    our %new_PARAMS = (
-        method => undef,
-        alias  => undef,
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        confess $@ unless verify_args( \%new_PARAMS, %args );
-        return _new( @args{qw( method alias )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Perl::Pod;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    my %add_method_PARAMS = (
-        alias  => undef,
-        method => undef,
-        sample => undef,
-        pod    => undef,
-    );
-
-    sub add_method {
-        my ( $self, %args ) = @_;
-        verify_args( \%add_method_PARAMS, %args ) or confess $@;
-        _add_method( $self, @args{qw( alias method sample pod )} );
-    }
-
-    my %add_constructor_PARAMS = (
-        alias       => undef,
-        initializer => undef,
-        sample      => undef,
-        pod         => undef,
-    );
-
-    sub add_constructor {
-        my ( $self, %args ) = @_;
-        verify_args( \%add_constructor_PARAMS, %args ) or confess $@;
-        _add_constructor( $self, @args{qw( alias initializer sample pod )} );
-    }
-}
-
-{
-    package Clownfish::CFC::Binding::Perl::Subroutine;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Carp;
-    use Clownfish::CFC::Util qw( verify_args );
-
-    sub xsub_def { confess "Abstract method" }
-}
-
-{
-    package Clownfish::CFC::Binding::Perl::TypeMap;
-    use base qw( Exporter );
-
-    our @EXPORT_OK = qw( from_perl to_perl );
-
-    sub write_xs_typemap {
-        my ( undef, %args ) = @_;
-        _write_xs_typemap( $args{hierarchy} );
-    }
-}
-
-{
-    package Clownfish::CFC::Test;
-    BEGIN { push our @ISA, 'Clownfish::CFC::Base' }
-    use Clownfish::CFC::Util qw( verify_args );
-    use Carp;
-
-    my %new_PARAMS = (
-        formatter_name => 'tap',
-    );
-
-    sub new {
-        my ( $either, %args ) = @_;
-        verify_args( \%new_PARAMS, %args ) or confess $@;
-        confess "no subclassing allowed" unless $either eq __PACKAGE__;
-        $args{formatter_name} = 'tap' unless defined $args{formatter_name};
-        return _new( @args{qw( formatter_name )} );
-    }
-}
-
-1;
-
-=head1 NAME
-
-Clownfish::CFC - Clownfish compiler.
-
-=head1 PRIVATE API
-
-CFC is an Apache Lucy implementation detail.  This documentation is partial --
-enough for the curious hacker, but not a full API.
-
-=head1 SYNOPSIS
-
-    use Clownfish::CFC::Model::Hierarchy;
-    use Clownfish::CFC::Binding::Core;
-
-    # Compile all .cfh files in $cf_source into 'autogen'.
-    my $hierarchy = Clownfish::CFC::Model::Hierarchy->new(
-        source => $cf_source,
-        dest   => 'autogen',
-    );  
-    $hierarchy->build;
-    my $core_binding = Clownfish::CFC::Binding::Core->new(
-        hierarchy => $hierarchy,
-        dest      => 'autogen',
-        header    => $license_header,
-        footer    => '', 
-    );  
-    $core_binding->write_all_modified;
-
-=head1 COPYRIGHT 
- 
-Clownfish is distributed under the Apache License, Version 2.0, as 
-described in the file C<LICENSE> included with the distribution. 
-
-=cut
-


[lucy-commits] [39/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Implement Compare_To() for RawPosting.

Posted by ma...@apache.org.
Implement Compare_To() for RawPosting.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/e6d1963a
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/e6d1963a
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/e6d1963a

Branch: refs/heads/sortex_ptr_only
Commit: e6d1963ab2e5b9a5c394ff3639a4559cc5b20e0b
Parents: d4282a9
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Jan 2 17:43:16 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 08:56:54 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/Posting/RawPosting.c   | 22 ++++++++++++++++++++++
 core/Lucy/Index/Posting/RawPosting.cfh |  3 +++
 2 files changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/e6d1963a/core/Lucy/Index/Posting/RawPosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RawPosting.c b/core/Lucy/Index/Posting/RawPosting.c
index 5f5e8d4..d02cae2 100644
--- a/core/Lucy/Index/Posting/RawPosting.c
+++ b/core/Lucy/Index/Posting/RawPosting.c
@@ -51,6 +51,28 @@ RawPost_Destroy_IMP(RawPosting *self) {
     THROW(ERR, "Illegal attempt to destroy RawPosting object");
 }
 
+int32_t
+RawPost_Compare_To_IMP(RawPosting *self, Obj *other) {
+    RawPostingIVARS *const ivars = RawPost_IVARS(self);
+    RawPostingIVARS *const ovars = RawPost_IVARS((RawPosting*)other);
+    const size_t my_len    = ivars->content_len;
+    const size_t other_len = ovars->content_len;
+    const size_t len       = my_len < other_len ? my_len : other_len;
+    int32_t comparison = memcmp(ivars->blob, ovars->blob, len);
+
+    if (comparison == 0) {
+        // If a is a substring of b, it's less than b, so return a neg num.
+        comparison = (int32_t)((int64_t)my_len - (int64_t)other_len);
+
+        // Break ties by doc id.
+        if (comparison == 0) {
+            comparison = ivars->doc_id - ovars->doc_id;
+        }
+    }
+
+    return comparison;
+}
+
 uint32_t
 RawPost_Get_RefCount_IMP(RawPosting* self) {
     UNUSED_VAR(self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/e6d1963a/core/Lucy/Index/Posting/RawPosting.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RawPosting.cfh b/core/Lucy/Index/Posting/RawPosting.cfh
index b57c285..2fe0286 100644
--- a/core/Lucy/Index/Posting/RawPosting.cfh
+++ b/core/Lucy/Index/Posting/RawPosting.cfh
@@ -59,6 +59,9 @@ class Lucy::Index::RawPosting nickname RawPost
     uint32_t
     Dec_RefCount(RawPosting* self);
 
+    public int32_t
+    Compare_To(RawPosting *self, Obj *other);
+
     /** Throws an error.
      */
     public void


[lucy-commits] [32/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Remove unneeded build action dependency

Posted by ma...@apache.org.
Remove unneeded build action dependency


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/12104ffd
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/12104ffd
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/12104ffd

Branch: refs/heads/sortex_ptr_only
Commit: 12104ffd658443db85653718e0b820b9fb2f7950
Parents: 0c43d91
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Apr 22 22:49:32 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 22 23:05:37 2014 +0200

----------------------------------------------------------------------
 perl/buildlib/Lucy/Build.pm | 8 --------
 1 file changed, 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/12104ffd/perl/buildlib/Lucy/Build.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build.pm b/perl/buildlib/Lucy/Build.pm
index ebfabb5..7bdf648 100644
--- a/perl/buildlib/Lucy/Build.pm
+++ b/perl/buildlib/Lucy/Build.pm
@@ -93,14 +93,6 @@ sub ACTION_copy_clownfish_includes {
     $self->cf_copy_include_file( qw( Lucy Util ToolSet.h ) );
 }
 
-sub ACTION_clownfish {
-    my $self = shift;
-
-    $self->depends_on('charmony');
-
-    $self->SUPER::ACTION_clownfish;
-}
-
 sub ACTION_suppressions {
     my $self       = shift;
     my $LOCAL_SUPP = 'local.supp';


[lucy-commits] [25/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Stop using bundled Clownfish.

Posted by ma...@apache.org.
Stop using bundled Clownfish.

Don't use bundled Clownfish compiler or runtime.
Eliminate commands to build bundled Clownfish compiler and runtime.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/ba087226
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/ba087226
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/ba087226

Branch: refs/heads/sortex_ptr_only
Commit: ba087226d6c053fd552b156911afc1ba97c4ef89
Parents: 746f4c0
Author: Tim Wilkens <ti...@gmail.com>
Authored: Fri Mar 21 15:57:06 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 12 00:38:34 2014 -0600

----------------------------------------------------------------------
 perl/buildlib/Lucy/Build.pm | 71 +---------------------------------------
 1 file changed, 1 insertion(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/ba087226/perl/buildlib/Lucy/Build.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build.pm b/perl/buildlib/Lucy/Build.pm
index 8f45e82..0d611ef 100644
--- a/perl/buildlib/Lucy/Build.pm
+++ b/perl/buildlib/Lucy/Build.pm
@@ -16,25 +16,8 @@
 use strict;
 use warnings;
 
-use lib '../clownfish/compiler/perl/blib/arch';
-use lib '../clownfish/compiler/perl/blib/lib';
-use lib 'clownfish/compiler/perl/blib/arch';
-use lib 'clownfish/compiler/perl/blib/lib';
-use lib '../clownfish/runtime/perl/blib/arch';
-use lib '../clownfish/runtime/perl/blib/lib';
-use lib 'clownfish/runtime/perl/blib/arch';
-use lib 'clownfish/runtime/perl/blib/lib';
-
 package Lucy::Build;
-
-# We want to subclass Clownfish::CFC::Perl::Build, but CFC might not be built
-# yet. So we look in 'clownfish/compiler/perl/lib' directly and cleanup @INC
-# afterwards.
-use lib '../clownfish/compiler/perl/lib';
-use lib 'clownfish/compiler/perl/lib';
 use base qw( Clownfish::CFC::Perl::Build );
-no lib '../clownfish/compiler/perl/lib';
-no lib 'clownfish/compiler/perl/lib';
 
 our $VERSION = '0.003000';
 $VERSION = eval $VERSION;
@@ -53,10 +36,6 @@ my $CHARMONIZER_C     = catfile( $COMMON_SOURCE_DIR, 'charmonizer.c' );
 my $LEMON_DIR         = catdir( @BASE_PATH, 'lemon' );
 my $LEMON_EXE_PATH    = catfile( $LEMON_DIR, "lemon$Config{_exe}" );
 my $CORE_SOURCE_DIR   = catdir( @BASE_PATH, 'core' );
-my $CFC_DIR           = catdir( @BASE_PATH, 'clownfish', 'compiler', 'perl' );
-my $CFC_BUILD         = catfile( $CFC_DIR, 'Build' );
-my $CFR_DIR           = catdir( @BASE_PATH, 'clownfish', 'runtime', 'perl' );
-my $CFR_BUILD         = catfile( $CFR_DIR, 'Build' );
 my $LIB_DIR           = 'lib';
 
 sub new {
@@ -103,32 +82,6 @@ sub ACTION_lemon {
     );
 }
 
-sub ACTION_cfc {
-    my $self    = shift;
-    my $old_dir = getcwd();
-    chdir($CFC_DIR);
-    if ( !-f 'Build' ) {
-        print "\nBuilding Clownfish compiler... \n";
-        system("$^X Build.PL");
-        system("$^X Build code");
-        print "\nFinished building Clownfish compiler.\n\n";
-    }
-    chdir($old_dir);
-}
-
-sub ACTION_cfr {
-    my $self    = shift;
-    my $old_dir = getcwd();
-    chdir($CFR_DIR);
-    if ( !-f 'Build' ) {
-        print "\nBuilding Clownfish runtime... \n";
-        system("$^X Build.PL");
-        system("$^X Build code");
-        print "\nFinished building Clownfish runtime.\n\n";
-    }
-    chdir($old_dir);
-}
-
 sub ACTION_copy_clownfish_includes {
     my $self = shift;
 
@@ -145,8 +98,6 @@ sub ACTION_clownfish {
     my $self = shift;
 
     $self->dispatch('charmony');
-    $self->dispatch('cfc');
-    $self->dispatch('cfr');
 
     $self->SUPER::ACTION_clownfish;
 }
@@ -448,29 +399,9 @@ sub ACTION_semiclean {
     }
 }
 
-# Run the cleanup targets for independent prerequisite builds.
-sub _clean_prereq_builds {
-    my $self = shift;
-    if ( -e $CFC_BUILD ) {
-        my $old_dir = getcwd();
-        chdir $CFC_DIR;
-        system("$^X Build realclean")
-            and die "Clownfish compiler clean failed";
-        chdir $old_dir;
-    }
-    if ( -e $CFR_BUILD ) {
-        my $old_dir = getcwd();
-        chdir $CFR_DIR;
-        system("$^X Build realclean")
-            and die "Clownfish runtime clean failed";
-        chdir $old_dir;
-    }
-    $self->_run_make( dir => $LEMON_DIR, args => ['clean'] );
-}
-
 sub ACTION_clean {
     my $self = shift;
-    _clean_prereq_builds($self);
+    $self->_run_make( dir => $LEMON_DIR, args => ['clean'] );
     $self->SUPER::ACTION_clean;
 }
 


[lucy-commits] [12/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlConstructor.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlConstructor.c b/clownfish/compiler/src/CFCPerlConstructor.c
deleted file mode 100644
index eeaec24..0000000
--- a/clownfish/compiler/src/CFCPerlConstructor.c
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-#define CFC_NEED_PERLSUB_STRUCT_DEF 1
-#include "CFCPerlSub.h"
-#include "CFCPerlConstructor.h"
-#include "CFCClass.h"
-#include "CFCFunction.h"
-#include "CFCParamList.h"
-#include "CFCType.h"
-#include "CFCVariable.h"
-#include "CFCUtil.h"
-#include "CFCPerlTypeMap.h"
-
-struct CFCPerlConstructor {
-    CFCPerlSub   sub;
-    CFCFunction *init_func;
-};
-
-static const CFCMeta CFCPERLCONSTRUCTOR_META = {
-    "Clownfish::CFC::Binding::Perl::Constructor",
-    sizeof(CFCPerlConstructor),
-    (CFCBase_destroy_t)CFCPerlConstructor_destroy
-};
-
-CFCPerlConstructor*
-CFCPerlConstructor_new(CFCClass *klass, const char *alias,
-                       const char *initializer) {
-    CFCPerlConstructor *self
-        = (CFCPerlConstructor*)CFCBase_allocate(&CFCPERLCONSTRUCTOR_META);
-    return CFCPerlConstructor_init(self, klass, alias, initializer);
-}
-
-CFCPerlConstructor*
-CFCPerlConstructor_init(CFCPerlConstructor *self, CFCClass *klass,
-                        const char *alias, const char *initializer) {
-    CFCUTIL_NULL_CHECK(alias);
-    CFCUTIL_NULL_CHECK(klass);
-    const char *class_name = CFCClass_get_class_name(klass);
-    initializer = initializer ? initializer : "init";
-
-    // Find the implementing function.
-    self->init_func = NULL;
-    CFCFunction **funcs = CFCClass_functions(klass);
-    for (size_t i = 0; funcs[i] != NULL; i++) {
-        CFCFunction *func = funcs[i];
-        const char *func_name = CFCFunction_micro_sym(func);
-        if (strcmp(initializer, func_name) == 0) {
-            self->init_func = (CFCFunction*)CFCBase_incref((CFCBase*)func);
-            break;
-        }
-    }
-    if (!self->init_func) {
-        CFCUtil_die("Missing or invalid '%s' function for '%s'",
-                    initializer, class_name);
-    }
-    CFCParamList *param_list = CFCFunction_get_param_list(self->init_func);
-    CFCPerlSub_init((CFCPerlSub*)self, param_list, class_name, alias,
-                    true);
-    return self;
-}
-
-void
-CFCPerlConstructor_destroy(CFCPerlConstructor *self) {
-    CFCBase_decref((CFCBase*)self->init_func);
-    CFCPerlSub_destroy((CFCPerlSub*)self);
-}
-
-char*
-CFCPerlConstructor_xsub_def(CFCPerlConstructor *self) {
-    const char *c_name = self->sub.c_name;
-    CFCParamList *param_list = self->sub.param_list;
-    const char   *name_list  = CFCParamList_name_list(param_list);
-    CFCVariable **arg_vars   = CFCParamList_get_variables(param_list);
-    const char   *func_sym   = CFCFunction_full_func_sym(self->init_func);
-    char *allot_params = CFCPerlSub_build_allot_params((CFCPerlSub*)self);
-    CFCVariable *self_var       = arg_vars[0];
-    CFCType     *self_type      = CFCVariable_get_type(self_var);
-    const char  *self_type_str  = CFCType_to_c(self_type);
-
-    // Compensate for swallowed refcounts.
-    char *refcount_mods = CFCUtil_strdup("");
-    for (size_t i = 0; arg_vars[i] != NULL; i++) {
-        CFCVariable *var = arg_vars[i];
-        CFCType *type = CFCVariable_get_type(var);
-        if (CFCType_is_object(type) && CFCType_decremented(type)) {
-            const char *name = CFCVariable_micro_sym(var);
-            refcount_mods = CFCUtil_cat(refcount_mods, "\n    CFISH_INCREF(",
-                                        name, ");", NULL);
-        }
-    }
-
-    const char pattern[] =
-        "XS(%s);\n"
-        "XS(%s) {\n"
-        "    dXSARGS;\n"
-        "    CFISH_UNUSED_VAR(cv);\n"
-        "    if (items < 1) { CFISH_THROW(CFISH_ERR, \"Usage: %%s(class_name, ...)\",  GvNAME(CvGV(cv))); }\n"
-        "    SP -= items;\n"
-        "\n"
-        "    %s\n"
-        // Create "self" last, so that earlier exceptions while fetching
-        // params don't trigger a bad invocation of DESTROY.
-        "    %s self = (%s)XSBind_new_blank_obj(ST(0));%s\n"
-        "\n"
-        "    %s retval = %s(%s);\n"
-        "    if (retval) {\n"
-        "        ST(0) = (SV*)CFISH_Obj_To_Host((cfish_Obj*)retval);\n"
-        "        CFISH_Obj_Dec_RefCount((cfish_Obj*)retval);\n"
-        "    }\n"
-        "    else {\n"
-        "        ST(0) = newSV(0);\n"
-        "    }\n"
-        "    sv_2mortal(ST(0));\n"
-        "    XSRETURN(1);\n"
-        "}\n\n";
-    char *xsub_def
-        = CFCUtil_sprintf(pattern, c_name, c_name, allot_params, self_type_str,
-                          self_type_str, refcount_mods, self_type_str,
-                          func_sym, name_list);
-
-    FREEMEM(refcount_mods);
-    FREEMEM(allot_params);
-
-    return xsub_def;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlConstructor.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlConstructor.h b/clownfish/compiler/src/CFCPerlConstructor.h
deleted file mode 100644
index 3de46b5..0000000
--- a/clownfish/compiler/src/CFCPerlConstructor.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCPERLCONSTRUCTOR
-#define H_CFCPERLCONSTRUCTOR
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCPerlConstructor CFCPerlConstructor;
-struct CFCClass;
-
-/** Clownfish::CFC::Binding::Perl::Constructor - Binding for an object method.
- *
- * This class isa Clownfish::CFC::Binding::Perl::Subroutine -- see its
- * documentation for various code-generating routines.
- * 
- * Constructors are always bound to accept labeled params, even if there is only
- * a single argument.
- */
-
-/**
- * @param klass A L<Clownfish::CFC::Model::Class>.
- * @param alias The Perl name for the constructor.
- * @param initializer The name of the function which should be bound (default
- * "init").
- */
-CFCPerlConstructor*
-CFCPerlConstructor_new(struct CFCClass *klass, const char *alias,
-                       const char *initializer);
-
-CFCPerlConstructor*
-CFCPerlConstructor_init(CFCPerlConstructor *self, struct CFCClass *klass,
-                        const char *alias, const char *initializer);
-
-void
-CFCPerlConstructor_destroy(CFCPerlConstructor *self);
-
-/** Generate C code for the XSUB.
- */
-char*
-CFCPerlConstructor_xsub_def(CFCPerlConstructor *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPERLCONSTRUCTOR */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlMethod.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlMethod.c b/clownfish/compiler/src/CFCPerlMethod.c
deleted file mode 100644
index a5c0bd0..0000000
--- a/clownfish/compiler/src/CFCPerlMethod.c
+++ /dev/null
@@ -1,666 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#define CFC_NEED_PERLSUB_STRUCT_DEF 1
-#include "CFCPerlSub.h"
-#include "CFCPerlMethod.h"
-#include "CFCUtil.h"
-#include "CFCClass.h"
-#include "CFCMethod.h"
-#include "CFCSymbol.h"
-#include "CFCType.h"
-#include "CFCParcel.h"
-#include "CFCParamList.h"
-#include "CFCPerlTypeMap.h"
-#include "CFCVariable.h"
-
-struct CFCPerlMethod {
-    CFCPerlSub  sub;
-    CFCMethod  *method;
-};
-
-// Return the main chunk of the code for the xsub.
-static char*
-S_xsub_body(CFCPerlMethod *self);
-
-// Create an assignment statement for extracting $self from the Perl stack.
-static char*
-S_self_assign_statement(CFCPerlMethod *self, CFCType *type);
-
-// Return code for an xsub which uses labeled params.
-static char*
-S_xsub_def_labeled_params(CFCPerlMethod *self);
-
-// Return code for an xsub which uses positional args.
-static char*
-S_xsub_def_positional_args(CFCPerlMethod *self);
-
-/* Take a NULL-terminated list of CFCVariables and build up a string of
- * directives like:
- *
- *     UNUSED_VAR(var1);
- *     UNUSED_VAR(var2);
- */
-static char*
-S_build_unused_vars(CFCVariable **vars);
-
-/* Create an unreachable return statement if necessary, in order to thwart
- * compiler warnings. */
-static char*
-S_maybe_unreachable(CFCType *return_type);
-
-/* Generate code which converts C types to Perl types and pushes arguments
- * onto the Perl stack.
- */
-static char*
-S_callback_start(CFCMethod *method);
-
-/* Adapt the refcounts of parameters and return types.
- */
-static char*
-S_callback_refcount_mods(CFCMethod *method);
-
-/* Return a function which throws a runtime error indicating which variable
- * couldn't be mapped.  TODO: it would be better to resolve all these cases at
- * compile-time.
- */
-static char*
-S_invalid_callback_def(CFCMethod *method);
-
-// Create a callback for a method which operates in a void context.
-static char*
-S_void_callback_def(CFCMethod *method, const char *callback_start,
-                    const char *refcount_mods);
-
-// Create a callback which returns a primitive type.
-static char*
-S_primitive_callback_def(CFCMethod *method, const char *callback_start,
-                         const char *refcount_mods);
-
-/* Create a callback which returns an object type -- either a generic object or
- * a string. */
-static char*
-S_obj_callback_def(CFCMethod *method, const char *callback_start,
-                   const char *refcount_mods);
-
-static const CFCMeta CFCPERLMETHOD_META = {
-    "Clownfish::CFC::Binding::Perl::Method",
-    sizeof(CFCPerlMethod),
-    (CFCBase_destroy_t)CFCPerlMethod_destroy
-};
-
-CFCPerlMethod*
-CFCPerlMethod_new(CFCMethod *method, const char *alias) {
-    CFCPerlMethod *self
-        = (CFCPerlMethod*)CFCBase_allocate(&CFCPERLMETHOD_META);
-    return CFCPerlMethod_init(self, method, alias);
-}
-
-CFCPerlMethod*
-CFCPerlMethod_init(CFCPerlMethod *self, CFCMethod *method,
-                   const char *alias) {
-    CFCParamList *param_list = CFCMethod_get_param_list(method);
-    const char *class_name = CFCMethod_get_class_name(method);
-    int use_labeled_params = CFCParamList_num_vars(param_list) > 2
-                             ? 1 : 0;
-
-    // The Clownfish destructor needs to be spelled DESTROY for Perl.
-    if (!alias) {
-        alias = CFCMethod_micro_sym(method);
-    }
-    static const char destroy_uppercase[] = "DESTROY";
-    if (strcmp(alias, "destroy") == 0) {
-        alias = destroy_uppercase;
-    }
-
-    CFCPerlSub_init((CFCPerlSub*)self, param_list, class_name, alias,
-                    use_labeled_params);
-    self->method = (CFCMethod*)CFCBase_incref((CFCBase*)method);
-    return self;
-}
-
-void
-CFCPerlMethod_destroy(CFCPerlMethod *self) {
-    CFCBase_decref((CFCBase*)self->method);
-    CFCPerlSub_destroy((CFCPerlSub*)self);
-}
-
-char*
-CFCPerlMethod_xsub_def(CFCPerlMethod *self) {
-    if (self->sub.use_labeled_params) {
-        return S_xsub_def_labeled_params(self);
-    }
-    else {
-        return S_xsub_def_positional_args(self);
-    }
-}
-
-static char*
-S_xsub_body(CFCPerlMethod *self) {
-    CFCMethod    *method        = self->method;
-    CFCParamList *param_list    = CFCMethod_get_param_list(method);
-    CFCVariable **arg_vars      = CFCParamList_get_variables(param_list);
-    const char   *name_list     = CFCParamList_name_list(param_list);
-    char *body = CFCUtil_strdup("");
-
-    CFCParcel *parcel = CFCMethod_get_parcel(method);
-    const char *class_name = CFCMethod_get_class_name(method);
-    CFCClass *klass = CFCClass_fetch_singleton(parcel, class_name);
-    if (!klass) {
-        CFCUtil_die("Can't find a CFCClass for '%s'", class_name);
-    }
-
-    // Extract the method function pointer.
-    char *full_typedef = CFCMethod_full_typedef(method, klass);
-    char *full_meth    = CFCMethod_full_method_sym(method, klass);
-    char *method_ptr
-        = CFCUtil_sprintf("%s method = CFISH_METHOD_PTR(%s, %s);\n    ",
-                          full_typedef, CFCClass_full_vtable_var(klass),
-                          full_meth);
-    body = CFCUtil_cat(body, method_ptr, NULL);
-    FREEMEM(full_typedef);
-    FREEMEM(full_meth);
-    FREEMEM(method_ptr);
-
-    // Compensate for functions which eat refcounts.
-    for (int i = 0; arg_vars[i] != NULL; i++) {
-        CFCVariable *var = arg_vars[i];
-        CFCType     *type = CFCVariable_get_type(var);
-        if (CFCType_is_object(type) && CFCType_decremented(type)) {
-            body = CFCUtil_cat(body, "CFISH_INCREF(",
-                               CFCVariable_micro_sym(var), ");\n    ", NULL);
-        }
-    }
-
-    if (CFCType_is_void(CFCMethod_get_return_type(method))) {
-        // Invoke method in void context.
-        body = CFCUtil_cat(body, "method(", name_list,
-                           ");\n    XSRETURN(0);", NULL);
-    }
-    else {
-        // Return a value for method invoked in a scalar context.
-        CFCType *return_type = CFCMethod_get_return_type(method);
-        const char *type_str = CFCType_to_c(return_type);
-        char *assignment = CFCPerlTypeMap_to_perl(return_type, "retval");
-        if (!assignment) {
-            CFCUtil_die("Can't find typemap for '%s'", type_str);
-        }
-        body = CFCUtil_cat(body, type_str, " retval = method(",
-                           name_list, ");\n    ST(0) = ", assignment, ";",
-                           NULL);
-        if (CFCType_is_object(return_type)
-            && CFCType_incremented(return_type)
-           ) {
-            body = CFCUtil_cat(body, "\n    CFISH_DECREF(retval);", NULL);
-        }
-        body = CFCUtil_cat(body, "\n    sv_2mortal( ST(0) );\n    XSRETURN(1);",
-                           NULL);
-        FREEMEM(assignment);
-    }
-
-    return body;
-}
-
-// Create an assignment statement for extracting $self from the Perl stack.
-static char*
-S_self_assign_statement(CFCPerlMethod *self, CFCType *type) {
-    (void)self; // unused
-    const char *type_c = CFCType_to_c(type);
-    if (!CFCType_is_object(type)) {
-        CFCUtil_die("Not an object type: %s", type_c);
-    }
-    const char *vtable_var = CFCType_get_vtable_var(type);
-    char pattern[] = "%s self = (%s)XSBind_sv_to_cfish_obj(ST(0), %s, NULL);";
-    char *statement = CFCUtil_sprintf(pattern, type_c, type_c, vtable_var);
-
-    return statement;
-}
-
-static char*
-S_xsub_def_labeled_params(CFCPerlMethod *self) {
-    const char *c_name = self->sub.c_name;
-    CFCParamList *param_list = self->sub.param_list;
-    CFCVariable **arg_vars   = CFCParamList_get_variables(param_list);
-    CFCVariable *self_var    = arg_vars[0];
-    CFCType     *self_type   = CFCVariable_get_type(self_var);
-    const char  *self_micro_sym = CFCVariable_micro_sym(self_var);
-    char *self_assign = S_self_assign_statement(self, self_type);
-    char *allot_params = CFCPerlSub_build_allot_params((CFCPerlSub*)self);
-    char *body = S_xsub_body(self);
-
-    char pattern[] =
-        "XS(%s);\n"
-        "XS(%s) {\n"
-        "    dXSARGS;\n"
-        "    CFISH_UNUSED_VAR(cv);\n"
-        "    if (items < 1) { CFISH_THROW(CFISH_ERR, \"Usage: %%s(%s, ...)\",  GvNAME(CvGV(cv))); }\n"
-        "    SP -= items;\n"
-        "\n"
-        "    /* Extract vars from Perl stack. */\n"
-        "    %s\n"
-        "    %s\n"
-        "\n"
-        "    /* Execute */\n"
-        "    %s\n"
-        "}\n";
-    char *xsub_def
-        = CFCUtil_sprintf(pattern, c_name, c_name, self_micro_sym,
-                          allot_params, self_assign, body);
-
-    FREEMEM(self_assign);
-    FREEMEM(allot_params);
-    FREEMEM(body);
-    return xsub_def;
-}
-
-static char*
-S_xsub_def_positional_args(CFCPerlMethod *self) {
-    CFCMethod *method = self->method;
-    CFCParamList *param_list = CFCMethod_get_param_list(method);
-    CFCVariable **arg_vars = CFCParamList_get_variables(param_list);
-    const char **arg_inits = CFCParamList_get_initial_values(param_list);
-    unsigned num_vars = (unsigned)CFCParamList_num_vars(param_list);
-    char *body = S_xsub_body(self);
-
-    // Determine how many args are truly required and build an error check.
-    unsigned min_required = 0;
-    for (unsigned i = 0; i < num_vars; i++) {
-        if (arg_inits[i] == NULL) {
-            min_required = i + 1;
-        }
-    }
-    char *xs_name_list = num_vars > 0
-                         ? CFCUtil_strdup(CFCVariable_micro_sym(arg_vars[0]))
-                         : CFCUtil_strdup("");
-    for (unsigned i = 1; i < num_vars; i++) {
-        const char *var_name = CFCVariable_micro_sym(arg_vars[i]);
-        if (i < min_required) {
-            xs_name_list = CFCUtil_cat(xs_name_list, ", ", var_name, NULL);
-        }
-        else {
-            xs_name_list = CFCUtil_cat(xs_name_list, ", [", var_name, "]",
-                                       NULL);
-        }
-    }
-    const char num_args_pattern[] =
-        "if (items %s %u) { CFISH_THROW(CFISH_ERR, \"Usage: %%s(%s)\", GvNAME(CvGV(cv))); }";
-    char *num_args_check;
-    if (min_required < num_vars) {
-        num_args_check = CFCUtil_sprintf(num_args_pattern, "<", min_required,
-                                         xs_name_list);
-    }
-    else {
-        num_args_check = CFCUtil_sprintf(num_args_pattern, "!=", num_vars,
-                                         xs_name_list);
-    }
-
-    // Var assignments.
-    char *var_assignments = CFCUtil_strdup("");
-    for (unsigned i = 0; i < num_vars; i++) {
-        CFCVariable *var = arg_vars[i];
-        const char  *val = arg_inits[i];
-        const char  *var_name = CFCVariable_micro_sym(var);
-        CFCType     *var_type = CFCVariable_get_type(var);
-        const char  *type_c   = CFCType_to_c(var_type);
-
-        if (i == 0) {    // self
-            char *statement = S_self_assign_statement(self, var_type);
-            var_assignments = CFCUtil_cat(var_assignments, statement, NULL);
-            FREEMEM(statement);
-        }
-        else {
-            char perl_stack_var[30];
-            sprintf(perl_stack_var, "ST(%u)", i);
-            char *conversion
-                = CFCPerlTypeMap_from_perl(var_type, perl_stack_var);
-            if (!conversion) {
-                CFCUtil_die("Can't map type '%s'", type_c);
-            }
-            if (val) {
-                char pattern[] =
-                    "\n    %s %s = ( items >= %u && XSBind_sv_defined(ST(%u)) )"
-                    " ? %s : %s;";
-                char *statement = CFCUtil_sprintf(pattern, type_c, var_name, i,
-                                                  i, conversion, val);
-                var_assignments
-                    = CFCUtil_cat(var_assignments, statement, NULL);
-                FREEMEM(statement);
-            }
-            else {
-                var_assignments
-                    = CFCUtil_cat(var_assignments, "\n    ", type_c, " ",
-                                  var_name, " = ", conversion, ";", NULL);
-            }
-            FREEMEM(conversion);
-        }
-    }
-
-    char pattern[] =
-        "XS(%s);\n"
-        "XS(%s) {\n"
-        "    dXSARGS;\n"
-        "    CFISH_UNUSED_VAR(cv);\n"
-        "    SP -= items;\n"
-        "    %s;\n"
-        "\n"
-        "    /* Extract vars from Perl stack. */\n"
-        "    %s\n"
-        "\n"
-        "    /* Execute */\n"
-        "    %s\n"
-        "}\n";
-    char *xsub
-        = CFCUtil_sprintf(pattern, self->sub.c_name, self->sub.c_name,
-                          num_args_check, var_assignments, body);
-
-    FREEMEM(num_args_check);
-    FREEMEM(var_assignments);
-    FREEMEM(body);
-    return xsub;
-}
-
-char*
-CFCPerlMethod_callback_def(CFCMethod *method) {
-    CFCType *return_type = CFCMethod_get_return_type(method);
-    char *start = S_callback_start(method);
-    char *callback_def = NULL;
-    char *refcount_mods = S_callback_refcount_mods(method);
-
-    if (!start) {
-        // Can't map vars, because there's at least one type in the argument
-        // list we don't yet support.  Return a callback wrapper that throws
-        // an error error.
-        callback_def = S_invalid_callback_def(method);
-    }
-    else if (CFCType_is_void(return_type)) {
-        callback_def = S_void_callback_def(method, start, refcount_mods);
-    }
-    else if (CFCType_is_object(return_type)) {
-        callback_def = S_obj_callback_def(method, start, refcount_mods);
-    }
-    else if (CFCType_is_integer(return_type)
-             || CFCType_is_floating(return_type)
-        ) {
-        callback_def = S_primitive_callback_def(method, start, refcount_mods);
-    }
-    else {
-        // Can't map return type.
-        callback_def = S_invalid_callback_def(method);
-    }
-
-    FREEMEM(start);
-    FREEMEM(refcount_mods);
-    return callback_def;
-}
-
-static char*
-S_build_unused_vars(CFCVariable **vars) {
-    char *unused = CFCUtil_strdup("");
-
-    for (int i = 0; vars[i] != NULL; i++) {
-        const char *var_name = CFCVariable_micro_sym(vars[i]);
-        size_t size = strlen(unused) + strlen(var_name) + 80;
-        unused = (char*)REALLOCATE(unused, size);
-        strcat(unused, "\n    CFISH_UNUSED_VAR(");
-        strcat(unused, var_name);
-        strcat(unused, ");");
-    }
-
-    return unused;
-}
-
-static char*
-S_maybe_unreachable(CFCType *return_type) {
-    char *return_statement;
-    if (CFCType_is_void(return_type)) {
-        return_statement = CFCUtil_strdup("");
-    }
-    else {
-        const char *ret_type_str = CFCType_to_c(return_type);
-        char pattern[] = "\n    CFISH_UNREACHABLE_RETURN(%s);";
-        return_statement = CFCUtil_sprintf(pattern, ret_type_str);
-    }
-    return return_statement;
-}
-
-static char*
-S_callback_start(CFCMethod *method) {
-    CFCParamList *param_list = CFCMethod_get_param_list(method);
-    static const char pattern[] =
-        "    dSP;\n"
-        "    EXTEND(SP, %d);\n"
-        "    ENTER;\n"
-        "    SAVETMPS;\n"
-        "    PUSHMARK(SP);\n"
-        "    mPUSHs((SV*)CFISH_Obj_To_Host((cfish_Obj*)self));\n";
-    int num_args = (int)CFCParamList_num_vars(param_list) - 1;
-    int num_to_extend = num_args == 0 ? 1
-                      : num_args == 1 ? 2
-                      : 1 + (num_args * 2);
-    char *params = CFCUtil_sprintf(pattern, num_to_extend);
-
-    // Iterate over arguments, mapping them to Perl scalars.
-    CFCVariable **arg_vars = CFCParamList_get_variables(param_list);
-    for (int i = 1; arg_vars[i] != NULL; i++) {
-        CFCVariable *var      = arg_vars[i];
-        const char  *name     = CFCVariable_micro_sym(var);
-        CFCType     *type     = CFCVariable_get_type(var);
-        const char  *c_type   = CFCType_to_c(type);
-
-        // Add labels when there are two or more parameters.
-        if (num_args > 1) {
-            char num_buf[20];
-            sprintf(num_buf, "%d", (int)strlen(name));
-            params = CFCUtil_cat(params, "   mPUSHp(\"", name, "\", ",
-                                 num_buf, ");\n", NULL);
-        }
-
-        if (CFCType_is_string_type(type)) {
-            // Convert Clownfish string type to UTF-8 Perl string scalars.
-            params = CFCUtil_cat(params, "    mPUSHs(XSBind_str_to_sv(",
-                                 "(cfish_String*)", name, "));\n", NULL);
-        }
-        else if (CFCType_is_object(type)) {
-            // Wrap other Clownfish object types in Perl objects.
-            params = CFCUtil_cat(params, "    mPUSHs(XSBind_cfish_to_perl(",
-                                 "(cfish_Obj*)", name, "));\n", NULL);
-        }
-        else if (CFCType_is_integer(type)) {
-            // Convert primitive integer types to IV Perl scalars.
-            int width = (int)CFCType_get_width(type);
-            if (width != 0 && width <= 4) {
-                params = CFCUtil_cat(params, "   mPUSHi(",
-                                     name, ");\n", NULL);
-            }
-            else {
-                // If the Perl IV integer type is not wide enough, use
-                // doubles.  This may be lossy if the value is above 2**52,
-                // but practically speaking, it's important to handle numbers
-                // between 2**32 and 2**52 cleanly.
-                params = CFCUtil_cat(params,
-                                     "    if (sizeof(IV) >= sizeof(", c_type,
-                                     ")) { mPUSHi(", name, "); }\n",
-                                     "    else { mPUSHn((double)", name,
-                                     "); } // lossy \n", NULL);
-            }
-        }
-        else if (CFCType_is_floating(type)) {
-            // Convert primitive floating point types to NV Perl scalars.
-            params = CFCUtil_cat(params, "   mPUSHn(",
-                                 name, ");\n", NULL);
-        }
-        else {
-            // Can't map variable type.  Signal to caller.
-            FREEMEM(params);
-            return NULL;
-        }
-    }
-
-    // Restore the Perl stack pointer.
-    params = CFCUtil_cat(params, "    PUTBACK;\n", NULL);
-
-    return params;
-}
-
-static char*
-S_callback_refcount_mods(CFCMethod *method) {
-    char *refcount_mods = CFCUtil_strdup("");
-    CFCType *return_type = CFCMethod_get_return_type(method);
-    CFCParamList *param_list = CFCMethod_get_param_list(method);
-    CFCVariable **arg_vars = CFCParamList_get_variables(param_list);
-
-    // `XSBind_perl_to_cfish()` returns an incremented object.  If this method
-    // does not return an incremented object, we must cancel out that
-    // refcount.  (No function can return a decremented object.)
-    if (CFCType_is_object(return_type) && !CFCType_incremented(return_type)) {
-        refcount_mods = CFCUtil_cat(refcount_mods,
-                                    "\n    CFISH_DECREF(retval);", NULL);
-    }
-
-    // Adjust refcounts of arguments per method signature, so that Perl code
-    // does not have to.
-    for (int i = 0; arg_vars[i] != NULL; i++) {
-        CFCVariable *var  = arg_vars[i];
-        CFCType     *type = CFCVariable_get_type(var);
-        const char  *name = CFCVariable_micro_sym(var);
-        if (!CFCType_is_object(type)) {
-            continue;
-        }
-        else if (CFCType_incremented(type)) {
-            refcount_mods = CFCUtil_cat(refcount_mods, "\n    CFISH_INCREF(",
-                                        name, ");", NULL);
-        }
-        else if (CFCType_decremented(type)) {
-            refcount_mods = CFCUtil_cat(refcount_mods, "\n    CFISH_DECREF(",
-                                        name, ");", NULL);
-        }
-    }
-
-    return refcount_mods;
-}
-
-static char*
-S_invalid_callback_def(CFCMethod *method) {
-    char *full_method_sym = CFCMethod_full_method_sym(method, NULL);
-
-    const char *override_sym = CFCMethod_full_override_sym(method);
-    CFCParamList *param_list = CFCMethod_get_param_list(method);
-    const char *params = CFCParamList_to_c(param_list);
-    CFCVariable **param_vars = CFCParamList_get_variables(param_list);
-
-    // Thwart compiler warnings.
-    CFCType *return_type = CFCMethod_get_return_type(method);
-    const char *ret_type_str = CFCType_to_c(return_type);
-    char *unused = S_build_unused_vars(param_vars);
-    char *unreachable = S_maybe_unreachable(return_type);
-
-    char pattern[] =
-        "%s\n"
-        "%s(%s) {%s\n"
-        "    CFISH_THROW(CFISH_ERR, \"Can't override %s via binding\");%s\n"
-        "}\n";
-    char *callback_def
-        = CFCUtil_sprintf(pattern, ret_type_str, override_sym, params, unused,
-                          full_method_sym, unreachable);
-
-    FREEMEM(full_method_sym);
-    FREEMEM(unreachable);
-    FREEMEM(unused);
-    return callback_def;
-}
-
-static char*
-S_void_callback_def(CFCMethod *method, const char *callback_start,
-                    const char *refcount_mods) {
-    const char *override_sym = CFCMethod_full_override_sym(method);
-    const char *params = CFCParamList_to_c(CFCMethod_get_param_list(method));
-    const char *micro_sym = CFCMethod_micro_sym(method);
-    const char pattern[] =
-        "void\n"
-        "%s(%s) {\n"
-        "%s"
-        "    S_finish_callback_void(\"%s\");%s\n"
-        "}\n";
-    char *callback_def
-        = CFCUtil_sprintf(pattern, override_sym, params, callback_start,
-                          micro_sym, refcount_mods);
-
-    return callback_def;
-}
-
-static char*
-S_primitive_callback_def(CFCMethod *method, const char *callback_start,
-                         const char *refcount_mods) {
-    const char *override_sym = CFCMethod_full_override_sym(method);
-    const char *params = CFCParamList_to_c(CFCMethod_get_param_list(method));
-    CFCType *return_type = CFCMethod_get_return_type(method);
-    const char *ret_type_str = CFCType_to_c(return_type);
-    const char *micro_sym = CFCMethod_micro_sym(method);
-    char callback_func[50];
-
-    if (CFCType_is_integer(return_type)) {
-        strcpy(callback_func, "S_finish_callback_i64");
-    }
-    else if (CFCType_is_floating(return_type)) {
-        strcpy(callback_func, "S_finish_callback_f64");
-    }
-    else {
-        CFCUtil_die("Unexpected type: %s", ret_type_str);
-    }
-
-    char pattern[] =
-        "%s\n"
-        "%s(%s) {\n"
-        "%s"
-        "    %s retval = (%s)%s(\"%s\");%s\n"
-        "    return retval;\n"
-        "}\n";
-    char *callback_def
-        = CFCUtil_sprintf(pattern, ret_type_str, override_sym, params,
-                          callback_start, ret_type_str, ret_type_str,
-                          callback_func, micro_sym, refcount_mods);
-
-    return callback_def;
-}
-
-static char*
-S_obj_callback_def(CFCMethod *method, const char *callback_start,
-                   const char *refcount_mods) {
-    const char *override_sym = CFCMethod_full_override_sym(method);
-    const char *params = CFCParamList_to_c(CFCMethod_get_param_list(method));
-    CFCType *return_type = CFCMethod_get_return_type(method);
-    const char *ret_type_str = CFCType_to_c(return_type);
-    const char *micro_sym = CFCMethod_micro_sym(method);
-    const char *nullable  = CFCType_nullable(return_type) ? "true" : "false";
-
-    char pattern[] =
-        "%s\n"
-        "%s(%s) {\n"
-        "%s"
-        "    %s retval = (%s)S_finish_callback_obj(self, \"%s\", %s);%s\n"
-        "    return retval;\n"
-        "}\n";
-    char *callback_def
-        = CFCUtil_sprintf(pattern, ret_type_str, override_sym, params,
-                          callback_start, ret_type_str, ret_type_str,
-                          micro_sym, nullable, refcount_mods);
-
-    return callback_def;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlMethod.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlMethod.h b/clownfish/compiler/src/CFCPerlMethod.h
deleted file mode 100644
index dbd19c0..0000000
--- a/clownfish/compiler/src/CFCPerlMethod.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCPERLMETHOD
-#define H_CFCPERLMETHOD
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Clownfish::CFC::Binding::Perl::Method - Binding for an object method.
- *
- * 
- * This class isa Clownfish::CFC::Binding::Perl::Subroutine -- see its
- * documentation for various code-generating routines.
- * 
- * Method bindings use labeled parameters if the C function takes more than one
- * argument (other than "self").  If there is only one argument, the binding
- * will be set up to accept a single positional argument.
- */
-typedef struct CFCPerlMethod CFCPerlMethod;
-struct CFCMethod;
-
-CFCPerlMethod*
-CFCPerlMethod_new(struct CFCMethod *method, const char *alias);
-
-/**
- * @param method A Clownfish::CFC::Model::Method.
- * @param alias The perl name for the method.  Defaults to the lowercased name
- * of the supplied Clownfish Method.
- */
-CFCPerlMethod*
-CFCPerlMethod_init(CFCPerlMethod *self, struct CFCMethod *method,
-                   const char *alias);
-
-void
-CFCPerlMethod_destroy(CFCPerlMethod *self);
-
-/** Generate C code for the XSUB.
- */
-char*
-CFCPerlMethod_xsub_def(CFCPerlMethod *self);
-
-/** Return C code implementing a callback to Perl for this method.  This code
- * is run when a Perl subclass has overridden a method in a Clownfish base
- * class.
- */
-char*
-CFCPerlMethod_callback_def(struct CFCMethod *method);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPERLMETHOD */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlPod.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlPod.c b/clownfish/compiler/src/CFCPerlPod.c
deleted file mode 100644
index 78c804f..0000000
--- a/clownfish/compiler/src/CFCPerlPod.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <ctype.h>
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCPerlPod.h"
-#include "CFCUtil.h"
-#include "CFCClass.h"
-#include "CFCMethod.h"
-#include "CFCParcel.h"
-#include "CFCParamList.h"
-#include "CFCFunction.h"
-#include "CFCDocuComment.h"
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-typedef struct NamePod {
-    char *alias;
-    char *func;
-    char *sample;
-    char *pod;
-} NamePod;
-
-struct CFCPerlPod {
-    CFCBase base;
-    char    *synopsis;
-    char    *description;
-    NamePod *methods;
-    size_t   num_methods;
-    NamePod *constructors;
-    size_t   num_constructors;
-};
-
-static const CFCMeta CFCPERLPOD_META = {
-    "Clownfish::CFC::Binding::Perl::Pod",
-    sizeof(CFCPerlPod),
-    (CFCBase_destroy_t)CFCPerlPod_destroy
-};
-
-CFCPerlPod*
-CFCPerlPod_new(void) {
-    CFCPerlPod *self
-        = (CFCPerlPod*)CFCBase_allocate(&CFCPERLPOD_META);
-    return CFCPerlPod_init(self);
-}
-
-CFCPerlPod*
-CFCPerlPod_init(CFCPerlPod *self) {
-    self->synopsis         = CFCUtil_strdup("");
-    self->description      = CFCUtil_strdup("");
-    self->methods          = NULL;
-    self->constructors     = NULL;
-    self->num_methods      = 0;
-    self->num_constructors = 0;
-    return self;
-}
-
-void
-CFCPerlPod_destroy(CFCPerlPod *self) {
-    FREEMEM(self->synopsis);
-    FREEMEM(self->description);
-    for (size_t i = 0; i < self->num_methods; i++) {
-        FREEMEM(self->methods[i].alias);
-        FREEMEM(self->methods[i].pod);
-        FREEMEM(self->methods[i].func);
-        FREEMEM(self->methods[i].sample);
-    }
-    FREEMEM(self->methods);
-    for (size_t i = 0; i < self->num_constructors; i++) {
-        FREEMEM(self->constructors[i].alias);
-        FREEMEM(self->constructors[i].pod);
-        FREEMEM(self->constructors[i].func);
-        FREEMEM(self->constructors[i].sample);
-    }
-    FREEMEM(self->constructors);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-void
-CFCPerlPod_add_method(CFCPerlPod *self, const char *alias, const char *method,
-                      const char *sample, const char *pod) {
-    CFCUTIL_NULL_CHECK(alias);
-    self->num_methods++;
-    size_t size = self->num_methods * sizeof(NamePod);
-    self->methods = (NamePod*)REALLOCATE(self->methods, size);
-    NamePod *slot = &self->methods[self->num_methods - 1];
-    slot->alias  = CFCUtil_strdup(alias);
-    slot->func   = method ? CFCUtil_strdup(method) : NULL;
-    slot->sample = CFCUtil_strdup(sample ? sample : "");
-    slot->pod    = pod ? CFCUtil_strdup(pod) : NULL;
-}
-
-void
-CFCPerlPod_add_constructor(CFCPerlPod *self, const char *alias,
-                           const char *initializer, const char *sample,
-                           const char *pod) {
-    self->num_constructors++;
-    size_t size = self->num_constructors * sizeof(NamePod);
-    self->constructors = (NamePod*)REALLOCATE(self->constructors, size);
-    NamePod *slot = &self->constructors[self->num_constructors - 1];
-    slot->alias  = CFCUtil_strdup(alias ? alias : "new");
-    slot->func   = CFCUtil_strdup(initializer ? initializer : "init");
-    slot->sample = CFCUtil_strdup(sample ? sample : "");
-    slot->pod    = pod ? CFCUtil_strdup(pod) : NULL;
-}
-
-void
-CFCPerlPod_set_synopsis(CFCPerlPod *self, const char *synopsis) {
-    FREEMEM(self->synopsis);
-    self->synopsis = CFCUtil_strdup(synopsis);
-}
-
-const char*
-CFCPerlPod_get_synopsis(CFCPerlPod *self) {
-    return self->synopsis;
-}
-
-void
-CFCPerlPod_set_description(CFCPerlPod *self, const char *description) {
-    FREEMEM(self->description);
-    self->description = CFCUtil_strdup(description);
-}
-
-const char*
-CFCPerlPod_get_description(CFCPerlPod *self) {
-    return self->description;
-}
-
-char*
-CFCPerlPod_methods_pod(CFCPerlPod *self, CFCClass *klass) {
-    const char *class_name = CFCClass_get_class_name(klass);
-    char *abstract_pod = CFCUtil_strdup("");
-    char *methods_pod  = CFCUtil_strdup("");
-    for (size_t i = 0; i < self->num_methods; i++) {
-        NamePod meth_spec = self->methods[i];
-        CFCMethod *method = CFCClass_method(klass, meth_spec.func);
-        if (!method) {
-            method = CFCClass_method(klass, meth_spec.alias);
-        }
-        if (!method) {
-            CFCUtil_die("Can't find method '%s' in class '%s'",
-                        meth_spec.alias, CFCClass_get_class_name(klass));
-        }
-        char *meth_pod;
-        if (meth_spec.pod) {
-            meth_pod = CFCPerlPod_perlify_doc_text(self, meth_spec.pod);
-        }
-        else {
-            char *raw
-                = CFCPerlPod_gen_subroutine_pod(self, (CFCFunction*)method,
-                                                meth_spec.alias, klass,
-                                                meth_spec.sample, class_name,
-                                                false);
-            meth_pod = CFCPerlPod_perlify_doc_text(self, raw);
-            FREEMEM(raw);
-        }
-        if (CFCMethod_abstract(method)) {
-            abstract_pod = CFCUtil_cat(abstract_pod, meth_pod, NULL);
-        }
-        else {
-            methods_pod = CFCUtil_cat(methods_pod, meth_pod, NULL);
-        }
-        FREEMEM(meth_pod);
-    }
-
-    char *pod = CFCUtil_strdup("");
-    if (strlen(abstract_pod)) {
-        pod = CFCUtil_cat(pod, "=head1 ABSTRACT METHODS\n\n", abstract_pod, NULL);
-    }
-    FREEMEM(abstract_pod);
-    if (strlen(methods_pod)) {
-        pod = CFCUtil_cat(pod, "=head1 METHODS\n\n", methods_pod, NULL);
-    }
-    FREEMEM(methods_pod);
-
-    return pod;
-}
-
-char*
-CFCPerlPod_constructors_pod(CFCPerlPod *self, CFCClass *klass) {
-    if (!self->num_constructors) {
-        return CFCUtil_strdup("");
-    }
-    const char *class_name = CFCClass_get_class_name(klass);
-    char *pod = CFCUtil_strdup("=head1 CONSTRUCTORS\n\n");
-    for (size_t i = 0; i < self->num_constructors; i++) {
-        NamePod slot = self->constructors[i];
-        if (slot.pod) {
-            char *perlified = CFCPerlPod_perlify_doc_text(self, slot.pod);
-            pod = CFCUtil_cat(pod, perlified, NULL);
-            FREEMEM(perlified);
-        }
-        else {
-            CFCFunction *init_func = CFCClass_function(klass, slot.func);
-            char *sub_pod
-                = CFCPerlPod_gen_subroutine_pod(self, init_func, slot.alias, klass,
-                                                slot.sample, class_name, true);
-            char *perlified = CFCPerlPod_perlify_doc_text(self, sub_pod);
-            pod = CFCUtil_cat(pod, perlified, NULL);
-            FREEMEM(sub_pod);
-            FREEMEM(perlified);
-        }
-    }
-    return pod;
-}
-
-static char*
-S_global_replace(const char *string, const char *match,
-                 const char *replacement) {
-    char *found = (char*)string;
-    int   string_len      = (int)strlen(string);
-    int   match_len       = (int)strlen(match);
-    int   replacement_len = (int)strlen(replacement);
-    int   len_diff        = replacement_len - match_len;
-
-    // Allocate space.
-    unsigned count = 0;
-    while (NULL != (found = strstr(found, match))) {
-        count++;
-        found += match_len;
-    }
-    int size = string_len + count * len_diff + 1;
-    char *modified = (char*)MALLOCATE(size);
-    modified[size - 1] = 0; // NULL-terminate.
-
-    // Iterate through all matches.
-    found = (char*)string;
-    char *target = modified;
-    size_t last_end = 0;
-    if (count) {
-        while (NULL != (found = strstr(found, match))) {
-            size_t pos = found - string;
-            size_t unchanged_len = pos - last_end;
-            found += match_len;
-            memcpy(target, string + last_end, unchanged_len);
-            target += unchanged_len;
-            last_end = pos + match_len;
-            memcpy(target, replacement, replacement_len);
-            target += replacement_len;
-        }
-    }
-    size_t remaining = string_len - last_end;
-    memcpy(target, string + string_len - remaining, remaining);
-
-    return modified;
-}
-
-char*
-CFCPerlPod_gen_subroutine_pod(CFCPerlPod *self, CFCFunction *func,
-                              const char *alias, CFCClass *klass,
-                              const char *code_sample,
-                              const char *class_name, int is_constructor) {
-    // Only allow "public" subs to be exposed as part of the public API.
-    if (!CFCFunction_public(func)) {
-        CFCUtil_die("%s#%s is not public", class_name, alias);
-    }
-
-    CFCParamList *param_list = CFCFunction_get_param_list(func);
-    int num_vars = (int)CFCParamList_num_vars(param_list);
-    char *pod = CFCUtil_sprintf("=head2 %s", alias);
-
-    // Get documentation, which may be inherited.
-    CFCDocuComment *docucomment = CFCFunction_get_docucomment(func);
-    if (!docucomment) {
-        const char *micro_sym = CFCFunction_micro_sym(func);
-        CFCClass *parent = klass;
-        while (NULL != (parent = CFCClass_get_parent(parent))) {
-            CFCFunction *parent_func
-                = (CFCFunction*)CFCClass_method(parent, micro_sym);
-            if (!parent_func) { break; }
-            docucomment = CFCFunction_get_docucomment(parent_func);
-            if (docucomment) { break; }
-        }
-    }
-    if (!docucomment) {
-        CFCUtil_die("No DocuComment for '%s' in '%s'", alias, class_name);
-    }
-
-    // Build string summarizing arguments to use in header.
-    if (num_vars > 2 || (is_constructor && num_vars > 1)) {
-        pod = CFCUtil_cat(pod, "( I<[labeled params]> )\n\n", NULL);
-    }
-    else if (num_vars == 2) {
-        // Kill self param.
-        const char *name_list = CFCParamList_name_list(param_list);
-        const char *after_comma = strchr(name_list, ',') + 1;
-        while (isspace(*after_comma)) { after_comma++; }
-        pod = CFCUtil_cat(pod, "(", after_comma, ")\n\n", NULL);
-    }
-    else {
-        // num_args == 1, leave off 'self'.
-        pod = CFCUtil_cat(pod, "()\n\n", NULL);
-    }
-
-    // Add code sample.
-    if (code_sample && strlen(code_sample)) {
-        pod = CFCUtil_cat(pod, code_sample, "\n", NULL);
-    }
-
-    // Incorporate "description" text from DocuComment.
-    const char *long_doc = CFCDocuComment_get_description(docucomment);
-    if (long_doc && strlen(long_doc)) {
-        char *perlified = CFCPerlPod_perlify_doc_text(self, long_doc);
-        pod = CFCUtil_cat(pod, perlified, "\n\n", NULL);
-        FREEMEM(perlified);
-    }
-
-    // Add params in a list.
-    const char**param_names = CFCDocuComment_get_param_names(docucomment);
-    const char**param_docs  = CFCDocuComment_get_param_docs(docucomment);
-    if (param_names[0]) {
-        pod = CFCUtil_cat(pod, "=over\n\n", NULL);
-        for (size_t i = 0; param_names[i] != NULL; i++) {
-            pod = CFCUtil_cat(pod, "=item *\n\nB<", param_names[i], "> - ",
-                              param_docs[i], "\n\n", NULL);
-        }
-        pod = CFCUtil_cat(pod, "=back\n\n", NULL);
-    }
-
-    // Add return value description, if any.
-    const char *retval_doc = CFCDocuComment_get_retval(docucomment);
-    if (retval_doc && strlen(retval_doc)) {
-        pod = CFCUtil_cat(pod, "Returns: ", retval_doc, "\n\n", NULL);
-    }
-
-    return pod;
-}
-
-char*
-CFCPerlPod_perlify_doc_text(CFCPerlPod *self, const char *source) {
-    (void)self; // unused
-
-    // Change <code>foo</code> to C<< foo >>.
-    char *copy = CFCUtil_strdup(source);
-    char *orig = copy;
-    copy = S_global_replace(orig, "<code>", "C<< ");
-    FREEMEM(orig);
-    orig = copy;
-    copy = S_global_replace(orig, "</code>", " >>");
-    FREEMEM(orig);
-
-    // Lowercase all method names: Open_In() => open_in()
-    for (size_t i = 0, max = strlen(copy); i < max; i++) {
-        if (isupper(copy[i])) {
-            size_t mark = i;
-            for (; i < max; i++) {
-                char c = copy[i];
-                if (!(isalpha(c) || c == '_')) {
-                    if (memcmp(copy + i, "()", 2) == 0) {
-                        for (size_t j = mark; j < i; j++) {
-                            copy[j] = tolower(copy[j]);
-                        }
-                        i += 2; // go past parens.
-                    }
-                    break;
-                }
-            }
-        }
-    }
-
-    // Change all instances of NULL to 'undef'
-    orig = copy;
-    copy = S_global_replace(orig, "NULL", "undef");
-    FREEMEM(orig);
-
-    // Change "Err_error" to "Clownfish->error".
-    orig = copy;
-    copy = S_global_replace(orig, "Err_error", "Clownfish->error");
-    FREEMEM(orig);
-
-    return copy;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlPod.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlPod.h b/clownfish/compiler/src/CFCPerlPod.h
deleted file mode 100644
index 3fb94eb..0000000
--- a/clownfish/compiler/src/CFCPerlPod.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCPERLPOD
-#define H_CFCPERLPOD
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Spec for generating POD for a single class.
- */
-
-typedef struct CFCPerlPod CFCPerlPod;
-struct CFCFunction;
-struct CFCClass;
-
-CFCPerlPod*
-CFCPerlPod_new(void);
-
-CFCPerlPod*
-CFCPerlPod_init(CFCPerlPod *self);
-
-void
-CFCPerlPod_destroy(CFCPerlPod *self);
-
-/** Add pod for a method.
- * 
- * @param alias The name of the method, spelled as it will be used from
- * Perl-space.
- * @param method The name of the method from the Clownfish class.  If not
- * supplied, an attempt will be made to locate the correct method using
- * <code>alias</code>.
- * @param sample An optional Perl usage sample.
- * @param pod Optional verbatim POD, which will override all POD which would
- * otherwise have been generated.
- */
-void
-CFCPerlPod_add_method(CFCPerlPod *self, const char *alias, const char *method,
-                      const char *sample, const char *pod);
-
-/** Add pod for a constructor.
- * 
- * @param alias The name of the constructor, spelled as it will be used from
- * Perl-space.
- * @param initializer The name of the initialization routine from the
- * Clownfish class.  Defaults to "init".
- * @param sample An optional Perl usage sample.
- * @param pod Optional verbatim POD, which will override all POD which would
- * otherwise have been generated.
- */
-void
-CFCPerlPod_add_constructor(CFCPerlPod *self, const char *alias,
-                           const char *initializer, const char *sample,
-                           const char *pod);
-
-/** Generate POD for a METHODS section and possibly an ABSTRACT METHODS
- * section as well.
- */
-char*
-CFCPerlPod_methods_pod(CFCPerlPod *self, struct CFCClass *klass);
-
-/** Generate POD for a CONSTRUCTORS section.
- */
-char*
-CFCPerlPod_constructors_pod(CFCPerlPod *self, struct CFCClass *klass);
-
-/** Supply a SYNOPSIS section.
- */
-void
-CFCPerlPod_set_synopsis(CFCPerlPod *self, const char *synopsis);
-
-/** Accessor for SYNOPSIS text.
- */
-const char*
-CFCPerlPod_get_synopsis(CFCPerlPod *self);
-
-/** Supply a DESCRIPTION section.
- */
-void
-CFCPerlPod_set_description(CFCPerlPod *self, const char *description);
-
-/** Accessor for DESCRIPTION text.
- */
-const char*
-CFCPerlPod_get_description(CFCPerlPod *self);
-
-char*
-CFCPerlPod_perlify_doc_text(CFCPerlPod *self, const char *source);
-
-/** Autogenerate pod for either a Clownfish::CFC::Model::Method or a
- * Clownfish::CFC::Model::Function.
- * 
- * @param func The Method or Function.
- * @param alias The Perl name for the subroutine.
- * @param klass The Clownfish::CFC::Model::Class.
- * @param code_sample Optional example usage code.
- * @param is_construtor Indicate whether this is a constructor, as the default
- * argument handling is different for constructors.
- */
-char*
-CFCPerlPod_gen_subroutine_pod(CFCPerlPod *self, struct CFCFunction *func,
-                              const char *alias, struct CFCClass *klass,
-                              const char *code_sample,
-                              const char *class_name, int is_constructor);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPERLPOD */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlSub.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlSub.c b/clownfish/compiler/src/CFCPerlSub.c
deleted file mode 100644
index 5d8d1f2..0000000
--- a/clownfish/compiler/src/CFCPerlSub.c
+++ /dev/null
@@ -1,262 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-#define CFC_NEED_BASE_STRUCT_DEF
-#define CFC_NEED_PERLSUB_STRUCT_DEF
-#include "CFCPerlSub.h"
-#include "CFCBase.h"
-#include "CFCUtil.h"
-#include "CFCParamList.h"
-#include "CFCVariable.h"
-#include "CFCType.h"
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-CFCPerlSub*
-CFCPerlSub_init(CFCPerlSub *self, CFCParamList *param_list,
-                const char *class_name, const char *alias,
-                int use_labeled_params) {
-    CFCUTIL_NULL_CHECK(param_list);
-    CFCUTIL_NULL_CHECK(class_name);
-    CFCUTIL_NULL_CHECK(alias);
-    self->param_list  = (CFCParamList*)CFCBase_incref((CFCBase*)param_list);
-    self->class_name  = CFCUtil_strdup(class_name);
-    self->alias       = CFCUtil_strdup(alias);
-    self->use_labeled_params = use_labeled_params;
-    self->perl_name = CFCUtil_sprintf("%s::%s", class_name, alias);
-
-    size_t c_name_len = strlen(self->perl_name) + sizeof("XS_") + 1;
-    self->c_name = (char*)MALLOCATE(c_name_len);
-    int j = 3;
-    memcpy(self->c_name, "XS_", j);
-    for (int i = 0, max = (int)strlen(self->perl_name); i < max; i++) {
-        char c = self->perl_name[i];
-        if (c == ':') {
-            while (self->perl_name[i + 1] == ':') { i++; }
-            self->c_name[j++] = '_';
-        }
-        else {
-            self->c_name[j++] = c;
-        }
-    }
-    self->c_name[j] = 0; // NULL-terminate.
-
-    return self;
-}
-
-void
-CFCPerlSub_destroy(CFCPerlSub *self) {
-    CFCBase_decref((CFCBase*)self->param_list);
-    FREEMEM(self->class_name);
-    FREEMEM(self->alias);
-    FREEMEM(self->perl_name);
-    FREEMEM(self->c_name);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-char*
-CFCPerlSub_params_hash_def(CFCPerlSub *self) {
-    if (!self->use_labeled_params) {
-        return NULL;
-    }
-
-    char *def = CFCUtil_strdup("");
-    def = CFCUtil_cat(def, "%", self->perl_name, "_PARAMS = (", NULL);
-
-    CFCVariable **arg_vars = CFCParamList_get_variables(self->param_list);
-    const char **vals = CFCParamList_get_initial_values(self->param_list);
-
-    // No labeled params means an empty params hash def.
-    if (!arg_vars[1]) {
-        def = CFCUtil_cat(def, ");\n", NULL);
-        return def;
-    }
-
-    for (int i = 1; arg_vars[i] != NULL; i++) {
-        CFCVariable *var = arg_vars[i];
-        const char *micro_sym = CFCVariable_micro_sym(var);
-        const char *val = vals[i];
-        val = val == NULL
-              ? "undef"
-              : strcmp(val, "NULL") == 0
-              ? "undef"
-              : strcmp(val, "true") == 0
-              ? "1"
-              : strcmp(val, "false") == 0
-              ? "0"
-              : val;
-        def = CFCUtil_cat(def, "\n    ", micro_sym, " => ", val, ",", NULL);
-    }
-    def = CFCUtil_cat(def, "\n);\n", NULL);
-
-    return def;
-}
-
-struct allot_macro_map {
-    const char *prim_type;
-    const char *allot_macro;
-};
-
-struct allot_macro_map prim_type_to_allot_macro[] = {
-    { "double",     "ALLOT_F64"    },
-    { "float",      "ALLOT_F32"    },
-    { "int",        "ALLOT_INT"    },
-    { "short",      "ALLOT_SHORT"  },
-    { "long",       "ALLOT_LONG"   },
-    { "size_t",     "ALLOT_SIZE_T" },
-    { "uint64_t",   "ALLOT_U64"    },
-    { "uint32_t",   "ALLOT_U32"    },
-    { "uint16_t",   "ALLOT_U16"    },
-    { "uint8_t",    "ALLOT_U8"     },
-    { "int64_t",    "ALLOT_I64"    },
-    { "int32_t",    "ALLOT_I32"    },
-    { "int16_t",    "ALLOT_I16"    },
-    { "int8_t",     "ALLOT_I8"     },
-    { "bool",       "ALLOT_BOOL"   },
-    { NULL, NULL }
-};
-
-static char*
-S_allot_params_arg(CFCType *type, const char *label, int required) {
-    const char *type_c_string = CFCType_to_c(type);
-    unsigned label_len = (unsigned)strlen(label);
-    const char *req_string = required ? "true" : "false";
-
-    if (CFCType_is_object(type)) {
-        const char *struct_sym = CFCType_get_specifier(type);
-        const char *vtable_var = CFCType_get_vtable_var(type);
-
-        // Share buffers rather than copy between Perl scalars and Clownfish
-        // string types.
-        int use_sv_buffer = false;
-        if (strcmp(struct_sym, "cfish_String") == 0
-            || strcmp(struct_sym, "cfish_Obj") == 0
-           ) {
-            use_sv_buffer = true;
-        }
-        const char *allocation = use_sv_buffer
-                                 ? "alloca(cfish_SStr_size())"
-                                 : "NULL";
-        const char pattern[] = "ALLOT_OBJ(&%s, \"%s\", %u, %s, %s, %s)";
-        char *arg = CFCUtil_sprintf(pattern, label, label, label_len,
-                                    req_string, vtable_var, allocation);
-        return arg;
-    }
-    else if (CFCType_is_primitive(type)) {
-        for (int i = 0; prim_type_to_allot_macro[i].prim_type != NULL; i++) {
-            const char *prim_type = prim_type_to_allot_macro[i].prim_type;
-            if (strcmp(prim_type, type_c_string) == 0) {
-                const char *allot = prim_type_to_allot_macro[i].allot_macro;
-                char pattern[] = "%s(&%s, \"%s\", %u, %s)";
-                char *arg = CFCUtil_sprintf(pattern, allot, label, label,
-                                            label_len, req_string);
-                return arg;
-            }
-        }
-    }
-
-    CFCUtil_die("Missing typemap for %s", type_c_string);
-    return NULL; // unreachable
-}
-
-char*
-CFCPerlSub_build_allot_params(CFCPerlSub *self) {
-    CFCParamList *param_list = self->param_list;
-    CFCVariable **arg_vars   = CFCParamList_get_variables(param_list);
-    const char  **arg_inits  = CFCParamList_get_initial_values(param_list);
-    size_t        num_vars   = CFCParamList_num_vars(param_list);
-    char *allot_params = CFCUtil_strdup("");
-
-    // Declare variables and assign default values.
-    for (size_t i = 1; i < num_vars; i++) {
-        CFCVariable *arg_var = arg_vars[i];
-        const char  *val     = arg_inits[i];
-        const char  *local_c = CFCVariable_local_c(arg_var);
-        if (val == NULL) {
-            CFCType *arg_type = CFCVariable_get_type(arg_var);
-            val = CFCType_is_object(arg_type)
-                  ? "NULL"
-                  : "0";
-        }
-        allot_params = CFCUtil_cat(allot_params, local_c, " = ", val,
-                                   ";\n    ", NULL);
-    }
-
-    // Iterate over args in param list.
-    allot_params
-        = CFCUtil_cat(allot_params,
-                      "bool args_ok = XSBind_allot_params(\n"
-                      "        &(ST(0)), 1, items, ", NULL);
-    for (size_t i = 1; i < num_vars; i++) {
-        CFCVariable *var = arg_vars[i];
-        const char  *val = arg_inits[i];
-        int required = val ? 0 : 1;
-        const char *name = CFCVariable_micro_sym(var);
-        CFCType *type = CFCVariable_get_type(var);
-        char *arg = S_allot_params_arg(type, name, required);
-        allot_params
-            = CFCUtil_cat(allot_params, "        ", arg, ",\n", NULL);
-        FREEMEM(arg);
-    }
-    allot_params
-        = CFCUtil_cat(allot_params, "        NULL);\n",
-                      "    if (!args_ok) {\n"
-                      "        CFISH_RETHROW(CFISH_INCREF(cfish_Err_get_error()));\n"
-                      "    }", NULL);
-
-    return allot_params;
-}
-
-CFCParamList*
-CFCPerlSub_get_param_list(CFCPerlSub *self) {
-    return self->param_list;
-}
-
-const char*
-CFCPerlSub_get_class_name(CFCPerlSub *self) {
-    return self->class_name;
-}
-
-const char*
-CFCPerlSub_get_alias(CFCPerlSub *self) {
-    return self->alias;
-}
-
-int
-CFCPerlSub_use_labeled_params(CFCPerlSub *self) {
-    return self->use_labeled_params;
-}
-
-const char*
-CFCPerlSub_perl_name(CFCPerlSub *self) {
-    return self->perl_name;
-}
-
-const char*
-CFCPerlSub_c_name(CFCPerlSub *self) {
-    return self->c_name;
-}
-
-const char*
-CFCPerlSub_c_name_list(CFCPerlSub *self) {
-    return CFCParamList_name_list(self->param_list);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlSub.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlSub.h b/clownfish/compiler/src/CFCPerlSub.h
deleted file mode 100644
index 6bc846c..0000000
--- a/clownfish/compiler/src/CFCPerlSub.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCPERLSUB
-#define H_CFCPERLSUB
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCPerlSub CFCPerlSub;
-struct CFCParamList;
-struct CFCType;
-
-#ifdef CFC_NEED_PERLSUB_STRUCT_DEF
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-struct CFCPerlSub {
-    CFCBase base;
-    struct CFCParamList *param_list;
-    char *class_name;
-    char *alias;
-    int use_labeled_params;
-    char *perl_name;
-    char *c_name;
-};
-#endif
-
-/** Clownfish::CFC::Binding::Perl::Subroutine - Abstract base binding for a
- * Clownfish::CFC::Model::Function.
- * 
- * This class is used to generate binding code for invoking Clownfish's
- * functions and methods across the Perl/C barrier.
- */ 
-
-/** Abstract constructor.
- * 
- * @param param_list A Clownfish::CFC::Model::ParamList.
- * @param class_name The name of the Perl class that the subroutine belongs
- * to.
- * @param alias The local, unqualified name for the Perl subroutine that
- * will be used to invoke the function.
- * @param use_labeled_params True if the binding should take hash-style
- * labeled parameters, false if it should take positional arguments.
- */
-CFCPerlSub*
-CFCPerlSub_init(CFCPerlSub *self, struct CFCParamList *param_list,
-                const char *class_name, const char *alias,
-                int use_labeled_params);
-
-void
-CFCPerlSub_destroy(CFCPerlSub *self);
-
-/** Return Perl code initializing a package-global hash where all the keys are
- * the names of labeled params.  The hash's name consists of the the binding's
- * perl_name() plus "_PARAMS".
- */
-char*
-CFCPerlSub_params_hash_def(CFCPerlSub *self);
-
-/** Generate code which will invoke XSBind_allot_params() to parse labeled
- * parameters supplied to an XSUB.
- */
-char*
-CFCPerlSub_build_allot_params(CFCPerlSub *self);
-
-/** Accessor for param list.
- */
-struct CFCParamList*
-CFCPerlSub_get_param_list(CFCPerlSub *self);
-
-/** Accessor for class name.
- */
-const char*
-CFCPerlSub_get_class_name(CFCPerlSub *self);
-
-/** Accessor for use_labeled_params.
- */
-int
-CFCPerlSub_use_labeled_params(CFCPerlSub *self);
-
-/**
- * @return the fully-qualified perl subroutine name.
- */
-const char*
-CFCPerlSub_perl_name(CFCPerlSub *self);
-
-/**
- * @return the fully-qualified name of the C function that implements the
- * XSUB.
- */
-const char*
-CFCPerlSub_c_name(CFCPerlSub *self);
-
-/**
- * @return a string containing the names of arguments to feed to bound C
- * function, joined by commas.
- */
-const char*
-CFCPerlSub_c_name_list(CFCPerlSub *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPERLSUB */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlTypeMap.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlTypeMap.c b/clownfish/compiler/src/CFCPerlTypeMap.c
deleted file mode 100644
index 4553a13..0000000
--- a/clownfish/compiler/src/CFCPerlTypeMap.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-#include "CFCPerlTypeMap.h"
-#include "CFCUtil.h"
-#include "CFCHierarchy.h"
-#include "CFCClass.h"
-#include "CFCType.h"
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-// Convert from a Perl scalar to a primitive type.
-struct char_map {
-    char *key;
-    char *value;
-};
-
-
-char*
-CFCPerlTypeMap_from_perl(CFCType *type, const char *xs_var) {
-    char *result = NULL;
-
-    if (CFCType_is_object(type)) {
-        const char *struct_sym = CFCType_get_specifier(type);
-        const char *vtable_var = CFCType_get_vtable_var(type);
-        const char *allocation;
-        if (strcmp(struct_sym, "cfish_String") == 0
-            || strcmp(struct_sym, "cfish_Obj") == 0
-           ) {
-            // Share buffers rather than copy between Perl scalars and
-            // Clownfish string types.
-            allocation = "alloca(cfish_SStr_size())";
-        }
-        else {
-            allocation = "NULL";
-        }
-        const char pattern[] = "(%s*)XSBind_sv_to_cfish_obj(%s, %s, %s)";
-        result = CFCUtil_sprintf(pattern, struct_sym, xs_var, vtable_var,
-                                 allocation);
-    }
-    else if (CFCType_is_primitive(type)) {
-        const char *specifier = CFCType_get_specifier(type);
-
-        if (strcmp(specifier, "double") == 0) {
-            result = CFCUtil_sprintf("SvNV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "float") == 0) {
-            result = CFCUtil_sprintf("(float)SvNV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "int") == 0) {
-            result = CFCUtil_sprintf("(int)SvIV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "short") == 0) {
-            result = CFCUtil_sprintf("(short)SvIV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "long") == 0) {
-            const char pattern[] =
-                "((sizeof(long) <= sizeof(IV)) ? (long)SvIV(%s) "
-                ": (long)SvNV(%s))";
-            result = CFCUtil_sprintf(pattern, xs_var, xs_var);
-        }
-        else if (strcmp(specifier, "size_t") == 0) {
-            result = CFCUtil_sprintf("(size_t)SvIV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "uint64_t") == 0) {
-            result = CFCUtil_sprintf("(uint64_t)SvNV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "uint32_t") == 0) {
-            result = CFCUtil_sprintf("(uint32_t)SvUV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "uint16_t") == 0) {
-            result = CFCUtil_sprintf("(uint16_t)SvUV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "uint8_t") == 0) {
-            result = CFCUtil_sprintf("(uint8_t)SvUV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "int64_t") == 0) {
-            result = CFCUtil_sprintf("(int64_t)SvNV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "int32_t") == 0) {
-            result = CFCUtil_sprintf("(int32_t)SvIV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "int16_t") == 0) {
-            result = CFCUtil_sprintf("(int16_t)SvIV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "int8_t") == 0) {
-            result = CFCUtil_sprintf("(int8_t)SvIV(%s)", xs_var);
-        }
-        else if (strcmp(specifier, "bool") == 0) {
-            result = CFCUtil_sprintf("SvTRUE(%s) ? 1 : 0", xs_var);
-        }
-        else {
-            FREEMEM(result);
-            result = NULL;
-        }
-    }
-
-    return result;
-}
-
-char*
-CFCPerlTypeMap_to_perl(CFCType *type, const char *cf_var) {
-    const char *type_str = CFCType_to_c(type);
-    char *result = NULL;
-
-    if (CFCType_is_object(type)) {
-        const char pattern[] =
-            "(%s == NULL ? newSV(0) : XSBind_cfish_to_perl((cfish_Obj*)%s))";
-        result = CFCUtil_sprintf(pattern, cf_var, cf_var);
-    }
-    else if (CFCType_is_primitive(type)) {
-        // Convert from a primitive type to a Perl scalar.
-        const char *specifier = CFCType_get_specifier(type);
-
-        if (strcmp(specifier, "double") == 0) {
-            result = CFCUtil_sprintf("newSVnv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "float") == 0) {
-            result = CFCUtil_sprintf("newSVnv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "int") == 0) {
-            result = CFCUtil_sprintf("newSViv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "short") == 0) {
-            result = CFCUtil_sprintf("newSViv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "long") == 0) {
-            char pattern[] =
-                "((sizeof(long) <= sizeof(IV)) ? "
-                "newSViv((IV)%s) : newSVnv((NV)%s))";
-            result = CFCUtil_sprintf(pattern, cf_var, cf_var);
-        }
-        else if (strcmp(specifier, "size_t") == 0) {
-            result = CFCUtil_sprintf("newSViv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "uint64_t") == 0) {
-            char pattern[] =
-                "sizeof(UV) == 8 ? "
-                "newSVuv((UV)%s) : newSVnv((NV)CFISH_U64_TO_DOUBLE(%s))";
-            result = CFCUtil_sprintf(pattern, cf_var, cf_var);
-        }
-        else if (strcmp(specifier, "uint32_t") == 0) {
-            result = CFCUtil_sprintf("newSVuv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "uint16_t") == 0) {
-            result = CFCUtil_sprintf("newSVuv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "uint8_t") == 0) {
-            result = CFCUtil_sprintf("newSVuv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "int64_t") == 0) {
-            char pattern[] = "sizeof(IV) == 8 ? newSViv((IV)%s) : newSVnv((NV)%s)";
-            result = CFCUtil_sprintf(pattern, cf_var, cf_var);
-        }
-        else if (strcmp(specifier, "int32_t") == 0) {
-            result = CFCUtil_sprintf("newSViv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "int16_t") == 0) {
-            result = CFCUtil_sprintf("newSViv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "int8_t") == 0) {
-            result = CFCUtil_sprintf("newSViv(%s)", cf_var);
-        }
-        else if (strcmp(specifier, "bool") == 0) {
-            result = CFCUtil_sprintf("newSViv(%s)", cf_var);
-        }
-        else {
-            FREEMEM(result);
-            result = NULL;
-        }
-    }
-    else if (CFCType_is_composite(type)) {
-        if (strcmp(type_str, "void*") == 0) {
-            // Assume that void* is a reference SV -- either a hashref or an
-            // arrayref.
-            result = CFCUtil_sprintf("newRV_inc((SV*)%s)", cf_var);
-        }
-    }
-
-    return result;
-}
-
-static const char typemap_start[] =
-    "# Auto-generated file.\n"
-    "\n"
-    "TYPEMAP\n"
-    "bool\tCFISH_BOOL\n"
-    "int8_t\tCFISH_SIGNED_INT\n"
-    "int16_t\tCFISH_SIGNED_INT\n"
-    "int32_t\tCFISH_SIGNED_INT\n"
-    "int64_t\tCFISH_BIG_SIGNED_INT\n"
-    "uint8_t\tCFISH_UNSIGNED_INT\n"
-    "uint16_t\tCFISH_UNSIGNED_INT\n"
-    "uint32_t\tCFISH_UNSIGNED_INT\n"
-    "uint64_t\tCFISH_BIG_UNSIGNED_INT\n"
-    "\n";
-
-
-static const char typemap_input[] =
-    "INPUT\n"
-    "\n"
-    "CFISH_BOOL\n"
-    "    $var = ($type)SvTRUE($arg);\n"
-    "\n"
-    "CFISH_SIGNED_INT \n"
-    "    $var = ($type)SvIV($arg);\n"
-    "\n"
-    "CFISH_UNSIGNED_INT\n"
-    "    $var = ($type)SvUV($arg);\n"
-    "\n"
-    "CFISH_BIG_SIGNED_INT \n"
-    "    $var = (sizeof(IV) == 8) ? ($type)SvIV($arg) : ($type)SvNV($arg);\n"
-    "\n"
-    "CFISH_BIG_UNSIGNED_INT \n"
-    "    $var = (sizeof(UV) == 8) ? ($type)SvUV($arg) : ($type)SvNV($arg);\n"
-    "\n";
-
-static const char typemap_output[] =
-    "OUTPUT\n"
-    "\n"
-    "CFISH_BOOL\n"
-    "    sv_setiv($arg, (IV)$var);\n"
-    "\n"
-    "CFISH_SIGNED_INT\n"
-    "    sv_setiv($arg, (IV)$var);\n"
-    "\n"
-    "CFISH_UNSIGNED_INT\n"
-    "    sv_setuv($arg, (UV)$var);\n"
-    "\n"
-    "CFISH_BIG_SIGNED_INT\n"
-    "    if (sizeof(IV) == 8) { sv_setiv($arg, (IV)$var); }\n"
-    "    else                 { sv_setnv($arg, (NV)$var); }\n"
-    "\n"
-    "CFISH_BIG_UNSIGNED_INT\n"
-    "    if (sizeof(UV) == 8) { sv_setuv($arg, (UV)$var); }\n"
-    "    else {\n"
-    "        sv_setnv($arg, (NV)CFISH_U64_TO_DOUBLE($var));\n"
-    "    }\n"
-    "\n";
-
-void
-CFCPerlTypeMap_write_xs_typemap(CFCHierarchy *hierarchy) {
-    CFCClass **classes = CFCHierarchy_ordered_classes(hierarchy);
-    char *start  = CFCUtil_strdup("");
-    char *input  = CFCUtil_strdup("");
-    char *output = CFCUtil_strdup("");
-    for (int i = 0; classes[i] != NULL; i++) {
-        CFCClass *klass = classes[i];
-        // TODO: Skip classes from parcels the source parcels don't depend on.
-
-        const char *full_struct_sym = CFCClass_full_struct_sym(klass);
-        const char *vtable_var      = CFCClass_full_vtable_var(klass);
-
-        start = CFCUtil_cat(start, full_struct_sym, "*\t", vtable_var, "_\n",
-                            NULL);
-        const char *allocation;
-        if (strcmp(full_struct_sym, "cfish_String") == 0) {
-            // Share buffers rather than copy between Perl scalars and
-            // Clownfish string types.
-            allocation = "alloca(cfish_SStr_size())";
-        }
-        else {
-            allocation = "NULL";
-        }
-        input = CFCUtil_cat(input, vtable_var, "_\n"
-                            "    $var = (", full_struct_sym,
-                            "*)XSBind_sv_to_cfish_obj($arg, ", vtable_var,
-                            ", ", allocation, ");\n\n", NULL);
-
-        output = CFCUtil_cat(output, vtable_var, "_\n"
-                             "    $arg = (SV*)CFISH_Obj_To_Host((cfish_Obj*)$var);\n"
-                             "    CFISH_DECREF($var);\n"
-                             "\n", NULL);
-    }
-
-    char *content = CFCUtil_strdup("");
-    content = CFCUtil_cat(content, typemap_start, start, "\n\n",
-                          typemap_input, input, "\n\n",
-                          typemap_output, output, "\n\n", NULL);
-    CFCUtil_write_if_changed("typemap", content, strlen(content));
-
-    FREEMEM(content);
-    FREEMEM(output);
-    FREEMEM(input);
-    FREEMEM(start);
-    FREEMEM(classes);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlTypeMap.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlTypeMap.h b/clownfish/compiler/src/CFCPerlTypeMap.h
deleted file mode 100644
index eceb86d..0000000
--- a/clownfish/compiler/src/CFCPerlTypeMap.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCPERLTYPEMAP
-#define H_CFCPERLTYPEMAP
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** Clownfish::CFC::Binding::Perl::TypeMap - Convert between Clownfish and
- * Perl via XS.
- *
- * TypeMap serves up C code fragments for translating between Perl data
- * structures and Clownfish data structures.  The functions to_perl() and
- * from_perl() achieve this for individual types; write_xs_typemap() exports
- * all types using the XS "typemap" format documented in "perlxs".
- */
-
-struct CFCHierarchy;
-struct CFCType;
-
-/** Return an expression which converts from a Perl scalar to a variable of
- * the specified type.
- * 
- * @param type A Clownfish::CFC::Model::Type, which will be used to select the
- * mapping code.
- * @param xs_var The C name of the Perl scalar from which we are extracting
- * a value.
- */
-char*
-CFCPerlTypeMap_from_perl(struct CFCType *type, const char *xs_var);
-
-/** Return an expression converts from a variable of type $type to a Perl
- * scalar.
- * 
- * @param type A Clownfish::CFC::Model::Type, which will be used to select the
- * mapping code.
- * @param cf_var The name of the variable from which we are extracting a
- * value.
- */ 
-char*
-CFCPerlTypeMap_to_perl(struct CFCType *type, const char *cf_var);
-
-/** Auto-generate a "typemap" file that adheres to the conventions documented
- * in "perlxs".
- * 
- * We generate this file on the fly rather than maintain a static copy because
- * we want an entry for each Clownfish type so that we can differentiate
- * between them when checking arguments.  Keeping the entries up-to-date
- * manually as classes come and go would be a pain.
- * 
- * @param hierarchy A Clownfish::CFC::Model::Hierarchy.
- */
-void
-CFCPerlTypeMap_write_xs_typemap(struct CFCHierarchy *hierarchy);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPERLTYPEMAP */
-


[lucy-commits] [33/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Remove dependency of Clownfish::CFC::Perl::Build on Charmonizer

Posted by ma...@apache.org.
Remove dependency of Clownfish::CFC::Perl::Build on Charmonizer

Add a new field 'cflags' to the 'clownfish_params' Module::Build
property to pass additional compiler flags.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/f24561ff
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/f24561ff
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/f24561ff

Branch: refs/heads/sortex_ptr_only
Commit: f24561ff4624c5563add8fb77a3e5206392bd293
Parents: 340d691
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Jul 21 00:00:30 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 22 23:05:37 2014 +0200

----------------------------------------------------------------------
 perl/buildlib/Lucy/Build.pm | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/f24561ff/perl/buildlib/Lucy/Build.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build.pm b/perl/buildlib/Lucy/Build.pm
index 1118474..ebfabb5 100644
--- a/perl/buildlib/Lucy/Build.pm
+++ b/perl/buildlib/Lucy/Build.pm
@@ -17,7 +17,10 @@ use strict;
 use warnings;
 
 package Lucy::Build;
-use base qw( Clownfish::CFC::Perl::Build );
+use base qw(
+    Clownfish::CFC::Perl::Build
+    Clownfish::CFC::Perl::Build::Charmonic
+);
 
 our $VERSION = '0.003000';
 $VERSION = eval $VERSION;
@@ -85,8 +88,6 @@ sub ACTION_lemon {
 sub ACTION_copy_clownfish_includes {
     my $self = shift;
 
-    $self->depends_on('charmony');
-
     $self->SUPER::ACTION_copy_clownfish_includes;
 
     $self->cf_copy_include_file( qw( Lucy Util ToolSet.h ) );
@@ -233,7 +234,20 @@ sub ACTION_parsers {
 sub ACTION_compile_custom_xs {
     my $self = shift;
 
-    $self->depends_on('parsers');
+    $self->depends_on(qw( parsers charmony ));
+
+    # Add extra compiler flags from Charmonizer.
+    my $charm_cflags = $self->charmony('EXTRA_CFLAGS');
+    if ($charm_cflags) {
+        my $cf_cflags = $self->clownfish_params('cflags');
+        if ($cf_cflags) {
+            $cf_cflags .= " $charm_cflags";
+        }
+        else {
+            $cf_cflags = $charm_cflags;
+        }
+        $self->clownfish_params( cflags => $cf_cflags );
+    }
 
     $self->SUPER::ACTION_compile_custom_xs;
 }


[lucy-commits] [35/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Remove parcel privacy defines from cflags

Posted by ma...@apache.org.
Remove parcel privacy defines from cflags

They're baked into the generated XS code now.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/0c43d919
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/0c43d919
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/0c43d919

Branch: refs/heads/sortex_ptr_only
Commit: 0c43d9193af8981fb1179ba8d7e2f4ff53a9ad7a
Parents: 87581ca
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Apr 22 21:30:30 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 22 23:05:37 2014 +0200

----------------------------------------------------------------------
 perl/Build.PL | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/0c43d919/perl/Build.PL
----------------------------------------------------------------------
diff --git a/perl/Build.PL b/perl/Build.PL
index ccad29e..a56d497 100644
--- a/perl/Build.PL
+++ b/perl/Build.PL
@@ -74,7 +74,6 @@ my $builder = Lucy::Build->new(
             $UTF8PROC_SRC_DIR,
         ],
     },
-    extra_compiler_flags => '-DCFP_LUCY -DCFP_TESTLUCY',
     add_to_cleanup => [
         qw(
             Lucy-*


[lucy-commits] [44/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Change return type for Peek() and Fetch().

Posted by ma...@apache.org.
Change return type for Peek() and Fetch().

Modify SortExternal and subclasses so that Peek() and Fetch return Obj*
rather than a void* which was actually Obj**.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/9ed7692c
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/9ed7692c
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/9ed7692c

Branch: refs/heads/sortex_ptr_only
Commit: 9ed7692cf8be7707ec892911b5a8949b4063d064
Parents: d477115
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Fri Jan 4 16:16:14 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 11:52:22 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/PostingPool.c            | 10 ++-----
 core/Lucy/Index/SortFieldWriter.c        |  6 ++--
 core/Lucy/Util/SortExternal.c            | 13 +++++----
 core/Lucy/Util/SortExternal.cfh          |  4 +--
 perl/buildlib/Lucy/Build/Binding/Util.pm | 42 ---------------------------
 5 files changed, 14 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/9ed7692c/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 57067f2..6628fc3 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -374,9 +374,8 @@ S_write_terms_and_postings(PostingPool *self, PostingWriter *post_writer,
         = Arch_Skip_Interval(Schema_Get_Architecture(ivars->schema));
 
     // Prime heldover variables.
-    RawPosting *posting = (RawPosting*)CERTIFY(
-                              (*(RawPosting**)PostPool_Fetch(self)),
-                              RAWPOSTING);
+    RawPosting *posting
+        = (RawPosting*)CERTIFY(PostPool_Fetch(self), RAWPOSTING);
     RawPostingIVARS *post_ivars = RawPost_IVARS(posting);
     CharBuf *last_term_text
         = CB_new_from_trusted_utf8(post_ivars->blob, post_ivars->content_len);
@@ -465,10 +464,7 @@ S_write_terms_and_postings(PostingPool *self, PostingWriter *post_writer,
         // Retrieve the next posting from the sort pool.
         // DECREF(posting);  // No!!  DON'T destroy!!!
 
-        void *address = PostPool_Fetch(self);
-        posting = address
-                  ? *(RawPosting**)address
-                  : NULL;
+        posting = (RawPosting*)PostPool_Fetch(self);
         post_ivars = RawPost_IVARS(posting);
     }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/9ed7692c/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index 34aa84d..2e55a39 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -558,8 +558,7 @@ S_write_files(SortFieldWriter *self, OutStream *ord_out, OutStream *ix_out,
 
     // Grab the first item and record its ord.  Add a dummy ord for invalid
     // doc id 0.
-    SFWriterElem **elem_ptr = (SFWriterElem**)SortFieldWriter_Fetch(self);
-    SFWriterElem *elem = *elem_ptr;
+    SFWriterElem *elem = (SFWriterElem*)SortFieldWriter_Fetch(self);
     SFWriterElemIVARS *elem_ivars = SFWriterElem_IVARS(elem);
     ords[elem_ivars->doc_id] = ord;
     ords[0] = 0;
@@ -568,8 +567,7 @@ S_write_files(SortFieldWriter *self, OutStream *ord_out, OutStream *ix_out,
     ivars->last_val = INCREF(elem_ivars->value);
     Obj *last_val_address = elem_ivars->value;
     S_write_val(elem_ivars->value, prim_id, ix_out, dat_out, dat_start);
-    while (NULL != (elem_ptr = (SFWriterElem**)SortFieldWriter_Fetch(self))) {
-        elem = *elem_ptr;
+    while (NULL != (elem = (SFWriterElem*)SortFieldWriter_Fetch(self))) {
         elem_ivars = SFWriterElem_IVARS(elem);
         if (elem_ivars->value != last_val_address) {
             int32_t comparison

http://git-wip-us.apache.org/repos/asf/lucy/blob/9ed7692c/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index 98158b9..9f0c30e 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -94,29 +94,30 @@ SortEx_Feed_IMP(SortExternal *self, Obj *item) {
     ivars->cache_max++;
 }
 
-static CFISH_INLINE void*
+static CFISH_INLINE Obj*
 SI_peek(SortExternal *self, SortExternalIVARS *ivars) {
     if (ivars->cache_tick >= ivars->cache_max) {
         S_refill_cache(self, ivars);
     }
 
     if (ivars->cache_max > 0) {
-        return ivars->cache + ivars->cache_tick * sizeof(Obj*);
+        Obj **elems = (Obj**)ivars->cache;
+        return elems[ivars->cache_tick];
     }
     else {
         return NULL;
     }
 }
 
-void*
+Obj*
 SortEx_Fetch_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    void *address = SI_peek(self, ivars);
+    Obj *item = SI_peek(self, ivars);
     ivars->cache_tick++;
-    return address;
+    return item;
 }
 
-void*
+Obj*
 SortEx_Peek_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     return SI_peek(self, ivars);

http://git-wip-us.apache.org/repos/asf/lucy/blob/9ed7692c/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index a6a7313..a27f2c2 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -92,13 +92,13 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     /** Fetch the next sorted item from the sort pool.  Invalid prior to
      * calling Flip(). Returns NULL when all elements have been exhausted.
      */
-    nullable void*
+    incremented nullable Obj*
     Fetch(SortExternal *self);
 
     /** Preview the next item that Fetch will return, but don't pop it.
      * Invalid prior to calling Flip().
      */
-    nullable void*
+    nullable Obj*
     Peek(SortExternal *self);
 
     /** Add a run to the sortex's collection.

http://git-wip-us.apache.org/repos/asf/lucy/blob/9ed7692c/perl/buildlib/Lucy/Build/Binding/Util.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build/Binding/Util.pm b/perl/buildlib/Lucy/Build/Binding/Util.pm
index a0de3ed..5bd6ed9 100644
--- a/perl/buildlib/Lucy/Build/Binding/Util.pm
+++ b/perl/buildlib/Lucy/Build/Binding/Util.pm
@@ -29,52 +29,10 @@ sub bind_all {
 }
 
 sub bind_bbsortex {
-    my @hand_rolled = qw(
-        Fetch
-        Peek
-    );
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Lucy    PACKAGE = Lucy::Util::BBSortEx
-
-SV*
-fetch(self)
-    lucy_BBSortEx *self;
-CODE:
-{
-    void *address = LUCY_BBSortEx_Fetch(self);
-    if (address) {
-        RETVAL = XSBind_cfish_to_perl(*(cfish_Obj**)address);
-        CFISH_DECREF(*(cfish_Obj**)address);
-    }
-    else {
-        RETVAL = newSV(0);
-    }
-}
-OUTPUT: RETVAL
-
-SV*
-peek(self)
-    lucy_BBSortEx *self;
-CODE:
-{
-    void *address = LUCY_BBSortEx_Peek(self);
-    if (address) {
-        RETVAL = XSBind_cfish_to_perl(*(cfish_Obj**)address);
-    }
-    else {
-        RETVAL = newSV(0);
-    }
-}
-OUTPUT: RETVAL
-
-END_XS_CODE
-
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel     => "Lucy",
         class_name => "Lucy::Util::BBSortEx",
     );
-    $binding->append_xs($xs_code);
-
     Clownfish::CFC::Binding::Perl::Class->register($binding);
 }
 


[lucy-commits] [41/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Eliminate `width` member from SortExternal.

Posted by ma...@apache.org.
Eliminate `width` member from SortExternal.

Remove `width` as a constructor argument and member variable from
SortExternal and its subclasses, replacing it with hard-coded
"sizeof(Obj*)" as needed.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/8369f5f2
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/8369f5f2
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/8369f5f2

Branch: refs/heads/sortex_ptr_only
Commit: 8369f5f2a6732b32ff730e1f6f6c12b8065d72a5
Parents: 0bf76df
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Fri Jan 4 13:10:56 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 10:19:34 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/PostingPool.c     |  2 +-
 core/Lucy/Index/SortFieldWriter.c |  2 +-
 core/Lucy/Util/BBSortEx.c         |  5 ++--
 core/Lucy/Util/SortExternal.c     | 43 ++++++++++++++--------------------
 core/Lucy/Util/SortExternal.cfh   |  3 +--
 5 files changed, 24 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/8369f5f2/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 6cf0d40..57067f2 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -76,7 +76,7 @@ PostPool_init(PostingPool *self, Schema *schema, Snapshot *snapshot,
               OutStream *lex_temp_out, OutStream *post_temp_out,
               OutStream *skip_out) {
     // Init.
-    SortEx_init((SortExternal*)self, sizeof(Obj*));
+    SortEx_init((SortExternal*)self);
     PostingPoolIVARS *const ivars = PostPool_IVARS(self);
     ivars->doc_base         = 0;
     ivars->last_doc_id      = 0;

http://git-wip-us.apache.org/repos/asf/lucy/blob/8369f5f2/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index 249e6ea..123e7f6 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -76,7 +76,7 @@ SortFieldWriter_init(SortFieldWriter *self, Schema *schema,
                      OutStream *temp_ord_out, OutStream *temp_ix_out,
                      OutStream *temp_dat_out) {
     // Init.
-    SortEx_init((SortExternal*)self, sizeof(SFWriterElem*));
+    SortEx_init((SortExternal*)self);
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
     ivars->null_ord        = -1;
     ivars->count           = 0;

http://git-wip-us.apache.org/repos/asf/lucy/blob/8369f5f2/core/Lucy/Util/BBSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.c b/core/Lucy/Util/BBSortEx.c
index 92d80a5..a0a0c7e 100644
--- a/core/Lucy/Util/BBSortEx.c
+++ b/core/Lucy/Util/BBSortEx.c
@@ -33,7 +33,7 @@ BBSortEx_new(uint32_t mem_threshold, VArray *external) {
 
 BBSortEx*
 BBSortEx_init(BBSortEx *self, uint32_t mem_threshold, VArray *external) {
-    SortEx_init((SortExternal*)self, sizeof(Obj*));
+    SortEx_init((SortExternal*)self);
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
     ivars->external_tick = 0;
     ivars->external = (VArray*)INCREF(external);
@@ -133,7 +133,8 @@ BBSortEx_Refill_IMP(BBSortEx *self) {
 
         if (ivars->cache_max == ivars->cache_cap) {
             BBSortEx_Grow_Cache(self,
-                                Memory_oversize(ivars->cache_max + 1, ivars->width));
+                                Memory_oversize(ivars->cache_max + 1,
+                                                sizeof(Obj*)));
         }
         Obj **cache = (Obj**)ivars->cache;
         cache[ivars->cache_max++] = INCREF(elem);

http://git-wip-us.apache.org/repos/asf/lucy/blob/8369f5f2/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index fc86556..b948131 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -41,12 +41,9 @@ S_find_slice_size(SortExternal *self, SortExternalIVARS *ivars,
                   uint8_t *endpost);
 
 SortExternal*
-SortEx_init(SortExternal *self, size_t width) {
+SortEx_init(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    // Assign.
-    ivars->width        = width;
 
-    // Init.
     ivars->mem_thresh   = UINT32_MAX;
     ivars->cache        = NULL;
     ivars->cache_cap    = 0;
@@ -88,13 +85,12 @@ SortEx_Clear_Cache_IMP(SortExternal *self) {
 void
 SortEx_Feed_IMP(SortExternal *self, void *data) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    const size_t width = ivars->width;
     if (ivars->cache_max == ivars->cache_cap) {
-        size_t amount = Memory_oversize(ivars->cache_max + 1, width);
+        size_t amount = Memory_oversize(ivars->cache_max + 1, sizeof(Obj*));
         SortEx_Grow_Cache(self, amount);
     }
-    uint8_t *target = ivars->cache + ivars->cache_max * width;
-    memcpy(target, data, width);
+    uint8_t *target = ivars->cache + ivars->cache_max * sizeof(Obj*);
+    memcpy(target, data, sizeof(Obj*));
     ivars->cache_max++;
 }
 
@@ -105,7 +101,7 @@ SI_peek(SortExternal *self, SortExternalIVARS *ivars) {
     }
 
     if (ivars->cache_max > 0) {
-        return ivars->cache + ivars->cache_tick * ivars->width;
+        return ivars->cache + ivars->cache_tick * sizeof(Obj*);
     }
     else {
         return NULL;
@@ -140,10 +136,10 @@ SortEx_Sort_Cache_IMP(SortExternal *self) {
             ivars->scratch_cap = ivars->cache_cap;
             ivars->scratch
                 = (uint8_t*)REALLOCATE(ivars->scratch,
-                                       ivars->scratch_cap * ivars->width);
+                                       ivars->scratch_cap * sizeof(Obj*));
         }
         Sort_mergesort(ivars->cache, ivars->scratch, ivars->cache_max,
-                       ivars->width, compare, self);
+                       sizeof(Obj*), compare, self);
     }
 }
 
@@ -193,7 +189,6 @@ S_refill_cache(SortExternal *self, SortExternalIVARS *ivars) {
 static uint8_t*
 S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
     uint8_t *endpost = NULL;
-    const size_t width = ivars->width;
 
     for (uint32_t i = 0, max = VA_Get_Size(ivars->runs); i < max; i++) {
         // Get a run and retrieve the last item in its cache.
@@ -207,7 +202,7 @@ S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
         else {
             // Cache item with the highest sort value currently held in memory
             // by the run.
-            uint8_t *candidate = run_ivars->cache + tick * width;
+            uint8_t *candidate = run_ivars->cache + tick * sizeof(Obj*);
 
             // If it's the first run, item is automatically the new endpost.
             if (i == 0) {
@@ -226,7 +221,6 @@ S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
 static void
 S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
                 uint8_t *endpost) {
-    size_t      width        = ivars->width;
     uint32_t    num_runs     = VA_Get_Size(ivars->runs);
     uint8_t   **slice_starts = ivars->slice_starts;
     uint32_t   *slice_sizes  = ivars->slice_sizes;
@@ -246,12 +240,12 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
             // Move slice content from run cache to main cache.
             if (ivars->cache_max + slice_size > ivars->cache_cap) {
                 size_t cap = Memory_oversize(ivars->cache_max + slice_size,
-                                             width);
+                                             sizeof(Obj*));
                 SortEx_Grow_Cache(self, cap);
             }
-            memcpy(ivars->cache + ivars->cache_max * width,
-                   run_ivars->cache + run_ivars->cache_tick * width,
-                   slice_size * width);
+            memcpy(ivars->cache + ivars->cache_max * sizeof(Obj*),
+                   run_ivars->cache + run_ivars->cache_tick * sizeof(Obj*),
+                   slice_size * sizeof(Obj*));
             run_ivars->cache_tick += slice_size;
             ivars->cache_max += slice_size;
 
@@ -263,7 +257,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     // Transform slice starts from ticks to pointers.
     uint32_t total = 0;
     for (uint32_t i = 0; i < ivars->num_slices; i++) {
-        slice_starts[i] = ivars->cache + total * width;
+        slice_starts[i] = ivars->cache + total * sizeof(Obj*);
         total += slice_sizes[i];
     }
 
@@ -272,7 +266,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     if (ivars->scratch_cap < ivars->cache_cap) {
         ivars->scratch_cap = ivars->cache_cap;
         ivars->scratch = (uint8_t*)REALLOCATE(
-                            ivars->scratch, ivars->scratch_cap * width);
+                            ivars->scratch, ivars->scratch_cap * sizeof(Obj*));
     }
 
     // Exploit previous sorting, rather than sort cache naively.
@@ -287,10 +281,10 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
                 const uint32_t merged_size = slice_sizes[i] + slice_sizes[i + 1];
                 Sort_merge(slice_starts[i], slice_sizes[i],
                            slice_starts[i + 1], slice_sizes[i + 1], ivars->scratch,
-                           ivars->width, compare, self);
+                           sizeof(Obj*), compare, self);
                 slice_sizes[j]  = merged_size;
                 slice_starts[j] = slice_starts[i];
-                memcpy(slice_starts[j], ivars->scratch, merged_size * width);
+                memcpy(slice_starts[j], ivars->scratch, merged_size * sizeof(Obj*));
                 i += 2;
                 j += 1;
             }
@@ -312,7 +306,7 @@ void
 SortEx_Grow_Cache_IMP(SortExternal *self, uint32_t size) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     if (size > ivars->cache_cap) {
-        ivars->cache = (uint8_t*)REALLOCATE(ivars->cache, size * ivars->width);
+        ivars->cache = (uint8_t*)REALLOCATE(ivars->cache, size * sizeof(Obj*));
         ivars->cache_cap = size;
     }
 }
@@ -323,14 +317,13 @@ S_find_slice_size(SortExternal *self, SortExternalIVARS *ivars,
     int32_t          lo      = ivars->cache_tick - 1;
     int32_t          hi      = ivars->cache_max;
     uint8_t *const   cache   = ivars->cache;
-    const size_t     width   = ivars->width;
     SortEx_Compare_t compare
         = METHOD_PTR(SortEx_Get_VTable(self), LUCY_SortEx_Compare);
 
     // Binary search.
     while (hi - lo > 1) {
         const int32_t mid   = lo + ((hi - lo) / 2);
-        const int32_t delta = compare(self, cache + mid * width, endpost);
+        const int32_t delta = compare(self, cache + mid * sizeof(Obj*), endpost);
         if (delta > 0) { hi = mid; }
         else           { lo = mid; }
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/8369f5f2/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index c414140..8362c4f 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -60,11 +60,10 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     uint8_t      **slice_starts;
     uint32_t      *slice_sizes;
     uint32_t       mem_thresh;
-    size_t         width;
     bool           flipped;
 
     inert SortExternal*
-    init(SortExternal *self, size_t width);
+    init(SortExternal *self);
 
     /** Compare two sortable elements.
      */


[lucy-commits] [46/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Change type for some SortEx private functions.

Posted by ma...@apache.org.
Change type for some SortEx private functions.

Modify some private subroutines in SortExternal to use Obj pointers
rather than byte addresses.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/7392ca1c
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/7392ca1c
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/7392ca1c

Branch: refs/heads/sortex_ptr_only
Commit: 7392ca1c8e700df22be4a7ea1bdeecdd9139fb21
Parents: 90cfcac
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jan 8 16:45:18 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 12:05:49 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Util/SortExternal.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/7392ca1c/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index 4d68664..3aa3334 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -27,18 +27,18 @@ S_refill_cache(SortExternal *self, SortExternalIVARS *ivars);
 // cache.
 static void
 S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
-                uint8_t *endpost);
+                Obj **endpost);
 
 // Return the address for the item in one of the runs' caches which is the
 // highest in sort order, but which we can guarantee is lower in sort order
 // than any item which has yet to enter a run cache.
-static uint8_t*
+static Obj**
 S_find_endpost(SortExternal *self, SortExternalIVARS *ivars);
 
-// Determine how many cache items are less than or equal to [endpost].
+// Determine how many buffered items are less than or equal to `endpost`.
 static uint32_t
 S_find_slice_size(SortExternal *self, SortExternalIVARS *ivars,
-                  uint8_t *endpost);
+                  Obj **endpost);
 
 SortExternal*
 SortEx_init(SortExternal *self) {
@@ -182,14 +182,14 @@ S_refill_cache(SortExternal *self, SortExternalIVARS *ivars) {
 
     // Absorb as many elems as possible from all runs into main cache.
     if (VA_Get_Size(ivars->runs)) {
-        uint8_t *endpost = S_find_endpost(self, ivars);
+        Obj **endpost = S_find_endpost(self, ivars);
         S_absorb_slices(self, ivars, endpost);
     }
 }
 
-static uint8_t*
+static Obj**
 S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
-    uint8_t *endpost = NULL;
+    Obj **endpost = NULL;
 
     for (uint32_t i = 0, max = VA_Get_Size(ivars->runs); i < max; i++) {
         // Get a run and retrieve the last item in its cache.
@@ -203,7 +203,7 @@ S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
         else {
             // Cache item with the highest sort value currently held in memory
             // by the run.
-            uint8_t *candidate = run_ivars->cache + tick * sizeof(Obj*);
+            Obj **candidate = (Obj**)run_ivars->cache + tick;
 
             // If it's the first run, item is automatically the new endpost.
             if (i == 0) {
@@ -221,7 +221,7 @@ S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
 
 static void
 S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
-                uint8_t *endpost) {
+                Obj **endpost) {
     uint32_t    num_runs     = VA_Get_Size(ivars->runs);
     Obj       **slice_starts = ivars->slice_starts;
     uint32_t   *slice_sizes  = ivars->slice_sizes;
@@ -314,17 +314,17 @@ SortEx_Grow_Cache_IMP(SortExternal *self, uint32_t size) {
 
 static uint32_t
 S_find_slice_size(SortExternal *self, SortExternalIVARS *ivars,
-                  uint8_t *endpost) {
+                  Obj **endpost) {
     int32_t          lo      = ivars->cache_tick - 1;
     int32_t          hi      = ivars->cache_max;
-    uint8_t *const   cache   = ivars->cache;
+    Obj            **cache   = (Obj**)ivars->cache;
     SortEx_Compare_t compare
         = METHOD_PTR(SortEx_Get_VTable(self), LUCY_SortEx_Compare);
 
     // Binary search.
     while (hi - lo > 1) {
         const int32_t mid   = lo + ((hi - lo) / 2);
-        const int32_t delta = compare(self, cache + mid * sizeof(Obj*), endpost);
+        const int32_t delta = compare(self, cache + mid, endpost);
         if (delta > 0) { hi = mid; }
         else           { lo = mid; }
     }


[lucy-commits] [02/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/buildlib/Clownfish/Build.pm b/clownfish/runtime/perl/buildlib/Clownfish/Build.pm
deleted file mode 100644
index 9a28a55..0000000
--- a/clownfish/runtime/perl/buildlib/Clownfish/Build.pm
+++ /dev/null
@@ -1,281 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use lib '../../compiler/perl/blib/arch';
-use lib '../../compiler/perl/blib/lib';
-
-package Clownfish::Build;
-
-# We want to subclass Clownfish::CFC::Perl::Build, but CFC might not be built
-# yet. So we look in 'clownfish/compiler/perl/lib' directly and cleanup @INC
-# afterwards.
-use lib '../../compiler/perl/lib';
-use base qw( Clownfish::CFC::Perl::Build );
-no lib '../../compiler/perl/lib';
-
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-use File::Spec::Functions qw( catdir catfile updir rel2abs );
-use File::Path qw( rmtree );
-use File::Copy qw( move );
-use Config;
-use Carp;
-use Cwd qw( getcwd );
-
-my @BASE_PATH = __PACKAGE__->cf_base_path;
-
-my $COMMON_SOURCE_DIR = catdir( @BASE_PATH, 'common' );
-my $CHARMONIZER_C     = catfile( $COMMON_SOURCE_DIR, 'charmonizer.c' );
-my $CORE_SOURCE_DIR   = catdir( @BASE_PATH, 'core' );
-my $CFC_DIR           = catdir( @BASE_PATH, updir(), 'compiler', 'perl' );
-my $CFC_BUILD         = catfile( $CFC_DIR, 'Build' );
-my $LIB_DIR           = 'lib';
-
-sub new {
-    my $self = shift->SUPER::new( recursive_test_files => 1, @_ );
-
-    if ( $ENV{LUCY_VALGRIND} ) {
-        my $optimize = $self->config('optimize') || '';
-        $optimize =~ s/\-O\d+/-O1/g;
-        $self->config( optimize => $optimize );
-    }
-
-    $self->charmonizer_params( charmonizer_c => $CHARMONIZER_C );
-
-    $self->clownfish_params( autogen_header => $self->autogen_header );
-
-    return $self;
-}
-
-sub _run_make {
-    my ( $self, %params ) = @_;
-    my @command           = @{ $params{args} };
-    my $dir               = $params{dir};
-    my $current_directory = getcwd();
-    chdir $dir if $dir;
-    unshift @command, 'CC=' . $self->config('cc');
-    if ( $self->config('cc') =~ /^cl\b/ ) {
-        unshift @command, "-f", "Makefile.MSVC";
-    }
-    elsif ( $^O =~ /mswin/i ) {
-        unshift @command, "-f", "Makefile.MinGW";
-    }
-    unshift @command, "$Config{make}";
-    system(@command) and confess("$Config{make} failed");
-    chdir $current_directory if $dir;
-}
-
-sub ACTION_cfc {
-    my $self    = shift;
-    my $old_dir = getcwd();
-    chdir($CFC_DIR);
-    if ( !-f 'Build' ) {
-        print "\nBuilding Clownfish compiler... \n";
-        system("$^X Build.PL");
-        system("$^X Build code");
-        print "\nFinished building Clownfish compiler.\n\n";
-    }
-    chdir($old_dir);
-}
-
-sub ACTION_copy_clownfish_includes {
-    my $self = shift;
-
-    $self->dispatch('charmony');
-
-    $self->SUPER::ACTION_copy_clownfish_includes;
-
-    $self->cf_copy_include_file( 'charmony.h' );
-    $self->cf_copy_include_file( 'XSBind.h' );
-}
-
-sub ACTION_clownfish {
-    my $self = shift;
-
-    $self->dispatch('charmony');
-    $self->dispatch('cfc');
-
-    $self->SUPER::ACTION_clownfish;
-}
-
-sub ACTION_suppressions {
-    my $self       = shift;
-    my $LOCAL_SUPP = 'local.supp';
-    return
-        if $self->up_to_date( '../devel/bin/valgrind_triggers.pl',
-        $LOCAL_SUPP );
-
-    # Generate suppressions.
-    print "Writing $LOCAL_SUPP...\n";
-    $self->add_to_cleanup($LOCAL_SUPP);
-    my $command
-        = "yes | "
-        . $self->_valgrind_base_command
-        . "--gen-suppressions=yes "
-        . $self->perl
-        . " ../devel/bin/valgrind_triggers.pl 2>&1";
-    my $suppressions = `$command`;
-    $suppressions =~ s/^==.*?\n//mg;
-    $suppressions =~ s/^--.*?\n//mg;
-    my $rule_number = 1;
-
-    while ( $suppressions =~ /<insert.a.*?>/ ) {
-        $suppressions =~ s/^\s*<insert.a.*?>/{\n  <core_perl_$rule_number>/m;
-        $rule_number++;
-    }
-
-    # Change e.g. fun:_vgrZU_libcZdsoZa_calloc to fun:calloc
-    $suppressions =~ s/fun:\w+_((m|c|re)alloc)/fun:$1/g;
-
-    # Write local suppressions file.
-    open( my $supp_fh, '>', $LOCAL_SUPP )
-        or confess("Can't open '$LOCAL_SUPP': $!");
-    print $supp_fh $suppressions;
-}
-
-sub _valgrind_base_command {
-    return
-          "PERL_DESTRUCT_LEVEL=2 LUCY_VALGRIND=1 valgrind "
-        . "--leak-check=yes "
-        . "--show-reachable=yes "
-        . "--num-callers=10 "
-        . "--dsymutil=yes "
-        . "--suppressions=../devel/conf/lucyperl.supp ";
-}
-
-# Run the entire test suite under Valgrind.
-#
-# For this to work, Lucy must be compiled with the LUCY_VALGRIND environment
-# variable set to a true value, under a debugging Perl.
-#
-# A custom suppressions file will probably be needed -- use your judgment.
-# To pass in one or more local suppressions files, provide a comma separated
-# list like so:
-#
-#   $ ./Build test_valgrind --suppressions=foo.supp,bar.supp
-sub ACTION_test_valgrind {
-    my $self = shift;
-    die "Must be run under a perl that was compiled with -DDEBUGGING"
-        unless $self->config('ccflags') =~ /-D?DEBUGGING\b/;
-    if ( !$ENV{LUCY_VALGRIND} ) {
-        warn "\$ENV{LUCY_VALGRIND} not true -- possible false positives";
-    }
-    $self->dispatch('code');
-    $self->dispatch('suppressions');
-
-    # Unbuffer STDOUT, grab test file names and suppressions files.
-    $|++;
-    my $t_files = $self->find_test_files;    # not public M::B API, may fail
-    my $valgrind_command = $self->_valgrind_base_command;
-    $valgrind_command .= "--suppressions=local.supp ";
-
-    if ( my $local_supp = $self->args('suppressions') ) {
-        for my $supp ( split( ',', $local_supp ) ) {
-            $valgrind_command .= "--suppressions=$supp ";
-        }
-    }
-
-    # Iterate over test files.
-    my @failed;
-    for my $t_file (@$t_files) {
-
-        # Run test file under Valgrind.
-        print "Testing $t_file...";
-        die "Can't find '$t_file'" unless -f $t_file;
-        my $command = "$valgrind_command $^X -Mblib $t_file 2>&1";
-        my $output = "\n" . ( scalar localtime(time) ) . "\n$command\n";
-        $output .= `$command`;
-
-        # Screen-scrape Valgrind output, looking for errors and leaks.
-        if (   $?
-            or $output =~ /ERROR SUMMARY:\s+[^0\s]/
-            or $output =~ /definitely lost:\s+[^0\s]/
-            or $output =~ /possibly lost:\s+[^0\s]/
-            or $output =~ /still reachable:\s+[^0\s]/ )
-        {
-            print " failed.\n";
-            push @failed, $t_file;
-            print "$output\n";
-        }
-        else {
-            print " succeeded.\n";
-        }
-    }
-
-    # If there are failed tests, print a summary list.
-    if (@failed) {
-        print "\nFailed "
-            . scalar @failed . "/"
-            . scalar @$t_files
-            . " test files:\n    "
-            . join( "\n    ", @failed ) . "\n";
-        exit(1);
-    }
-}
-
-sub autogen_header {
-    my $self = shift;
-    return <<"END_AUTOGEN";
-/***********************************************
-
- !!!! DO NOT EDIT !!!!
-
- This file was auto-generated by Build.PL.
-
- ***********************************************/
-
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-END_AUTOGEN
-}
-
-# Run the cleanup targets for independent prerequisite builds.
-sub _clean_prereq_builds {
-    my $self = shift;
-    if ( -e $CFC_BUILD ) {
-        my $old_dir = getcwd();
-        chdir $CFC_DIR;
-        system("$^X Build realclean")
-            and die "Clownfish clean failed";
-        chdir $old_dir;
-    }
-}
-
-sub ACTION_clean {
-    my $self = shift;
-    _clean_prereq_builds($self);
-    $self->SUPER::ACTION_clean;
-}
-
-1;
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm b/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
deleted file mode 100644
index d61718d..0000000
--- a/clownfish/runtime/perl/buildlib/Clownfish/Build/Binding.pm
+++ /dev/null
@@ -1,730 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-package Clownfish::Build::Binding;
-use strict;
-use warnings;
-
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-sub bind_all {
-    my $class = shift;
-    $class->bind_clownfish;
-    $class->bind_test;
-    $class->bind_bytebuf;
-    $class->bind_string;
-    $class->bind_err;
-    $class->bind_hash;
-    $class->bind_float32;
-    $class->bind_float64;
-    $class->bind_obj;
-    $class->bind_varray;
-    $class->bind_vtable;
-    $class->bind_stringhelper;
-}
-
-sub bind_clownfish {
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish    PACKAGE = Clownfish
-
-BOOT:
-    cfish_Clownfish_bootstrap();
-
-IV
-_dummy_function()
-CODE:
-    RETVAL = 1;
-OUTPUT:
-    RETVAL
-
-SV*
-to_clownfish(sv)
-    SV *sv;
-CODE:
-{
-    cfish_Obj *obj = XSBind_perl_to_cfish(sv);
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(obj);
-}
-OUTPUT: RETVAL
-
-SV*
-to_perl(sv)
-    SV *sv;
-CODE:
-{
-    if (sv_isobject(sv) && sv_derived_from(sv, "Clownfish::Obj")) {
-        IV tmp = SvIV(SvRV(sv));
-        cfish_Obj* obj = INT2PTR(cfish_Obj*, tmp);
-        RETVAL = XSBind_cfish_to_perl(obj);
-    }
-    else {
-        RETVAL = newSVsv(sv);
-    }
-}
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish",
-    );
-    $binding->append_xs($xs_code);
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_test {
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish   PACKAGE = Clownfish::Test
-
-bool
-run_tests(package)
-    char *package;
-CODE:
-    cfish_String *class_name = cfish_Str_newf("%s", package);
-    cfish_TestFormatter *formatter
-        = (cfish_TestFormatter*)cfish_TestFormatterTAP_new();
-    cfish_TestSuite *suite = testcfish_Test_create_test_suite();
-    bool result = CFISH_TestSuite_Run_Batch(suite, class_name, formatter);
-    CFISH_DECREF(class_name);
-    CFISH_DECREF(formatter);
-    CFISH_DECREF(suite);
-
-    RETVAL = result;
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "TestClownfish",
-        class_name => "Clownfish::Test",
-    );
-    $binding->append_xs($xs_code);
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_bytebuf {
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish     PACKAGE = Clownfish::ByteBuf
-
-SV*
-new(either_sv, sv)
-    SV *either_sv;
-    SV *sv;
-CODE:
-{
-    STRLEN size;
-    char *ptr = SvPV(sv, size);
-    cfish_ByteBuf *self = (cfish_ByteBuf*)XSBind_new_blank_obj(either_sv);
-    cfish_BB_init(self, size);
-    CFISH_BB_Mimic_Bytes(self, ptr, size);
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(self);
-}
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::ByteBuf",
-    );
-    $binding->append_xs($xs_code);
-    $binding->exclude_constructor;
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_string {
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish     PACKAGE = Clownfish::String
-
-SV*
-new(either_sv, sv)
-    SV *either_sv;
-    SV *sv;
-CODE:
-{
-    STRLEN size;
-    char *ptr = SvPVutf8(sv, size);
-    cfish_String *self = (cfish_String*)XSBind_new_blank_obj(either_sv);
-    cfish_Str_init_from_trusted_utf8(self, ptr, size);
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(self);
-}
-OUTPUT: RETVAL
-
-SV*
-_clone(self)
-    cfish_String *self;
-CODE:
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(CFISH_Str_Clone_IMP(self));
-OUTPUT: RETVAL
-
-SV*
-to_perl(self)
-    cfish_String *self;
-CODE:
-    RETVAL = XSBind_str_to_sv(self);
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::String",
-    );
-    $binding->append_xs($xs_code);
-    $binding->exclude_constructor;
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_err {
-    my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new;
-    my $synopsis = <<'END_SYNOPSIS';
-    package MyErr;
-    use base qw( Clownfish::Err );
-    
-    ...
-    
-    package main;
-    use Scalar::Util qw( blessed );
-    while (1) {
-        eval {
-            do_stuff() or MyErr->throw("retry");
-        };
-        if ( blessed($@) and $@->isa("MyErr") ) {
-            warn "Retrying...\n";
-        }
-        else {
-            # Re-throw.
-            die "do_stuff() died: $@";
-        }
-    }
-END_SYNOPSIS
-    $pod_spec->set_synopsis($synopsis);
-
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish    PACKAGE = Clownfish::Err
-
-SV*
-trap(routine_sv, context_sv)
-    SV *routine_sv;
-    SV *context_sv;
-CODE:
-    cfish_Err *error = XSBind_trap(routine_sv, context_sv);
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(error);
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::Err",
-    );
-    $binding->bind_constructor( alias => '_new' );
-    $binding->set_pod_spec($pod_spec);
-    $binding->append_xs($xs_code);
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_hash {
-    my @hand_rolled = qw(
-        Store
-        Next
-    );
-
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish    PACKAGE = Clownfish::Hash
-SV*
-_fetch(self, key)
-    cfish_Hash *self;
-    cfish_String *key;
-CODE:
-    RETVAL = CFISH_OBJ_TO_SV(CFISH_Hash_Fetch_IMP(self, (cfish_Obj*)key));
-OUTPUT: RETVAL
-
-void
-store(self, key, value);
-    cfish_Hash         *self;
-    cfish_String *key;
-    cfish_Obj          *value;
-PPCODE:
-{
-    if (value) { CFISH_INCREF(value); }
-    CFISH_Hash_Store_IMP(self, (cfish_Obj*)key, value);
-}
-
-void
-next(self)
-    cfish_Hash *self;
-PPCODE:
-{
-    cfish_Obj *key;
-    cfish_Obj *val;
-
-    if (CFISH_Hash_Next(self, &key, &val)) {
-        SV *key_sv = (SV*)CFISH_Obj_To_Host(key);
-        SV *val_sv = (SV*)CFISH_Obj_To_Host(val);
-
-        XPUSHs(sv_2mortal(key_sv));
-        XPUSHs(sv_2mortal(val_sv));
-        XSRETURN(2);
-    }
-    else {
-        XSRETURN_EMPTY;
-    }
-}
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::Hash",
-    );
-    $binding->exclude_method($_) for @hand_rolled;
-    $binding->append_xs($xs_code);
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_float32 {
-    my $float32_xs_code = <<'END_XS_CODE';
-MODULE = Clownfish   PACKAGE = Clownfish::Float32
-
-SV*
-new(either_sv, value)
-    SV    *either_sv;
-    float  value;
-CODE:
-{
-    cfish_Float32 *self = (cfish_Float32*)XSBind_new_blank_obj(either_sv);
-    cfish_Float32_init(self, value);
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(self);
-}
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::Float32",
-    );
-    $binding->append_xs($float32_xs_code);
-    $binding->exclude_constructor;
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_float64 {
-    my $float64_xs_code = <<'END_XS_CODE';
-MODULE = Clownfish   PACKAGE = Clownfish::Float64
-
-SV*
-new(either_sv, value)
-    SV     *either_sv;
-    double  value;
-CODE:
-{
-    cfish_Float64 *self = (cfish_Float64*)XSBind_new_blank_obj(either_sv);
-    cfish_Float64_init(self, value);
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(self);
-}
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::Float64",
-    );
-    $binding->append_xs($float64_xs_code);
-    $binding->exclude_constructor;
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_obj {
-    my @exposed = qw(
-        To_String
-        To_I64
-        To_F64
-        Equals
-    );
-    my @hand_rolled = qw(
-        Is_A
-    );
-
-    my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new;
-    my $synopsis = <<'END_SYNOPSIS';
-    package MyObj;
-    use base qw( Clownfish::Obj );
-    
-    # Inside-out member var.
-    my %foo;
-    
-    sub new {
-        my ( $class, %args ) = @_;
-        my $foo = delete $args{foo};
-        my $self = $class->SUPER::new(%args);
-        $foo{$$self} = $foo;
-        return $self;
-    }
-    
-    sub get_foo {
-        my $self = shift;
-        return $foo{$$self};
-    }
-    
-    sub DESTROY {
-        my $self = shift;
-        delete $foo{$$self};
-        $self->SUPER::DESTROY;
-    }
-END_SYNOPSIS
-    my $description = <<'END_DESCRIPTION';
-Clownfish::Obj is the base class of the Clownfish object hierarchy.
-
-From the standpoint of a Perl programmer, all classes are implemented as
-blessed scalar references, with the scalar storing a pointer to a C struct.
-
-=head2 Subclassing
-
-The recommended way to subclass Clownfish::Obj and its descendants is
-to use the inside-out design pattern.  (See L<Class::InsideOut> for an
-introduction to inside-out techniques.)
-
-Since the blessed scalar stores a C pointer value which is unique per-object,
-C<$$self> can be used as an inside-out ID.
-
-    # Accessor for 'foo' member variable.
-    sub get_foo {
-        my $self = shift;
-        return $foo{$$self};
-    }
-
-
-Caveats:
-
-=over
-
-=item *
-
-Inside-out aficionados will have noted that the "cached scalar id" stratagem
-recommended above isn't compatible with ithreads.
-
-=item *
-
-Overridden methods must not return undef unless the API specifies that
-returning undef is permissible.  (Failure to adhere to this rule currently
-results in a segfault rather than an exception.)
-
-=back
-
-=head1 CONSTRUCTOR
-
-=head2 new()
-
-Abstract constructor -- must be invoked via a subclass.  Attempting to
-instantiate objects of class "Clownfish::Obj" directly causes an
-error.
-
-Takes no arguments; if any are supplied, an error will be reported.
-
-=head1 DESTRUCTOR
-
-=head2 DESTROY
-
-All Clownfish classes implement a DESTROY method; if you override it in a
-subclass, you must call C<< $self->SUPER::DESTROY >> to avoid leaking memory.
-END_DESCRIPTION
-    $pod_spec->set_synopsis($synopsis);
-    $pod_spec->set_description($description);
-    $pod_spec->add_method( method => $_, alias => lc($_) ) for @exposed;
-
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish     PACKAGE = Clownfish::Obj
-
-bool
-is_a(self, class_name)
-    cfish_Obj *self;
-    cfish_String *class_name;
-CODE:
-{
-    cfish_VTable *target = cfish_VTable_fetch_vtable(class_name);
-    RETVAL = CFISH_Obj_Is_A(self, target);
-}
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::Obj",
-    );
-    $binding->exclude_method($_) for @hand_rolled;
-    $binding->append_xs($xs_code);
-    $binding->set_pod_spec($pod_spec);
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_varray {
-    my @hand_rolled = qw(
-        Shallow_Copy
-        Shift
-        Pop
-        Delete
-        Store
-        Fetch
-    );
-
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish   PACKAGE = Clownfish::VArray
-
-SV*
-shallow_copy(self)
-    cfish_VArray *self;
-CODE:
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(CFISH_VA_Shallow_Copy(self));
-OUTPUT: RETVAL
-
-SV*
-_clone(self)
-    cfish_VArray *self;
-CODE:
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(CFISH_VA_Clone(self));
-OUTPUT: RETVAL
-
-SV*
-shift(self)
-    cfish_VArray *self;
-CODE:
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(CFISH_VA_Shift(self));
-OUTPUT: RETVAL
-
-SV*
-pop(self)
-    cfish_VArray *self;
-CODE:
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(CFISH_VA_Pop(self));
-OUTPUT: RETVAL
-
-SV*
-delete(self, tick)
-    cfish_VArray *self;
-    uint32_t    tick;
-CODE:
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(CFISH_VA_Delete(self, tick));
-OUTPUT: RETVAL
-
-void
-store(self, tick, value);
-    cfish_VArray *self;
-    uint32_t     tick;
-    cfish_Obj    *value;
-PPCODE:
-{
-    if (value) { CFISH_INCREF(value); }
-    CFISH_VA_Store_IMP(self, tick, value);
-}
-
-SV*
-fetch(self, tick)
-    cfish_VArray *self;
-    uint32_t     tick;
-CODE:
-    RETVAL = CFISH_OBJ_TO_SV(CFISH_VA_Fetch(self, tick));
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::VArray",
-    );
-    $binding->exclude_method($_) for @hand_rolled;
-    $binding->append_xs($xs_code);
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_vtable {
-    my @hand_rolled = qw( Make_Obj );
-
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish   PACKAGE = Clownfish::VTable
-
-SV*
-_get_registry()
-CODE:
-    if (cfish_VTable_registry == NULL) {
-        cfish_VTable_init_registry();
-    }
-    RETVAL = (SV*)CFISH_Obj_To_Host((cfish_Obj*)cfish_VTable_registry);
-OUTPUT: RETVAL
-
-SV*
-fetch_vtable(unused_sv, class_name_sv)
-    SV *unused_sv;
-    SV *class_name_sv;
-CODE:
-{
-    CFISH_UNUSED_VAR(unused_sv);
-    STRLEN size;
-    char *ptr = SvPVutf8(class_name_sv, size);
-    cfish_StackString *class_name = CFISH_SSTR_WRAP_UTF8(ptr, size);
-    cfish_VTable *vtable
-        = cfish_VTable_fetch_vtable((cfish_String*)class_name);
-    RETVAL = vtable ? (SV*)CFISH_VTable_To_Host(vtable) : &PL_sv_undef;
-}
-OUTPUT: RETVAL
-
-SV*
-singleton(unused_sv, ...)
-    SV *unused_sv;
-CODE:
-{
-    CFISH_UNUSED_VAR(unused_sv);
-    cfish_String *class_name = NULL;
-    cfish_VTable *parent     = NULL;
-    bool args_ok
-        = XSBind_allot_params(&(ST(0)), 1, items,
-                              ALLOT_OBJ(&class_name, "class_name", 10, true,
-                                        CFISH_STRING, alloca(cfish_SStr_size())),
-                              ALLOT_OBJ(&parent, "parent", 6, false,
-                                        CFISH_VTABLE, NULL),
-                              NULL);
-    if (!args_ok) {
-        CFISH_RETHROW(CFISH_INCREF(cfish_Err_get_error()));
-    }
-    cfish_VTable *singleton = cfish_VTable_singleton(class_name, parent);
-    RETVAL = (SV*)CFISH_VTable_To_Host(singleton);
-}
-OUTPUT: RETVAL
-
-SV*
-make_obj(self)
-    cfish_VTable *self;
-CODE:
-    cfish_Obj *blank = CFISH_VTable_Make_Obj(self);
-    RETVAL = CFISH_OBJ_TO_SV_NOINC(blank);
-OUTPUT: RETVAL
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::VTable",
-    );
-    $binding->exclude_method($_) for @hand_rolled;
-    $binding->append_xs($xs_code);
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-sub bind_stringhelper {
-    my $xs_code = <<'END_XS_CODE';
-MODULE = Clownfish   PACKAGE = Clownfish::Util::StringHelper
-
-=for comment
-
-Turn an SV's UTF8 flag on.  Equivalent to Encode::_utf8_on, but we don't have
-to load Encode.
-
-=cut
-
-void
-utf8_flag_on(sv)
-    SV *sv;
-PPCODE:
-    SvUTF8_on(sv);
-
-=for comment
-
-Turn an SV's UTF8 flag off.
-
-=cut
-
-void
-utf8_flag_off(sv)
-    SV *sv;
-PPCODE:
-    SvUTF8_off(sv);
-
-SV*
-to_base36(num)
-    uint64_t num;
-CODE:
-{
-    char base36[cfish_StrHelp_MAX_BASE36_BYTES];
-    size_t size = cfish_StrHelp_to_base36(num, &base36);
-    RETVAL = newSVpvn(base36, size);
-}
-OUTPUT: RETVAL
-
-IV
-from_base36(str)
-    char *str;
-CODE:
-    RETVAL = strtol(str, NULL, 36);
-OUTPUT: RETVAL
-
-=for comment
-
-Upgrade a SV to UTF8, converting Latin1 if necessary. Equivalent to
-utf::upgrade().
-
-=cut
-
-void
-utf8ify(sv)
-    SV *sv;
-PPCODE:
-    sv_utf8_upgrade(sv);
-
-bool
-utf8_valid(sv)
-    SV *sv;
-CODE:
-{
-    STRLEN len;
-    char *ptr = SvPV(sv, len);
-    RETVAL = cfish_StrHelp_utf8_valid(ptr, len);
-}
-OUTPUT: RETVAL
-
-=for comment
-
-Concatenate one scalar onto the end of the other, ignoring UTF-8 status of the
-second scalar.  This is necessary because $not_utf8 . $utf8 results in a
-scalar which has been infected by the UTF-8 flag of the second argument.
-
-=cut
-
-void
-cat_bytes(sv, catted)
-    SV *sv;
-    SV *catted;
-PPCODE:
-{
-    STRLEN len;
-    char *ptr = SvPV(catted, len);
-    if (SvUTF8(sv)) { CFISH_THROW(CFISH_ERR, "Can't cat_bytes onto a UTF-8 SV"); }
-    sv_catpvn(sv, ptr, len);
-}
-END_XS_CODE
-
-    my $binding = Clownfish::CFC::Binding::Perl::Class->new(
-        parcel     => "Clownfish",
-        class_name => "Clownfish::Util::StringHelper",
-    );
-    $binding->append_xs($xs_code);
-
-    Clownfish::CFC::Binding::Perl::Class->register($binding);
-}
-
-1;

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish.pm b/clownfish/runtime/perl/lib/Clownfish.pm
deleted file mode 100644
index d683245..0000000
--- a/clownfish/runtime/perl/lib/Clownfish.pm
+++ /dev/null
@@ -1,225 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-package Clownfish;
-
-use 5.008003;
-
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-use Exporter 'import';
-BEGIN {
-    our @EXPORT_OK = qw(
-        to_clownfish
-        to_perl
-        kdump
-        );
-}
-
-# On most UNIX variants, this flag makes DynaLoader pass RTLD_GLOBAL to
-# dl_open, so extensions can resolve the needed symbols without explicitly
-# linking against the DSO.
-sub dl_load_flags { 1 }
-
-BEGIN {
-    require DynaLoader;
-    our @ISA = qw( DynaLoader );
-    # This loads a large number of disparate subs.
-    bootstrap Clownfish '0.3.0';
-    _init_autobindings();
-}
-
-sub kdump {
-    require Data::Dumper;
-    my $kdumper = Data::Dumper->new( [@_] );
-    $kdumper->Sortkeys( sub { return [ sort keys %{ $_[0] } ] } );
-    $kdumper->Indent(1);
-    warn $kdumper->Dump;
-}
-
-sub error {$Clownfish::Err::error}
-
-{
-    package Clownfish::Util::StringHelper;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-    BEGIN {
-        push our @ISA, 'Exporter';
-        our @EXPORT_OK = qw(
-            utf8_flag_on
-            utf8_flag_off
-            to_base36
-            from_base36
-            utf8ify
-            utf8_valid
-            cat_bytes
-        );
-    }
-}
-
-{
-    package Clownfish::LockFreeRegistry;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-    no warnings 'redefine';
-    sub DESTROY { }    # leak all
-}
-
-{
-    package Clownfish::Obj;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-    use Clownfish qw( to_clownfish to_perl );
-}
-
-{
-    package Clownfish::VTable;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-
-    sub _find_parent_class {
-        my $package = shift;
-        no strict 'refs';
-        for my $parent ( @{"$package\::ISA"} ) {
-            return $parent if $parent->isa('Clownfish::Obj');
-        }
-        return;
-    }
-
-    sub _fresh_host_methods {
-        my $package = shift;
-        no strict 'refs';
-        my $stash = \%{"$package\::"};
-        my $methods
-            = Clownfish::VArray->new( capacity => scalar keys %$stash );
-        while ( my ( $symbol, $glob ) = each %$stash ) {
-            next if ref $glob;
-            next unless *$glob{CODE};
-            $methods->push( Clownfish::String->new($symbol) );
-        }
-        return $methods;
-    }
-
-    sub _register {
-        my ( $singleton, $parent ) = @_;
-        my $singleton_class = $singleton->get_name;
-        my $parent_class    = $parent->get_name;
-        if ( !$singleton_class->isa($parent_class) ) {
-            no strict 'refs';
-            push @{"$singleton_class\::ISA"}, $parent_class;
-        }
-    }
-
-    no warnings 'redefine';
-    sub DESTROY { }    # leak all
-}
-
-{
-    package Clownfish::Method;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-    no warnings 'redefine';
-    sub DESTROY { }    # leak all
-}
-
-{
-    package Clownfish::ViewByteBuf;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-    use Carp;
-    sub new { confess "ViewByteBuf objects can only be created from C." }
-}
-
-{
-    package Clownfish::String;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-
-    {
-        # Defeat obscure bugs in the XS auto-generation by redefining clone().
-        # (Because of how the typemap works for String*,
-        # the auto-generated methods return UTF-8 Perl scalars rather than
-        # actual String objects.)
-        no warnings 'redefine';
-        sub clone { shift->_clone(@_) }
-    }
-}
-
-{
-    package Clownfish::StackString;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-    use Carp;
-    sub new { confess "StackString objects can only be created from C." }
-    no warnings 'redefine';
-    sub DESTROY { }
-}
-
-{
-    package Clownfish::Err;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-    sub do_to_string { shift->to_string }
-    use Scalar::Util qw( blessed );
-    use Carp qw( confess longmess );
-    use overload
-        '""'     => \&do_to_string,
-        fallback => 1;
-
-    sub new {
-        my ( $either, $message ) = @_;
-        my ( undef, $file, $line ) = caller;
-        $message .= ", $file line $line\n";
-        return $either->_new( mess => Clownfish::String->new($message) );
-    }
-
-    sub do_throw {
-        my $err      = shift;
-        my $longmess = longmess();
-        $longmess =~ s/^\s*/\t/;
-        $err->cat_mess($longmess);
-        die $err;
-    }
-
-    our $error;
-    sub set_error {
-        my $val = $_[1];
-        if ( defined $val ) {
-            confess("Not a Clownfish::Err")
-                unless ( blessed($val)
-                && $val->isa("Clownfish::Err") );
-        }
-        $error = $val;
-    }
-    sub get_error {$error}
-}
-
-{
-    package Clownfish::VArray;
-    our $VERSION = '0.003000';
-    $VERSION = eval $VERSION;
-    no warnings 'redefine';
-    sub clone       { CORE::shift->_clone }
-}
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish.pod
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish.pod b/clownfish/runtime/perl/lib/Clownfish.pod
deleted file mode 100644
index 60609c2..0000000
--- a/clownfish/runtime/perl/lib/Clownfish.pod
+++ /dev/null
@@ -1,618 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-=head1 NAME
-
-Clownfish - Symbiotic object system.
-
-=head1 VERSION
-
-0.3.0
-
-=head1 DESCRIPTION
-
-Clownfish is a "symbiotic" object system for C which is designed to pair
-with a "host" dynamic language environment, facilitating the development
-of high performance host language extensions.  Clownfish classes are
-declared in header files with a C<.cfh> extension.  The Clownfish headers
-are used by the Clownfish compiler to generate C header files and host
-language bindings.  Methods, functions and variables are defined in normal
-C source files.
-
-=head2 Features
-
-=over
-
-=item *
-
-Designed to support multiple host languages. Currently, only Perl is supported.
-
-=item *
-
-Support for stand-alone C libraries and executables.
-
-=item *
-
-Subclassing and method overriding from the host language.
-
-=item *
-
-Support for host language idioms like named parameters or default argument
-values.
-
-=item *
-
-Highly performant object system with lazy creation of host language objects.
-
-=item *
-
-Runtime with classes for commonly used data structures like strings, dynamic
-arrays and hash tables.
-
-=item *
-
-Modularity.
-
-=item *
-
-Introspection.
-
-=item *
-
-Documentation generator.
-
-=back
-
-=head2 Planned features
-
-=over
-
-=item *
-
-Support for more host languages.
-
-=item *
-
-Guaranteed ABI stability when adding or reordering methods or instance
-variables.
-
-=back
-
-=head1 USING CLOWNFISH CLASSES
-
-TODO: Simple introduction
-
-=head1 WRITING CLOWNFISH CLASSES
-
-=head2 Parcels
-
-Every Clownfish class belongs to a Clownfish parcel. Parcels are used for
-namespacing and versioning. Information about parcels is stored in C<.cfp>
-files which contain a JSON hash with the following keys:
-
-=over
-
-=item name
-
-The parcel's name. It must contain only letters.
-
-=item nickname
-
-A short nickname. It must contain only letters. This nickname, followed by an
-underscore, is used to prefix generated C symbols and macros. Depending on the
-kind of symbol, a lowercase, mixed case, or uppercase prefix will be used.
-
-=item version
-
-A version specifier of the following form (without whitespace):
-
-    version-specifier = "v" version-number
-    version-number = digit | digit "." version-number
-
-=back
-
-An example C<.cfp> file might look like:
-
-    {
-        "name": "Pathfinder",
-        "nickname": "Pfind",
-        "version": "v2.3.8"
-    }
-
-A parcel specifier of the following form is used in Clownfish header files:
-
-    parcel-specifier = "parcel" parcel-name ";"
-    parcel-name = identifier
-
-For example:
-
-    parcel Pathfinder;
-
-All classes following a parcel specifier will be associated with that parcel.
-
-=head3 Initialization
-
-Every Clownfish parcel must be initialized before it is used. The
-initialization function is named C<{parcel_nick}_bootstrap_parcel> and takes
-no arguments.
-
-Example call:
-
-    pfind_bootstrap_parcel();
-
-=head3 Short names
-
-If a macro with the uppercase name C<{PARCEL_NICK}_USE_SHORT_NAMES> is
-defined before including a generated C header, additional macros without the
-parcel prefix will be defined for most symbols.
-
-Example:
-
-    #define PFIND_USE_SHORT_NAMES
-    #include <Pathfinder/Graph.h>
-    #include <Pathfinder/Path.h>
-
-    /* Prefixes can be omitted. */
-    Path *path = Graph_Find_Shortest_Path(graph);
-
-    /* Without PFIND_USE_SHORT_NAMES, one would have to write: */
-    pfind_Path *path = Pfind_Graph_Find_Shortest_Path(graph);
-
-For object types in Clownfish header files, prefixes of class structs can
-also be omitted unless multiple parcels declare classes with the same last
-component of the class name.
-
-=head3 The "Clownfish" parcel
-
-The Clownfish runtime classes live in a parcel named C<Clownfish> with
-nickname C<Cfish>. Consequently, the short name macro is named
-C<CFISH_USE_SHORT_NAMES>.
-
-=head2 Declaring classes
-
-Classes are declared in Clownfish header files using a declaration of the
-following form:
-
-    class-declaration = class-exposure-specifier?
-                        class-modifier*
-                        "class" class-name
-                        ("cnick" class-nickname)?
-                        ("inherits" class-name)?
-                        "{" class-contents "}"
-    class-exposure-specifier = "public"
-    class-modifier = "inert" | "final"
-    class-name = identifier | identifier "::" class-name
-    class-nickname = identifier
-    class-contents = (variable-declaration | function-declaration)*
-
-Class name components must start with an uppercase letter and must not contain
-underscores. The last component must contain at least one lowercase letter and
-must be unique for every class in a parcel.
-
-For every class, a struct with the name C<{parcel_nick}_{Class_Last_Comp}>
-and a corresponding typedef are declared in the generated C header. The struct
-members are only visible if the uppercase macro
-C<C_{PARCEL_NICK}_{CLASS_LAST_COMP}> is defined before including the header
-file.
-
-For every class, a global variable with the uppercase name
-C<{PARCEL_NICK}_{CLASS_LAST_COMP}> is defined. This variable is a pointer to
-a Clownfish::VTable object which is initialized when bootstrapping the parcel.
-
-Example of a class declaration:
-
-    parcel Pathfinder;
-
-    public class Pathfinder::Graph::VisibilityGraph cnick VisGraph
-        extends Clownfish::Obj {
-        /* Variables and functions */
-    }
-
-This will generate:
-
-    struct pfind_VisibilityGraph {
-        /* Instance variables */
-    };
-    typedef struct pfind_VisibilityGraph pfind_VisibilityGraph;
-    extern cfish_VTable *PFIND_VISIBILITYGRAPH;
-
-=head3 Class exposure
-
-Classes without public exposure have parcel exposure. They are not visible
-outside of the parcel and must not contain public variables or functions.
-
-=head3 Inert classes
-
-Inert classes must contain only inert variables or inert methods, that is,
-neither instance variables nor methods. They must not inherit from another
-class or be inherited from. Non-inert classes inherit from Clownfish::Obj by
-default.
-
-=head3 Final classes
-
-For final classes, every method is made final, regardless of the method
-modifier. Final classes must not be inherited from.
-
-=head2 Variables
-
-Variables are declared with a declaration of the following form:
-
-    variable-declaration = variable-exposure-specifier?
-                           variable-modifier*
-                           type variable-name ";"
-    variable-exposure-specifier = "public"
-    variable-modifier = "inert"
-    variable-name = identifier
-
-=head3 Inert variables
-
-Inert variables are class variables of which only a single copy exists.
-They are declared in the generated C header with the name
-C<{parcel_nick}_{Class_Nick}_{Variable_Name}> and must be defined in a C
-source file.
-
-Example:
-
-    public class Pathfinder::Path {
-        public inert int max_path_length;
-    }
-
-This will generate:
-
-    extern int pfind_Path_max_path_length;
-
-The C source file defining the variable will typically use short names. So the
-definition will look like:
-
-    int Path_max_path_length = 5000;
-
-=head3 Inert variable exposure
-
-Inert variables without public exposure have parcel exposure. They are not
-visible outside of the parcel.
-
-=head3 Instance variables
-
-Non-inert variables are instance variables and added to the class struct. They
-must not have an exposure specifier.
-
-Example:
-
-    public class Pathfinder::Path {
-        int num_nodes;
-
-        public int
-        Get_Num_Nodes(Path *self);
-    }
-
-This will add a C<num_nodes> member to struct C<pfind_Path>. To access the
-member, the macro C<C_PFIND_PATH> must be defined before including the
-generated header file:
-
-    #define C_PFIND_PATH
-    #define PFIND_USE_SHORT_NAMES
-    #include "Pathfinder/Path.h"
-
-    int
-    Path_get_num_nodes(Path *self) {
-        return self->num_nodes;
-    }
-
-=head2 Functions
-
-    function-declaration = function-exposure-specifier?
-                           function-modifier*
-                           return-type function-name
-                           "(" param-list? ")" ";"
-    function-exposure-specifier = "public"
-    function-modifier = "inert" | "inline" | "abstract" | "final"
-    return-type = return-type-qualifier* type
-    return-type-qualifier = "incremented" | "nullable"
-    function-name = identifier
-    param-list = param | param "," param-list
-    param = param-qualifier* type param-name ("=" scalar-constant)?
-    param-name = identifier
-    param-qualifier = "decremented"
-
-=head3 Function exposure
-
-Functions without public exposure have parcel exposure. They are not
-visible outside of the parcel.
-
-=head3 Inert functions
-
-Inert functions are dispatched statically. They are declared in the generated
-C header with the name C<{parcel_nick}_{Class_Nick}_{Function_Name}>
-and must be defined in a C source file. They must be neither abstract nor
-final.
-
-Example:
-
-    public class Pathfinder::Graph::VisibilityGraph cnick VisGraph
-        extends Clownfish::Obj {
-
-        public inert incremented VisibilityGraph*
-        new(int node_capacity);
-    }
-
-This will generate:
-
-    pfind_VisibilityGraph*
-    pfind_VisGraph_new(int node_capacity);
-
-The C source file implementing the inert function will typically use short
-names. So the implementation will look like:
-
-    #define PFIND_USE_SHORT_NAMES
-    #include "Pathfinder/Graph/VisibilityGraph.h"
-
-    VisibilityGraph*
-    VisGraph_new(int node_capacity) {
-        /* Implementation */
-    }
-
-=head3 Inline functions
-
-Inert functions can be inline. They should be defined as static inline
-functions in a C block in the Clownfish header file. The macro C<CFISH_INLINE>
-expands to the C compiler's inline keyword and should be used for portability.
-
-=head3 Methods
-
-Non-inert functions are dynamically dispatched methods. Their name must start
-with an uppercase letter and every underscore must be followed by an uppercase
-letter. Methods must not be declared inline.
-
-The first parameter of a method must be a pointer to an object of the method's
-class which receives the object on which the method was invoked. By convention,
-this parameter is named C<self>.
-
-For every method, an inline wrapper for dynamic dispatch is defined in
-the generated C header with the name
-C<{Parcel_Nick}_{Class_Nick}_{Method_Name}>. Additionally, an
-implementing function is declared with the name
-C<{Parcel_Nick}_{Class_Nick}_{Method_Name}_IMP>. The Clownfish compiler also
-generates a typedef for the method's function pointer type named
-C<{Parcel_Nick}_{Class_Nick}_{Method_Name}_t>. Wrappers and typedefs are
-created for all subclasses whether they override a method or not.
-
-Example:
-
-    public class Pathfinder::Graph::VisibilityGraph cnick VisGraph
-        extends Clownfish::Obj {
-
-        public void
-        Add_Node(VisibilityGraph *self, decremented Node *node);
-    }
-
-This will generate:
-
-    /* Wrapper for dynamic dispatch */
-    static inline void
-    Pfind_VisGraph_Add_Node(pfind_VisibilityGraph *self, pfind_Node *node) {
-        /* Inline code for wrapper */
-    }
-
-    /* Declaration of implementing function */
-    void
-    Pfind_VisGraph_Add_Node_IMP(pfind_VisibilityGraph *self,
-                                pfind_Node *node);
-
-    /* Declaration of function pointer type */
-    typedef void
-    (*Pfind_VisGraph_Add_Node_t)(pfind_VisibilityGraph *self,
-                                 pfind_Node *node);
-
-The implementing function of non-abstract methods must be defined in a C source
-file. This file will typically define the short names macro. So the
-implementation will look like:
-
-    #define PFIND_USE_SHORT_NAMES
-    #include "Pathfinder/Graph/VisibilityGraph.h"
-
-    void
-    VisGraph_Add_Node_IMP(VisibilityGraph *self, Node *node) {
-        /* Implementation */
-    }
-
-=head3 Looking up function pointers
-
-Clownfish defines a macro named C<CFISH_METHOD_PTR> that looks up the pointer
-to the implementing function of a method. The first parameter of the macro is
-a pointer to the Clownfish::VTable object of the method's class, the second is
-the unshortened name of the method wrapper. If short names for the Clownfish
-parcel are used, the macro is also available under the name C<METHOD_PTR>.
-
-To lookup methods from a superclass, there's a macro C<CFISH_SUPER_METHOD_PTR>
-with the same parameters.
-
-Example using short names:
-
-    VisGraph_Add_Node_t add_node
-        = METHOD_PTR(PFIND_VISIBILITYGRAPH, Pfind_VisGraph_Add_Node);
-
-    VisGraph_Add_Node_t super_add_node
-        = SUPER_METHOD_PTR(PFIND_VISIBILITYGRAPH, Pfind_VisGraph_Add_Node);
-
-=head3 Abstract methods
-
-For abstract methods, the Clownfish compiler generates an implementing function
-which throws an error. They should be overridden in a subclass.
-
-=head3 Final methods
-
-Final methods must not be overridden. They must not be abstract.
-
-=head3 Nullable return type
-
-If a function has a nullable return type, it must return a pointer.
-Non-nullable functions must never return the NULL pointer.
-
-=head3 Incremented return type
-
-Incremented return types must be pointers to Clownfish objects. The function
-will either return a new object with an initial reference count of 1 or
-increment the reference count. The caller must decrement the reference count of
-the returned object when it's no longer used.
-
-For returned objects with non-incremented return type, usually no additional
-handling of reference counts is required. Only if an object is returned from an
-accessor or a collection object and the caller wants to use the object longer
-than the returning object retains a reference, it must increment the reference
-count itself and decrement when the object is no longer used.
-
-=head3 Decremented parameters
-
-Decremented parameters must be pointers to Clownfish objects. The function
-will either decrement the reference count of the passed-in object or retain a
-reference without incrementing the reference count. If the caller wants to use
-the passed-in object afterwards, it usually must increment its reference count
-before the call and decrement it when it's no longer used. If the caller does
-not make further use of the passed-in object, it must not decrement its
-reference count after the call.
-
-=head3 Default parameter values
-
-Default parameter values can be given as integer, float, or string literals.
-The values C<true>, C<false>, and C<NULL> are also supported. The default
-values are only used by the host language bindings. They're not supported
-when calling a function from C.
-
-=head2 C blocks
-
-Clownfish headers can contain C blocks which start with a line containing the
-string C<__C__> and end on a line containing the string C<__END_C__>. The
-contents of a C block are copied verbatim to the generated C header.
-
-Example:
-
-    __C__
-
-    struct pfind_AuxiliaryStruct {
-        int a;
-        int b;
-    };
-
-    __END_C__
-
-=head2 Object life cycle
-
-=head3 Object creation
-
-Objects are allocated by invoking the C<Make_Obj> method on a class's
-Clownfish::VTable object.
-
-Any inert function can be used to construct objects from C. But to support
-inheritance and object creation from the host language, Clownfish classes
-need a separate function to initialize objects. The initializer must take a
-pointer to an object as first argument and return a pointer to the same
-object. If the parent class has an initializer, it should be called first by
-the subclass's initializer.
-
-By convention, the standard constructor is named C<new>. If a class has an
-inert function named C<init>, it is used as initializer to create a host
-language constructor by default.
-
-Example:
-
-    /* Clownfish header */
-
-    class Vehicle {
-        double max_speed;
-
-        inert Vehicle*
-        init(Vehicle *self, double max_speed);
-    }
-
-    class Train inherits Vehicle {
-        double track_gauge;
-
-        inert incremented Train*
-        new(double max_speed, double track_gauge);
-
-        inert Train*
-        init(Train *self, double max_speed, double track_gauge);
-    }
-
-    /* Implementation */
-
-    Train*
-    Train_new(double max_speed, double track_gauge) {
-        Train *self = (Train*)VTable_Make_Obj(TRAIN);
-        return Train_init(self, max_speed, track_gauge);
-    }
-
-    Train*
-    Train_init(Train *self, double max_speed, double track_gauge) {
-        Vehicle_init((Vehicle*)self, max_speed);
-        self->track_gauge = track_gauge;
-        return self;
-    }
-
-=head3 Reference counting
-
-Clownfish uses reference counting for memory management. Objects are created
-with a reference count of 1. There are two macros C<CFISH_INCREF> and
-C<CFISH_DECREF> to increment and decrement reference counts. If short names
-for the Clownfish parcel are enabled, the macros can be abbreviated to
-C<INCREF> and C<DECREF>. Both macros take a pointer to an object as argument.
-NULL pointers are allowed. C<CFISH_INCREF> returns a pointer to the object.
-This value might differ from the passed-in pointer in some cases. So if a
-reference is retained, the pointer returned from C<CFISH_INCREF> should be
-used. C<CFISH_DECREF> returns the modified reference count.
-
-Examples:
-
-    self->value = INCREF(arg);
-
-    DECREF(object);
-
-=head3 Object destruction
-
-If an object's reference count reaches 0, its C<Destroy> method is called.
-This public method takes no arguments besides C<self> and has no return value.
-It should release the resources held by the object and finally call the
-C<Destroy> method of the superclass via the C<CFISH_SUPER_DESTROY> macro with
-short name C<SUPER_DESTROY>. This macro takes the C<self> pointer as first
-argument and a pointer to the object's Clownfish::VTable as second argument.
-The C<Destroy> method of the Clownfish::Obj class will eventually free the
-object struct.
-
-Example:
-
-    /* Clownfish header */
-
-    class Path {
-        VArray *nodes;
-
-        public void
-        Destroy(Path *self);
-    }
-
-    /* Implementation */
-
-    void
-    Path_Destroy_IMP(Path *self) {
-        DECREF(self->nodes);
-        SUPER_DESTROY(self, PATH);
-    }
-
-=head1 COPYRIGHT
-
-Clownfish is distributed under the Apache License, Version 2.0, as described
-in the file C<LICENSE> included with the distribution.
-
-=cut
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/ByteBuf.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/ByteBuf.pm b/clownfish/runtime/perl/lib/Clownfish/ByteBuf.pm
deleted file mode 100644
index cab5b7d..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/ByteBuf.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::ByteBuf;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/CharBuf.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/CharBuf.pm b/clownfish/runtime/perl/lib/Clownfish/CharBuf.pm
deleted file mode 100644
index a6458c8..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/CharBuf.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::String;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/Err.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/Err.pm b/clownfish/runtime/perl/lib/Clownfish/Err.pm
deleted file mode 100644
index 61a8a5a..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/Err.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::Err;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/Hash.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/Hash.pm b/clownfish/runtime/perl/lib/Clownfish/Hash.pm
deleted file mode 100644
index b542f59..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/Hash.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::Hash;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/LockFreeRegistry.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/LockFreeRegistry.pm b/clownfish/runtime/perl/lib/Clownfish/LockFreeRegistry.pm
deleted file mode 100644
index e13e53c..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/LockFreeRegistry.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::LockFreeRegistry;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/Num.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/Num.pm b/clownfish/runtime/perl/lib/Clownfish/Num.pm
deleted file mode 100644
index 72bafaa..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/Num.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::Num;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/Obj.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/Obj.pm b/clownfish/runtime/perl/lib/Clownfish/Obj.pm
deleted file mode 100644
index 3036630..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/Obj.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::Obj;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/Test.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/Test.pm b/clownfish/runtime/perl/lib/Clownfish/Test.pm
deleted file mode 100644
index aad0681..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/Test.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::Test;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/Util/StringHelper.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/Util/StringHelper.pm b/clownfish/runtime/perl/lib/Clownfish/Util/StringHelper.pm
deleted file mode 100644
index 47d9120..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/Util/StringHelper.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::Util::StringHelper;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/VArray.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/VArray.pm b/clownfish/runtime/perl/lib/Clownfish/VArray.pm
deleted file mode 100644
index 949a904..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/VArray.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::VArray;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/lib/Clownfish/VTable.pm
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/lib/Clownfish/VTable.pm b/clownfish/runtime/perl/lib/Clownfish/VTable.pm
deleted file mode 100644
index b5f5eb5..0000000
--- a/clownfish/runtime/perl/lib/Clownfish/VTable.pm
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-package Clownfish::VTable;
-use Clownfish;
-our $VERSION = '0.003000';
-$VERSION = eval $VERSION;
-
-1;
-
-__END__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/002-clownfish.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/002-clownfish.t b/clownfish/runtime/perl/t/002-clownfish.t
deleted file mode 100644
index d3e36b7..0000000
--- a/clownfish/runtime/perl/t/002-clownfish.t
+++ /dev/null
@@ -1,52 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More;
-use File::Find 'find';
-
-my @modules;
-
-# None for now -- until we remove a module.
-my %excluded = map { ( $_ => 1 ) } qw();
-
-find(
-    {   no_chdir => 1,
-        wanted   => sub {
-            return unless $File::Find::name =~ /\.pm$/;
-            push @modules, $File::Find::name;
-            }
-    },
-    'lib'
-);
-
-plan( tests => scalar @modules );
-
-for (@modules) {
-    s/^.*?Clownfish/Clownfish/;
-    s/\.pm$//;
-    s/\W+/::/g;
-    if ( $excluded{$_} ) {
-        eval qq|use $_;|;
-        like( $@, qr/removed|replaced|renamed/i,
-            "Removed module '$_' throws error on load" );
-    }
-    else {
-        use_ok($_);
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/018-host.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/018-host.t b/clownfish/runtime/perl/t/018-host.t
deleted file mode 100644
index 5a79eff..0000000
--- a/clownfish/runtime/perl/t/018-host.t
+++ /dev/null
@@ -1,42 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 3;
-use Clownfish qw( to_perl to_clownfish );
-
-my %complex_data_structure = (
-    a => [ 1, 2, 3, { ooga => 'booga' } ],
-    b => { foo => 'foofoo', bar => 'barbar' },
-);
-my $kobj = to_clownfish( \%complex_data_structure );
-isa_ok( $kobj, 'Clownfish::Obj' );
-my $transformed = to_perl($kobj);
-is_deeply( $transformed, \%complex_data_structure,
-    "transform from Perl to Clownfish data structures and back" );
-
-my $bread_and_butter = Clownfish::Hash->new;
-$bread_and_butter->store( 'bread', Clownfish::ByteBuf->new('butter') );
-my $salt_and_pepper = Clownfish::Hash->new;
-$salt_and_pepper->store( 'salt', Clownfish::ByteBuf->new('pepper') );
-$complex_data_structure{c} = $bread_and_butter;
-$complex_data_structure{d} = $salt_and_pepper;
-$transformed = to_perl( to_clownfish( \%complex_data_structure ) );
-$complex_data_structure{c} = { bread => 'butter' };
-$complex_data_structure{d} = { salt  => 'pepper' };
-is_deeply( $transformed, \%complex_data_structure,
-    "handle mixed data structure correctly" );

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/021-vtable.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/021-vtable.t b/clownfish/runtime/perl/t/021-vtable.t
deleted file mode 100644
index d2e0c14..0000000
--- a/clownfish/runtime/perl/t/021-vtable.t
+++ /dev/null
@@ -1,57 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-package MyHash;
-use base qw( Clownfish::Hash );
-
-sub oodle { }
-
-package main;
-
-use Test::More tests => 5;
-
-my $stringified;
-my $storage = Clownfish::Hash->new;
-
-{
-    my $subclassed_hash = MyHash->new;
-    $stringified = $subclassed_hash->to_string;
-
-    isa_ok( $subclassed_hash, "MyHash", "Perl isa reports correct subclass" );
-
-   # Store the subclassed object.  At the end of this block, the Perl object
-   # will go out of scope and DESTROY will be called, but the Clownfish object
-   # will persist.
-    $storage->store( "test", $subclassed_hash );
-}
-
-my $resurrected = $storage->_fetch("test");
-
-isa_ok( $resurrected, "MyHash", "subclass name survived Perl destruction" );
-is( $resurrected->to_string, $stringified,
-    "It's the same Hash from earlier (though a different Perl object)" );
-
-my $booga = Clownfish::String->new("booga");
-$resurrected->store( "ooga", $booga );
-
-is( $resurrected->fetch("ooga"),
-    "booga", "subclassed object still performs correctly at the C level" );
-
-my $methods = Clownfish::VTable::_fresh_host_methods('MyHash');
-is_deeply( $methods->to_perl, ['oodle'], "fresh_host_methods" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/binding/016-varray.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/binding/016-varray.t b/clownfish/runtime/perl/t/binding/016-varray.t
deleted file mode 100644
index 4397cf5..0000000
--- a/clownfish/runtime/perl/t/binding/016-varray.t
+++ /dev/null
@@ -1,29 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 1;
-use Clownfish;
-
-my ( $varray, $twin );
-
-$varray = Clownfish::VArray->new;
-$varray->push( Clownfish::String->new($_) ) for 1 .. 5;
-$varray->delete(3);
-$twin = $varray->_clone;
-is_deeply( $twin->to_perl, $varray->to_perl, "clone" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/binding/017-hash.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/binding/017-hash.t b/clownfish/runtime/perl/t/binding/017-hash.t
deleted file mode 100644
index 1843198..0000000
--- a/clownfish/runtime/perl/t/binding/017-hash.t
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 2;
-use Clownfish qw( to_perl to_clownfish );
-
-my $hash = Clownfish::Hash->new( capacity => 10 );
-$hash->store( "foo", Clownfish::String->new("bar") );
-$hash->store( "baz", Clownfish::String->new("banana") );
-
-ok( !defined( $hash->fetch("blah") ),
-    "fetch for a non-existent key returns undef" );
-
-my %hash_with_utf8_keys = ( "\x{263a}" => "foo" );
-my $round_tripped = to_perl( to_clownfish( \%hash_with_utf8_keys ) );
-is_deeply( $round_tripped, \%hash_with_utf8_keys,
-    "Round trip conversion of hash with UTF-8 keys" );

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/binding/019-obj.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/binding/019-obj.t b/clownfish/runtime/perl/t/binding/019-obj.t
deleted file mode 100644
index 5560f48..0000000
--- a/clownfish/runtime/perl/t/binding/019-obj.t
+++ /dev/null
@@ -1,96 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Test::More tests => 15;
-
-package TestObj;
-use base qw( Clownfish::Obj );
-
-our $version = $Clownfish::VERSION;
-
-package SonOfTestObj;
-use base qw( TestObj );
-{
-    sub to_string {
-        my $self = shift;
-        return "STRING: " . $self->SUPER::to_string;
-    }
-}
-
-package BadRefCount;
-use base qw( Clownfish::Obj );
-{
-    sub inc_refcount {
-        my $self = shift;
-        $self->SUPER::inc_refcount;
-        return;
-    }
-}
-
-package main;
-
-ok( defined $TestObj::version,
-    "Using base class should grant access to "
-        . "package globals in the Clownfish:: namespace"
-);
-
-my $object = TestObj->new;
-isa_ok( $object, "Clownfish::Obj",
-    "Clownfish objects can be subclassed" );
-
-ok( $object->is_a("Clownfish::Obj"),     "custom is_a correct" );
-ok( !$object->is_a("Clownfish::Object"), "custom is_a too long" );
-ok( !$object->is_a("Clownfish"),         "custom is_a substring" );
-ok( !$object->is_a(""),                  "custom is_a blank" );
-ok( !$object->is_a("thing"),             "custom is_a wrong" );
-
-eval { my $another_obj = TestObj->new( kill_me_now => 1 ) };
-like( $@, qr/kill_me_now/, "reject bad param" );
-
-my $stringified_perl_obj = "$object";
-require Clownfish::Hash;
-my $hash = Clownfish::Hash->new;
-$hash->store( foo => $object );
-is( $object->get_refcount, 2, "refcount increased via C code" );
-is( $object->get_refcount, 2, "refcount increased via C code" );
-undef $object;
-$object = $hash->fetch("foo");
-is( "$object", $stringified_perl_obj, "same perl object as before" );
-
-is( $object->get_refcount, 2, "correct refcount after retrieval" );
-undef $hash;
-is( $object->get_refcount, 1, "correct refcount after destruction of ref" );
-
-$object = SonOfTestObj->new;
-like( $object->to_string, qr/STRING:.*?SonOfTestObj/,
-    "overridden XS bindings can be called via SUPER" );
-
-SKIP: {
-    skip( "Exception thrown within callback leaks", 1 )
-        if $ENV{LUCY_VALGRIND};
-
-    # The Perl binding for VArray#store calls inc_refcount() from C space.
-    # This test verifies that the Perl bindings generated by CFC handle
-    # non-`nullable` return values correctly, by ensuring that the Perl
-    # callback wrapper for inc_refcount() checks the return value and throws
-    # an exception if a Perl-space implementation returns undef.
-    my $array = Clownfish::VArray->new;
-    eval { $array->store( 1, BadRefCount->new ); };
-    like( $@, qr/NULL/,
-        "Don't allow methods without nullable return values to return NULL" );
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/binding/029-charbuf.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/binding/029-charbuf.t b/clownfish/runtime/perl/t/binding/029-charbuf.t
deleted file mode 100644
index bc802e5..0000000
--- a/clownfish/runtime/perl/t/binding/029-charbuf.t
+++ /dev/null
@@ -1,43 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-use lib 'buildlib';
-
-use Test::More tests => 3;
-use Encode qw( _utf8_off );
-use Clownfish;
-
-# Return 3 strings useful for verifying UTF-8 integrity.
-sub utf8_test_strings {
-    my $smiley       = "\x{263a}";
-    my $not_a_smiley = $smiley;
-    _utf8_off($not_a_smiley);
-    my $frowny = $not_a_smiley;
-    utf8::upgrade($frowny);
-    return ( $smiley, $not_a_smiley, $frowny );
-}
-
-my ( $smiley, $not_a_smiley, $frowny ) = utf8_test_strings();
-
-my $string = Clownfish::String->new($smiley);
-isa_ok( $string, "Clownfish::String" );
-is( $string->to_perl, $smiley, "round trip UTF-8" );
-
-$string = Clownfish::String->new($smiley);
-my $clone = $string->clone;
-is( $clone->to_perl, Clownfish::String->new($smiley)->to_perl, "clone" );
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/binding/034-err.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/binding/034-err.t b/clownfish/runtime/perl/t/binding/034-err.t
deleted file mode 100644
index ae91063..0000000
--- a/clownfish/runtime/perl/t/binding/034-err.t
+++ /dev/null
@@ -1,70 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-use Clownfish;
-
-package Nirvana;
-
-sub enter {
-    die Clownfish::Err->new("blam");
-}
-
-package GloriousDeath;
-use base qw( Clownfish::Err );
-
-package main;
-use Test::More tests => 10;
-
-isa_ok( Clownfish::Err->new("Bad stuff happened"),
-    'Clownfish::Err', "new" );
-
-my $glorious = GloriousDeath->new("Banzai");
-isa_ok( $glorious, 'GloriousDeath',     "subclass" );
-isa_ok( $glorious, 'Clownfish::Err', "subclass" );
-
-isa_ok( Clownfish::Err::trap( "bite_the_dust", undef ),
-    'Clownfish::Err', "trap string call" );
-
-isa_ok( Clownfish::Err::trap( "Nirvana::enter", undef ),
-    'Clownfish::Err', "trap string call in another package" );
-
-isa_ok( Clownfish::Err::trap( \&bite_the_dust, undef ),
-    'Clownfish::Err', "trap sub ref" );
-
-isa_ok( Clownfish::Err::trap( \&Nirvana::enter, undef ),
-    'Clownfish::Err', "trap sub ref to another package" );
-
-isa_ok( Clownfish::Err::trap( \&judge_gladiator, "down" ),
-    'Clownfish::Err', "pass argument to 'trap'" );
-
-my $last_words = sub { die "Rosebud" };
-isa_ok( Clownfish::Err::trap( $last_words, undef ),
-    'Clownfish::Err', "Wrap host exception in Err" );
-
-my $succeed = sub { };
-ok( !defined( Clownfish::Err::trap( $succeed, undef ) ),
-    "nothing to trap" );
-
-sub bite_the_dust { die Clownfish::Err->new("gasp") }
-
-sub judge_gladiator {
-    my $thumb = shift;
-    if ( $thumb and $thumb eq 'down' ) {
-        die GloriousDeath->new("gurgle");
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/perl/t/binding/038-lock_free_registry.t
----------------------------------------------------------------------
diff --git a/clownfish/runtime/perl/t/binding/038-lock_free_registry.t b/clownfish/runtime/perl/t/binding/038-lock_free_registry.t
deleted file mode 100644
index 0c9f60a..0000000
--- a/clownfish/runtime/perl/t/binding/038-lock_free_registry.t
+++ /dev/null
@@ -1,75 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Config;
-use Test::More;
-BEGIN {
-    if ( $ENV{LUCY_VALGRIND} ) {
-        plan( skip_all => 'Known leaks' );
-    }
-    elsif ( !defined( $ENV{LUCY_DEBUG} ) ) {
-        plan( skip_all => 'Debug-only test' );
-    }
-    elsif ( $Config{usethreads} and $^O !~ /mswin/i ) {
-        plan( tests => 1 );
-    }
-    else {
-        plan( skip_all => 'No thread support' );
-    }
-}
-use threads;
-use threads::shared;
-use Time::HiRes qw( time usleep );
-use List::Util qw( shuffle );
-use Clownfish;
-
-my $registry = Clownfish::LockFreeRegistry->new( capacity => 32 );
-
-sub register_many {
-    my ( $nums, $delay ) = @_;
-
-    # Encourage contention, so that all threads try to register at the same
-    # time.
-    sleep $delay;
-    threads->yield();
-
-    my $succeeded = 0;
-    for my $number (@$nums) {
-        my $obj = Clownfish::String->new($number);
-        $succeeded += $registry->register( key => $obj, value => $obj );
-    }
-
-    return $succeeded;
-}
-
-my @threads;
-
-my $target_time = time() + .5;
-my @num_sets = map { [ shuffle( 1 .. 10000 ) ] } 1 .. 5;
-for my $num ( 1 .. 5 ) {
-    my $delay = $target_time - time();
-    my $thread = threads->create( \&register_many, pop @num_sets, $delay );
-    push @threads, $thread;
-}
-
-my $total_succeeded = 0;
-$total_succeeded += $_->join for @threads;
-
-is( $total_succeeded, 10000,
-    "registered exactly the right number of entries across all threads" );
-


[lucy-commits] [48/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Handle refcounting when clearing SortEx buffer.

Posted by ma...@apache.org.
Handle refcounting when clearing SortEx buffer.

Now that SortExternal only handles objects rather than addresses, it
makes sense to decref objects when emptying out the buffer.

This change is safe for all subclasses and incurs no performance penalty
under normal conditions -- unless something goes wrong all buffered
items will have already been consumed by the time the buffer-clearing
operation is invoked.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/88271ce1
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/88271ce1
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/88271ce1

Branch: refs/heads/sortex_ptr_only
Commit: 88271ce1059c6191bc6b946deb51c1aba48ca474
Parents: c09c1dc
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jan 8 17:22:23 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 14:10:55 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Util/BBSortEx.c     | 4 ----
 core/Lucy/Util/SortExternal.c | 5 +++++
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/88271ce1/core/Lucy/Util/BBSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.c b/core/Lucy/Util/BBSortEx.c
index 40238cf..c5c4c13 100644
--- a/core/Lucy/Util/BBSortEx.c
+++ b/core/Lucy/Util/BBSortEx.c
@@ -52,10 +52,6 @@ BBSortEx_Destroy_IMP(BBSortEx *self) {
 void
 BBSortEx_Clear_Cache_IMP(BBSortEx *self) {
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
-    Obj **const cache = ivars->cache;
-    for (uint32_t i = ivars->cache_tick, max = ivars->cache_max; i < max; i++) {
-        DECREF(cache[i]);
-    }
     ivars->mem_consumed = 0;
     BBSortEx_Clear_Cache_t super_clear_cache
         = SUPER_METHOD_PTR(BBSORTEX, LUCY_BBSortEx_Clear_Cache);

http://git-wip-us.apache.org/repos/asf/lucy/blob/88271ce1/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index 434c34d..c4d936e 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -78,6 +78,11 @@ SortEx_Destroy_IMP(SortExternal *self) {
 void
 SortEx_Clear_Cache_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
+    Obj **const cache = ivars->cache;
+    const uint32_t max = ivars->cache_max;
+    for (uint32_t i = ivars->cache_tick; i < max; i++) {
+        DECREF(cache[i]);
+    }
     ivars->cache_max    = 0;
     ivars->cache_tick   = 0;
 }


[lucy-commits] [43/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Modify SortEx_Feed() argument type.

Posted by ma...@apache.org.
Modify SortEx_Feed() argument type.

Have Feed() take an Obj* rather than void*.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/d4771158
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/d4771158
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/d4771158

Branch: refs/heads/sortex_ptr_only
Commit: d477115848375c74b9266f49144bfc2a817895e0
Parents: bb2a97d
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Fri Jan 4 15:17:17 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 11:36:01 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/Posting/MatchPosting.c   | 2 +-
 core/Lucy/Index/Posting/RichPosting.c    | 2 +-
 core/Lucy/Index/Posting/ScorePosting.c   | 2 +-
 core/Lucy/Index/SortFieldWriter.c        | 2 +-
 core/Lucy/Util/BBSortEx.c                | 6 +++---
 core/Lucy/Util/BBSortEx.cfh              | 2 +-
 core/Lucy/Util/SortExternal.c            | 6 +++---
 core/Lucy/Util/SortExternal.cfh          | 7 ++-----
 perl/buildlib/Lucy/Build/Binding/Util.pm | 9 ---------
 9 files changed, 13 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/core/Lucy/Index/Posting/MatchPosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/MatchPosting.c b/core/Lucy/Index/Posting/MatchPosting.c
index 55c9734..800d684 100644
--- a/core/Lucy/Index/Posting/MatchPosting.c
+++ b/core/Lucy/Index/Posting/MatchPosting.c
@@ -138,7 +138,7 @@ MatchPost_Add_Inversion_To_Pool_IMP(MatchPosting *self,
         RawPosting *raw_posting
             = RawPost_new(MemPool_Grab(mem_pool, raw_post_bytes), doc_id,
                           freq, token_ivars->text, token_ivars->len);
-        PostPool_Feed(post_pool, &raw_posting);
+        PostPool_Feed(post_pool, (Obj*)raw_posting);
     }
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/core/Lucy/Index/Posting/RichPosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/RichPosting.c b/core/Lucy/Index/Posting/RichPosting.c
index f5af4ce..8bcc423 100644
--- a/core/Lucy/Index/Posting/RichPosting.c
+++ b/core/Lucy/Index/Posting/RichPosting.c
@@ -147,7 +147,7 @@ RichPost_Add_Inversion_To_Pool_IMP(RichPosting *self, PostingPool *post_pool,
         raw_post_ivars->aux_len = dest - start;
         raw_post_bytes = dest - (char*)raw_posting;
         MemPool_Resize(mem_pool, raw_posting, raw_post_bytes);
-        PostPool_Feed(post_pool, &raw_posting);
+        PostPool_Feed(post_pool, (Obj*)raw_posting);
     }
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/core/Lucy/Index/Posting/ScorePosting.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Posting/ScorePosting.c b/core/Lucy/Index/Posting/ScorePosting.c
index b2d3265..f5aa961 100644
--- a/core/Lucy/Index/Posting/ScorePosting.c
+++ b/core/Lucy/Index/Posting/ScorePosting.c
@@ -117,7 +117,7 @@ ScorePost_Add_Inversion_To_Pool_IMP(ScorePosting *self,
         raw_post_ivars->aux_len = dest - start;
         raw_post_bytes = dest - (char*)raw_posting;
         MemPool_Resize(mem_pool, raw_posting, raw_post_bytes);
-        PostPool_Feed(post_pool, &raw_posting);
+        PostPool_Feed(post_pool, (Obj*)raw_posting);
     }
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index 7c0e770..34aa84d 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -199,7 +199,7 @@ SortFieldWriter_Add_IMP(SortFieldWriter *self, int32_t doc_id, Obj *value) {
     // Uniq-ify the value, and record it for this document.
     Obj *copy = S_find_unique_value(ivars->uniq_vals, value);
     SFWriterElem *elem = S_SFWriterElem_create(ivars->mem_pool, copy, doc_id);
-    SortFieldWriter_Feed(self, &elem);
+    SortFieldWriter_Feed(self, (Obj*)elem);
     ivars->count++;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/core/Lucy/Util/BBSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.c b/core/Lucy/Util/BBSortEx.c
index a0a0c7e..fb50522 100644
--- a/core/Lucy/Util/BBSortEx.c
+++ b/core/Lucy/Util/BBSortEx.c
@@ -63,14 +63,14 @@ BBSortEx_Clear_Cache_IMP(BBSortEx *self) {
 }
 
 void
-BBSortEx_Feed_IMP(BBSortEx *self, void *data) {
+BBSortEx_Feed_IMP(BBSortEx *self, Obj *item) {
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
     BBSortEx_Feed_t super_feed
         = SUPER_METHOD_PTR(BBSORTEX, LUCY_BBSortEx_Feed);
-    super_feed(self, data);
+    super_feed(self, item);
 
     // Flush() if necessary.
-    ByteBuf *bytebuf = (ByteBuf*)CERTIFY(*(ByteBuf**)data, BYTEBUF);
+    ByteBuf *bytebuf = (ByteBuf*)CERTIFY(item, BYTEBUF);
     ivars->mem_consumed += BB_Get_Size(bytebuf);
     if (ivars->mem_consumed >= ivars->mem_thresh) {
         BBSortEx_Flush(self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/core/Lucy/Util/BBSortEx.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.cfh b/core/Lucy/Util/BBSortEx.cfh
index 41f72ea..3ba7531 100644
--- a/core/Lucy/Util/BBSortEx.cfh
+++ b/core/Lucy/Util/BBSortEx.cfh
@@ -34,7 +34,7 @@ class Lucy::Util::BBSortEx
         VArray *external = NULL);
 
     void
-    Feed(BBSortEx *self, void *data);
+    Feed(BBSortEx *self, decremented Obj *item);
 
     void
     Flush(BBSortEx *self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index b948131..98158b9 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -83,14 +83,14 @@ SortEx_Clear_Cache_IMP(SortExternal *self) {
 }
 
 void
-SortEx_Feed_IMP(SortExternal *self, void *data) {
+SortEx_Feed_IMP(SortExternal *self, Obj *item) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     if (ivars->cache_max == ivars->cache_cap) {
         size_t amount = Memory_oversize(ivars->cache_max + 1, sizeof(Obj*));
         SortEx_Grow_Cache(self, amount);
     }
-    uint8_t *target = ivars->cache + ivars->cache_max * sizeof(Obj*);
-    memcpy(target, data, sizeof(Obj*));
+    Obj **elems = (Obj**)ivars->cache;
+    elems[ivars->cache_max] = item;
     ivars->cache_max++;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index 8362c4f..a6a7313 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -79,13 +79,10 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     abstract void
     Flush(SortExternal *self);
 
-    /** Add data to the sort pool.
-     *
-     * @param data Pointer to the data being added, which must be exactly
-     * <code>width</code> bytes in size.
+    /** Add an item to the sort pool.
      */
     void
-    Feed(SortExternal *self, void *data);
+    Feed(SortExternal *self, decremented Obj *item);
 
     /** Flip the sortex from write mode to read mode.
      */

http://git-wip-us.apache.org/repos/asf/lucy/blob/d4771158/perl/buildlib/Lucy/Build/Binding/Util.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build/Binding/Util.pm b/perl/buildlib/Lucy/Build/Binding/Util.pm
index 1561b48..a0de3ed 100644
--- a/perl/buildlib/Lucy/Build/Binding/Util.pm
+++ b/perl/buildlib/Lucy/Build/Binding/Util.pm
@@ -32,7 +32,6 @@ sub bind_bbsortex {
     my @hand_rolled = qw(
         Fetch
         Peek
-        Feed
     );
     my $xs_code = <<'END_XS_CODE';
 MODULE = Lucy    PACKAGE = Lucy::Util::BBSortEx
@@ -68,14 +67,6 @@ CODE:
 }
 OUTPUT: RETVAL
 
-void
-feed(self, bb)
-    lucy_BBSortEx *self;
-    cfish_ByteBuf *bb;
-CODE:
-    CFISH_INCREF(bb);
-    LUCY_BBSortEx_Feed(self, &bb);
-
 END_XS_CODE
 
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(


[lucy-commits] [29/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Use default Clownfish include directories

Posted by ma...@apache.org.
Use default Clownfish include directories


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/9b9b8c27
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/9b9b8c27
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/9b9b8c27

Branch: refs/heads/sortex_ptr_only
Commit: 9b9b8c27f8b30bee153b5b9e85e716cb648ae812
Parents: 7329c7e
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Apr 15 21:44:45 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Apr 15 21:44:45 2014 +0200

----------------------------------------------------------------------
 perl/Build.PL | 5 -----
 1 file changed, 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/9b9b8c27/perl/Build.PL
----------------------------------------------------------------------
diff --git a/perl/Build.PL b/perl/Build.PL
index 756af6f..ccad29e 100644
--- a/perl/Build.PL
+++ b/perl/Build.PL
@@ -21,7 +21,6 @@ use File::Spec::Functions qw( catdir );
 use Lucy::Build;
 
 my @BASE_PATH        = Lucy::Build->cf_base_path;
-my @CF_SYS_INCLUDES  = Lucy::Build->cf_system_include_dirs;
 my $MODULES_DIR      = catdir( @BASE_PATH, 'modules' );
 my $SNOWSTEM_SRC_DIR = catdir( $MODULES_DIR, qw( analysis snowstem source ) );
 my $SNOWSTEM_INC_DIR = catdir( $SNOWSTEM_SRC_DIR, 'include' );
@@ -65,7 +64,6 @@ my $builder = Lucy::Build->new(
         $SNOWSTEM_INC_DIR,
         $UCD_INC_DIR,
         $UTF8PROC_SRC_DIR,
-        @CF_SYS_INCLUDES,
     ],
     clownfish_params => {
         source => [
@@ -75,9 +73,6 @@ my $builder = Lucy::Build->new(
             $SNOWSTOP_SRC_DIR,
             $UTF8PROC_SRC_DIR,
         ],
-        include => [
-            @CF_SYS_INCLUDES,
-        ],
     },
     extra_compiler_flags => '-DCFP_LUCY -DCFP_TESTLUCY',
     add_to_cleanup => [


[lucy-commits] [51/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Rename some vars in SortExternal.

Posted by ma...@apache.org.
Rename some vars in SortExternal.

Use "buffer" instead of "cache", plus "buf_max" instead "cache_max",
etc.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/4cff84bc
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/4cff84bc
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/4cff84bc

Branch: refs/heads/sortex_ptr_only
Commit: 4cff84bc0451fe784c074bc6866e6d8229be2903
Parents: 79f4ca5
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Jan 9 13:14:00 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 16:00:52 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/PostingPool.c     |  42 +++++------
 core/Lucy/Index/SortFieldWriter.c |  24 +++---
 core/Lucy/Util/BBSortEx.c         |  30 ++++----
 core/Lucy/Util/SortExternal.c     | 130 ++++++++++++++++-----------------
 core/Lucy/Util/SortExternal.cfh   |  10 +--
 5 files changed, 118 insertions(+), 118 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/4cff84bc/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index cc56c34..9c538ed 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -191,7 +191,7 @@ PostPool_Flip_IMP(PostingPool *self) {
     }
 
     PostPool_Sort_Cache(self);
-    if (num_runs && (ivars->cache_max - ivars->cache_tick) > 0) {
+    if (num_runs && (ivars->buf_max - ivars->buf_tick) > 0) {
         uint32_t num_items = PostPool_Cache_Count(self);
         // Cheap imitation of flush. FIXME.
         PostingPool *run
@@ -202,12 +202,12 @@ PostPool_Flip_IMP(PostingPool *self) {
         PostPool_Grow_Cache(run, num_items);
         PostingPoolIVARS *const run_ivars = PostPool_IVARS(run);
 
-        memcpy(run_ivars->cache, (ivars->cache) + ivars->cache_tick,
+        memcpy(run_ivars->buffer, (ivars->buffer) + ivars->buf_tick,
                num_items * sizeof(Obj*));
-        run_ivars->cache_max = num_items;
+        run_ivars->buf_max = num_items;
         PostPool_Add_Run(self, (SortExternal*)run);
-        ivars->cache_tick = 0;
-        ivars->cache_max = 0;
+        ivars->buf_tick = 0;
+        ivars->buf_max = 0;
     }
 
     // Assign.
@@ -278,10 +278,10 @@ PostPool_Flush_IMP(PostingPool *self) {
                                             ivars->post_temp_out);
 
     // Borrow the cache.
-    run_ivars->cache      = ivars->cache;
-    run_ivars->cache_tick = ivars->cache_tick;
-    run_ivars->cache_max  = ivars->cache_max;
-    run_ivars->cache_cap  = ivars->cache_cap;
+    run_ivars->buffer   = ivars->buffer;
+    run_ivars->buf_tick = ivars->buf_tick;
+    run_ivars->buf_max  = ivars->buf_max;
+    run_ivars->buf_cap  = ivars->buf_cap;
 
     // Write to temp files.
     LexWriter_Enter_Temp_Mode(ivars->lex_writer, ivars->field,
@@ -296,10 +296,10 @@ PostPool_Flush_IMP(PostingPool *self) {
     LexWriter_Leave_Temp_Mode(ivars->lex_writer);
 
     // Return the cache and empty it.
-    run_ivars->cache      = NULL;
-    run_ivars->cache_tick = 0;
-    run_ivars->cache_max  = 0;
-    run_ivars->cache_cap  = 0;
+    run_ivars->buffer   = NULL;
+    run_ivars->buf_tick = 0;
+    run_ivars->buf_max  = 0;
+    run_ivars->buf_cap  = 0;
     PostPool_Clear_Cache(self);
 
     // Add the run to the array.
@@ -459,12 +459,12 @@ PostPool_Refill_IMP(PostingPool *self) {
     else { term_text = (String*)Lex_Get_Term(lexicon); }
 
     // Make sure cache is empty.
-    if (ivars->cache_max - ivars->cache_tick > 0) {
+    if (ivars->buf_max - ivars->buf_tick > 0) {
         THROW(ERR, "Refill called but cache contains %u32 items",
-              ivars->cache_max - ivars->cache_tick);
+              ivars->buf_max - ivars->buf_tick);
     }
-    ivars->cache_max  = 0;
-    ivars->cache_tick = 0;
+    ivars->buf_max  = 0;
+    ivars->buf_tick = 0;
 
     // Ditch old MemoryPool and get another.
     DECREF(ivars->mem_pool);
@@ -515,17 +515,17 @@ PostPool_Refill_IMP(PostingPool *self) {
         }
 
         // Add to the run's cache.
-        if (num_elems >= ivars->cache_cap) {
+        if (num_elems >= ivars->buf_cap) {
             size_t new_cap = Memory_oversize(num_elems + 1, sizeof(Obj*));
             PostPool_Grow_Cache(self, new_cap);
         }
-        ivars->cache[num_elems] = (Obj*)rawpost;
+        ivars->buffer[num_elems] = (Obj*)rawpost;
         num_elems++;
     }
 
     // Reset the cache array position and length; remember file pos.
-    ivars->cache_max   = num_elems;
-    ivars->cache_tick  = 0;
+    ivars->buf_max   = num_elems;
+    ivars->buf_tick  = 0;
 
     return num_elems;
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/4cff84bc/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index 2e55a39..1a0d5ff 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -399,10 +399,10 @@ SortFieldWriter_Flush_IMP(SortFieldWriter *self) {
     run_ivars->dat_start = OutStream_Align(temp_dat_out, sizeof(int64_t));
 
     // Have the run borrow the array of elems.
-    run_ivars->cache      = ivars->cache;
-    run_ivars->cache_max  = ivars->cache_max;
-    run_ivars->cache_tick = ivars->cache_tick;
-    run_ivars->cache_cap  = ivars->cache_cap;
+    run_ivars->buffer   = ivars->buffer;
+    run_ivars->buf_max  = ivars->buf_max;
+    run_ivars->buf_tick = ivars->buf_tick;
+    run_ivars->buf_cap  = ivars->buf_cap;
 
     // Write files, record stats.
     run_ivars->run_max = (int32_t)Seg_Get_Count(ivars->segment);
@@ -410,11 +410,11 @@ SortFieldWriter_Flush_IMP(SortFieldWriter *self) {
                                                temp_dat_out);
 
     // Reclaim the buffer from the run and empty it.
-    run_ivars->cache       = NULL;
-    run_ivars->cache_max   = 0;
-    run_ivars->cache_tick  = 0;
-    run_ivars->cache_cap   = 0;
-    ivars->cache_tick = ivars->cache_max;
+    run_ivars->buffer    = NULL;
+    run_ivars->buf_max   = 0;
+    run_ivars->buf_tick  = 0;
+    run_ivars->buf_cap   = 0;
+    ivars->buf_tick = ivars->buf_max;
     SortFieldWriter_Clear_Cache(self);
 
     // Record stream ends.
@@ -434,10 +434,10 @@ SortFieldWriter_Refill_IMP(SortFieldWriter *self) {
     if (!ivars->sort_cache) { return 0; }
 
     // Sanity check, then reset the cache and prepare to start loading items.
-    uint32_t cache_count = SortFieldWriter_Cache_Count(self);
-    if (cache_count) {
+    uint32_t buf_count = SortFieldWriter_Cache_Count(self);
+    if (buf_count) {
         THROW(ERR, "Refill called but cache contains %u32 items",
-              cache_count);
+              buf_count);
     }
     SortFieldWriter_Clear_Cache(self);
     MemPool_Release_All(ivars->mem_pool);

http://git-wip-us.apache.org/repos/asf/lucy/blob/4cff84bc/core/Lucy/Util/BBSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.c b/core/Lucy/Util/BBSortEx.c
index c5c4c13..156ab02 100644
--- a/core/Lucy/Util/BBSortEx.c
+++ b/core/Lucy/Util/BBSortEx.c
@@ -76,24 +76,24 @@ BBSortEx_Feed_IMP(BBSortEx *self, Obj *item) {
 void
 BBSortEx_Flush_IMP(BBSortEx *self) {
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
-    uint32_t     cache_count = ivars->cache_max - ivars->cache_tick;
-    Obj        **cache = ivars->cache;
+    uint32_t     buf_count = ivars->buf_max - ivars->buf_tick;
+    Obj        **buffer = ivars->buffer;
     VArray      *elems;
 
-    if (!cache_count) { return; }
-    else              { elems = VA_new(cache_count); }
+    if (!buf_count) { return; }
+    else            { elems = VA_new(buf_count); }
 
     // Sort, then create a new run.
     BBSortEx_Sort_Cache(self);
-    for (uint32_t i = ivars->cache_tick; i < ivars->cache_max; i++) {
-        VA_Push(elems, cache[i]);
+    for (uint32_t i = ivars->buf_tick; i < ivars->buf_max; i++) {
+        VA_Push(elems, buffer[i]);
     }
     BBSortEx *run = BBSortEx_new(0, elems);
     DECREF(elems);
     BBSortEx_Add_Run(self, (SortExternal*)run);
 
     // Blank the cache vars.
-    ivars->cache_tick += cache_count;
+    ivars->buf_tick += buf_count;
     BBSortEx_Clear_Cache(self);
 }
 
@@ -102,12 +102,12 @@ BBSortEx_Refill_IMP(BBSortEx *self) {
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
 
     // Make sure cache is empty, then set cache tick vars.
-    if (ivars->cache_max - ivars->cache_tick > 0) {
+    if (ivars->buf_max - ivars->buf_tick > 0) {
         THROW(ERR, "Refill called but cache contains %u32 items",
-              ivars->cache_max - ivars->cache_tick);
+              ivars->buf_max - ivars->buf_tick);
     }
-    ivars->cache_tick = 0;
-    ivars->cache_max  = 0;
+    ivars->buf_tick = 0;
+    ivars->buf_max  = 0;
 
     // Read in elements.
     while (1) {
@@ -127,15 +127,15 @@ BBSortEx_Refill_IMP(BBSortEx *self) {
             ivars->mem_consumed += BB_Get_Size(elem);
         }
 
-        if (ivars->cache_max == ivars->cache_cap) {
+        if (ivars->buf_max == ivars->buf_cap) {
             BBSortEx_Grow_Cache(self,
-                                Memory_oversize(ivars->cache_max + 1,
+                                Memory_oversize(ivars->buf_max + 1,
                                                 sizeof(Obj*)));
         }
-        ivars->cache[ivars->cache_max++] = INCREF(elem);
+        ivars->buffer[ivars->buf_max++] = INCREF(elem);
     }
 
-    return ivars->cache_max;
+    return ivars->buf_max;
 }
 
 void

http://git-wip-us.apache.org/repos/asf/lucy/blob/4cff84bc/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index f8a2690..ce42550 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -45,10 +45,10 @@ SortEx_init(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
 
     ivars->mem_thresh   = UINT32_MAX;
-    ivars->cache        = NULL;
-    ivars->cache_cap    = 0;
-    ivars->cache_max    = 0;
-    ivars->cache_tick   = 0;
+    ivars->buffer       = NULL;
+    ivars->buf_cap      = 0;
+    ivars->buf_max      = 0;
+    ivars->buf_tick     = 0;
     ivars->scratch      = NULL;
     ivars->scratch_cap  = 0;
     ivars->runs         = VA_new(0);
@@ -67,9 +67,9 @@ SortEx_Destroy_IMP(SortExternal *self) {
     FREEMEM(ivars->scratch);
     FREEMEM(ivars->slice_sizes);
     FREEMEM(ivars->slice_starts);
-    if (ivars->cache) {
+    if (ivars->buffer) {
         SortEx_Clear_Cache(self);
-        FREEMEM(ivars->cache);
+        FREEMEM(ivars->buffer);
     }
     DECREF(ivars->runs);
     SUPER_DESTROY(self, SORTEXTERNAL);
@@ -78,34 +78,34 @@ SortEx_Destroy_IMP(SortExternal *self) {
 void
 SortEx_Clear_Cache_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    Obj **const cache = ivars->cache;
-    const uint32_t max = ivars->cache_max;
-    for (uint32_t i = ivars->cache_tick; i < max; i++) {
-        DECREF(cache[i]);
+    Obj **const buffer = ivars->buffer;
+    const uint32_t max = ivars->buf_max;
+    for (uint32_t i = ivars->buf_tick; i < max; i++) {
+        DECREF(buffer[i]);
     }
-    ivars->cache_max    = 0;
-    ivars->cache_tick   = 0;
+    ivars->buf_max    = 0;
+    ivars->buf_tick   = 0;
 }
 
 void
 SortEx_Feed_IMP(SortExternal *self, Obj *item) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    if (ivars->cache_max == ivars->cache_cap) {
-        size_t amount = Memory_oversize(ivars->cache_max + 1, sizeof(Obj*));
+    if (ivars->buf_max == ivars->buf_cap) {
+        size_t amount = Memory_oversize(ivars->buf_max + 1, sizeof(Obj*));
         SortEx_Grow_Cache(self, amount);
     }
-    ivars->cache[ivars->cache_max] = item;
-    ivars->cache_max++;
+    ivars->buffer[ivars->buf_max] = item;
+    ivars->buf_max++;
 }
 
 static CFISH_INLINE Obj*
 SI_peek(SortExternal *self, SortExternalIVARS *ivars) {
-    if (ivars->cache_tick >= ivars->cache_max) {
+    if (ivars->buf_tick >= ivars->buf_max) {
         S_refill_cache(self, ivars);
     }
 
-    if (ivars->cache_max > 0) {
-        return ivars->cache[ivars->cache_tick];
+    if (ivars->buf_max > 0) {
+        return ivars->buffer[ivars->buf_tick];
     }
     else {
         return NULL;
@@ -116,7 +116,7 @@ Obj*
 SortEx_Fetch_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     Obj *item = SI_peek(self, ivars);
-    ivars->cache_tick++;
+    ivars->buf_tick++;
     return item;
 }
 
@@ -129,20 +129,20 @@ SortEx_Peek_IMP(SortExternal *self) {
 void
 SortEx_Sort_Cache_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    if (ivars->cache_tick != 0) {
-        THROW(ERR, "Cant Sort_Cache() after fetching %u32 items", ivars->cache_tick);
+    if (ivars->buf_tick != 0) {
+        THROW(ERR, "Cant Sort_Cache() after fetching %u32 items", ivars->buf_tick);
     }
-    if (ivars->cache_max != 0) {
+    if (ivars->buf_max != 0) {
         VTable *vtable = SortEx_Get_VTable(self);
         CFISH_Sort_Compare_t compare
             = (CFISH_Sort_Compare_t)METHOD_PTR(vtable, LUCY_SortEx_Compare);
-        if (ivars->scratch_cap < ivars->cache_cap) {
-            ivars->scratch_cap = ivars->cache_cap;
+        if (ivars->scratch_cap < ivars->buf_cap) {
+            ivars->scratch_cap = ivars->buf_cap;
             ivars->scratch
                 = (Obj**)REALLOCATE(ivars->scratch,
                                     ivars->scratch_cap * sizeof(Obj*));
         }
-        Sort_mergesort(ivars->cache, ivars->scratch, ivars->cache_max,
+        Sort_mergesort(ivars->buffer, ivars->scratch, ivars->buf_max,
                        sizeof(Obj*), compare, self);
     }
 }
@@ -168,24 +168,24 @@ SortEx_Add_Run_IMP(SortExternal *self, SortExternal *run) {
 void
 SortEx_Shrink_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    if (ivars->cache_max - ivars->cache_tick > 0) {
-        size_t cache_count = SortEx_Cache_Count(self);
-        size_t size        = cache_count * sizeof(Obj*);
-        if (ivars->cache_tick > 0) {
-            Obj **start = ivars->cache + ivars->cache_tick;
-            memmove(ivars->cache, start, size);
+    if (ivars->buf_max - ivars->buf_tick > 0) {
+        size_t buf_count = SortEx_Cache_Count(self);
+        size_t size        = buf_count * sizeof(Obj*);
+        if (ivars->buf_tick > 0) {
+            Obj **start = ivars->buffer + ivars->buf_tick;
+            memmove(ivars->buffer, start, size);
         }
-        ivars->cache      = (Obj**)REALLOCATE(ivars->cache, size);
-        ivars->cache_tick = 0;
-        ivars->cache_max  = cache_count;
-        ivars->cache_cap  = cache_count;
+        ivars->buffer   = (Obj**)REALLOCATE(ivars->buffer, size);
+        ivars->buf_tick = 0;
+        ivars->buf_max  = buf_count;
+        ivars->buf_cap  = buf_count;
     }
     else {
-        FREEMEM(ivars->cache);
-        ivars->cache      = NULL;
-        ivars->cache_tick = 0;
-        ivars->cache_max  = 0;
-        ivars->cache_cap  = 0;
+        FREEMEM(ivars->buffer);
+        ivars->buffer   = NULL;
+        ivars->buf_tick = 0;
+        ivars->buf_max  = 0;
+        ivars->buf_cap  = 0;
     }
     ivars->scratch_cap = 0;
     FREEMEM(ivars->scratch);
@@ -229,15 +229,15 @@ S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
         // Get a run and retrieve the last item in its cache.
         SortExternal *const run = (SortExternal*)VA_Fetch(ivars->runs, i);
         SortExternalIVARS *const run_ivars = SortEx_IVARS(run);
-        const uint32_t tick = run_ivars->cache_max - 1;
-        if (tick >= run_ivars->cache_cap || run_ivars->cache_max < 1) {
+        const uint32_t tick = run_ivars->buf_max - 1;
+        if (tick >= run_ivars->buf_cap || run_ivars->buf_max < 1) {
             THROW(ERR, "Invalid SortExternal cache access: %u32 %u32 %u32", tick,
-                  run_ivars->cache_max, run_ivars->cache_cap);
+                  run_ivars->buf_max, run_ivars->buf_cap);
         }
         else {
             // Cache item with the highest sort value currently held in memory
             // by the run.
-            Obj **candidate = run_ivars->cache + tick;
+            Obj **candidate = run_ivars->buffer + tick;
 
             // If it's the first run, item is automatically the new endpost.
             if (i == 0) {
@@ -263,7 +263,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     CFISH_Sort_Compare_t compare
         = (CFISH_Sort_Compare_t)METHOD_PTR(vtable, LUCY_SortEx_Compare);
 
-    if (ivars->cache_max != 0) { THROW(ERR, "Can't refill unless empty"); }
+    if (ivars->buf_max != 0) { THROW(ERR, "Can't refill unless empty"); }
 
     // Move all the elements in range into the main cache as slices.
     for (uint32_t i = 0; i < num_runs; i++) {
@@ -273,16 +273,16 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
 
         if (slice_size) {
             // Move slice content from run cache to main cache.
-            if (ivars->cache_max + slice_size > ivars->cache_cap) {
-                size_t cap = Memory_oversize(ivars->cache_max + slice_size,
+            if (ivars->buf_max + slice_size > ivars->buf_cap) {
+                size_t cap = Memory_oversize(ivars->buf_max + slice_size,
                                              sizeof(Obj*));
                 SortEx_Grow_Cache(self, cap);
             }
-            memcpy(ivars->cache + ivars->cache_max,
-                   run_ivars->cache + run_ivars->cache_tick,
+            memcpy(ivars->buffer + ivars->buf_max,
+                   run_ivars->buffer + run_ivars->buf_tick,
                    slice_size * sizeof(Obj*));
-            run_ivars->cache_tick += slice_size;
-            ivars->cache_max += slice_size;
+            run_ivars->buf_tick += slice_size;
+            ivars->buf_max += slice_size;
 
             // Track number of slices and slice sizes.
             slice_sizes[ivars->num_slices++] = slice_size;
@@ -292,14 +292,14 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     // Transform slice starts from ticks to pointers.
     uint32_t total = 0;
     for (uint32_t i = 0; i < ivars->num_slices; i++) {
-        slice_starts[i] = ivars->cache + total;
+        slice_starts[i] = ivars->buffer + total;
         total += slice_sizes[i];
     }
 
     // The main cache now consists of several slices.  Sort the main cache,
     // but exploit the fact that each slice is already sorted.
-    if (ivars->scratch_cap < ivars->cache_cap) {
-        ivars->scratch_cap = ivars->cache_cap;
+    if (ivars->scratch_cap < ivars->buf_cap) {
+        ivars->scratch_cap = ivars->buf_cap;
         ivars->scratch = (Obj**)REALLOCATE(
                             ivars->scratch, ivars->scratch_cap * sizeof(Obj*));
     }
@@ -338,27 +338,27 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
 }
 
 void
-SortEx_Grow_Cache_IMP(SortExternal *self, uint32_t size) {
+SortEx_Grow_Cache_IMP(SortExternal *self, uint32_t cap) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    if (size > ivars->cache_cap) {
-        ivars->cache = (Obj**)REALLOCATE(ivars->cache, size * sizeof(Obj*));
-        ivars->cache_cap = size;
+    if (cap > ivars->buf_cap) {
+        ivars->buffer = (Obj**)REALLOCATE(ivars->buffer, cap * sizeof(Obj*));
+        ivars->buf_cap = cap;
     }
 }
 
 static uint32_t
 S_find_slice_size(SortExternal *self, SortExternalIVARS *ivars,
                   Obj **endpost) {
-    int32_t          lo      = ivars->cache_tick - 1;
-    int32_t          hi      = ivars->cache_max;
-    Obj            **cache   = ivars->cache;
+    int32_t          lo      = ivars->buf_tick - 1;
+    int32_t          hi      = ivars->buf_max;
+    Obj            **buffer  = ivars->buffer;
     SortEx_Compare_t compare
         = METHOD_PTR(SortEx_Get_VTable(self), LUCY_SortEx_Compare);
 
     // Binary search.
     while (hi - lo > 1) {
         const int32_t mid   = lo + ((hi - lo) / 2);
-        const int32_t delta = compare(self, cache + mid, endpost);
+        const int32_t delta = compare(self, buffer + mid, endpost);
         if (delta > 0) { hi = mid; }
         else           { lo = mid; }
     }
@@ -366,7 +366,7 @@ S_find_slice_size(SortExternal *self, SortExternalIVARS *ivars,
     // If lo is still -1, we didn't find anything.
     return lo == -1
            ? 0
-           : (lo - ivars->cache_tick) + 1;
+           : (lo - ivars->buf_tick) + 1;
 }
 
 void
@@ -377,7 +377,7 @@ SortEx_Set_Mem_Thresh_IMP(SortExternal *self, uint32_t mem_thresh) {
 uint32_t
 SortEx_Cache_Count_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
-    return ivars->cache_max - ivars->cache_tick;
+    return ivars->buf_max - ivars->buf_tick;
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/4cff84bc/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index a813459..9674f92 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -38,10 +38,10 @@ parcel Lucy;
 abstract class Lucy::Util::SortExternal nickname SortEx
     inherits Clownfish::Obj {
 
-    Obj          **cache;
-    uint32_t       cache_cap;
-    uint32_t       cache_max;
-    uint32_t       cache_tick;
+    Obj          **buffer;
+    uint32_t       buf_cap;
+    uint32_t       buf_max;
+    uint32_t       buf_tick;
     Obj          **scratch;
     uint32_t       scratch_cap;
     VArray        *runs;
@@ -127,7 +127,7 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     /** Allocate more memory to the cache.
      */
     void
-    Grow_Cache(SortExternal *self, uint32_t new_cache_cap);
+    Grow_Cache(SortExternal *self, uint32_t cap);
 
     void
     Set_Mem_Thresh(SortExternal *self, uint32_t mem_thresh);


[lucy-commits] [40/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Change SortFieldWriter to use pointer-sized elems.

Posted by ma...@apache.org.
Change SortFieldWriter to use pointer-sized elems.

SortFieldWriter is the only subclass of SortExternal where the elements
have been anything other than pointers.  By changing it to use pointers,
we enable subsequent commits simplifying SortExternal by limiting it to
sorting pointers only.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/0bf76df7
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/0bf76df7
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/0bf76df7

Branch: refs/heads/sortex_ptr_only
Commit: 0bf76df7e7bf07c4df35a3d68d7dc6da009bf7b5
Parents: e6d1963
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Thu Jan 3 17:57:22 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 09:52:20 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/SortFieldWriter.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/0bf76df7/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index e7d35cf..249e6ea 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -76,7 +76,7 @@ SortFieldWriter_init(SortFieldWriter *self, Schema *schema,
                      OutStream *temp_ord_out, OutStream *temp_ix_out,
                      OutStream *temp_dat_out) {
     // Init.
-    SortEx_init((SortExternal*)self, sizeof(SFWriterElem));
+    SortEx_init((SortExternal*)self, sizeof(SFWriterElem*));
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
     ivars->null_ord        = -1;
     ivars->count           = 0;
@@ -139,6 +139,11 @@ SortFieldWriter_Clear_Cache_IMP(SortFieldWriter *self) {
     SortFieldWriter_Clear_Cache_t super_clear_cache
         = SUPER_METHOD_PTR(SORTFIELDWRITER, LUCY_SortFieldWriter_Clear_Cache);
     super_clear_cache(self);
+    // Note that we have not called MemPool_Release_All() on our memory pool.
+    // This is because the pool is shared amongst multiple SortFieldWriters
+    // which belong to a parent SortWriter; it is the responsibility of the
+    // parent SortWriter to release the memory pool once **all** of its child
+    // SortFieldWriters have cleared their caches.
 }
 
 void
@@ -191,9 +196,10 @@ SortFieldWriter_Add_IMP(SortFieldWriter *self, int32_t doc_id, Obj *value) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
 
     // Uniq-ify the value, and record it for this document.
-    SFWriterElem elem;
-    elem.value = S_find_unique_value(ivars->uniq_vals, value);
-    elem.doc_id = doc_id;
+    SFWriterElem *elem
+        = (SFWriterElem*)MemPool_Grab(ivars->mem_pool, sizeof(SFWriterElem));
+    elem->value = S_find_unique_value(ivars->uniq_vals, value);
+    elem->doc_id = doc_id;
     SortFieldWriter_Feed(self, &elem);
     ivars->count++;
 }
@@ -336,8 +342,8 @@ S_write_val(Obj *val, int8_t prim_id, OutStream *ix_out, OutStream *dat_out,
 int
 SortFieldWriter_Compare_IMP(SortFieldWriter *self, void *va, void *vb) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
-    SFWriterElem *a = (SFWriterElem*)va;
-    SFWriterElem *b = (SFWriterElem*)vb;
+    SFWriterElem *a = *(SFWriterElem**)va;
+    SFWriterElem *b = *(SFWriterElem**)vb;
     int32_t comparison
         = FType_null_back_compare_values(ivars->type, a->value, b->value);
     if (comparison == 0) { comparison = b->doc_id - a->doc_id; }
@@ -553,7 +559,8 @@ S_write_files(SortFieldWriter *self, OutStream *ord_out, OutStream *ix_out,
 
     // Grab the first item and record its ord.  Add a dummy ord for invalid
     // doc id 0.
-    SFWriterElem *elem = (SFWriterElem*)SortFieldWriter_Fetch(self);
+    SFWriterElem **elem_ptr = (SFWriterElem**)SortFieldWriter_Fetch(self);
+    SFWriterElem *elem = *elem_ptr;
     ords[elem->doc_id] = ord;
     ords[0] = 0;
 
@@ -561,7 +568,8 @@ S_write_files(SortFieldWriter *self, OutStream *ord_out, OutStream *ix_out,
     ivars->last_val = INCREF(elem->value);
     Obj *last_val_address = elem->value;
     S_write_val(elem->value, prim_id, ix_out, dat_out, dat_start);
-    while (NULL != (elem = (SFWriterElem*)SortFieldWriter_Fetch(self))) {
+    while (NULL != (elem_ptr = (SFWriterElem**)SortFieldWriter_Fetch(self))) {
+        elem = *elem_ptr;
         if (elem->value != last_val_address) {
             int32_t comparison
                 = FType_Compare_Values(ivars->type, elem->value, ivars->last_val);


[lucy-commits] [53/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Update SortExternal docs with new terminology.

Posted by ma...@apache.org.
Update SortExternal docs with new terminology.

Modify comments and docs to use "buffer" instead of "cache".


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/00181bd4
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/00181bd4
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/00181bd4

Branch: refs/heads/sortex_ptr_only
Commit: 00181bd4e0eb18c3d79f09ddbb8f8e63c08101e5
Parents: 3b0c585
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Fri Jan 11 16:13:45 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 16:01:56 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/PostingPool.c     | 16 ++++++++--------
 core/Lucy/Index/SortFieldWriter.c |  6 +++---
 core/Lucy/Util/BBSortEx.c         |  6 +++---
 core/Lucy/Util/SortExternal.c     | 26 +++++++++++++-------------
 core/Lucy/Util/SortExternal.cfh   | 16 ++++++++--------
 5 files changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/00181bd4/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 3088f34..fc71473 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -277,7 +277,7 @@ PostPool_Flush_IMP(PostingPool *self) {
                                             ivars->segment, ivars->polyreader,
                                             ivars->post_temp_out);
 
-    // Borrow the cache.
+    // Borrow the buffer.
     run_ivars->buffer   = ivars->buffer;
     run_ivars->buf_tick = ivars->buf_tick;
     run_ivars->buf_max  = ivars->buf_max;
@@ -295,7 +295,7 @@ PostPool_Flush_IMP(PostingPool *self) {
     run_ivars->post_end = OutStream_Tell(ivars->post_temp_out);
     LexWriter_Leave_Temp_Mode(ivars->lex_writer);
 
-    // Return the cache and empty it.
+    // Return the buffer and empty it.
     run_ivars->buffer   = NULL;
     run_ivars->buf_tick = 0;
     run_ivars->buf_max  = 0;
@@ -458,9 +458,9 @@ PostPool_Refill_IMP(PostingPool *self) {
     if (ivars->lexicon == NULL) { return 0; }
     else { term_text = (String*)Lex_Get_Term(lexicon); }
 
-    // Make sure cache is empty.
+    // Make sure buffer is empty.
     if (ivars->buf_max - ivars->buf_tick > 0) {
-        THROW(ERR, "Refill called but cache contains %u32 items",
+        THROW(ERR, "Refill called but buffer contains %u32 items",
               ivars->buf_max - ivars->buf_tick);
     }
     ivars->buf_max  = 0;
@@ -492,7 +492,7 @@ PostPool_Refill_IMP(PostingPool *self) {
             }
         }
 
-        // Bail if we've hit the ceiling for this run's cache.
+        // Bail if we've hit the ceiling for this run's buffer.
         if (mem_pool_ivars->consumed >= mem_thresh && num_elems > 0) {
             break;
         }
@@ -514,7 +514,7 @@ PostPool_Refill_IMP(PostingPool *self) {
             rawpost_ivars->doc_id = remapped;
         }
 
-        // Add to the run's cache.
+        // Add to the run's buffer.
         if (num_elems >= ivars->buf_cap) {
             size_t new_cap = Memory_oversize(num_elems + 1, sizeof(Obj*));
             PostPool_Grow_Buffer(self, new_cap);
@@ -523,7 +523,7 @@ PostPool_Refill_IMP(PostingPool *self) {
         num_elems++;
     }
 
-    // Reset the cache array position and length; remember file pos.
+    // Reset the buffer array position and length; remember file pos.
     ivars->buf_max   = num_elems;
     ivars->buf_tick  = 0;
 
@@ -546,7 +546,7 @@ S_fresh_flip(PostingPool *self, InStream *lex_temp_in,
     if (ivars->flipped) { THROW(ERR, "Can't Flip twice"); }
     ivars->flipped = true;
 
-    // Sort RawPostings in cache, if any.
+    // Sort RawPostings in buffer, if any.
     PostPool_Sort_Buffer(self);
 
     // Bail if never flushed.

http://git-wip-us.apache.org/repos/asf/lucy/blob/00181bd4/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index 9cdf47a..381f9ad 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -144,7 +144,7 @@ SortFieldWriter_Clear_Buffer_IMP(SortFieldWriter *self) {
     // This is because the pool is shared amongst multiple SortFieldWriters
     // which belong to a parent SortWriter; it is the responsibility of the
     // parent SortWriter to release the memory pool once **all** of its child
-    // SortFieldWriters have cleared their caches.
+    // SortFieldWriters have cleared their buffers.
 }
 
 void
@@ -433,10 +433,10 @@ SortFieldWriter_Refill_IMP(SortFieldWriter *self) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
     if (!ivars->sort_cache) { return 0; }
 
-    // Sanity check, then reset the cache and prepare to start loading items.
+    // Sanity check, then reset the buffer and prepare to start loading items.
     uint32_t buf_count = SortFieldWriter_Buffer_Count(self);
     if (buf_count) {
-        THROW(ERR, "Refill called but cache contains %u32 items",
+        THROW(ERR, "Refill called but buffer contains %u32 items",
               buf_count);
     }
     SortFieldWriter_Clear_Buffer(self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/00181bd4/core/Lucy/Util/BBSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.c b/core/Lucy/Util/BBSortEx.c
index 662a570..ff96c73 100644
--- a/core/Lucy/Util/BBSortEx.c
+++ b/core/Lucy/Util/BBSortEx.c
@@ -92,7 +92,7 @@ BBSortEx_Flush_IMP(BBSortEx *self) {
     DECREF(elems);
     BBSortEx_Add_Run(self, (SortExternal*)run);
 
-    // Blank the cache vars.
+    // Blank the buffer vars.
     ivars->buf_tick += buf_count;
     BBSortEx_Clear_Buffer(self);
 }
@@ -101,9 +101,9 @@ uint32_t
 BBSortEx_Refill_IMP(BBSortEx *self) {
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
 
-    // Make sure cache is empty, then set cache tick vars.
+    // Make sure buffer is empty, then set buffer tick vars.
     if (ivars->buf_max - ivars->buf_tick > 0) {
-        THROW(ERR, "Refill called but cache contains %u32 items",
+        THROW(ERR, "Refill called but buffer contains %u32 items",
               ivars->buf_max - ivars->buf_tick);
     }
     ivars->buf_tick = 0;

http://git-wip-us.apache.org/repos/asf/lucy/blob/00181bd4/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index c7dff90..c8b6963 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -19,19 +19,19 @@
 
 #include "Lucy/Util/SortExternal.h"
 
-// Refill the main cache, drawing from the caches of all runs.
+// Refill the main buffer, drawing from the buffers of all runs.
 static void
 S_refill_buffer(SortExternal *self, SortExternalIVARS *ivars);
 
 // Absorb all the items which are "in-range" from all the Runs into the main
-// cache.
+// buffer.
 static void
 S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
                 Obj **endpost);
 
-// Return the address for the item in one of the runs' caches which is the
+// Return the address for the item in one of the runs' buffers which is the
 // highest in sort order, but which we can guarantee is lower in sort order
-// than any item which has yet to enter a run cache.
+// than any item which has yet to enter a run buffer.
 static Obj**
 S_find_endpost(SortExternal *self, SortExternalIVARS *ivars);
 
@@ -199,10 +199,10 @@ SortEx_Shrink_IMP(SortExternal *self) {
 
 static void
 S_refill_buffer(SortExternal *self, SortExternalIVARS *ivars) {
-    // Reset cache vars.
+    // Reset buffer vars.
     SortEx_Clear_Buffer(self);
 
-    // Make sure all runs have at least one item in the cache.
+    // Make sure all runs have at least one item in the buffer.
     uint32_t i = 0;
     while (i < VA_Get_Size(ivars->runs)) {
         SortExternal *const run = (SortExternal*)VA_Fetch(ivars->runs, i);
@@ -214,7 +214,7 @@ S_refill_buffer(SortExternal *self, SortExternalIVARS *ivars) {
         }
     }
 
-    // Absorb as many elems as possible from all runs into main cache.
+    // Absorb as many elems as possible from all runs into main buffer.
     if (VA_Get_Size(ivars->runs)) {
         Obj **endpost = S_find_endpost(self, ivars);
         S_absorb_slices(self, ivars, endpost);
@@ -226,12 +226,12 @@ S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
     Obj **endpost = NULL;
 
     for (uint32_t i = 0, max = VA_Get_Size(ivars->runs); i < max; i++) {
-        // Get a run and retrieve the last item in its cache.
+        // Get a run and retrieve the last item in its buffer.
         SortExternal *const run = (SortExternal*)VA_Fetch(ivars->runs, i);
         SortExternalIVARS *const run_ivars = SortEx_IVARS(run);
         const uint32_t tick = run_ivars->buf_max - 1;
         if (tick >= run_ivars->buf_cap || run_ivars->buf_max < 1) {
-            THROW(ERR, "Invalid SortExternal cache access: %u32 %u32 %u32", tick,
+            THROW(ERR, "Invalid SortExternal buffer access: %u32 %u32 %u32", tick,
                   run_ivars->buf_max, run_ivars->buf_cap);
         }
         else {
@@ -265,14 +265,14 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
 
     if (ivars->buf_max != 0) { THROW(ERR, "Can't refill unless empty"); }
 
-    // Move all the elements in range into the main cache as slices.
+    // Move all the elements in range into the main buffer as slices.
     for (uint32_t i = 0; i < num_runs; i++) {
         SortExternal *const run = (SortExternal*)VA_Fetch(ivars->runs, i);
         SortExternalIVARS *const run_ivars = SortEx_IVARS(run);
         uint32_t slice_size = S_find_slice_size(run, run_ivars, endpost);
 
         if (slice_size) {
-            // Move slice content from run cache to main cache.
+            // Move slice content from run buffer to main buffer.
             if (ivars->buf_max + slice_size > ivars->buf_cap) {
                 size_t cap = Memory_oversize(ivars->buf_max + slice_size,
                                              sizeof(Obj*));
@@ -296,7 +296,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
         total += slice_sizes[i];
     }
 
-    // The main cache now consists of several slices.  Sort the main cache,
+    // The main buffer now consists of several slices.  Sort the main buffer,
     // but exploit the fact that each slice is already sorted.
     if (ivars->scratch_cap < ivars->buf_cap) {
         ivars->scratch_cap = ivars->buf_cap;
@@ -304,7 +304,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
                             ivars->scratch, ivars->scratch_cap * sizeof(Obj*));
     }
 
-    // Exploit previous sorting, rather than sort cache naively.
+    // Exploit previous sorting, rather than sort buffer naively.
     // Leave the first slice intact if the number of slices is odd. */
     while (ivars->num_slices > 1) {
         uint32_t i = 0;

http://git-wip-us.apache.org/repos/asf/lucy/blob/00181bd4/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index 917f5df..5ffb44c 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -26,7 +26,7 @@ parcel Lucy;
  * It's expected that the total memory footprint of the sortable objects will
  * eventually exceed a specified threshold; at that point, the SortExternal
  * object will call the abstract method Flush().  It's expected that Flush()
- * implementations will empty out the current sort cache, write a sorted "run"
+ * implementations will empty out the current sort buffer, write a sorted "run"
  * to external storage, and add a new child SortExternal object to the top
  * level object's "runs" array to represent the flushed content.
  *
@@ -59,7 +59,7 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     abstract int
     Compare(SortExternal *self, void *va, void *vb);
 
-    /** Flush all elements currently in the cache.
+    /** Flush all elements currently in the buffer.
      *
      * Presumably this entails sorting everything, writing the sorted elements
      * to disk, spawning a child object to represent those elements, and
@@ -100,31 +100,31 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     void
     Shrink(SortExternal *self);
 
-    /** Refill the cache of a run.  Will only be called on child objects, not
+    /** Refill the buffer of a run.  Will only be called on child objects, not
      * the main object.
      */
     abstract uint32_t
     Refill(SortExternal *self);
 
-    /** Sort all items currently in the main cache.
+    /** Sort all items currently in the main buffer.
      */
     void
     Sort_Buffer(SortExternal *self);
 
-    /** Reset cache variables so that cache gives the appearance of having
+    /** Reset buffer variables so that buffer gives the appearance of having
      * been initialized.
      *
-     * Subclasses may take steps to release items held in cache, if any.
+     * Subclasses may take steps to release items held in buffer, if any.
      */
     void
     Clear_Buffer(SortExternal *self);
 
-    /** Return the number of items presently in the cache.
+    /** Return the number of items presently in the buffer.
      */
     uint32_t
     Buffer_Count(SortExternal *self);
 
-    /** Allocate more memory to the cache.
+    /** Allocate more memory to the buffer.
      */
     void
     Grow_Buffer(SortExternal *self, uint32_t cap);


[lucy-commits] [18/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/404-file.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/404-file.t b/clownfish/compiler/perl/t/core/404-file.t
deleted file mode 100644
index 69c112e..0000000
--- a/clownfish/compiler/perl/t/core/404-file.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::File');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/500-hierarchy.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/500-hierarchy.t b/clownfish/compiler/perl/t/core/500-hierarchy.t
deleted file mode 100644
index 5b60568..0000000
--- a/clownfish/compiler/perl/t/core/500-hierarchy.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Hierarchy');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/t/core/600-parser.t
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/t/core/600-parser.t b/clownfish/compiler/perl/t/core/600-parser.t
deleted file mode 100644
index 0311548..0000000
--- a/clownfish/compiler/perl/t/core/600-parser.t
+++ /dev/null
@@ -1,25 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-use strict;
-use warnings;
-
-use Clownfish::CFC::Test;
-
-my $test   = Clownfish::CFC::Test->new;
-my $passed = $test->run_batch('Clownfish::CFC::Model::Parser');
-
-exit($passed ? 0 : 1);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/perl/typemap
----------------------------------------------------------------------
diff --git a/clownfish/compiler/perl/typemap b/clownfish/compiler/perl/typemap
deleted file mode 100644
index d744071..0000000
--- a/clownfish/compiler/perl/typemap
+++ /dev/null
@@ -1,154 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-TYPEMAP
-CFCBase*	CLOWNFISH_TYPE
-CFCCBlock*	CLOWNFISH_MODEL
-CFCClass*	CLOWNFISH_MODEL
-CFCDocuComment*	CLOWNFISH_MODEL
-CFCFile*	CLOWNFISH_MODEL
-CFCFileSpec*	CLOWNFISH_MODEL
-CFCFunction*	CLOWNFISH_MODEL
-CFCHierarchy*	CLOWNFISH_MODEL
-CFCMethod*	CLOWNFISH_MODEL
-CFCMemPool*	CLOWNFISH_TYPE
-CFCParamList*	CLOWNFISH_MODEL
-CFCParcel*	CLOWNFISH_MODEL
-CFCParser*	CLOWNFISH_TYPE
-CFCSymbol*	CLOWNFISH_MODEL
-CFCTest*	CLOWNFISH_TYPE
-CFCType*	CLOWNFISH_MODEL
-CFCVariable*	CLOWNFISH_MODEL
-CFCVersion*	CLOWNFISH_MODEL
-CFCBindCore*	CLOWNFISH_BINDING_CORE
-CFCBindClass*	CLOWNFISH_BINDING_CORE_TYPE
-CFCPerl*	CLOWNFISH_BINDING_PERL
-CFCPerlSub*	CLOWNFISH_BINDING_PERL_SUBROUTINE
-CFCPerlClass*	CLOWNFISH_BINDING_PERL_COMMON
-CFCPerlConstructor*	CLOWNFISH_BINDING_PERL_COMMON
-CFCPerlMethod*	CLOWNFISH_BINDING_PERL_COMMON
-CFCPerlPod*	CLOWNFISH_BINDING_PERL_COMMON
-
-INPUT
-
-CLOWNFISH_MODEL
-	if (!SvOK($arg)) {
-        $var = NULL;
-    }
-	else if (sv_derived_from($arg, \"${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::CFC::Model::$1/;\$t}\")) {
-		IV objint = SvIV((SV*)SvRV($arg));
-		$var = INT2PTR($type, objint);
-	}
-    else {
-		croak(\"Not a ${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::CFC::Model::$1/;\$t}\");
-	}
-
-CLOWNFISH_TYPE
-	if (!SvOK($arg)) {
-        $var = NULL;
-    }
-	else if (sv_derived_from($arg, \"${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::CFC::$1/;\$t}\")) {
-		IV objint = SvIV((SV*)SvRV($arg));
-		$var = INT2PTR($type, objint);
-	}
-    else {
-		croak(\"Not a ${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::CFC::$1/;\$t}\");
-	}
-
-CLOWNFISH_BINDING_CORE
-	if (!SvOK($arg)) {
-        $var = NULL;
-    }
-	else if (sv_derived_from($arg, \"Clownfish::CFC::Binding::Core\")) {
-		IV objint = SvIV((SV*)SvRV($arg));
-		$var = INT2PTR($type, objint);
-	}
-    else {
-		croak(\"Not a Clownfish::CFC::Binding::Core\");
-	}
-
-CLOWNFISH_BINDING_CORE_TYPE
-	if (!SvOK($arg)) {
-        $var = NULL;
-    }
-	else if (sv_derived_from($arg, \"${(my $t = $type) =~ s/CFCBind(\w+).*/Clownfish::CFC::Binding::Core::$1/;\$t}\")) {
-		IV objint = SvIV((SV*)SvRV($arg));
-		$var = INT2PTR($type, objint);
-	}
-    else {
-		croak(\"Not a ${(my $t = $type) =~ s/CFCBind(\w+).*/Clownfish::CFC::Binding::Core::$1/;\$t}\");
-	}
-
-CLOWNFISH_BINDING_PERL
-	if (!SvOK($arg)) {
-        $var = NULL;
-    }
-	else if (sv_derived_from($arg, \"Clownfish::CFC::Binding::Perl\")) {
-		IV objint = SvIV((SV*)SvRV($arg));
-		$var = INT2PTR($type, objint);
-	}
-    else {
-		croak(\"Not a Clownfish::CFC::Binding::Perl\");
-	}
-
-
-CLOWNFISH_BINDING_PERL_SUBROUTINE
-	if (!SvOK($arg)) {
-        $var = NULL;
-    }
-	else if (sv_derived_from($arg, \"Clownfish::CFC::Binding::Perl::Subroutine\")) {
-		IV objint = SvIV((SV*)SvRV($arg));
-		$var = INT2PTR($type, objint);
-	}
-    else {
-		croak(\"Not a Clownfish::CFC::Binding::Perl::Subroutine\");
-	}
-
-CLOWNFISH_BINDING_PERL_COMMON
-	if (!SvOK($arg)) {
-        $var = NULL;
-    }
-	else if (sv_derived_from($arg, \"${(my $t = $type) =~ s/CFCPerl(\w+).*/Clownfish::CFC::Binding::Perl::$1/;\$t}\")) {
-		IV objint = SvIV((SV*)SvRV($arg));
-		$var = INT2PTR($type, objint);
-	}
-    else {
-		croak(\"Not a ${(my $t = $type) =~ s/CFCPerl(\w+).*/Clownfish::CFC::Binding::Perl::$1/;\$t}\");
-	}
-
-
-OUTPUT
-
-CLOWNFISH_MODEL
-	sv_setref_pv($arg, \"${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::CFC::Model::$1/;\$t}\", (void*)$var);
-
-CLOWNFISH_TYPE
-	sv_setref_pv($arg, \"${(my $t = $type) =~ s/CFC(\w+).*/Clownfish::CFC::$1/;\$t}\", (void*)$var);
-
-CLOWNFISH_BINDING_CORE
-	sv_setref_pv($arg, \"Clownfish::CFC::Binding::Core\", (void*)$var);
-
-CLOWNFISH_BINDING_CORE_TYPE
-	sv_setref_pv($arg, \"${(my $t = $type) =~ s/CFCBind(\w+).*/Clownfish::CFC::Binding::Core::$1/;\$t}\", (void*)$var);
-
-CLOWNFISH_BINDING_PERL
-	sv_setref_pv($arg, \"Clownfish::CFC::Binding::Perl\", (void*)$var);
-
-CLOWNFISH_BINDING_PERL_COMMON
-	sv_setref_pv($arg, \"${(my $t = $type) =~ s/CFCPerl(\w+).*/Clownfish::CFC::Binding::Perl::$1/;\$t}\", (void*)$var);
-
-CLOWNFISH_BINDING_PERL_SUBROUTINE
-	sv_setref_pv($arg, \"Clownfish::CFC::Binding::Perl::Subroutine\", (void*)$var);
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/python/clownfish/_cfc.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/python/clownfish/_cfc.c b/clownfish/compiler/python/clownfish/_cfc.c
deleted file mode 100644
index 253f23c..0000000
--- a/clownfish/compiler/python/clownfish/_cfc.c
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "Python.h"
-#include "CFC.h"
-
-typedef struct {
-    PyObject_HEAD
-    void *cfc_obj;
-} CFCPyWrapper;
-
-static CFCHierarchy*
-S_extract_hierarchy(PyObject *wrapper) {
-    return (CFCHierarchy*)((CFCPyWrapper*)wrapper)->cfc_obj;
-}
-
-static CFCPyWrapper*
-S_CFCHierarchy_new(PyTypeObject *type, PyObject *args,
-                   PyObject *keyword_args) {
-    char *dest = NULL;
-    char *keywords[] = {"dest", NULL};
-    int result = PyArg_ParseTupleAndKeywords(args, keyword_args, "|s",
-                                             keywords, &dest);
-    if (!result) { return NULL; }
-    if (!dest) {
-        PyErr_SetString(PyExc_TypeError, "Missing required arg 'dest'");
-        return NULL;
-    }
-    CFCPyWrapper *wrapper = (CFCPyWrapper*)type->tp_alloc(type, 0);
-    if (wrapper) {
-        wrapper->cfc_obj = CFCHierarchy_new(dest);
-    }
-    return wrapper;
-}
-
-static void
-S_CFCHierarchy_dealloc(CFCPyWrapper *wrapper) {
-    CFCBase *temp = (CFCBase*)wrapper->cfc_obj;
-    wrapper->cfc_obj = NULL;
-    CFCBase_decref(temp);
-    Py_TYPE(wrapper)->tp_free(wrapper);
-}
-
-static PyObject*
-S_CFCHierarchy_add_include_dir(PyObject *wrapper, PyObject *dir) {
-    CFCHierarchy *wrapped  = S_extract_hierarchy(wrapper);
-    CFCHierarchy_add_include_dir(S_extract_hierarchy(wrapper),
-                                 PyUnicode_AsUTF8(dir));
-    Py_RETURN_NONE;
-}
-
-static PyModuleDef cfc_module_def = {
-    PyModuleDef_HEAD_INIT,
-    "clownfish.cfc",
-    "CFC: Clownfish compiler",
-    -1,
-    NULL, NULL, NULL, NULL, NULL
-};
-
-static PyModuleDef cfc_model_module_def = {
-    PyModuleDef_HEAD_INIT,
-    "clownfish.cfc.model",
-    "CFC classes which model language constructs",
-    -1,
-    NULL, NULL, NULL, NULL, NULL
-};
-
-static PyMethodDef hierarchy_methods[] = {
-    {"add_include_dir", (PyCFunction)S_CFCHierarchy_add_include_dir, METH_O,
-     NULL},
-    {NULL}
-};
-
-static PyTypeObject CFCHierarchy_pytype = {
-    PyVarObject_HEAD_INIT(NULL, 0)
-    "clownfish.cfc.model.Hierarchy",    // tp_name
-    sizeof(CFCPyWrapper),               // tp_basicsize
-    0,                                  // tp_itemsize
-    (destructor)S_CFCHierarchy_dealloc, // tp_dealloc
-    0,                                  // tp_print
-    0,                                  // tp_getattr
-    0,                                  // tp_setattr
-    0,                                  // tp_reserved
-    0,                                  // tp_repr
-    0,                                  // tp_as_number
-    0,                                  // tp_as_sequence
-    0,                                  // tp_as_mapping
-    0,                                  // tp_hash
-    0,                                  // tp_call
-    0,                                  // tp_str
-    0,                                  // tp_getattro
-    0,                                  // tp_setattro
-    0,                                  // tp_as_buffer
-    Py_TPFLAGS_DEFAULT,                 // tp_flags
-    "CFCHierarchy",                     // tp_doc
-    0,                                  // tp_traverse
-    0,                                  // tp_clear
-    0,                                  // tp_richcompare
-    0,                                  // tp_weaklistoffset
-    0,                                  // tp_iter
-    0,                                  // tp_iternext
-    hierarchy_methods,                  // tp_methods
-    0,                                  // tp_members
-    0,                                  // tp_getset
-    0,                                  // tp_base
-    0,                                  // tp_dict
-    0,                                  // tp_descr_get
-    0,                                  // tp_descr_set
-    0,                                  // tp_dictoffset
-    0,                                  // tp_init
-    0,                                  // tp_allow
-    (newfunc)S_CFCHierarchy_new         // tp_new
-};
-
-PyMODINIT_FUNC
-PyInit__cfc(void) {
-    if (PyType_Ready(&CFCHierarchy_pytype) < 0) {
-        return NULL;
-    }
-    PyObject *cfc_module = PyModule_Create(&cfc_module_def);
-    PyObject *cfc_model_module = PyModule_Create(&cfc_model_module_def);
-    PyModule_AddObject(cfc_module, "model", (PyObject*)cfc_model_module);
-    Py_INCREF(&CFCHierarchy_pytype);
-    PyModule_AddObject(cfc_model_module, "Hierarchy",
-                       (PyObject*)&CFCHierarchy_pytype);
-
-    return cfc_module;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/python/clownfish/cfc/__init__.py
----------------------------------------------------------------------
diff --git a/clownfish/compiler/python/clownfish/cfc/__init__.py b/clownfish/compiler/python/clownfish/cfc/__init__.py
deleted file mode 100644
index 8ab5aaf..0000000
--- a/clownfish/compiler/python/clownfish/cfc/__init__.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from clownfish._cfc import *
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/python/setup.py
----------------------------------------------------------------------
diff --git a/clownfish/compiler/python/setup.py b/clownfish/compiler/python/setup.py
deleted file mode 100644
index c5917e1..0000000
--- a/clownfish/compiler/python/setup.py
+++ /dev/null
@@ -1,203 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from distutils.core import setup, Extension
-from distutils.command.build import build as _build
-from distutils.command.clean import clean as _clean
-from distutils.cmd import Command as _Command
-from distutils.dep_util import newer_group
-import distutils.ccompiler
-import os
-import glob
-import platform
-import re
-import shutil
-import subprocess
-import sysconfig
-
-# Get a compiler object and and strings representing the compiler type and
-# CFLAGS.
-compiler = distutils.ccompiler.new_compiler()
-cflags = sysconfig.get_config_var('CFLAGS')
-compiler_type = distutils.ccompiler.get_default_compiler()
-
-# There's no public way to get a string representing the compiler executable
-# out of distutils, but the member variable has been in the same place for a
-# long time, so violating encapsulation may be ok.
-compiler_name = " ".join(compiler.compiler)
-
-BASE_DIR = os.path.abspath(os.path.join(os.pardir, os.pardir, os.pardir))
-PARENT_DIR      = os.path.abspath(os.pardir)
-CFC_SOURCE_DIR  = os.path.join(PARENT_DIR, 'src')
-CFC_INCLUDE_DIR = os.path.join(PARENT_DIR, 'include')
-COMMON_SOURCE_DIR    = os.path.join(PARENT_DIR, 'common')
-CHARMONIZER_C        = os.path.join(COMMON_SOURCE_DIR, 'charmonizer.c')
-CHARMONIZER_EXE_NAME = compiler.executable_filename('charmonizer')
-CHARMONIZER_EXE_PATH = os.path.join(os.curdir, CHARMONIZER_EXE_NAME)
-CHARMONY_H_PATH      = 'charmony.h'
-LEMON_DIR = os.path.join(BASE_DIR, 'lemon')
-LEMON_EXE_NAME = compiler.executable_filename('lemon')
-LEMON_EXE_PATH = os.path.join(LEMON_DIR, LEMON_EXE_NAME)
-
-# Accumulate lists of source files and target files.
-c_filepaths = []
-y_filepaths = []
-paths_to_clean = [
-    CHARMONIZER_EXE_PATH,
-    CHARMONY_H_PATH,
-    '_charm*',
-]
-c_filepaths.append(os.path.join('clownfish', '_cfc.c'))
-for (dirpath, dirnames, files) in os.walk(CFC_SOURCE_DIR):
-    for filename in files:
-        if filename.endswith('.y'):
-            path = os.path.join(dirpath, filename)
-            y_filepaths.append(path)
-            path = re.sub(r'y$', 'h', path)
-            paths_to_clean.append(path)
-            path = re.sub(r'h$', 'c', path)
-            paths_to_clean.append(path)
-            c_filepaths.append(path)
-            path = compiler.object_filenames([path])[0]
-            paths_to_clean.append(path)
-        if filename.endswith('.c'):
-            path = os.path.join(dirpath, filename)
-            c_filepaths.append(path)
-            path = compiler.object_filenames([path])[0]
-            paths_to_clean.append(path)
-
-def _quotify(text):
-    text = text.replace('\\', '\\\\')
-    text = text.replace('"', '\\"')
-    return '"' + text + '"'
-
-def _run_make(command=[], directory=None):
-    current_directory = os.getcwd();
-    if (directory != None):
-        os.chdir(directory)
-    if (compiler_type == 'msvc'):
-        command.insert(0, 'Makefile.MSVC')
-        command.insert(0, '-f')
-    elif (platform.system() == 'Windows'):
-        command.insert(0, 'Makefile.MinGW')
-        command.insert(0, '-f')
-    command.insert(0, "make")
-    subprocess.check_call(command)
-    if (directory != None):
-        os.chdir(current_directory)
-
-class charmony(_Command):
-    description = "Build and run charmonizer"
-    user_options = []
-    def initialize_options(self):
-        pass
-    def finalize_options(self):
-        pass
-    def run(self):
-        # Compile charmonizer.
-        if newer_group([CHARMONIZER_C], CHARMONIZER_EXE_PATH):
-            command = [compiler_name]
-            if compiler_type == 'msvc':
-                command.append('/Fe' + CHARMONIZER_EXE_PATH)
-            else:
-                command.extend(['-o', CHARMONIZER_EXE_PATH])
-            command.append(CHARMONIZER_C)
-            print(" ".join(command))
-            subprocess.check_call(command)
-
-        # Run charmonizer.
-        if newer_group([CHARMONIZER_EXE_PATH], CHARMONY_H_PATH):
-            command = [
-                CHARMONIZER_EXE_PATH,
-                '--cc=' + _quotify(compiler_name),
-                '--enable-c',
-                '--',
-                cflags
-            ]
-            if 'CHARM_VALGRIND' in os.environ:
-                command[0:0] = "valgrind", "--leak-check=yes";
-            print(" ".join(command))
-            subprocess.check_call(command)
-
-class lemon(_Command):
-    description = "Compile the Lemon parser generator"
-    user_options = []
-    def initialize_options(self):
-        pass
-    def finalize_options(self):
-        pass
-    def run(self):
-        if not os.path.exists(LEMON_EXE_PATH):
-            _run_make(['CC=' + _quotify(compiler_name)], directory=LEMON_DIR)
-
-class parsers(_Command):
-    description = "Run .y files through lemon"
-    user_options = []
-    def initialize_options(self):
-        pass
-    def finalize_options(self):
-        pass
-    def run(self):
-        for y_path in y_filepaths:
-            target = re.sub(r'y$', 'c', y_path)
-            if newer_group([y_path], target):
-                command = [LEMON_EXE_PATH, '-c', y_path]
-                subprocess.check_call(command)
-
-class my_clean(_clean):
-    def run(self):
-        _clean.run(self)
-        _run_make(command=['clean'], directory=LEMON_DIR)
-        for elem in paths_to_clean:
-            for path in glob.glob(elem):
-                print("removing " + path)
-                if os.path.isdir(path):
-                    shutil.rmtree(path)
-                else:
-                    os.unlink(path)
-
-class my_build(_build):
-    def run(self):
-        self.run_command('charmony')
-        self.run_command('lemon')
-        self.run_command('parsers')
-        _build.run(self)
-
-cfc_extension = Extension('clownfish._cfc',
-                          define_macros = [('CFCPYTHON', None)],
-                          include_dirs = [
-                              CFC_INCLUDE_DIR,
-                              CFC_SOURCE_DIR,
-                              os.curdir,
-                          ],
-                          sources = c_filepaths)
-
-setup(name = 'clownfish-cfc',
-      version = '0.3.0',
-      description = 'Clownfish compiler',
-      author = 'Apache Lucy Project',
-      author_email = 'dev at lucy dot apache dot org',
-      url = 'http://lucy.apache.org',
-      packages = ['clownfish.cfc',
-                 ],
-      cmdclass = {
-          'build': my_build,
-          'clean': my_clean,
-          'lemon': lemon,
-          'charmony': charmony,
-          'parsers': parsers,
-      },
-      ext_modules = [cfc_extension])
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/ruby/Rakefile
----------------------------------------------------------------------
diff --git a/clownfish/compiler/ruby/Rakefile b/clownfish/compiler/ruby/Rakefile
deleted file mode 100644
index 0811396..0000000
--- a/clownfish/compiler/ruby/Rakefile
+++ /dev/null
@@ -1,184 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-require 'rake/clean' 
-import '../../runtime/ruby/Rakefile.common'
-
-def rbconfig
-  RbConfig::CONFIG
-end
-
-def exe_path(*args)
-  File.join(args).ext(RbConfig::CONFIG["EXEEXT"])
-end
-
-BASE_PATH = '..'
-COMMON_SOURCE_DIR       = File.join(BASE_PATH, "common")
-CHARMONIZER_C           = File.join(COMMON_SOURCE_DIR, 'charmonizer.c')
-CHARMONIZER_EXE_PATH    = File.absolute_path(exe_path('charmonizer'))
-CHARMONIZER_ORIG_DIR    = File.absolute_path( File.join( BASE_PATH, '..', '..', 'charmonizer' ) )
-CHARMONY_H_PATH         = 'charmony.h'
-CHARMONY_RB_PATH        = 'Charmony.rb'
-CLOWNFISH_RUBY_DIR      = File.absolute_path('.')
-CLOWNFISH_INCLUDE_DIR   = File.join(CLOWNFISH_RUBY_DIR,'..','include')
-CLOWNFISH_RUNTIME       = File.join('..','..','runtime','ruby')
-CLOWNFISH_SRC_DIR       = File.join(CLOWNFISH_RUBY_DIR,'..','src')
-LEMON_SRC_DIR           = File.join('..','..','..','lemon')
-RUBY_EXT_CFC            = File.join('.','ext','Clownfish')
-
-
-desc "Build lemon"
-task :build_lemon => [:build_charmonizer_tests] do
-  puts "Building lemon"
-  run_make(LEMON_SRC_DIR,[])
-end
-
-desc "Build Clownfish"
-task :clownfish => [:parse_y_files] do
-  Dir.glob(File.join(CLOWNFISH_SRC_DIR, '**', '*.c')).each do|c_file|
-    obj_file = c_file.ext(rbconfig['OBJEXT'])
-    next if uptodate?(obj_file, [c_file])
-    command = "#{cc_command} #{includes} #{extra_ccflags} -o #{obj_file} -c #{c_file}"
-    puts command
-    if system(command).nil?
-      abort "Failed cc compile"
-    end
-  end
-  Rake::Task['cfc_ext'].invoke
-
-end
-
-# Clean up compiled object files.
-obj_glob = File.join(CLOWNFISH_SRC_DIR, '**', '*.' + rbconfig['OBJEXT'])
-Dir.glob(obj_glob).each do |file|
-  CLEAN.include(file);
-end
-
-desc "Build CFC Ext"
-task :cfc_ext => [:clownfish] do
-  makefile_path = File.join('ext', 'Clownfish', 'Makefile')
-  dependencies  = Dir.glob(File.join(CLOWNFISH_SRC_DIR, '**', '*.h'))
-  dependencies << File.join(RUBY_EXT_CFC, "extconf.rb")
-  dependencies << 'Rakefile'
-  if !uptodate?(makefile_path, dependencies)
-    Dir.chdir(RUBY_EXT_CFC) do
-      ruby 'extconf.rb'
-    end
-  end
-  Dir.chdir(RUBY_EXT_CFC) do
-    if system('make').nil?
-      abort "Failed to make cfc ruby extension"
-    end
-  end
-end
-
-# Clean up Ruby extension.
-Dir.glob(File.join('ext', '**', '*.' + rbconfig['OBJEXT'])).each do |file|
-  CLEAN.include(file);
-end
-Dir.glob(File.join('ext', '**', '*.' + rbconfig['DLEXT'])).each do |file|
-  CLEAN.include(file);
-end
-CLEAN.include(File.join('ext', 'Clownfish', 'Makefile'))
-
-desc "Lemonize the y file"
-task :parse_y_files => [:build_lemon] do
-  puts "Parsing y files"
-  Dir.glob(File.join(CLOWNFISH_SRC_DIR, '**', '*.y')).each do |y_file|
-    c_file = y_file.ext('c')
-    h_file = y_file.ext('h')
-    report_file = y_file.ext('out')
-    next if uptodate?(c_file, [y_file]);
-    command = File.join(LEMON_SRC_DIR,'lemon') + ' -c ' + y_file    
-    puts command
-    if system(command).nil?
-      abort "Problem parsing y file with lemon"
-    end
-  end
-  puts "Done."
-end
-
-desc "Building Charmonizer Tests"
-task :build_charmonizer_tests => [:charmony] do
-  puts "Building Charmonizer Tests"
-  flags = [
-    '-fno-common',
-    '-DFCRUBY',
-    '-fno-strict-aliasing',
-    '-pipe',
-    '-fstack-protector',
-    '-std=gnu99',
-    '-D_GNU_SOURCE',
-    '-I' + Dir.pwd
-  ].join(" ").gsub(/"/,'\"')
-
-  run_make( CHARMONIZER_ORIG_DIR, [ "DEFS=#{flags}", "tests"])
-end
-
-desc "Build and run charmonizer, creating charmony.h and charmony.rb"
-task :charmony do
-  # Compile charmonizer executable.
-  if !uptodate? CHARMONIZER_EXE_PATH, [CHARMONIZER_C]
-    outflag = cc_command.match(/cl\b/) ? "/Fe" : "-o "
-    command = "#{cc_command} #{outflag}#{CHARMONIZER_EXE_PATH} #{CHARMONIZER_C}"
-    puts command
-    if !system(command)
-      raise "Failed to compile #{CHARMONIZER_EXE_PATH}"
-    end
-  end
-
-  # Return if charmonizer output is current.
-  if uptodate? CHARMONY_RB_PATH, [CHARMONIZER_EXE_PATH]
-    next
-  end
-  puts "Running #{CHARMONIZER_EXE_PATH}...\n"
-
-  # Prepare arguments to charmonizer.
-  command = [
-    CHARMONIZER_EXE_PATH,
-    '--cc=' + quotify(cc_command),
-    '--enable-c',
-    '--enable-ruby',
-    '--',
-    all_ccflags,
-  ]
-  if (ENV['CHARM_VALGRIND'])
-    command.unshift("valgrind", "--leak-check=yes")
-  end
-
-  # Run charmonizer.
-  puts command.join(" ")
-  if !system(*command)
-    raise "Failed to run #{CHARMONIZER_EXE_PATH}: " + $?
-  end
-end
-CLEAN.include(CHARMONIZER_EXE_PATH)
-CLEAN.include(CHARMONY_H_PATH)
-CLEAN.include(CHARMONY_RB_PATH)
-# Clean up after charmonizer if it doesn't succeed on its own.
-CLEAN.include("_charm*")
-
-# Clean up after Lemonized files.
-Dir.glob(File.join(CLOWNFISH_SRC_DIR, '**', '*.y')).each do |y_file|
-  CLEAN.include(y_file.ext('c'))
-  CLEAN.include(y_file.ext('h'))
-  CLEAN.include(y_file.ext('out'))
-end
-
-task :default => [:clownfish]
-
-def includes
-  return "-I#{CLOWNFISH_INCLUDE_DIR} -I#{CLOWNFISH_SRC_DIR} -I#{CLOWNFISH_RUBY_DIR} -I#{CLOWNFISH_RUNTIME}"
-end

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/ruby/ext/Clownfish/CFC.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/ruby/ext/Clownfish/CFC.c b/clownfish/compiler/ruby/ext/Clownfish/CFC.c
deleted file mode 100644
index 4910ebf..0000000
--- a/clownfish/compiler/ruby/ext/Clownfish/CFC.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ruby.h"
-#include "CFC.h"
-
-static VALUE mClownfish;
-static VALUE mCFC;
-static VALUE mModel;
-static VALUE cHierarchy;
-static VALUE mBinding;
-static VALUE cBindCore;
-static VALUE cBindRuby;
-
-static VALUE
-S_CFC_Binding_Core_Alloc(VALUE klass) {
-    void *ptr = NULL;
-    return Data_Wrap_Struct(klass, NULL, NULL, ptr);
-}
-
-static VALUE
-S_CFC_Binding_Core_Init(VALUE self_rb, VALUE params) {
-
-    CFCHierarchy* hierarchy_obj;
-    CFCBindCore* self;
-
-    VALUE hierarchy = rb_hash_aref(params, ID2SYM(rb_intern("hierarchy"))); 
-    VALUE header    = rb_hash_aref(params, ID2SYM(rb_intern("header"))); 
-    VALUE footer    = rb_hash_aref(params, ID2SYM(rb_intern("footer"))); 
-
-    Data_Get_Struct(hierarchy, CFCHierarchy, hierarchy_obj);
-    Data_Get_Struct(self_rb, CFCBindCore, self);
-
-    self = CFCBindCore_new(hierarchy_obj, StringValuePtr(header), StringValuePtr(footer));
-
-    DATA_PTR(self_rb) = self;
-    return self_rb;
-}
-
-static VALUE
-S_CFC_Binding_Core_Write_All_Modified(int argc, VALUE *argv, VALUE self_rb) {
-    CFCBindCore *self;
-
-    int modified = argc > 0 && RTEST(argv[0]) ? 1 : 0;
-    Data_Get_Struct(self_rb, CFCBindCore, self);
-    return INT2NUM(CFCBindCore_write_all_modified(self, modified));
-}
-
-static void
-S_init_Binding_Core(void) {
-    cBindCore = rb_define_class_under(mBinding, "Core", rb_cObject);
-    rb_define_alloc_func(cBindCore, S_CFC_Binding_Core_Alloc);
-    rb_define_method(cBindCore, "initialize", S_CFC_Binding_Core_Init, 1);
-    rb_define_method(cBindCore, "write_all_modified",
-                     S_CFC_Binding_Core_Write_All_Modified, -1);
-}
-
-static VALUE
-S_CFC_Binding_Ruby_Alloc(VALUE klass) {
-    void *ptr = NULL;
-    return Data_Wrap_Struct(klass, NULL, NULL, ptr);
-}
-
-static VALUE
-S_CFC_Binding_Ruby_Init(VALUE self_rb, VALUE params) {
-
-    CFCHierarchy* hierarchy_obj;
-    CFCParcel* parcel_obj;
-    CFCRuby* self;
-
-    VALUE hierarchy  = rb_hash_aref(params, ID2SYM(rb_intern("hierarchy"))); 
-    VALUE parcel     = rb_hash_aref(params, ID2SYM(rb_intern("parcel"))); 
-    VALUE lib_dir    = rb_hash_aref(params, ID2SYM(rb_intern("lib_dir"))); 
-    VALUE boot_class = rb_hash_aref(params, ID2SYM(rb_intern("boot_class"))); 
-    VALUE header     = rb_hash_aref(params, ID2SYM(rb_intern("header"))); 
-    VALUE footer     = rb_hash_aref(params, ID2SYM(rb_intern("footer"))); 
-
-    parcel_obj = CFCParcel_new(StringValuePtr(parcel), NULL, NULL);
-    Data_Get_Struct(hierarchy, CFCHierarchy, hierarchy_obj);
-    Data_Get_Struct(self_rb, CFCRuby, self);
-
-    self = CFCRuby_new(parcel_obj, hierarchy_obj, StringValuePtr(lib_dir), StringValuePtr(boot_class),
-                                StringValuePtr(header), StringValuePtr(footer));
-    DATA_PTR(self_rb) = self;
-
-    return self_rb;
-}
-
-static VALUE
-S_CFC_Binding_Ruby_Write_Boot(VALUE self_rb) {
-
-    CFCRuby *self;
-    Data_Get_Struct(self_rb, CFCRuby, self);
-    CFCRuby_write_boot(self);
-
-    return Qnil;
-}
-
-static VALUE
-S_CFC_Binding_Ruby_Write_Hostdefs(VALUE self_rb) {
-
-    CFCRuby *self;
-    Data_Get_Struct(self_rb, CFCRuby, self);
-    CFCRuby_write_hostdefs(self);
-
-    return Qnil;
-}
-
-static void
-S_init_Binding_Ruby(void) {
-    cBindRuby = rb_define_class_under(mBinding, "Ruby", rb_cObject);
-    rb_define_alloc_func(cBindRuby, S_CFC_Binding_Ruby_Alloc);
-    rb_define_method(cBindRuby, "initialize", S_CFC_Binding_Ruby_Init, 1);
-    rb_define_method(cBindRuby, "write_boot",
-                     S_CFC_Binding_Ruby_Write_Boot, 0);
-    rb_define_method(cBindRuby, "write_hostdefs",
-                     S_CFC_Binding_Ruby_Write_Hostdefs, 0);
-}
-
-static VALUE
-S_CFC_Hierarchy_Alloc(VALUE klass) {
-    void *ptr = NULL;
-    return Data_Wrap_Struct(klass, NULL, NULL, ptr);
-}
-
-static VALUE
-S_CFC_Hierarchy_Init(VALUE self_rb, VALUE params) {
-    CFCHierarchy* self;
-  
-    VALUE dest = rb_hash_aref(params, ID2SYM(rb_intern("dest"))); 
-
-    Data_Get_Struct(self_rb, CFCHierarchy, self);
-
-    self = CFCHierarchy_new(StringValuePtr(dest));
-
-    DATA_PTR(self_rb) = self;
-    return self_rb;
-}
-
-static VALUE
-S_CFC_Hierarchy_Add_Source_Dir(VALUE self_rb, VALUE source_dir) {
-    CFCHierarchy *self;
-
-    Data_Get_Struct(self_rb, CFCHierarchy, self);
-    CFCHierarchy_add_source_dir(self, StringValuePtr(source_dir));
-
-    return Qnil;
-}
-
-static VALUE
-S_CFC_Hierarchy_Add_Include_Dir(VALUE self_rb, VALUE include_dir) {
-    CFCHierarchy *self;
-
-    Data_Get_Struct(self_rb, CFCHierarchy, self);
-    CFCHierarchy_add_include_dir(self, StringValuePtr(include_dir));
-
-    return Qnil;
-}
-
-static VALUE
-S_CFC_Hierarchy_Build(VALUE self_rb) {
-    CFCHierarchy *self;
-
-    Data_Get_Struct(self_rb, CFCHierarchy, self);
-    CFCHierarchy_build(self);
-
-    return Qnil;
-}
-
-static void
-S_init_Hierarchy(void) {
-    cHierarchy = rb_define_class_under(mModel, "Hierarchy", rb_cObject);
-    rb_define_alloc_func(cHierarchy, S_CFC_Hierarchy_Alloc);
-    rb_define_method(cHierarchy, "initialize", S_CFC_Hierarchy_Init, 1);
-    rb_define_method(cHierarchy, "build", S_CFC_Hierarchy_Build, 0);
-    rb_define_method(cHierarchy, "add_source_dir", S_CFC_Hierarchy_Add_Source_Dir, 1);
-    rb_define_method(cHierarchy, "add_include_dir", S_CFC_Hierarchy_Add_Include_Dir, 1);
-}
-
-void
-Init_CFC() { 
-    mClownfish  = rb_define_module("Clownfish");
-    mCFC        = rb_define_module_under(mClownfish, "CFC");
-    mBinding    = rb_define_module_under(mCFC, "Binding");
-    mModel      = rb_define_module_under(mCFC, "Model");
-    S_init_Binding_Core();
-    S_init_Binding_Ruby();
-    S_init_Hierarchy();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/ruby/ext/Clownfish/extconf.rb
----------------------------------------------------------------------
diff --git a/clownfish/compiler/ruby/ext/Clownfish/extconf.rb b/clownfish/compiler/ruby/ext/Clownfish/extconf.rb
deleted file mode 100644
index e644bcb..0000000
--- a/clownfish/compiler/ruby/ext/Clownfish/extconf.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-require 'mkmf'
-require 'rbconfig'
-
-CLOWNFISH_INCLUDE_DIR   = File.join('..','..','..','include')
-CLOWNFISH_SRC_DIR       = File.join('..','..','..','src')
-CLOWNFISH_RUNTIME       = File.join('..','..','..','..','runtime','ruby')
-$CFLAGS = "-I#{CLOWNFISH_INCLUDE_DIR} -I#{CLOWNFISH_SRC_DIR} -I#{CLOWNFISH_RUNTIME}"
-$objs = ['CFC.' + RbConfig::CONFIG['OBJEXT']]
-obj_glob = File.join(CLOWNFISH_SRC_DIR, '*.' + RbConfig::CONFIG['OBJEXT'])
-Dir.glob(obj_glob).each do|o|
-    $objs.push o
-end
-
-create_makefile 'CFC'

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/ruby/ext/example.rb
----------------------------------------------------------------------
diff --git a/clownfish/compiler/ruby/ext/example.rb b/clownfish/compiler/ruby/ext/example.rb
deleted file mode 100644
index 9cf923e..0000000
--- a/clownfish/compiler/ruby/ext/example.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-#! /usr/bin/env ruby
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Simple example on how to call CFC in ruby
-require_relative 'Clownfish/CFC'
-
-hierarchy = Clownfish::CFC::Model::Hierarchy.new(:dest => "autogen")
-hierarchy.build
-
-core_binding = Clownfish::CFC::Binding::Core.new(:hierarchy => hierarchy, :header => 'foobar', :footer => '')
-core_binding.write_all_modified

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBase.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBase.c b/clownfish/compiler/src/CFCBase.c
deleted file mode 100644
index bce7e70..0000000
--- a/clownfish/compiler/src/CFCBase.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCUtil.h"
-
-CFCBase*
-CFCBase_allocate(const CFCMeta *meta) {
-    CFCBase *self = (CFCBase*)CALLOCATE(meta->obj_alloc_size, 1);
-    self->refcount = 1;
-    self->meta = meta;
-    return self;
-}
-
-void
-CFCBase_destroy(CFCBase *self) {
-    FREEMEM(self);
-}
-
-CFCBase*
-CFCBase_incref(CFCBase *self) {
-    if (self) {
-        self->refcount++;
-    }
-    return self;
-}
-
-unsigned
-CFCBase_decref(CFCBase *self) {
-    if (!self) { return 0; }
-    unsigned modified_refcount = --self->refcount;
-    if (modified_refcount == 0) {
-        self->meta->destroy(self);
-    }
-    return modified_refcount;
-}
-
-unsigned
-CFCBase_get_refcount(CFCBase *self) {
-    return self->refcount;
-}
-
-const char*
-CFCBase_get_cfc_class(CFCBase *self) {
-    return self->meta->cfc_class;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBase.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBase.h b/clownfish/compiler/src/CFCBase.h
deleted file mode 100644
index 9117ae2..0000000
--- a/clownfish/compiler/src/CFCBase.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCBASE
-#define H_CFCBASE
-
-/** Clownfish::CFC::Base - Base class for all CFC objects.
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-
-typedef struct CFCBase CFCBase;
-typedef struct CFCMeta CFCMeta;
-typedef void (*CFCBase_destroy_t)(CFCBase *self);
-
-#ifdef CFC_NEED_BASE_STRUCT_DEF
-struct CFCBase {
-    const CFCMeta *meta;
-    int refcount;
-};
-#endif
-struct CFCMeta {
-    const char *cfc_class;
-    size_t obj_alloc_size;
-    CFCBase_destroy_t destroy;
-};
-
-/** Allocate a new CFC object.
- *
- * @param size Size of the desired allocation in bytes.
- * @param klass Class name.
- */
-CFCBase*
-CFCBase_allocate(const CFCMeta *meta);
-
-/** Clean up CFCBase member variables as necessary and free the object blob
- * itself.
- */
-void
-CFCBase_destroy(CFCBase *self);
-
-/** Increment the refcount of the object.
- *
- * @return the object itself, allowing an assignment idiom.
- */
-CFCBase*
-CFCBase_incref(CFCBase *self);
-
-/** Decrement the refcount of the object.
- *
- * @return the modified refcount.
- */
-unsigned
-CFCBase_decref(CFCBase *self);
-
-/** Return the CFC object's refcount.
- */
-unsigned
-CFCBase_get_refcount(CFCBase *self);
-
-/** Return the class name of the CFC object.  (Not the class name of any
- * parsed object the CFC object might represent.)
- */
-const char*
-CFCBase_get_cfc_class(CFCBase *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCBASE */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindAliases.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindAliases.c b/clownfish/compiler/src/CFCBindAliases.c
deleted file mode 100644
index 91da364..0000000
--- a/clownfish/compiler/src/CFCBindAliases.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include "CFCBindAliases.h"
-#include "CFCUtil.h"
-
-struct alias {
-    const char *from;
-    const char *to;
-};
-
-struct alias aliases[] = {
-    {NULL, NULL}
-};
-
-char*
-CFCBindAliases_c_aliases(void) {
-    size_t size = 200;
-    for (int i = 0; aliases[i].from != NULL; i++) {
-        size += strlen(aliases[i].from);
-        size += strlen(aliases[i].to);
-        size += sizeof("#define %s %s\n");
-    }
-    char *content = (char*)MALLOCATE(size);
-    content[0] = '\0';
-
-    strcat(content, "#ifndef CFISH_C_ALIASES\n#define CFISH_C_ALIASES\n\n");
-    for (int i = 0; aliases[i].from != NULL; i++) {
-        strcat(content, "#define ");
-        strcat(content, aliases[i].from);
-        strcat(content, " ");
-        strcat(content, aliases[i].to);
-        strcat(content, "\n");
-    }
-    strcat(content, "\n#endif /* CFISH_C_ALIASES */\n\n");
-
-    return content;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindAliases.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindAliases.h b/clownfish/compiler/src/CFCBindAliases.h
deleted file mode 100644
index f6b6988..0000000
--- a/clownfish/compiler/src/CFCBindAliases.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCBINDALIASES
-#define H_CFCBINDALIASES
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-char*
-CFCBindAliases_c_aliases(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCBINDALIASES */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindClass.c b/clownfish/compiler/src/CFCBindClass.c
deleted file mode 100644
index 2b0a53a..0000000
--- a/clownfish/compiler/src/CFCBindClass.c
+++ /dev/null
@@ -1,719 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_NEED_BASE_STRUCT_DEF
-
-#include <stdio.h>
-#include <string.h>
-#include "CFCBindClass.h"
-#include "CFCBindFunction.h"
-#include "CFCBindMethod.h"
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCFunction.h"
-#include "CFCMethod.h"
-#include "CFCParamList.h"
-#include "CFCParcel.h"
-#include "CFCType.h"
-#include "CFCVariable.h"
-#include "CFCUtil.h"
-
-struct CFCBindClass {
-    CFCBase base;
-    CFCClass *client;
-    char *short_names_macro;
-};
-
-// Generate C header for an inert class.
-static char*
-S_to_c_header_inert(CFCBindClass *self);
-
-// Generate C header for a dynamic class.
-static char*
-S_to_c_header_dynamic(CFCBindClass *self);
-
-// Create the definition for the instantiable object struct.
-static char*
-S_struct_definition(CFCBindClass *self);
-
-// Declare typedefs for fresh methods, to ease casting.
-static char*
-S_method_typedefs(CFCBindClass *self);
-
-// If class inherits from something, include the parent class's header.
-static char*
-S_parent_include(CFCBindClass *self);
-
-// Add a C function definition for each method and each function.
-static char*
-S_sub_declarations(CFCBindClass *self);
-
-// Declare class (a.k.a. "inert") variables.
-static char*
-S_inert_var_declarations(CFCBindClass *self);
-
-// Define method invocation inline functions.
-static char*
-S_method_defs(CFCBindClass *self);
-
-// Define short names for all of the symbols associated with this class.
-static char*
-S_short_names(CFCBindClass *self);
-
-static const CFCMeta CFCBINDCLASS_META = {
-    "Clownfish::CFC::Binding::Core::Class",
-    sizeof(CFCBindClass),
-    (CFCBase_destroy_t)CFCBindClass_destroy
-};
-
-CFCBindClass*
-CFCBindClass_new(CFCClass *client) {
-    CFCBindClass *self = (CFCBindClass*)CFCBase_allocate(&CFCBINDCLASS_META);
-    return CFCBindClass_init(self, client);
-}
-
-CFCBindClass*
-CFCBindClass_init(CFCBindClass *self, CFCClass *client) {
-    CFCUTIL_NULL_CHECK(client);
-    self->client = (CFCClass*)CFCBase_incref((CFCBase*)client);
-
-    const char *PREFIX = CFCClass_get_PREFIX(client);
-    self->short_names_macro = CFCUtil_sprintf("%sUSE_SHORT_NAMES", PREFIX);
-
-    return self;
-}
-
-void
-CFCBindClass_destroy(CFCBindClass *self) {
-    FREEMEM(self->short_names_macro);
-    CFCBase_decref((CFCBase*)self->client);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-char*
-CFCBindClass_to_c_header(CFCBindClass *self) {
-    if (CFCClass_inert(self->client)) {
-        // Inert classes only output inert functions and vars.
-        return S_to_c_header_inert(self);
-    }
-    else {
-        return S_to_c_header_dynamic(self);
-    }
-}
-
-static char*
-S_to_c_header_inert(CFCBindClass *self) {
-    char *inert_func_decs = S_sub_declarations(self);
-    char *inert_var_defs  = S_inert_var_declarations(self);
-    char *short_names     = S_short_names(self);
-
-    char pattern[] =
-        "/* Declare this class's inert variables.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Declare this class's inert functions.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Define \"short names\" for this class's symbols.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n";
-    char *content = CFCUtil_sprintf(pattern, inert_var_defs, inert_func_decs,
-                                    short_names);
-
-    FREEMEM(inert_var_defs);
-    FREEMEM(inert_func_decs);
-    FREEMEM(short_names);
-    return content;
-}
-
-static char*
-S_ivars_func(CFCBindClass *self) {
-    CFCClass *client = self->client;
-    const char *full_type    = CFCClass_full_struct_sym(client);
-    const char *full_func    = CFCClass_full_ivars_func(client);
-    const char *short_func   = CFCClass_short_ivars_func(client);
-    const char *full_struct  = CFCClass_full_ivars_struct(client);
-    const char *short_struct = CFCClass_short_ivars_struct(client);
-    const char *full_offset  = CFCClass_full_ivars_offset(client);
-    const char *PREFIX       = CFCClass_get_PREFIX(client);
-    char pattern[] =
-        "extern size_t %s;\n"
-        "typedef struct %s %s;\n"
-        "static CFISH_INLINE %s*\n"
-        "%s(%s *self) {\n"
-        "   char *ptr = (char*)self + %s;\n"
-        "   return (%s*)ptr;\n"
-        "}\n"
-        "#ifdef %sUSE_SHORT_NAMES\n"
-        "  #define %s %s\n"
-        "  #define %s %s\n"
-        "#endif\n";
-    char *content = CFCUtil_sprintf(pattern,
-                                    full_offset,
-                                    full_struct, full_struct,
-                                    full_struct,
-                                    full_func, full_type,
-                                    full_offset,
-                                    full_struct,
-                                    PREFIX,
-                                    short_struct, full_struct,
-                                    short_func, full_func);
-    return content;
-}
-
-static char*
-S_to_c_header_dynamic(CFCBindClass *self) {
-    const char *privacy_symbol  = CFCClass_privacy_symbol(self->client);
-    const char *vt_var          = CFCClass_full_vtable_var(self->client);
-    const char *PREFIX          = CFCClass_get_PREFIX(self->client);
-    char *ivars                 = S_ivars_func(self);
-    char *struct_def            = S_struct_definition(self);
-    char *parent_include        = S_parent_include(self);
-    char *sub_declarations      = S_sub_declarations(self);
-    char *inert_var_defs        = S_inert_var_declarations(self);
-    char *method_typedefs       = S_method_typedefs(self);
-    char *method_defs           = S_method_defs(self);
-    char *short_names           = S_short_names(self);
-
-    char pattern[] =
-        "/* Include the header for this class's parent. \n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Define the struct layout for instances of this class.\n"
-        " */\n"
-        "\n"
-        "#ifdef %s\n"
-        "%s\n"
-        "%s\n"
-        "#endif /* %s */\n"
-        "\n"
-        "/* Declare this class's inert variables.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Declare both this class's inert functions and the C functions which\n"
-        " * implement this class's dynamic methods.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Define typedefs for each dynamic method, allowing us to cast generic\n"
-        " * pointers to the appropriate function pointer type more cleanly.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Define the inline functions which implement this class's virtual methods.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Declare the VTable singleton for this class.\n"
-        " */\n"
-        "\n"
-        "extern %sVISIBLE cfish_VTable *%s;\n"
-        "\n"
-        "/* Define \"short names\" for this class's symbols.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n";
-    char *content
-        = CFCUtil_sprintf(pattern, parent_include, privacy_symbol, ivars,
-                          struct_def, privacy_symbol, inert_var_defs,
-                          sub_declarations, method_typedefs, method_defs,
-                          PREFIX, vt_var, short_names);
-
-    FREEMEM(ivars);
-    FREEMEM(struct_def);
-    FREEMEM(parent_include);
-    FREEMEM(sub_declarations);
-    FREEMEM(inert_var_defs);
-    FREEMEM(method_typedefs);
-    FREEMEM(method_defs);
-    FREEMEM(short_names);
-    return content;
-}
-
-char*
-CFCBindClass_to_c_data(CFCBindClass *self) {
-    CFCClass *client = self->client;
-    const char *class_name = CFCClass_get_class_name(client);
-
-    if (CFCClass_inert(client)) {
-        return CFCUtil_strdup("");
-    }
-
-    const char *ivars_offset = CFCClass_full_ivars_offset(client);
-
-    const char *vt_var    = CFCClass_full_vtable_var(client);
-
-    CFCMethod **methods  = CFCClass_methods(client);
-
-    char *offsets           = CFCUtil_strdup("");
-    char *method_defs       = CFCUtil_strdup("");
-    char *novel_ms_var      = CFCUtil_strdup("");
-    char *overridden_ms_var = CFCUtil_strdup("");
-    char *inherited_ms_var  = CFCUtil_strdup("");
-
-    for (int meth_num = 0; methods[meth_num] != NULL; meth_num++) {
-        CFCMethod *method = methods[meth_num];
-
-        // Define method offset variable.
-        char *full_offset_sym = CFCMethod_full_offset_sym(method, client);
-        offsets = CFCUtil_cat(offsets, "size_t ", full_offset_sym, ";\n",
-                              NULL);
-        FREEMEM(full_offset_sym);
-
-        const char *meth_class_name = CFCMethod_get_class_name(method);
-        int is_fresh = strcmp(class_name, meth_class_name) == 0;
-
-        // Create a default implementation for abstract methods.
-        if (is_fresh && CFCMethod_abstract(method)) {
-            char *method_def = CFCBindMeth_abstract_method_def(method);
-            method_defs = CFCUtil_cat(method_defs, method_def, "\n", NULL);
-            FREEMEM(method_def);
-        }
-
-        if (is_fresh && CFCMethod_novel(method)) {
-            if (novel_ms_var[0] == '\0') {
-                // Start an array of cfish_NovelMethSpec structs.  Since C89
-                // doesn't allow us to initialize a pointer to an anonymous
-                // array inside a global struct, we have to give it a real
-                // symbol and then store a pointer to that symbol inside the
-                // VTableSpec struct.
-                novel_ms_var
-                    = CFCUtil_cat(novel_ms_var,
-                                  "static const cfish_NovelMethSpec ",
-                                  vt_var, "_NOVEL_METHS[] = {\n", NULL);
-            }
-            else {
-                novel_ms_var = CFCUtil_cat(novel_ms_var, ",\n", NULL);
-            }
-            char *ms_def = CFCBindMeth_novel_spec_def(method);
-            novel_ms_var = CFCUtil_cat(novel_ms_var, ms_def, NULL);
-            FREEMEM(ms_def);
-        }
-        else if (is_fresh) {
-            if (overridden_ms_var[0] == '\0') {
-                // Start an array of cfish_OverriddenMethSpec structs.
-                overridden_ms_var
-                    = CFCUtil_cat(overridden_ms_var,
-                                  "static const cfish_OverriddenMethSpec ",
-                                  vt_var, "_OVERRIDDEN_METHS[] = {\n", NULL);
-            }
-            else {
-                overridden_ms_var
-                    = CFCUtil_cat(overridden_ms_var, ",\n", NULL);
-            }
-            char *ms_def = CFCBindMeth_overridden_spec_def(method, client);
-            overridden_ms_var = CFCUtil_cat(overridden_ms_var, ms_def, NULL);
-            FREEMEM(ms_def);
-        }
-        else {
-            if (inherited_ms_var[0] == '\0') {
-                // Start an array of cfish_InheritedMethSpec structs.
-                inherited_ms_var
-                    = CFCUtil_cat(inherited_ms_var,
-                                  "static const cfish_InheritedMethSpec ",
-                                  vt_var, "_INHERITED_METHS[] = {\n", NULL);
-            }
-            else {
-                inherited_ms_var = CFCUtil_cat(inherited_ms_var, ",\n", NULL);
-            }
-            char *ms_def = CFCBindMeth_inherited_spec_def(method, client);
-            inherited_ms_var = CFCUtil_cat(inherited_ms_var, ms_def, NULL);
-            FREEMEM(ms_def);
-        }
-    }
-
-    // Close MethSpec array definitions.
-    if (novel_ms_var[0] != '\0') {
-        novel_ms_var = CFCUtil_cat(novel_ms_var, "\n};\n\n", NULL);
-    }
-    if (overridden_ms_var[0] != '\0') {
-        overridden_ms_var = CFCUtil_cat(overridden_ms_var, "\n};\n\n", NULL);
-    }
-    if (inherited_ms_var[0] != '\0') {
-        inherited_ms_var = CFCUtil_cat(inherited_ms_var, "\n};\n\n", NULL);
-    }
-
-    const char pattern[] =
-        "/* Offset from the top of the object at which the IVARS struct\n"
-        " * can be found.\n"
-        " */\n"
-        "\n"
-        "size_t %s;\n"
-        "\n"
-        "/* Offsets for method pointers, measured in bytes, from the top\n"
-        " * of this class's vtable.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Define abstract methods of this class.\n"
-        " */\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "/* Define the MethSpec structs used during VTable initialization.\n"
-        " */\n"
-        "\n"
-        "%s"
-        "%s"
-        "%s"
-        "/* Define this class's VTable.\n"
-        " */\n"
-        "\n"
-        "cfish_VTable *%s;\n"
-        "\n";
-    char *code
-        = CFCUtil_sprintf(pattern, ivars_offset, offsets, method_defs,
-                          novel_ms_var, overridden_ms_var, inherited_ms_var,
-                          vt_var);
-
-    FREEMEM(offsets);
-    FREEMEM(method_defs);
-    FREEMEM(novel_ms_var);
-    FREEMEM(overridden_ms_var);
-    FREEMEM(inherited_ms_var);
-    return code;
-}
-
-// Create the definition for the instantiable object struct.
-static char*
-S_struct_definition(CFCBindClass *self) {
-    CFCClass *const client = self->client;
-    const char *struct_sym;
-    const char *prefix = CFCClass_get_prefix(client);
-    if (strcmp(prefix, "cfish_") == 0) {
-        struct_sym = CFCClass_full_struct_sym(client);
-    }
-    else {
-        struct_sym = CFCClass_full_ivars_struct(client);
-    }
-
-    // Count the number of member variables declared in ancestor classes
-    // outside this package so that we can skip over them.
-    int num_non_package_members = 0;
-    CFCParcel *parcel = CFCClass_get_parcel(client);
-    CFCClass *ancestor = CFCClass_get_parent(client);
-    while (ancestor && CFCClass_get_parcel(ancestor) == parcel) {
-        ancestor = CFCClass_get_parent(ancestor);
-    }
-    if (ancestor) {
-        num_non_package_members = CFCClass_num_member_vars(ancestor);
-    }
-
-    // Add all member variables declared by classes in this package.
-    CFCVariable **member_vars = CFCClass_member_vars(client);
-    char *member_decs = CFCUtil_strdup("");
-    for (int i = num_non_package_members; member_vars[i] != NULL; i++) {
-        const char *member_dec = CFCVariable_local_declaration(member_vars[i]);
-        size_t needed = strlen(member_decs) + strlen(member_dec) + 10;
-        member_decs = (char*)REALLOCATE(member_decs, needed);
-        strcat(member_decs, "\n    ");
-        strcat(member_decs, member_dec);
-    }
-
-    char pattern[] = "struct %s {\n    CFISH_OBJ_HEAD%s\n};\n";
-    char *struct_def = CFCUtil_sprintf(pattern, struct_sym, member_decs);
-
-    FREEMEM(member_decs);
-    return struct_def;
-}
-
-// Return C definition of the class's VTableSpec.
-char*
-CFCBindClass_spec_def(CFCBindClass *self) {
-    CFCClass *client = self->client;
-
-    CFCClass   *parent       = CFCClass_get_parent(client);
-    const char *class_name   = CFCClass_get_class_name(client);
-    const char *vt_var       = CFCClass_full_vtable_var(client);
-    const char *struct_sym   = CFCClass_full_struct_sym(client);
-    const char *ivars_struct = CFCClass_full_ivars_struct(client);
-    const char *prefix       = CFCClass_get_prefix(client);
-
-    // Create a pointer to the parent class's vtable.
-    char *parent_ref;
-    if (parent) {
-        parent_ref = CFCUtil_sprintf("&%s", CFCClass_full_vtable_var(parent));
-    }
-    else {
-        // No parent, e.g. Obj or inert classes.
-        parent_ref = CFCUtil_strdup("NULL");
-    }
-
-    int num_novel      = 0;
-    int num_overridden = 0;
-    int num_inherited  = 0;
-    CFCMethod **methods = CFCClass_methods(client);
-
-    for (int meth_num = 0; methods[meth_num] != NULL; meth_num++) {
-        CFCMethod *method = methods[meth_num];
-        const char *meth_class_name = CFCMethod_get_class_name(method);
-
-        if (strcmp(class_name, meth_class_name) == 0) {
-            if (CFCMethod_novel(method)) {
-                ++num_novel;
-            }
-            else {
-                ++num_overridden;
-            }
-        }
-        else {
-            ++num_inherited;
-        }
-    }
-
-    char *novel_ms_var      = num_novel
-                              ? CFCUtil_sprintf("%s_NOVEL_METHS", vt_var)
-                              : CFCUtil_strdup("NULL");
-    char *overridden_ms_var = num_overridden
-                              ? CFCUtil_sprintf("%s_OVERRIDDEN_METHS", vt_var)
-                              : CFCUtil_strdup("NULL");
-    char *inherited_ms_var  = num_inherited
-                              ? CFCUtil_sprintf("%s_INHERITED_METHS", vt_var)
-                              : CFCUtil_strdup("NULL");
-
-    const char *ivars_or_not = strcmp(prefix, "cfish_") == 0
-                               ? struct_sym : ivars_struct;
-    const char *ivars_offset_name = CFCClass_full_ivars_offset(client);
-
-    char pattern[] =
-        "    {\n"
-        "        &%s, /* vtable */\n"
-        "        %s, /* parent */\n"
-        "        \"%s\", /* name */\n"
-        "        sizeof(%s), /* ivars_size */\n"
-        "        &%s, /* ivars_offset_ptr */\n"
-        "        %d, /* num_novel */\n"
-        "        %d, /* num_overridden */\n"
-        "        %d, /* num_inherited */\n"
-        "        %s, /* novel_meth_specs */\n"
-        "        %s, /* overridden_meth_specs */\n"
-        "        %s /* inherited_meth_specs */\n"
-        "    }";
-    char *code
-        = CFCUtil_sprintf(pattern, vt_var, parent_ref, class_name,
-                          ivars_or_not, ivars_offset_name, num_novel,
-                          num_overridden, num_inherited, novel_ms_var,
-                          overridden_ms_var, inherited_ms_var);
-
-    FREEMEM(parent_ref);
-    FREEMEM(novel_ms_var);
-    FREEMEM(overridden_ms_var);
-    FREEMEM(inherited_ms_var);
-    return code;
-}
-
-// Declare host callbacks.
-char*
-CFCBindClass_callback_decs(CFCBindClass *self) {
-    CFCClass   *client        = self->client;
-    CFCMethod **fresh_methods = CFCClass_fresh_methods(client);
-    char       *cb_decs       = CFCUtil_strdup("");
-
-    for (int meth_num = 0; fresh_methods[meth_num] != NULL; meth_num++) {
-        CFCMethod *method = fresh_methods[meth_num];
-
-        // Declare callback.
-        if (CFCMethod_novel(method) && !CFCMethod_final(method)) {
-            char *cb_dec = CFCBindMeth_callback_dec(method);
-            cb_decs = CFCUtil_cat(cb_decs, cb_dec, "\n", NULL);
-            FREEMEM(cb_dec);
-        }
-    }
-
-    FREEMEM(fresh_methods);
-
-    return cb_decs;
-}
-
-// Declare typedefs for every method, to ease casting.
-static char*
-S_method_typedefs(CFCBindClass *self) {
-    CFCMethod** methods = CFCClass_methods(self->client);
-    char *typedefs = CFCUtil_strdup("");
-    for (int i = 0; methods[i] != NULL; i++) {
-        CFCMethod *method = methods[i];
-        char *typedef_str = CFCBindMeth_typedef_dec(method, self->client);
-        typedefs = CFCUtil_cat(typedefs, typedef_str, "\n", NULL);
-        FREEMEM(typedef_str);
-    }
-    return typedefs;
-}
-
-// If class inherits from something, include the parent class's header.
-static char*
-S_parent_include(CFCBindClass *self) {
-    char *parent_include = CFCUtil_strdup("");
-    CFCClass *parent = CFCClass_get_parent(self->client);
-    if (parent) {
-        parent_include = CFCUtil_cat(parent_include, "#include \"",
-                                     CFCClass_include_h(parent), "\"", NULL);
-    }
-    return parent_include;
-}
-
-// Add a C function definition for each method and each function.
-static char*
-S_sub_declarations(CFCBindClass *self) {
-    const char *PREFIX = CFCClass_get_PREFIX(self->client);
-    CFCFunction **functions = CFCClass_functions(self->client);
-    CFCMethod** fresh_methods = CFCClass_fresh_methods(self->client);
-    char *declarations = CFCUtil_strdup("");
-    for (int i = 0; functions[i] != NULL; i++) {
-        CFCFunction *func = functions[i];
-        char *dec = CFCBindFunc_func_declaration(func);
-        if (!CFCFunction_inline(func)) {
-            declarations = CFCUtil_cat(declarations, PREFIX, "VISIBLE ", NULL);
-        }
-        declarations = CFCUtil_cat(declarations, dec, "\n\n", NULL);
-        FREEMEM(dec);
-    }
-    for (int i = 0; fresh_methods[i] != NULL; i++) {
-        CFCMethod *method = fresh_methods[i];
-        char *dec = CFCBindMeth_imp_declaration(method);
-        if (CFCMethod_final(method)) {
-            declarations = CFCUtil_cat(declarations, PREFIX, "VISIBLE ", NULL);
-        }
-        declarations = CFCUtil_cat(declarations, dec, "\n\n", NULL);
-        FREEMEM(dec);
-    }
-    FREEMEM(fresh_methods);
-    return declarations;
-}
-
-// Declare class (a.k.a. "inert") variables.
-static char*
-S_inert_var_declarations(CFCBindClass *self) {
-    const char *PREFIX = CFCClass_get_PREFIX(self->client);
-    CFCVariable **inert_vars = CFCClass_inert_vars(self->client);
-    char *declarations = CFCUtil_strdup("");
-    for (int i = 0; inert_vars[i] != NULL; i++) {
-        const char *global_c = CFCVariable_global_c(inert_vars[i]);
-        declarations = CFCUtil_cat(declarations, "extern ", PREFIX, "VISIBLE ",
-                                   global_c, ";\n", NULL);
-    }
-    return declarations;
-}
-
-// Define method invocation inline functions.
-static char*
-S_method_defs(CFCBindClass *self) {
-    CFCMethod **methods = CFCClass_methods(self->client);
-    char *method_defs = CFCUtil_strdup("");
-    for (int i = 0; methods[i] != NULL; i++) {
-        CFCMethod *method = methods[i];
-        char *def = CFCBindMeth_method_def(method, self->client);
-        method_defs = CFCUtil_cat(method_defs, def, "\n", NULL);
-        FREEMEM(def);
-    }
-    return method_defs;
-}
-
-
-// Define short names for all of the symbols associated with this class.
-static char*
-S_short_names(CFCBindClass *self) {
-    CFCClass *client = self->client;
-    char *short_names = CFCUtil_strdup("");
-    short_names = CFCUtil_cat(short_names, "#ifdef ", self->short_names_macro,
-                              "\n", NULL);
-
-    if (!CFCClass_inert(client)) {
-        const char *short_struct = CFCClass_get_struct_sym(client);
-        const char *full_struct  = CFCClass_full_struct_sym(client);
-        const char *short_vt_var = CFCClass_short_vtable_var(client);
-        const char *full_vt_var  = CFCClass_full_vtable_var(client);
-        short_names = CFCUtil_cat(short_names, "  #define ",
-                                  short_struct, " ", full_struct, "\n",
-                                  "  #define ", short_vt_var, " ",
-                                  full_vt_var, "\n", NULL);
-    }
-
-    CFCFunction **functions = CFCClass_functions(client);
-    for (int i = 0; functions[i] != NULL; i++) {
-        CFCFunction *func = functions[i];
-        short_names = CFCUtil_cat(short_names, "  #define ",
-                                  CFCFunction_short_func_sym(func), " ",
-                                  CFCFunction_full_func_sym(func), "\n",
-                                  NULL);
-    }
-
-    CFCVariable **inert_vars = CFCClass_inert_vars(client);
-    for (int i = 0; inert_vars[i] != NULL; i++) {
-        CFCVariable *var = inert_vars[i];
-        short_names = CFCUtil_cat(short_names, "  #define ",
-                                  CFCVariable_short_sym(var), " ",
-                                  CFCVariable_full_sym(var), "\n", NULL);
-    }
-
-    if (!CFCClass_inert(client)) {
-        CFCMethod **fresh_methods = CFCClass_fresh_methods(client);
-        for (int i = 0; fresh_methods[i] != NULL; i++) {
-            CFCMethod *meth = fresh_methods[i];
-
-            // Implementing functions.
-            const char *short_imp  = CFCMethod_short_imp_func(meth);
-            const char *full_imp   = CFCMethod_imp_func(meth);
-            short_names = CFCUtil_cat(short_names, "  #define ", short_imp,
-                                      " ", full_imp, "\n", NULL);
-        }
-        FREEMEM(fresh_methods);
-
-        CFCMethod  **methods = CFCClass_methods(client);
-        for (int i = 0; methods[i] != NULL; i++) {
-            CFCMethod *meth = methods[i];
-            static const char pattern[] = "  #define %s %s\n";
-
-            // Method invocation symbols.
-            char *short_sym  = CFCMethod_short_method_sym(meth, client);
-            char *full_sym   = CFCMethod_full_method_sym(meth, client);
-            char *define_sym = CFCUtil_sprintf(pattern, short_sym, full_sym);
-            short_names = CFCUtil_cat(short_names, define_sym, NULL);
-            FREEMEM(short_sym);
-            FREEMEM(full_sym);
-            FREEMEM(define_sym);
-
-            // Method typedefs.
-            char *short_typedef  = CFCMethod_short_typedef(meth, client);
-            char *full_typedef   = CFCMethod_full_typedef(meth, client);
-            char *define_typedef = CFCUtil_sprintf(pattern, short_typedef,
-                                                   full_typedef);
-            short_names = CFCUtil_cat(short_names, define_typedef, NULL);
-            FREEMEM(short_typedef);
-            FREEMEM(full_typedef);
-            FREEMEM(define_typedef);
-        }
-    }
-    short_names = CFCUtil_cat(short_names, "#endif /* ",
-                              self->short_names_macro, " */\n", NULL);
-
-    return short_names;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCBindClass.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCBindClass.h b/clownfish/compiler/src/CFCBindClass.h
deleted file mode 100644
index 6cb9347..0000000
--- a/clownfish/compiler/src/CFCBindClass.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Binding::Core::Class - Generate core C code for a class.
- *
- * Clownfish::CFC::Model::Class is an abstract specification for a class.
- * This module autogenerates the C code with implements that specification.
- */
-
-#ifndef H_CFCBINDCLASS
-#define H_CFCBINDCLASS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCBindClass CFCBindClass;
-
-struct CFCClass;
-
-/**
- * @param client A Clownfish::CFC::Model::Class.
- */
-struct CFCBindClass*
-CFCBindClass_new(struct CFCClass *client);
-
-struct CFCBindClass*
-CFCBindClass_init(struct CFCBindClass *self, struct CFCClass *client);
-
-void
-CFCBindClass_destroy(CFCBindClass *self);
-
-/** Return the .h file which contains autogenerated C code defining the
- * class's interface: all method invocation functions, etc...
- */
-char*
-CFCBindClass_to_c_header(CFCBindClass *self);
-
-/** Return the C data definitions necessary for the class to function properly.
- */
-char*
-CFCBindClass_to_c_data(CFCBindClass *self);
-
-/** Return the autogenerated C definition of class's VTableSpec.
- */
-char*
-CFCBindClass_spec_def(CFCBindClass *self);
-
-/* Return the declarations of the host callbacks of this class.
- */
-char*
-CFCBindClass_callback_decs(CFCBindClass *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCBINDCLASS */
-


[lucy-commits] [10/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestMethod.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestMethod.c b/clownfish/compiler/src/CFCTestMethod.c
deleted file mode 100644
index cde5d7e..0000000
--- a/clownfish/compiler/src/CFCTestMethod.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCMethod.h"
-#include "CFCParamList.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCSymbol.h"
-#include "CFCTest.h"
-#include "CFCType.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-static void
-S_run_basic_tests(CFCTest *test);
-
-static void
-S_run_parser_tests(CFCTest *test);
-
-static void
-S_run_overridden_tests(CFCTest *test);
-
-static void
-S_run_final_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_METHOD = {
-    "Clownfish::CFC::Model::Method",
-    74,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    S_run_basic_tests(test);
-    S_run_parser_tests(test);
-    S_run_overridden_tests(test);
-    S_run_final_tests(test);
-}
-
-static void
-S_run_basic_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-    CFCParcel *neato_parcel
-        = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-
-    CFCType *return_type = CFCTest_parse_type(test, parser, "Obj*");
-    CFCParamList *param_list
-        = CFCTest_parse_param_list(test, parser,
-                                   "(Foo *self, int32_t count = 0)");
-    CFCMethod *method
-        = CFCMethod_new(neato_parcel, NULL, "Neato::Foo", "Foo",
-                        "Return_An_Obj", return_type, param_list,
-                        NULL, 0, 0);
-    OK(test, method != NULL, "new");
-    OK(test, CFCSymbol_parcel((CFCSymbol*)method),
-       "parcel exposure by default");
-
-    {
-        CFCMethod *dupe
-            = CFCMethod_new(neato_parcel, NULL, "Neato::Foo", "Foo",
-                            "Return_An_Obj", return_type, param_list,
-                            NULL, 0, 0);
-        OK(test, CFCMethod_compatible(method, dupe), "compatible");
-        CFCBase_decref((CFCBase*)dupe);
-    }
-
-    {
-        CFCMethod *macro_sym_differs
-            = CFCMethod_new(neato_parcel, NULL, "Neato::Foo", "Foo", "Eat",
-                            return_type, param_list, NULL, 0, 0);
-        OK(test, !CFCMethod_compatible(method, macro_sym_differs),
-           "different macro_sym spoils compatible");
-        OK(test, !CFCMethod_compatible(macro_sym_differs, method),
-           "... reversed");
-        CFCBase_decref((CFCBase*)macro_sym_differs);
-    }
-
-    {
-        static const char *param_strings[5] = {
-            "(Foo *self, int32_t count = 0, int b)",
-            "(Foo *self, int32_t count = 1)",
-            "(Foo *self, int32_t count)",
-            "(Foo *self, int32_t countess)",
-            "(Foo *self, uint32_t count = 0)"
-        };
-        static const char *test_names[5] = {
-            "extra param",
-            "different initial_value",
-            "missing initial_value",
-            "different param name",
-            "different param type"
-        };
-        for (int i = 0; i < 5; ++i) {
-            CFCParamList *other_param_list
-                = CFCTest_parse_param_list(test, parser, param_strings[i]);
-            CFCMethod *other
-                = CFCMethod_new(neato_parcel, NULL, "Neato::Foo", "Foo",
-                                "Return_An_Obj", return_type, other_param_list,
-                                NULL, 0, 0);
-            OK(test, !CFCMethod_compatible(method, other),
-               "%s spoils compatible", test_names[i]);
-            OK(test, !CFCMethod_compatible(other, method),
-               "... reversed");
-            CFCBase_decref((CFCBase*)other_param_list);
-            CFCBase_decref((CFCBase*)other);
-        }
-    }
-
-    {
-        CFCParamList *self_differs_list
-            = CFCTest_parse_param_list(test, parser,
-                                       "(Bar *self, int32_t count = 0)");
-        CFCMethod *self_differs
-            = CFCMethod_new(neato_parcel, NULL, "Neato::Bar", "Bar",
-                            "Return_An_Obj", return_type, self_differs_list,
-                            NULL, 0, 0);
-        OK(test, CFCMethod_compatible(method, self_differs),
-           "different self type still compatible(),"
-           " since can't test inheritance");
-        OK(test, CFCMethod_compatible(self_differs, method),
-           "... reversed");
-        CFCBase_decref((CFCBase*)self_differs_list);
-        CFCBase_decref((CFCBase*)self_differs);
-    }
-
-    {
-        CFCMethod *aliased
-            = CFCMethod_new(neato_parcel, NULL, "Neato::Foo", "Foo",
-                            "Aliased", return_type, param_list,
-                            NULL, 0, 0);
-        OK(test, !CFCMethod_get_host_alias(aliased),
-           "no host alias by default");
-        CFCMethod_set_host_alias(aliased, "Host_Alias");
-        STR_EQ(test, CFCMethod_get_host_alias(aliased), "Host_Alias",
-               "set/get host alias");
-        CFCBase_decref((CFCBase*)aliased);
-    }
-
-    {
-        CFCMethod *excluded
-            = CFCMethod_new(neato_parcel, NULL, "Neato::Foo", "Foo",
-                            "Excluded", return_type, param_list,
-                            NULL, 0, 0);
-        OK(test, !CFCMethod_excluded_from_host(excluded),
-           "not excluded by default");
-        CFCMethod_exclude_from_host(excluded);
-        OK(test, CFCMethod_excluded_from_host(excluded), "exclude from host");
-        CFCBase_decref((CFCBase*)excluded);
-    }
-
-    CFCBase_decref((CFCBase*)parser);
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)return_type);
-    CFCBase_decref((CFCBase*)param_list);
-    CFCBase_decref((CFCBase*)method);
-
-    CFCParcel_reap_singletons();
-}
-
-static void
-S_run_parser_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-    CFCParcel *neato_parcel
-        = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-    CFCParser_set_class_name(parser, "Neato::Obj");
-    CFCParser_set_class_cnick(parser, "Obj");
-
-    {
-        static const char *method_strings[4] = {
-            "public int Do_Foo(Obj *self);",
-            "Obj* Gimme_An_Obj(Obj *self);",
-            "void Do_Whatever(Obj *self, uint32_t a_num, float real);",
-            "Foo* Fetch_Foo(Obj *self, int num);",
-        };
-        for (int i = 0; i < 4; ++i) {
-            CFCMethod *method
-                = CFCTest_parse_method(test, parser, method_strings[i]);
-            CFCBase_decref((CFCBase*)method);
-        }
-    }
-
-    {
-        CFCMethod *method
-            = CFCTest_parse_method(test, parser,
-                                   "public final void The_End(Obj *self);");
-        OK(test, CFCMethod_final(method), "final");
-        CFCBase_decref((CFCBase*)method);
-    }
-
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)parser);
-
-    CFCParcel_reap_singletons();
-}
-
-static void
-S_run_overridden_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-    CFCParcel *neato_parcel
-        = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-    CFCType *return_type = CFCTest_parse_type(test, parser, "Obj*");
-
-    CFCParamList *param_list
-        = CFCTest_parse_param_list(test, parser, "(Foo *self)");
-    CFCMethod *orig
-        = CFCMethod_new(neato_parcel, NULL, "Neato::Foo", "Foo",
-                        "Return_An_Obj", return_type, param_list,
-                        NULL, 0, 0);
-
-    CFCParamList *overrider_param_list
-        = CFCTest_parse_param_list(test, parser, "(FooJr *self)");
-    CFCMethod *overrider
-        = CFCMethod_new(neato_parcel, NULL, "Neato::Foo::FooJr", "FooJr",
-                        "Return_An_Obj", return_type, overrider_param_list,
-                        NULL, 0, 0);
-
-    CFCMethod_override(overrider, orig);
-    OK(test, !CFCMethod_novel(overrider),
-       "A Method which overrides another is not 'novel'");
-
-    CFCBase_decref((CFCBase*)parser);
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)return_type);
-    CFCBase_decref((CFCBase*)param_list);
-    CFCBase_decref((CFCBase*)orig);
-    CFCBase_decref((CFCBase*)overrider_param_list);
-    CFCBase_decref((CFCBase*)overrider);
-
-    CFCParcel_reap_singletons();
-}
-
-static void
-S_run_final_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-    CFCParcel *neato_parcel
-        = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-    CFCClass *obj_class
-        = CFCTest_parse_class(test, parser, "class Obj {}");
-    CFCClass *foo_class
-        = CFCTest_parse_class(test, parser, "class Neato::Foo {}");
-    CFCClass *class_list[3] = { obj_class, foo_class, NULL };
-    CFCType *return_type = CFCTest_parse_type(test, parser, "Obj*");
-    CFCParamList *param_list
-        = CFCTest_parse_param_list(test, parser, "(Foo *self)");
-
-    CFCMethod *not_final
-        = CFCMethod_new(neato_parcel, NULL, "Neato::Foo", "Foo",
-                        "Return_An_Obj", return_type, param_list,
-                        NULL, 0, 0);
-    CFCMethod_resolve_types(not_final, class_list);
-    CFCMethod *final = CFCMethod_finalize(not_final);
-    OK(test, CFCMethod_compatible(not_final, final),
-       "finalize clones properly");
-    OK(test, !CFCMethod_final(not_final), "not final by default");
-    OK(test, CFCMethod_final(final), "finalize");
-
-    CFCBase_decref((CFCBase*)parser);
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)obj_class);
-    CFCBase_decref((CFCBase*)foo_class);
-    CFCBase_decref((CFCBase*)return_type);
-    CFCBase_decref((CFCBase*)param_list);
-    CFCBase_decref((CFCBase*)not_final);
-    CFCBase_decref((CFCBase*)final);
-
-    CFCClass_clear_registry();
-    CFCParcel_reap_singletons();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestParamList.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestParamList.c b/clownfish/compiler/src/CFCTestParamList.c
deleted file mode 100644
index 29ff226..0000000
--- a/clownfish/compiler/src/CFCTestParamList.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCParamList.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCTest.h"
-#include "CFCVariable.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_PARAM_LIST = {
-    "Clownfish::CFC::Model::ParamList",
-    23,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-    CFCParcel *neato_parcel
-        = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-    CFCClass *obj_class = CFCTest_parse_class(test, parser, "class Obj {}");
-    CFCClass *class_list[2] = { obj_class, NULL };
-
-    {
-        CFCParamList *param_list
-            = CFCTest_parse_param_list(test, parser, "(Obj *self, int num)");
-        CFCParamList_resolve_types(param_list, class_list);
-        OK(test, !CFCParamList_variadic(param_list), "not variadic");
-        STR_EQ(test, CFCParamList_to_c(param_list), "neato_Obj* self, int num",
-               "to_c");
-        STR_EQ(test, CFCParamList_name_list(param_list), "self, num",
-               "name_list");
-
-        CFCBase_decref((CFCBase*)param_list);
-    }
-
-    {
-        CFCParamList *param_list
-            = CFCTest_parse_param_list(test, parser,
-                                       "(Obj *self=NULL, int num, ...)");
-        CFCParamList_resolve_types(param_list, class_list);
-        OK(test, CFCParamList_variadic(param_list), "variadic");
-        STR_EQ(test, CFCParamList_to_c(param_list),
-               "neato_Obj* self, int num, ...", "to_c");
-        INT_EQ(test, CFCParamList_num_vars(param_list), 2, "num_vars");
-        const char **initial_values
-            = CFCParamList_get_initial_values(param_list);
-        STR_EQ(test, initial_values[0], "NULL", "initial_values[0]"); 
-        OK(test, initial_values[1] == NULL, "initial_values[1]");
-        CFCVariable **variables = CFCParamList_get_variables(param_list);
-        OK(test, variables[0] != NULL, "get_variables");
-        STR_EQ(test, CFCBase_get_cfc_class((CFCBase*)variables[0]),
-               "Clownfish::CFC::Model::Variable", "get_variables return type");
-
-        CFCBase_decref((CFCBase*)param_list);
-    }
-
-    {
-        CFCParamList *param_list
-            = CFCTest_parse_param_list(test, parser, "()");
-        CFCParamList_resolve_types(param_list, class_list);
-        STR_EQ(test, CFCParamList_to_c(param_list), "void", "to_c");
-        INT_EQ(test, CFCParamList_num_vars(param_list), 0, "num_vars");
-        CFCVariable **variables = CFCParamList_get_variables(param_list);
-        OK(test, variables[0] == NULL, "get_variables");
-
-        CFCBase_decref((CFCBase*)param_list);
-    }
-
-    CFCBase_decref((CFCBase*)parser);
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)obj_class);
-
-    CFCClass_clear_registry();
-    CFCParcel_reap_singletons();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestParcel.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestParcel.c b/clownfish/compiler/src/CFCTestParcel.c
deleted file mode 100644
index d91a271..0000000
--- a/clownfish/compiler/src/CFCTestParcel.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCParcel.h"
-#include "CFCSymbol.h"
-#include "CFCVersion.h"
-#include "CFCTest.h"
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_PARCEL = {
-    "Clownfish::CFC::Model::Parcel",
-    12,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    {
-        CFCParcel *parcel = CFCParcel_new("Foo", NULL, NULL, false);
-        OK(test, parcel != NULL, "new");
-        OK(test, !CFCParcel_included(parcel), "not included");
-        CFCBase_decref((CFCBase*)parcel);
-    }
-
-    {
-        CFCParcel *parcel = CFCParcel_new("Foo", NULL, NULL, true);
-        OK(test, CFCParcel_included(parcel), "included");
-        CFCBase_decref((CFCBase*)parcel);
-    }
-
-    {
-        const char *json =
-            "        {\n"
-            "            \"name\": \"Crustacean\",\n"
-            "            \"nickname\": \"Crust\",\n"
-            "            \"version\": \"v0.1.0\"\n"
-            "        }\n";
-        CFCParcel *parcel = CFCParcel_new_from_json(json, false);
-        OK(test, parcel != NULL, "new_from_json");
-        CFCBase_decref((CFCBase*)parcel);
-    }
-
-    {
-        const char *path = "t" CHY_DIR_SEP "cfbase" CHY_DIR_SEP "Animal.cfp";
-        CFCParcel *parcel = CFCParcel_new_from_file(path, false);
-        OK(test, parcel != NULL, "new_from_file");
-        CFCBase_decref((CFCBase*)parcel);
-    }
-
-    {
-        CFCParcel *parcel = CFCParcel_default_parcel();
-        CFCSymbol *thing = CFCSymbol_new(parcel, "parcel", NULL, NULL, "sym");
-        STR_EQ(test, CFCSymbol_get_prefix(thing), "",
-               "get_prefix with no parcel");
-        STR_EQ(test, CFCSymbol_get_Prefix(thing), "",
-               "get_Prefix with no parcel");
-        STR_EQ(test, CFCSymbol_get_PREFIX(thing), "",
-               "get_PREFIX with no parcel");
-        CFCBase_decref((CFCBase*)thing);
-    }
-
-    {
-        CFCParcel *parcel = CFCParcel_new("Crustacean", "Crust", NULL, false);
-        CFCParcel_register(parcel);
-        STR_EQ(test, CFCVersion_get_vstring(CFCParcel_get_version(parcel)),
-               "v0", "get_version");
-
-        CFCSymbol *thing = CFCSymbol_new(parcel, "parcel", NULL, NULL, "sym");
-        STR_EQ(test, CFCSymbol_get_prefix(thing), "crust_",
-               "get_prefix with parcel");
-        STR_EQ(test, CFCSymbol_get_Prefix(thing), "Crust_",
-               "get_Prefix with parcel");
-        STR_EQ(test, CFCSymbol_get_PREFIX(thing), "CRUST_",
-               "get_PREFIX with parcel");
-
-        CFCBase_decref((CFCBase*)thing);
-        CFCBase_decref((CFCBase*)parcel);
-    }
-
-    CFCParcel_reap_singletons();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestParser.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestParser.c b/clownfish/compiler/src/CFCTestParser.c
deleted file mode 100644
index 556a135..0000000
--- a/clownfish/compiler/src/CFCTestParser.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCMethod.h"
-#include "CFCParamList.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCSymbol.h"
-#include "CFCTest.h"
-#include "CFCType.h"
-#include "CFCUtil.h"
-#include "CFCVariable.h"
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-static void
-S_run_tests(CFCTest *test);
-
-static void
-S_test_initial_value(CFCTest *test, CFCParser *parser,
-                     const char *const *values, const char *type,
-                     const char *test_name);
-
-const CFCTestBatch CFCTEST_BATCH_PARSER = {
-    "Clownfish::CFC::Model::Parser",
-    203,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-    OK(test, parser != NULL, "new");
-
-    {
-        CFCParcel *fish = CFCTest_parse_parcel(test, parser, "parcel Fish;");
-
-        CFCParcel *registered
-            = CFCParcel_new("Crustacean", "Crust", NULL, false);
-        CFCParcel_register(registered);
-        CFCParcel *parcel
-            = CFCTest_parse_parcel(test, parser, "parcel Crustacean;");
-        OK(test, parcel == registered, "Fetch registered parcel");
-        OK(test, CFCParser_get_parcel(parser) == parcel,
-           "parcel_definition sets internal var");
-
-        CFCBase_decref((CFCBase*)fish);
-        CFCBase_decref((CFCBase*)registered);
-        CFCBase_decref((CFCBase*)parcel);
-    }
-
-    {
-        static const char *const specifiers[8] = {
-            "foo", "_foo", "foo_yoo", "FOO", "Foo", "fOO", "f00", "foo_foo_foo"
-        };
-        for (int i = 0; i < 8; ++i) {
-            const char *specifier = specifiers[i];
-            char *src = CFCUtil_sprintf("int32_t %s;", specifier);
-            CFCVariable *var = CFCTest_parse_variable(test, parser, src);
-            STR_EQ(test, CFCVariable_micro_sym(var), specifier,
-                   "identifier/declarator: %s", specifier);
-            FREEMEM(src);
-            CFCBase_decref((CFCBase*)var);
-        }
-    }
-
-    {
-        static const char *const specifiers[6] = {
-            "void", "float", "uint32_t", "int64_t", "uint8_t", "bool"
-        };
-        for (int i = 0; i < 6; ++i) {
-            const char *specifier = specifiers[i];
-            char *src = CFCUtil_sprintf("int32_t %s;", specifier);
-            CFCBase *result = CFCParser_parse(parser, src);
-            OK(test, result == NULL,
-               "reserved word not parsed as identifier: %s", specifier);
-            FREEMEM(src);
-            CFCBase_decref(result);
-        }
-    }
-
-    {
-        static const char *const type_strings[7] = {
-            "bool", "const char *", "Obj*", "i32_t", "char[]", "long[1]",
-            "i64_t[30]"
-        };
-        for (int i = 0; i < 7; ++i) {
-            const char *type_string = type_strings[i];
-            CFCType *type = CFCTest_parse_type(test, parser, type_string);
-            CFCBase_decref((CFCBase*)type);
-        }
-    }
-
-    {
-        static const char *const class_names[7] = {
-            "ByteBuf", "Obj", "ANDMatcher", "Foo", "FooJr", "FooIII", "Foo4th"
-        };
-        CFCClass *class_list[8];
-        for (int i = 0; i < 7; ++i) {
-            char *class_code = CFCUtil_sprintf("class %s {}", class_names[i]);
-            CFCClass *klass = CFCTest_parse_class(test, parser, class_code);
-            class_list[i] = klass;
-            FREEMEM(class_code);
-        }
-        class_list[7] = NULL;
-        for (int i = 0; i < 7; ++i) {
-            const char *class_name = class_names[i];
-            char *src      = CFCUtil_sprintf("%s*", class_name);
-            char *expected = CFCUtil_sprintf("crust_%s", class_name);
-            CFCType *type = CFCTest_parse_type(test, parser, src);
-            CFCType_resolve(type, class_list);
-            STR_EQ(test, CFCType_get_specifier(type), expected,
-                   "object_type_specifier: %s", class_name);
-            FREEMEM(src);
-            FREEMEM(expected);
-            CFCBase_decref((CFCBase*)type);
-        }
-        for (int i = 0; i < 7; ++i) {
-            CFCBase_decref((CFCBase*)class_list[i]);
-        }
-        CFCClass_clear_registry();
-    }
-
-    {
-        CFCType *type = CFCTest_parse_type(test, parser, "const char");
-        OK(test, CFCType_const(type), "type_qualifier const");
-        CFCBase_decref((CFCBase*)type);
-    }
-
-    {
-        static const char *const exposures[2] = {
-            "public", ""
-        };
-        static int (*const accessors[2])(CFCSymbol *sym) = {
-            CFCSymbol_public, CFCSymbol_parcel
-        };
-        for (int i = 0; i < 2; ++i) {
-            const char *exposure = exposures[i];
-            char *src = CFCUtil_sprintf("%s inert int32_t foo;", exposure);
-            CFCVariable *var = CFCTest_parse_variable(test, parser, src);
-            OK(test, accessors[i]((CFCSymbol*)var), "exposure_specifier %s",
-               exposure);
-            FREEMEM(src);
-            CFCBase_decref((CFCBase*)var);
-        }
-    }
-
-    {
-        static const char *const hex_constants[] = {
-            "0x1", "0x0a", "0xFFFFFFFF", "-0xFC", NULL
-        };
-        S_test_initial_value(test, parser, hex_constants, "int32_t",
-                             "hex_constant:");
-    }
-
-    {
-        static const char *const integer_constants[] = {
-            "1", "-9999", "0", "10000", NULL
-        };
-        S_test_initial_value(test, parser, integer_constants, "int32_t",
-                             "integer_constant:");
-    }
-
-    {
-        static const char *const float_constants[] = {
-            "1.0", "-9999.999", "0.1", "0.0", NULL
-        };
-        S_test_initial_value(test, parser, float_constants, "double",
-                             "float_constant:");
-    }
-
-    {
-        static const char *const string_literals[] = {
-            "\"blah\"", "\"blah blah\"", "\"\\\"blah\\\" \\\"blah\\\"\"", NULL
-        };
-        S_test_initial_value(test, parser, string_literals, "String*",
-                             "string_literal:");
-    }
-
-    {
-        static const char *const composites[5] = {
-            "int[]", "i32_t **", "Foo **", "Foo ***", "const void *"
-        };
-        for (int i = 0; i < 5; ++i) {
-            const char *composite = composites[i];
-            CFCType *type = CFCTest_parse_type(test, parser, composite);
-            OK(test, CFCType_is_composite(type), "composite_type: %s",
-               composite);
-            CFCBase_decref((CFCBase*)type);
-        }
-    }
-
-    {
-        static const char *const object_types[5] = {
-            "Obj *", "incremented Foo*", "decremented String *"
-        };
-        for (int i = 0; i < 3; ++i) {
-            const char *object_type = object_types[i];
-            CFCType *type = CFCTest_parse_type(test, parser, object_type);
-            OK(test, CFCType_is_object(type), "object_type: %s",
-               object_type);
-            CFCBase_decref((CFCBase*)type);
-        }
-    }
-
-    {
-        static const char *const param_list_strings[3] = {
-            "()",
-            "(int foo)",
-            "(Obj *foo, Foo **foo_ptr)"
-        };
-        for (int i = 0; i < 3; ++i) {
-            const char *param_list_string = param_list_strings[i];
-            CFCParamList *param_list
-                = CFCTest_parse_param_list(test, parser, param_list_string);
-            INT_EQ(test, CFCParamList_num_vars(param_list), i,
-                   "param list num_vars: %d", i);
-            CFCBase_decref((CFCBase*)param_list);
-        }
-    }
-
-    {
-        CFCParamList *param_list
-            = CFCTest_parse_param_list(test, parser, "(int foo, ...)");
-        OK(test, CFCParamList_variadic(param_list), "variadic param list");
-        CFCBase_decref((CFCBase*)param_list);
-    }
-
-    {
-        const char *param_list_string =
-            "(int foo = 0xFF, char *bar =\"blah\")";
-        CFCParamList *param_list
-            = CFCTest_parse_param_list(test, parser, param_list_string);
-        const char **initial_values
-            = CFCParamList_get_initial_values(param_list);
-        STR_EQ(test, initial_values[0], "0xFF",
-               "param list initial_values[0]");
-        STR_EQ(test, initial_values[1], "\"blah\"",
-               "param list initial_values[1]");
-        OK(test, initial_values[2] == NULL, "param list initial_values[2]");
-        CFCBase_decref((CFCBase*)param_list);
-    }
-
-    {
-        CFCParser_set_class_name(parser, "Stuff::Obj");
-        CFCParser_set_class_cnick(parser, "Obj");
-
-        const char *method_string =
-            "public Foo* Spew_Foo(Obj *self, uint32_t *how_many);";
-        CFCMethod *method = CFCTest_parse_method(test, parser, method_string);
-        CFCBase_decref((CFCBase*)method);
-
-        const char *var_string =
-            "public inert Hash *hash;";
-        CFCVariable *var = CFCTest_parse_variable(test, parser, var_string);
-        CFCBase_decref((CFCBase*)var);
-    }
-
-    {
-        static const char *const class_names[4] = {
-            "Foo", "Foo::FooJr", "Foo::FooJr::FooIII",
-            "Foo::FooJr::FooIII::Foo4th"
-        };
-        for (int i = 0; i < 4; ++i) {
-            const char *class_name = class_names[i];
-            char *class_string = CFCUtil_sprintf("class %s { }", class_name);
-            CFCClass *klass
-                = CFCTest_parse_class(test, parser, class_string);
-            STR_EQ(test, CFCClass_get_class_name(klass), class_name,
-                   "class_name: %s", class_name);
-            FREEMEM(class_string);
-            CFCBase_decref((CFCBase*)klass);
-        }
-    }
-
-    {
-        static const char *const cnicks[2] =  { "Food", "FF" };
-        for (int i = 0; i < 2; ++i) {
-            const char *cnick = cnicks[i];
-            char *class_string
-                = CFCUtil_sprintf("class Foodie%s cnick %s { }", cnick, cnick);
-            CFCClass *klass
-                = CFCTest_parse_class(test, parser, class_string);
-            STR_EQ(test, CFCClass_get_cnick(klass), cnick, "cnick: %s", cnick);
-            FREEMEM(class_string);
-            CFCBase_decref((CFCBase*)klass);
-        }
-    }
-
-    CFCBase_decref((CFCBase*)parser);
-
-    CFCClass_clear_registry();
-    CFCParcel_reap_singletons();
-}
-
-static void
-S_test_initial_value(CFCTest *test, CFCParser *parser,
-                     const char *const *values, const char *type,
-                     const char *test_name) {
-    for (int i = 0; values[i]; ++i) {
-        const char *value = values[i];
-        char *src = CFCUtil_sprintf("(%s foo = %s)", type, value);
-        CFCParamList *param_list
-            = CFCTest_parse_param_list(test, parser, src);
-        const char **initial_values
-            = CFCParamList_get_initial_values(param_list);
-        STR_EQ(test, initial_values[0], value, "%s %s", test_name, value);
-        FREEMEM(src);
-        CFCBase_decref((CFCBase*)param_list);
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestSymbol.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestSymbol.c b/clownfish/compiler/src/CFCTestSymbol.c
deleted file mode 100644
index 8f6518e..0000000
--- a/clownfish/compiler/src/CFCTestSymbol.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCParcel.h"
-#include "CFCSymbol.h"
-#include "CFCTest.h"
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_SYMBOL = {
-    "Clownfish::CFC::Model::Symbol",
-    28,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCParcel *parcel = CFCParcel_default_parcel();
-
-    {
-        static const char *exposures[4] = {
-            "public", "private", "parcel", "local"
-        };
-        static int (*accessors[4])(CFCSymbol *sym) = {
-            CFCSymbol_public,
-            CFCSymbol_private,
-            CFCSymbol_parcel,
-            CFCSymbol_local
-        };
-        for (int i = 0; i < 4; ++i) {
-            CFCSymbol *symbol
-                = CFCSymbol_new(parcel, exposures[i], NULL, NULL, "sym");
-            for (int j = 0; j < 4; ++j) {
-                int has_exposure = accessors[j](symbol);
-                if (i == j) {
-                    OK(test, has_exposure, "exposure %s", exposures[i]);
-                }
-                else {
-                    OK(test, !has_exposure, "%s means not %s", exposures[i],
-                       exposures[j]);
-                }
-            }
-            CFCBase_decref((CFCBase*)symbol);
-        }
-    }
-
-    {
-        CFCSymbol *foo = CFCSymbol_new(parcel, "parcel", "Foo", NULL, "sym");
-        CFCSymbol *foo_jr
-            = CFCSymbol_new(parcel, "parcel", "Foo::FooJr", NULL, "sym");
-
-        int equal = CFCSymbol_equals(foo, foo_jr);
-        OK(test, !equal, "different class_name spoils equals");
-        const char *foo_jr_name = CFCSymbol_get_class_name(foo_jr);
-        STR_EQ(test, foo_jr_name, "Foo::FooJr", "get_class_name");
-        const char *foo_jr_cnick = CFCSymbol_get_class_cnick(foo_jr);
-        STR_EQ(test, foo_jr_cnick, "FooJr",
-               "derive class_cnick from class_name");
-
-        CFCBase_decref((CFCBase*)foo);
-        CFCBase_decref((CFCBase*)foo_jr);
-    }
-
-    {
-        CFCSymbol *public_exposure
-            = CFCSymbol_new(parcel, "public", NULL, NULL, "sym");
-        CFCSymbol *parcel_exposure
-            = CFCSymbol_new(parcel, "parcel", NULL, NULL, "sym");
-        int equal = CFCSymbol_equals(public_exposure, parcel_exposure);
-        OK(test, !equal, "different exposure spoils equals");
-        CFCBase_decref((CFCBase*)public_exposure);
-        CFCBase_decref((CFCBase*)parcel_exposure);
-    }
-
-    {
-        CFCParcel *lucifer_parcel
-            = CFCParcel_new("Lucifer", NULL, NULL, false);
-        CFCParcel_register(lucifer_parcel);
-        CFCSymbol *lucifer
-            = CFCSymbol_new(lucifer_parcel, "parcel", NULL, NULL, "sym");
-
-        CFCParcel *symbol_parcel = CFCSymbol_get_parcel(lucifer);
-        OK(test, symbol_parcel == lucifer_parcel, "derive parcel");
-        const char *prefix = CFCSymbol_get_prefix(lucifer);
-        STR_EQ(test, prefix, "lucifer_", "get_prefix");
-        const char *Prefix = CFCSymbol_get_Prefix(lucifer);
-        STR_EQ(test, Prefix, "Lucifer_", "get_Prefix");
-        const char *PREFIX = CFCSymbol_get_PREFIX(lucifer);
-        STR_EQ(test, PREFIX, "LUCIFER_", "get_PREFIX");
-
-        CFCParcel *luser_parcel = CFCParcel_new("Luser", NULL, NULL, false);
-        CFCParcel_register(luser_parcel);
-        CFCSymbol *luser
-            = CFCSymbol_new(luser_parcel, "parcel", NULL, NULL, "sym");
-        int equal = CFCSymbol_equals(lucifer, luser);
-        OK(test, !equal, "different exposure spoils equals");
-
-        CFCBase_decref((CFCBase*)lucifer_parcel);
-        CFCBase_decref((CFCBase*)lucifer);
-        CFCBase_decref((CFCBase*)luser_parcel);
-        CFCBase_decref((CFCBase*)luser);
-    }
-
-    {
-        CFCSymbol *ooga = CFCSymbol_new(parcel, "parcel", NULL, NULL, "ooga");
-        CFCSymbol *booga
-            = CFCSymbol_new(parcel, "parcel", NULL, NULL, "booga");
-        int equal = CFCSymbol_equals(ooga, booga);
-        OK(test, !equal, "different micro_sym spoils equals");
-        CFCBase_decref((CFCBase*)ooga);
-        CFCBase_decref((CFCBase*)booga);
-    }
-
-    {
-        CFCParcel *eep_parcel = CFCParcel_new("Eep", NULL, NULL, false);
-        CFCParcel_register(eep_parcel);
-        CFCSymbol *eep
-            = CFCSymbol_new(eep_parcel, "parcel", "Op::Ork", NULL, "ah_ah");
-        const char *short_sym = CFCSymbol_short_sym(eep);
-        STR_EQ(test, short_sym, "Ork_ah_ah", "short_sym");
-        const char *full_sym = CFCSymbol_full_sym(eep);
-        STR_EQ(test, full_sym, "eep_Ork_ah_ah", "full_sym");
-        CFCBase_decref((CFCBase*)eep_parcel);
-        CFCBase_decref((CFCBase*)eep);
-    }
-
-    CFCParcel_reap_singletons();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestType.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestType.c b/clownfish/compiler/src/CFCTestType.c
deleted file mode 100644
index f452767..0000000
--- a/clownfish/compiler/src/CFCTestType.c
+++ /dev/null
@@ -1,545 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCTest.h"
-#include "CFCType.h"
-#include "CFCUtil.h"
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-static void
-S_run_tests(CFCTest *test);
-
-static void
-S_run_basic_tests(CFCTest *test);
-
-static void
-S_run_primitive_tests(CFCTest *test);
-
-static void
-S_run_integer_tests(CFCTest *test);
-
-static void
-S_run_float_tests(CFCTest *test);
-
-static void
-S_run_void_tests(CFCTest *test);
-
-static void
-S_run_object_tests(CFCTest *test);
-
-static void
-S_run_va_list_tests(CFCTest *test);
-
-static void
-S_run_arbitrary_tests(CFCTest *test);
-
-static void
-S_run_composite_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_TYPE = {
-    "Clownfish::CFC::Model::Type",
-    360,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    S_run_basic_tests(test);
-    S_run_primitive_tests(test);
-    S_run_integer_tests(test);
-    S_run_float_tests(test);
-    S_run_void_tests(test);
-    S_run_object_tests(test);
-    S_run_va_list_tests(test);
-    S_run_arbitrary_tests(test);
-    S_run_composite_tests(test);
-}
-
-static void
-S_run_basic_tests(CFCTest *test) {
-    CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, false);
-    CFCParcel_register(neato_parcel);
-    CFCType *type = CFCType_new(0, neato_parcel, "mytype_t", 0);
-
-    OK(test, CFCType_get_parcel(type) == neato_parcel, "get_parcel");
-    STR_EQ(test, CFCType_to_c(type), "mytype_t", "to_c");
-    STR_EQ(test, CFCType_get_specifier(type), "mytype_t", "get_specifier");
-
-#define TEST_BOOL_ACCESSOR(type, name) \
-    OK(test, !CFCType_ ## name(type), #name " false by default");
-
-    TEST_BOOL_ACCESSOR(type, const);
-    TEST_BOOL_ACCESSOR(type, nullable);
-    TEST_BOOL_ACCESSOR(type, incremented);
-    TEST_BOOL_ACCESSOR(type, decremented);
-    TEST_BOOL_ACCESSOR(type, is_void);
-    TEST_BOOL_ACCESSOR(type, is_object);
-    TEST_BOOL_ACCESSOR(type, is_primitive);
-    TEST_BOOL_ACCESSOR(type, is_integer);
-    TEST_BOOL_ACCESSOR(type, is_floating);
-    TEST_BOOL_ACCESSOR(type, is_string_type);
-    TEST_BOOL_ACCESSOR(type, is_va_list);
-    TEST_BOOL_ACCESSOR(type, is_arbitrary);
-    TEST_BOOL_ACCESSOR(type, is_composite);
-
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)type);
-
-    CFCParcel_reap_singletons();
-}
-
-static void
-S_run_primitive_tests(CFCTest *test) {
-    CFCParcel *parcel = CFCParcel_default_parcel();
-    CFCType *type = CFCType_new(CFCTYPE_PRIMITIVE, parcel, "hump_t", 0);
-    OK(test, CFCType_is_primitive(type), "is_primitive");
-
-    {
-        CFCType *twin = CFCType_new(CFCTYPE_PRIMITIVE, parcel, "hump_t", 0);
-        OK(test, CFCType_equals(type, twin), "equals");
-        CFCBase_decref((CFCBase*)twin);
-    }
-
-    {
-        CFCType *other = CFCType_new(CFCTYPE_PRIMITIVE, parcel, "dump_t", 0);
-        OK(test, !CFCType_equals(type, other), "equals spoiled by specifier");
-        CFCBase_decref((CFCBase*)other);
-    }
-
-    {
-        CFCType *other = CFCType_new(CFCTYPE_PRIMITIVE|CFCTYPE_CONST, parcel,
-                                     "hump_t", 0);
-        OK(test, !CFCType_equals(type, other), "equals spoiled by const");
-        CFCBase_decref((CFCBase*)other);
-    }
-
-    CFCBase_decref((CFCBase*)type);
-}
-
-static void
-S_run_integer_tests(CFCTest *test) {
-    {
-        CFCType *type = CFCType_new_integer(CFCTYPE_CONST, "int32_t");
-        OK(test, CFCType_const(type), "const");
-        STR_EQ(test, CFCType_get_specifier(type), "int32_t", "get_specifier");
-        STR_EQ(test, CFCType_to_c(type), "const int32_t",
-               "'const' in C representation");
-        CFCBase_decref((CFCBase*)type);
-    }
-
-    {
-        CFCParser *parser = CFCParser_new();
-        static const char *specifiers[14] = {
-            "bool",
-            "char",
-            "short",
-            "int",
-            "long",
-            "size_t",
-            "int8_t",
-            "int16_t",
-            "int32_t",
-            "int64_t",
-            "uint8_t",
-            "uint16_t",
-            "uint32_t",
-            "uint64_t"
-        };
-        for (int i = 0; i < 14; ++i) {
-            const char *specifier = specifiers[i];
-            CFCType *type;
-
-            type = CFCTest_parse_type(test, parser, specifier);
-            OK(test, CFCType_is_integer(type), "%s is_integer", specifier);
-            CFCBase_decref((CFCBase*)type);
-
-            char *const_specifier = CFCUtil_sprintf("const %s", specifier);
-            type = CFCTest_parse_type(test, parser, const_specifier);
-            OK(test, CFCType_is_integer(type), "%s is_integer",
-               const_specifier);
-            OK(test, CFCType_const(type), "%s is const", const_specifier);
-            FREEMEM(const_specifier);
-            CFCBase_decref((CFCBase*)type);
-        }
-        CFCBase_decref((CFCBase*)parser);
-    }
-}
-
-static void
-S_run_float_tests(CFCTest *test) {
-    {
-        CFCType *type = CFCType_new_float(CFCTYPE_CONST, "float");
-        OK(test, CFCType_const(type), "const");
-        STR_EQ(test, CFCType_get_specifier(type), "float", "get_specifier");
-        STR_EQ(test, CFCType_to_c(type), "const float",
-               "'const' in C representation");
-        CFCBase_decref((CFCBase*)type);
-    }
-
-    {
-        CFCParser *parser = CFCParser_new();
-        static const char *specifiers[2] = {
-            "float",
-            "double"
-        };
-        for (int i = 0; i < 2; ++i) {
-            const char *specifier = specifiers[i];
-            CFCType *type;
-
-            type = CFCTest_parse_type(test, parser, specifier);
-            OK(test, CFCType_is_floating(type), "%s is_floating", specifier);
-            CFCBase_decref((CFCBase*)type);
-
-            char *const_specifier = CFCUtil_sprintf("const %s", specifier);
-            type = CFCTest_parse_type(test, parser, const_specifier);
-            OK(test, CFCType_is_floating(type), "%s is_floating",
-               const_specifier);
-            OK(test, CFCType_const(type), "%s is const", const_specifier);
-            FREEMEM(const_specifier);
-            CFCBase_decref((CFCBase*)type);
-        }
-        CFCBase_decref((CFCBase*)parser);
-    }
-}
-
-static void
-S_run_void_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-
-    {
-        CFCType *type = CFCType_new_void(false);
-        STR_EQ(test, CFCType_get_specifier(type), "void", "get_specifier");
-        STR_EQ(test, CFCType_to_c(type), "void", "to_c");
-        OK(test, CFCType_is_void(type), "is_void");
-        CFCBase_decref((CFCBase*)type);
-    }
-
-    {
-        CFCType *type = CFCType_new_void(true);
-        STR_EQ(test, CFCType_to_c(type), "const void",
-               "'const' in C representation");
-        CFCBase_decref((CFCBase*)type);
-    }
-
-    {
-        CFCType *type = CFCTest_parse_type(test, parser, "void");
-        OK(test, CFCType_is_void(type), "void is_void");
-        CFCBase_decref((CFCBase*)type);
-    }
-
-    {
-        CFCType *type = CFCTest_parse_type(test, parser, "const void");
-        OK(test, CFCType_is_void(type), "const void is_void");
-        OK(test, CFCType_const(type), "const void is const");
-        CFCBase_decref((CFCBase*)type);
-    }
-
-    CFCBase_decref((CFCBase*)parser);
-}
-
-static void
-S_run_object_tests(CFCTest *test) {
-    static const char *modifiers[4] = {
-        "const", "incremented", "decremented", "nullable"
-    };
-    static int flags[4] = {
-        CFCTYPE_CONST,
-        CFCTYPE_INCREMENTED,
-        CFCTYPE_DECREMENTED,
-        CFCTYPE_NULLABLE
-    };
-    static int (*accessors[4])(CFCType *type) = {
-        CFCType_const,
-        CFCType_incremented,
-        CFCType_decremented,
-        CFCType_nullable
-    };
-
-    {
-        CFCParser *parser = CFCParser_new();
-        CFCParcel *neato_parcel
-            = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-
-        static const char *specifiers[4] = {
-            "Foo", "FooJr", "FooIII", "Foo4th"
-        };
-        for (int i = 0; i < 4; ++i) {
-            const char *specifier = specifiers[i];
-
-            char *class_code = CFCUtil_sprintf("class %s {}", specifier);
-            CFCClass *klass = CFCTest_parse_class(test, parser, class_code);
-            CFCClass *class_list[2] = { klass, NULL };
-            FREEMEM(class_code);
-
-            static const char *prefixes[2] = { "", "neato_" };
-            char *expect = CFCUtil_sprintf("neato_%s", specifier);
-            for (int j = 0; j < 2; ++j) {
-                char *src = CFCUtil_sprintf("%s%s*", prefixes[j], specifier);
-                CFCType *type = CFCTest_parse_type(test, parser, src);
-                CFCType_resolve(type, class_list);
-                STR_EQ(test, CFCType_get_specifier(type), expect,
-                       "object_type_specifier: %s", src);
-                OK(test, CFCType_is_object(type), "%s is_object", src);
-                INT_EQ(test, CFCType_get_indirection(type), 1,
-                       "%s indirection", src);
-
-                FREEMEM(src);
-                CFCBase_decref((CFCBase*)type);
-            }
-            FREEMEM(expect);
-
-            for (int j = 0; j < 4; ++j) {
-                char *src = CFCUtil_sprintf("%s %s*", modifiers[j], specifier);
-                CFCType *type = CFCTest_parse_type(test, parser, src);
-                OK(test, CFCType_is_object(type), "%s is_object", src);
-                OK(test, accessors[j](type), "%s accessor", src);
-
-                FREEMEM(src);
-                CFCBase_decref((CFCBase*)type);
-            }
-
-            CFCBase_decref((CFCBase*)klass);
-            CFCClass_clear_registry();
-        }
-
-        CFCBase_decref((CFCBase*)neato_parcel);
-        CFCBase_decref((CFCBase*)parser);
-    }
-
-    CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, false);
-    CFCClass *foo_class
-        = CFCClass_create(neato_parcel, NULL, "Foo", NULL, NULL, NULL, NULL,
-                          NULL, false, false);
-    CFCClass *class_list[2] = { foo_class, NULL };
-    CFCType *foo = CFCType_new_object(0, NULL, "Foo", 1);
-    CFCType_resolve(foo, class_list);
-
-    {
-        CFCType *another_foo = CFCType_new_object(0, NULL, "Foo", 1);
-        CFCType_resolve(another_foo, class_list);
-        OK(test, CFCType_equals(foo, another_foo), "equals");
-        CFCBase_decref((CFCBase*)another_foo);
-    }
-
-    {
-        CFCType *bar = CFCType_new_object(0, NULL, "Bar", 1);
-        OK(test, !CFCType_equals(foo, bar),
-           "different specifier spoils equals");
-        CFCBase_decref((CFCBase*)bar);
-    }
-
-    {
-        CFCParcel *foreign_parcel
-            = CFCParcel_new("Foreign", NULL, NULL, false);
-        CFCClass *foreign_foo_class
-            = CFCClass_create(foreign_parcel, NULL, "Foreign::Foo", NULL, NULL,
-                              NULL, NULL, NULL, false, false);
-        CFCClass *foreign_class_list[2] = { foreign_foo_class, NULL };
-        CFCType *foreign_foo = CFCType_new_object(0, foreign_parcel, "Foo", 1);
-        CFCType_resolve(foreign_foo, foreign_class_list);
-        OK(test, !CFCType_equals(foo, foreign_foo),
-           "different parcel spoils equals");
-        STR_EQ(test, CFCType_get_specifier(foreign_foo), "foreign_Foo",
-               "prepend parcel prefix to specifier");
-        CFCBase_decref((CFCBase*)foreign_parcel);
-        CFCBase_decref((CFCBase*)foreign_foo_class);
-        CFCBase_decref((CFCBase*)foreign_foo);
-    }
-
-    {
-        for (int i = 0; i < 4; ++i) {
-            CFCType *modified_foo
-                = CFCType_new_object(flags[i], NULL, "Foo", 1);
-            OK(test, accessors[i](modified_foo), "%s", modifiers[i]);
-            OK(test, !accessors[i](foo), "not %s", modifiers[i]);
-            OK(test, !CFCType_equals(foo, modified_foo),
-               "different %s spoils equals", modifiers[i]);
-            OK(test, !CFCType_similar(foo, modified_foo),
-               "different %s spoils similar", modifiers[i]);
-            CFCBase_decref((CFCBase*)modified_foo);
-        }
-    }
-
-    {
-        CFCType *string_type = CFCType_new_object(0, NULL, "String", 1);
-        OK(test, CFCType_is_string_type(string_type), "%s", "is_string_type");
-        OK(test, !CFCType_is_string_type(foo), "not %s", "not is_string_type");
-        CFCBase_decref((CFCBase*)string_type);
-    }
-
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)foo_class);
-    CFCBase_decref((CFCBase*)foo);
-
-    CFCClass_clear_registry();
-    CFCParcel_reap_singletons();
-}
-
-static void
-S_run_va_list_tests(CFCTest *test) {
-    {
-        CFCType *type = CFCType_new_va_list();
-        STR_EQ(test, CFCType_get_specifier(type), "va_list",
-               "specifier defaults to 'va_list'");
-        STR_EQ(test, CFCType_to_c(type), "va_list", "to_c");
-        CFCBase_decref((CFCBase*)type);
-    }
-
-    {
-        CFCParser *parser = CFCParser_new();
-        CFCType *type = CFCTest_parse_type(test, parser, "va_list");
-        OK(test, CFCType_is_va_list(type), "is_va_list");
-        CFCBase_decref((CFCBase*)type);
-        CFCBase_decref((CFCBase*)parser);
-    }
-}
-
-static void
-S_run_arbitrary_tests(CFCTest *test) {
-    {
-        CFCParcel *neato_parcel = CFCParcel_new("Neato", NULL, NULL, false);
-        CFCParcel_register(neato_parcel);
-
-        CFCType *foo = CFCType_new_arbitrary(neato_parcel, "foo_t");
-        STR_EQ(test, CFCType_get_specifier(foo), "foo_t", "get_specifier");
-        STR_EQ(test, CFCType_to_c(foo), "foo_t", "to_c");
-
-        CFCType *twin = CFCType_new_arbitrary(neato_parcel, "foo_t");
-        OK(test, CFCType_equals(foo, twin), "equals");
-
-        CFCType *compare_t
-            = CFCType_new_arbitrary(neato_parcel, "Sort_compare_t");
-        OK(test, !CFCType_equals(foo, compare_t),
-           "equals spoiled by different specifier");
-
-        CFCBase_decref((CFCBase*)neato_parcel);
-        CFCBase_decref((CFCBase*)foo);
-        CFCBase_decref((CFCBase*)compare_t);
-        CFCBase_decref((CFCBase*)twin);
-    }
-
-    {
-        CFCParser *parser = CFCParser_new();
-        static const char *specifiers[2] = { "foo_t", "Sort_compare_t" };
-        for (int i = 0; i < 2; ++i) {
-            const char *specifier = specifiers[i];
-            CFCType *type = CFCTest_parse_type(test, parser, specifier);
-            OK(test, CFCType_is_arbitrary(type), "arbitrary type %s",
-               specifier);
-            CFCBase_decref((CFCBase*)type);
-        }
-        CFCBase_decref((CFCBase*)parser);
-    }
-
-    CFCParcel_reap_singletons();
-}
-
-static void
-S_run_composite_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-
-    {
-        static const char *type_strings[14] = {
-            "char*",
-            "char**",
-            "char***",
-            "int32_t*",
-            "Obj**",
-            "int8_t[]",
-            "int8_t[1]",
-            "neato_method_t[]",
-            "neato_method_t[1]",
-            "multi_dimensional_t[1][10]",
-            "char * * ",
-            "const Obj**",
-            "const void*",
-            "int8_t[ 3 ]"
-        };
-        for (int i = 0; i < 14; ++i) {
-            const char *type_string = type_strings[i];
-            CFCType *type = CFCTest_parse_type(test, parser, type_string);
-            OK(test, CFCType_is_composite(type), "composite type %s",
-               type_string);
-            CFCBase_decref((CFCBase*)type);
-        }
-    }
-
-    {
-        CFCType *foo = CFCType_new_object(0, NULL, "Foo", 1);
-        CFCType *const_foo = CFCType_new_object(CFCTYPE_CONST, NULL, "Foo", 1);
-
-        CFCType *composite = CFCType_new_composite(0, foo, 1, NULL);
-        OK(test, CFCType_is_composite(composite), "is_composite");
-        STR_EQ(test, CFCType_get_specifier(composite), "Foo",
-               "get_specifier delegates to child" );
-
-        CFCType *twin = CFCType_new_composite(0, foo, 1, NULL);
-        OK(test, CFCType_equals(composite, twin), "equals");
-        CFCBase_decref((CFCBase*)twin);
-
-        CFCType *const_composite
-            = CFCType_new_composite(0, const_foo, 1, NULL);
-        OK(test, !CFCType_equals(composite, const_composite),
-           "equals spoiled by different child");
-        CFCBase_decref((CFCBase*)const_composite);
-
-        CFCBase_decref((CFCBase*)composite);
-        CFCBase_decref((CFCBase*)foo);
-        CFCBase_decref((CFCBase*)const_foo);
-    }
-
-    {
-        CFCClass *class_list[1] = { NULL };
-        CFCType *foo_array = CFCTest_parse_type(test, parser, "foo_t[]");
-        CFCType_resolve(foo_array, class_list);
-        STR_EQ(test, CFCType_get_array(foo_array), "[]", "get_array");
-        STR_EQ(test, CFCType_to_c(foo_array), "foo_t",
-               "array subscripts not included by to_c");
-        CFCType *foo_array_array
-            = CFCTest_parse_type(test, parser, "foo_t[][]");
-        OK(test, !CFCType_equals(foo_array, foo_array_array),
-           "equals spoiled by different array postfixes");
-
-        CFCBase_decref((CFCBase*)foo_array);
-        CFCBase_decref((CFCBase*)foo_array_array);
-    }
-
-    {
-        CFCType *foo_star = CFCTest_parse_type(test, parser, "foo_t*");
-        CFCType *foo_star_star = CFCTest_parse_type(test, parser, "foo_t**");
-        OK(test, !CFCType_equals(foo_star, foo_star_star),
-           "equals spoiled by different levels of indirection");
-        INT_EQ(test, CFCType_get_indirection(foo_star), 1,
-               "foo_t* indirection");
-        INT_EQ(test, CFCType_get_indirection(foo_star_star), 2,
-               "foo_t** indirection");
-
-        CFCBase_decref((CFCBase*)foo_star);
-        CFCBase_decref((CFCBase*)foo_star_star);
-    }
-
-    CFCBase_decref((CFCBase*)parser);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestUtil.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestUtil.c b/clownfish/compiler/src/CFCTestUtil.c
deleted file mode 100644
index fd431e3..0000000
--- a/clownfish/compiler/src/CFCTestUtil.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-
-#define CFC_USE_TEST_MACROS
-#include "CFCUtil.h"
-#include "CFCTest.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-static void
-S_run_string_tests(CFCTest *test);
-
-static void
-S_run_file_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_UTIL = {
-    "Clownfish::CFC::Util",
-    15,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    S_run_string_tests(test);
-    S_run_file_tests(test);
-}
-
-static void
-S_run_string_tests(CFCTest *test) {
-    const char *src = "Source string";
-    char *str;
-
-    str = CFCUtil_strdup(src);
-    STR_EQ(test, str, src, "strdup");
-    FREEMEM(str);
-    str = CFCUtil_strndup(src, 6);
-    STR_EQ(test, str, "Source", "strndup");
-    FREEMEM(str);
-    str = CFCUtil_sprintf("%s: %d", src, 123456789);
-    STR_EQ(test, str, "Source string: 123456789", "sprintf");
-    str = CFCUtil_cat(str, " ", "abc", NULL);
-    STR_EQ(test, str, "Source string: 123456789 abc", "cat");
-    FREEMEM(str);
-    str = CFCUtil_strdup(" \r\n\tabc \r\n\tdef \r\n\t");
-    CFCUtil_trim_whitespace(str);
-    STR_EQ(test, str, "abc \r\n\tdef", "trim_whitespace");
-    FREEMEM(str);
-}
-
-static void
-S_run_file_tests(CFCTest *test) {
-    const char *foo_txt = "foo.txt";
-    remove(foo_txt);
-    CFCUtil_write_file(foo_txt, "foo", 3);
-
-    {
-        FILE *file = fopen(foo_txt, "rb");
-        OK(test, file != NULL, "can open file");
-        char buf[10];
-        size_t chars_read = fread(buf, 1, 10, file);
-        INT_EQ(test, chars_read, 3, "read correct number of chars");
-        OK(test, memcmp(buf, "foo", 3) == 0, "read correct string");
-
-        long file_length = CFCUtil_flength(file);
-        INT_EQ(test, file_length, 3, "flength");
-
-        fclose(file);
-    }
-
-    {
-        size_t content_len;
-        char *content = CFCUtil_slurp_text(foo_txt, &content_len);
-        INT_EQ(test, content_len, 3, "slurp_text len");
-        OK(test, memcmp(content, "foo", 3) == 0, "slurp_text content");
-        FREEMEM(content);
-    }
-
-    {
-        OK(test, CFCUtil_current(foo_txt, foo_txt), "current");
-        OK(test, !CFCUtil_current(foo_txt, "nonexistent_file"),
-             "not current when dest file missing");
-        // TODO: Test two different files.
-    }
-
-    {
-        time_t past_time = time(NULL) - 10;
-        CFCTest_set_file_times(foo_txt, past_time);
-        past_time = CFCTest_get_file_mtime(foo_txt);
-        time_t mtime;
-        CFCUtil_write_if_changed(foo_txt, "foo", 3);
-        mtime = CFCTest_get_file_mtime(foo_txt);
-        OK(test, mtime == past_time,
-           "write_if_changed does nothing if contents not changed");
-        CFCUtil_write_if_changed(foo_txt, "foofoo", 6);
-        mtime = CFCTest_get_file_mtime(foo_txt);
-        OK(test, mtime != past_time,
-           "write_if_changed writes if contents changed");
-    }
-
-    remove(foo_txt);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestVariable.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestVariable.c b/clownfish/compiler/src/CFCTestVariable.c
deleted file mode 100644
index e8096e7..0000000
--- a/clownfish/compiler/src/CFCTestVariable.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCClass.h"
-#include "CFCParcel.h"
-#include "CFCParser.h"
-#include "CFCSymbol.h"
-#include "CFCTest.h"
-#include "CFCType.h"
-#include "CFCVariable.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_VARIABLE = {
-    "Clownfish::CFC::Model::Variable",
-    29,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCParser *parser = CFCParser_new();
-    CFCParcel *neato_parcel
-        = CFCTest_parse_parcel(test, parser, "parcel Neato;");
-    CFCClass *foo_class = CFCTest_parse_class(test, parser, "class Foo {}");
-    CFCClass *class_list[2] = { foo_class, NULL };
-
-    {
-        CFCType *type = CFCTest_parse_type(test, parser, "float*");
-        CFCVariable *var
-            = CFCVariable_new(NULL, NULL, NULL, NULL, "foo", type, 0);
-        CFCVariable_resolve_type(var, class_list);
-        STR_EQ(test, CFCVariable_local_c(var), "float* foo", "local_c");
-        STR_EQ(test, CFCVariable_local_declaration(var), "float* foo;",
-               "local_declaration");
-        OK(test, CFCSymbol_local((CFCSymbol*)var), "default to local access");
-
-        CFCBase_decref((CFCBase*)type);
-        CFCBase_decref((CFCBase*)var);
-    }
-
-    {
-        CFCType *type = CFCTest_parse_type(test, parser, "float[1]");
-        CFCVariable *var
-            = CFCVariable_new(NULL, NULL, NULL, NULL, "foo", type, 0);
-        CFCVariable_resolve_type(var, class_list);
-        STR_EQ(test, CFCVariable_local_c(var), "float foo[1]",
-               "to_c appends array to var name rather than type specifier");
-
-        CFCBase_decref((CFCBase*)type);
-        CFCBase_decref((CFCBase*)var);
-    }
-
-    {
-        CFCType *type = CFCTest_parse_type(test, parser, "Foo*");
-        CFCVariable *var
-            = CFCVariable_new(neato_parcel, NULL,
-                              "Crustacean::Lobster::LobsterClaw", "LobClaw",
-                              "foo", type, 0);
-        CFCVariable_resolve_type(var, class_list);
-        STR_EQ(test, CFCVariable_global_c(var), "neato_Foo* neato_LobClaw_foo",
-               "global_c");
-
-        CFCBase_decref((CFCBase*)type);
-        CFCBase_decref((CFCBase*)var);
-    }
-
-    {
-        static const char *variable_strings[7] = {
-            "int foo;",
-            "inert Obj *obj;",
-            "public inert int32_t **foo;",
-            "Dog *fido;",
-            "uint32_t baz",
-            "String *stuff",
-            "float **ptr"
-        };
-        for (int i = 0; i < 7; ++i) {
-            CFCVariable *var
-                = CFCTest_parse_variable(test, parser, variable_strings[i]);
-            CFCBase_decref((CFCBase*)var);
-        }
-    }
-
-    CFCBase_decref((CFCBase*)parser);
-    CFCBase_decref((CFCBase*)neato_parcel);
-    CFCBase_decref((CFCBase*)foo_class);
-
-    CFCClass_clear_registry();
-    CFCParcel_reap_singletons();
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCTestVersion.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCTestVersion.c b/clownfish/compiler/src/CFCTestVersion.c
deleted file mode 100644
index 693e01b..0000000
--- a/clownfish/compiler/src/CFCTestVersion.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define CFC_USE_TEST_MACROS
-#include "CFCBase.h"
-#include "CFCVersion.h"
-#include "CFCTest.h"
-
-static void
-S_run_tests(CFCTest *test);
-
-const CFCTestBatch CFCTEST_BATCH_VERSION = {
-    "Clownfish::CFC::Model::Version",
-    11,
-    S_run_tests
-};
-
-static void
-S_run_tests(CFCTest *test) {
-    CFCVersion *v3_2     = CFCVersion_new("v3.2");
-    CFCVersion *v3_2_0   = CFCVersion_new("v3.2.0");
-    CFCVersion *v3_2_1   = CFCVersion_new("v3.2.1");
-    CFCVersion *v3_2_1_0 = CFCVersion_new("v3.2.1.0");
-    CFCVersion *v3_3     = CFCVersion_new("v3.3");
-    CFCVersion *v90210   = CFCVersion_new("v90210");
-
-    INT_EQ(test, CFCVersion_get_major(v3_2_1), 3, "get_major");
-    INT_EQ(test, CFCVersion_get_major(v90210), 90210, "parse big number");
-    STR_EQ(test, CFCVersion_get_vstring(v3_2_1), "v3.2.1", "get_vstring");
-
-    int result;
-    result = CFCVersion_compare_to(v3_2_1, v3_2_1_0);
-    INT_EQ(test, result, 0, "ignore zeroes in compare_to");
-    result = CFCVersion_compare_to(v3_2_1_0, v3_2_1);
-    INT_EQ(test, result, 0, "ignore zeroes in compare_to");
-    result = CFCVersion_compare_to(v3_2_1, v3_3);
-    INT_EQ(test, result, -1, "compare_to A < B_fewer_digits");
-    result = CFCVersion_compare_to(v3_3, v3_2_1);
-    INT_EQ(test, result, 1, "compare_to A_fewer_digits > B");
-    result = CFCVersion_compare_to(v3_2_1, v3_2);
-    INT_EQ(test, result, 1, "compare_to A < B_fewer_digits");
-    result = CFCVersion_compare_to(v3_2, v3_2_1);
-    INT_EQ(test, result, -1, "compare_to A_fewer_digits > B");
-    result = CFCVersion_compare_to(v3_2_1, v3_2_0);
-    INT_EQ(test, result, 1, "compare_to A > B");
-    result = CFCVersion_compare_to(v3_2_0, v3_2_1);
-    INT_EQ(test, result, -1, "compare_to A < B");
-
-    CFCBase_decref((CFCBase*)v3_2);
-    CFCBase_decref((CFCBase*)v3_2_0);
-    CFCBase_decref((CFCBase*)v3_2_1);
-    CFCBase_decref((CFCBase*)v3_2_1_0);
-    CFCBase_decref((CFCBase*)v3_3);
-    CFCBase_decref((CFCBase*)v90210);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCType.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCType.c b/clownfish/compiler/src/CFCType.c
deleted file mode 100644
index a41ecbd..0000000
--- a/clownfish/compiler/src/CFCType.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCType.h"
-#include "CFCClass.h"
-#include "CFCParcel.h"
-#include "CFCSymbol.h"
-#include "CFCUtil.h"
-
-struct CFCType {
-    CFCBase  base;
-    int      flags;
-    char    *specifier;
-    char    *vtable_var;
-    int      indirection;
-    struct CFCParcel *parcel;
-    char    *c_string;
-    size_t   width;
-    char    *array;
-    struct CFCType *child;
-};
-
-static const CFCMeta CFCTYPE_META = {
-    "Clownfish::CFC::Model::Type",
-    sizeof(CFCType),
-    (CFCBase_destroy_t)CFCType_destroy
-};
-
-CFCType*
-CFCType_new(int flags, struct CFCParcel *parcel, const char *specifier,
-            int indirection) {
-    CFCType *self = (CFCType*)CFCBase_allocate(&CFCTYPE_META);
-    return CFCType_init(self, flags, parcel, specifier, indirection);
-}
-
-static void
-S_check_flags(int supplied, int acceptable, const char *type_name) {
-    int bad = (supplied & ~acceptable);
-    if (bad) {
-        char bad_flag[20];
-        if ((bad & CFCTYPE_CONST))            { strcpy(bad_flag, "CONST"); }
-        else if ((bad & CFCTYPE_NULLABLE))    { strcpy(bad_flag, "NULLABLE"); }
-        else if ((bad & CFCTYPE_INCREMENTED)) { strcpy(bad_flag, "INCREMENTED"); }
-        else if ((bad & CFCTYPE_DECREMENTED)) { strcpy(bad_flag, "DECREMENTED"); }
-        else if ((bad & CFCTYPE_OBJECT))      { strcpy(bad_flag, "OBJECT"); }
-        else if ((bad & CFCTYPE_PRIMITIVE))   { strcpy(bad_flag, "PRIMITIVE"); }
-        else if ((bad & CFCTYPE_INTEGER))     { strcpy(bad_flag, "INTEGER"); }
-        else if ((bad & CFCTYPE_FLOATING))    { strcpy(bad_flag, "FLOATING"); }
-        else if ((bad & CFCTYPE_STRING_TYPE)) { strcpy(bad_flag, "STRING_TYPE"); }
-        else if ((bad & CFCTYPE_VA_LIST))     { strcpy(bad_flag, "VA_LIST"); }
-        else if ((bad & CFCTYPE_ARBITRARY))   { strcpy(bad_flag, "ARBITRARY"); }
-        else if ((bad & CFCTYPE_COMPOSITE))   { strcpy(bad_flag, "COMPOSITE"); }
-        else {
-            CFCUtil_die("Unknown flags: %d", bad);
-        }
-        CFCUtil_die("Bad flag for type %s: %s", type_name, bad_flag);
-    }
-}
-
-CFCType*
-CFCType_init(CFCType *self, int flags, struct CFCParcel *parcel,
-             const char *specifier, int indirection) {
-    self->flags       = flags;
-    self->parcel      = (CFCParcel*)CFCBase_incref((CFCBase*)parcel);
-    self->specifier   = CFCUtil_strdup(specifier);
-    self->indirection = indirection;
-    self->c_string    = NULL;
-    self->width       = 0;
-    self->array       = NULL;
-    self->child       = NULL;
-    self->vtable_var  = NULL;
-
-    return self;
-}
-
-CFCType*
-CFCType_new_integer(int flags, const char *specifier) {
-    // Validate specifier, find width.
-    size_t width;
-    if (!strcmp(specifier, "int8_t") || !strcmp(specifier, "uint8_t")) {
-        width = 1;
-    }
-    else if (!strcmp(specifier, "int16_t") || !strcmp(specifier, "uint16_t")) {
-        width = 2;
-    }
-    else if (!strcmp(specifier, "int32_t") || !strcmp(specifier, "uint32_t")) {
-        width = 4;
-    }
-    else if (!strcmp(specifier, "int64_t") || !strcmp(specifier, "uint64_t")) {
-        width = 8;
-    }
-    else if (!strcmp(specifier, "char")
-             || !strcmp(specifier, "short")
-             || !strcmp(specifier, "int")
-             || !strcmp(specifier, "long")
-             || !strcmp(specifier, "size_t")
-             || !strcmp(specifier, "bool") // Charmonizer type.
-            ) {
-        width = 0;
-    }
-    else {
-        CFCUtil_die("Unknown integer specifier: '%s'", specifier);
-    }
-
-    // Add flags.
-    flags |= CFCTYPE_PRIMITIVE;
-    flags |= CFCTYPE_INTEGER;
-    S_check_flags(flags, CFCTYPE_CONST | CFCTYPE_PRIMITIVE | CFCTYPE_INTEGER,
-                  "Integer");
-
-    CFCType *self = CFCType_new(flags, NULL, specifier, 0);
-    self->width = width;
-    return self;
-}
-
-static const char *float_specifiers[] = {
-    "float",
-    "double",
-    NULL
-};
-
-CFCType*
-CFCType_new_float(int flags, const char *specifier) {
-    // Validate specifier.
-    for (size_t i = 0; ; i++) {
-        if (!float_specifiers[i]) {
-            CFCUtil_die("Unknown float specifier: '%s'", specifier);
-        }
-        if (strcmp(float_specifiers[i], specifier) == 0) {
-            break;
-        }
-    }
-
-    flags |= CFCTYPE_PRIMITIVE;
-    flags |= CFCTYPE_FLOATING;
-    S_check_flags(flags, CFCTYPE_CONST | CFCTYPE_PRIMITIVE | CFCTYPE_FLOATING,
-                  "Floating");
-
-    return CFCType_new(flags, NULL, specifier, 0);
-}
-
-CFCType*
-CFCType_new_object(int flags, CFCParcel *parcel, const char *specifier,
-                   int indirection) {
-    // Validate params.
-    if (indirection != 1) {
-        CFCUtil_die("Parameter 'indirection' can only be 1");
-    }
-    if (!specifier || !strlen(specifier)) {
-        CFCUtil_die("Missing required param 'specifier'");
-    }
-    if ((flags & CFCTYPE_INCREMENTED) && (flags & CFCTYPE_DECREMENTED)) {
-        CFCUtil_die("Can't be both incremented and decremented");
-    }
-
-    // Use default parcel if none supplied.
-    if (!parcel) {
-        parcel = CFCParcel_default_parcel();
-    }
-
-    // Add flags.
-    flags |= CFCTYPE_OBJECT;
-    if (strstr(specifier, "String")) {
-        // Determine whether this type is a string type.
-        flags |= CFCTYPE_STRING_TYPE;
-    }
-
-    // Validate specifier.
-    if (!isalpha(*specifier)) {
-        CFCUtil_die("Invalid specifier: '%s'", specifier);
-    }
-    const char *small_specifier = specifier;
-    while (!isupper(*small_specifier)) {
-        if (!isalnum(*small_specifier) && *small_specifier != '_') {
-            CFCUtil_die("Invalid specifier: '%s'", specifier);
-        }
-        small_specifier++;
-    }
-    if (!CFCSymbol_validate_class_name_component(small_specifier)) {
-        CFCUtil_die("Invalid specifier: '%s'", specifier);
-    }
-
-    int acceptable_flags = CFCTYPE_OBJECT
-                           | CFCTYPE_STRING_TYPE
-                           | CFCTYPE_CONST
-                           | CFCTYPE_NULLABLE
-                           | CFCTYPE_INCREMENTED
-                           | CFCTYPE_DECREMENTED;
-    S_check_flags(flags, acceptable_flags, "Object");
-
-    return CFCType_new(flags, parcel, specifier, 1);
-}
-
-CFCType*
-CFCType_new_composite(int flags, CFCType *child, int indirection,
-                      const char *array) {
-    if (!child) {
-        CFCUtil_die("Missing required param 'child'");
-    }
-    flags |= CFCTYPE_COMPOSITE;
-    S_check_flags(flags, CFCTYPE_COMPOSITE | CFCTYPE_NULLABLE, "Composite");
-
-    CFCType *self = CFCType_new(flags, NULL, CFCType_get_specifier(child),
-                                indirection);
-    self->child = (CFCType*)CFCBase_incref((CFCBase*)child);
-
-    // Record array spec.
-    const char *array_spec = array ? array : "";
-    size_t array_spec_size = strlen(array_spec) + 1;
-    self->array = (char*)MALLOCATE(array_spec_size);
-    strcpy(self->array, array_spec);
-
-    return self;
-}
-
-CFCType*
-CFCType_new_void(int is_const) {
-    int flags = CFCTYPE_VOID;
-    if (is_const) { flags |= CFCTYPE_CONST; }
-    return CFCType_new(flags, NULL, "void", 0);
-}
-
-CFCType*
-CFCType_new_va_list(void) {
-    return CFCType_new(CFCTYPE_VA_LIST, NULL, "va_list", 0);
-}
-
-CFCType*
-CFCType_new_arbitrary(CFCParcel *parcel, const char *specifier) {
-    // Validate specifier.
-    for (size_t i = 0, max = strlen(specifier); i < max; i++) {
-        if (!isalnum(specifier[i]) && specifier[i] != '_') {
-            CFCUtil_die("Illegal specifier: '%s'", specifier);
-        }
-    }
-
-    return CFCType_new(CFCTYPE_ARBITRARY, parcel, specifier, 0);
-}
-
-void
-CFCType_resolve(CFCType *self, CFCClass **classes) {
-    if (CFCType_is_composite(self)) {
-        CFCType_resolve(self->child, classes);
-        return;
-    }
-    if (!CFCType_is_object(self)) {
-        return;
-    }
-
-    CFCClass *klass     = NULL;
-    char     *specifier = self->specifier;
-
-    if (isupper(self->specifier[0])) {
-        // Try to find class from class list.
-        for (size_t i = 0; classes[i]; ++i) {
-            CFCClass   *maybe_class = classes[i];
-            const char *struct_sym  = CFCClass_get_struct_sym(maybe_class);
-
-            if (strcmp(specifier, struct_sym) == 0) {
-                if (klass) {
-                    CFCUtil_die("Type '%s' is ambigious", specifier);
-                }
-                klass = maybe_class;
-            }
-        }
-
-        if (!klass) {
-            CFCUtil_die("No class found for type '%s'", specifier);
-        }
-
-        // Create actual specifier with prefix.
-        const char *prefix = CFCClass_get_prefix(klass);
-        self->specifier = CFCUtil_sprintf("%s%s", prefix, specifier);
-        FREEMEM(specifier);
-    }
-    else {
-        // Try to find class from class list.
-        for (size_t i = 0; classes[i]; ++i) {
-            CFCClass *maybe_class = classes[i];
-            const char *full_struct_sym
-                = CFCClass_full_struct_sym(maybe_class);
-
-            if (strcmp(specifier, full_struct_sym) == 0) {
-                klass = maybe_class;
-                break;
-            }
-        }
-    }
-
-    // Add parcel dependency.
-    if (klass) {
-        CFCParcel *class_parcel = CFCClass_get_parcel(klass);
-        CFCParcel_add_dependent_parcel(self->parcel, class_parcel);
-    }
-}
-
-void
-CFCType_destroy(CFCType *self) {
-    if (self->child) {
-        CFCBase_decref((CFCBase*)self->child);
-    }
-    CFCBase_decref((CFCBase*)self->parcel);
-    FREEMEM(self->specifier);
-    FREEMEM(self->c_string);
-    FREEMEM(self->array);
-    FREEMEM(self->vtable_var);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-int
-CFCType_equals(CFCType *self, CFCType *other) {
-    if ((CFCType_const(self)           ^ CFCType_const(other))
-        || (CFCType_nullable(self)     ^ CFCType_nullable(other))
-        || (CFCType_is_void(self)      ^ CFCType_is_void(other))
-        || (CFCType_is_object(self)    ^ CFCType_is_object(other))
-        || (CFCType_is_primitive(self) ^ CFCType_is_primitive(other))
-        || (CFCType_is_integer(self)   ^ CFCType_is_integer(other))
-        || (CFCType_is_floating(self)  ^ CFCType_is_floating(other))
-        || (CFCType_is_va_list(self)   ^ CFCType_is_va_list(other))
-        || (CFCType_is_arbitrary(self) ^ CFCType_is_arbitrary(other))
-        || (CFCType_is_composite(self) ^ CFCType_is_composite(other))
-        || (CFCType_incremented(self)  ^ CFCType_incremented(other))
-        || (CFCType_decremented(self)  ^ CFCType_decremented(other))
-        || !!self->child ^ !!other->child
-        || !!self->array ^ !!other->array
-       ) {
-        return false;
-    }
-    if (self->indirection != other->indirection) { return false; }
-    if (strcmp(self->specifier, other->specifier) != 0) { return false; }
-    if (self->child) {
-        if (!CFCType_equals(self->child, other->child)) { return false; }
-    }
-    if (self->array) {
-        if (strcmp(self->array, other->array) != 0) { return false; }
-    }
-    return true;
-}
-
-int
-CFCType_similar(CFCType *self, CFCType *other) {
-    if (!CFCType_is_object(self)) {
-        CFCUtil_die("Attempt to call 'similar' on a non-object type");
-    }
-    if ((CFCType_const(self)           ^ CFCType_const(other))
-        || (CFCType_nullable(self)     ^ CFCType_nullable(other))
-        || (CFCType_incremented(self)  ^ CFCType_incremented(other))
-        || (CFCType_decremented(self)  ^ CFCType_decremented(other))
-        || (CFCType_is_object(self)    ^ CFCType_is_object(other))
-       ) {
-        return false;
-    }
-    return true;
-}
-
-void
-CFCType_set_specifier(CFCType *self, const char *specifier) {
-    FREEMEM(self->specifier);
-    self->specifier = CFCUtil_strdup(specifier);
-}
-
-const char*
-CFCType_get_specifier(CFCType *self) {
-    return self->specifier;
-}
-
-const char*
-CFCType_get_vtable_var(CFCType *self) {
-    if (!self->vtable_var) {
-        self->vtable_var = CFCUtil_strdup(self->specifier);
-        for (int i = 0; self->vtable_var[i] != 0; i++) {
-            self->vtable_var[i] = toupper(self->vtable_var[i]);
-        }
-    }
-    return self->vtable_var;
-}
-
-int
-CFCType_get_indirection(CFCType *self) {
-    return self->indirection;
-}
-
-struct CFCParcel*
-CFCType_get_parcel(CFCType *self) {
-    return self->parcel;
-}
-
-const char*
-CFCType_to_c(CFCType *self) {
-    char *c_string = self->c_string;
-
-    if (c_string) { return c_string; }
-
-    if (CFCType_is_composite(self)) {
-        // NOTE: Array postfixes are NOT included.
-        const char *child_c_string = CFCType_to_c(self->child);
-        size_t      child_c_len    = strlen(child_c_string);
-        size_t      amount         = child_c_len + self->indirection;
-        c_string = (char*)MALLOCATE(amount + 1);
-        strcpy(c_string, child_c_string);
-        for (int i = 0; i < self->indirection; i++) {
-            strncat(c_string, "*", 1);
-        }
-    }
-    else if (CFCType_is_object(self)) {
-        if (CFCType_const(self)) {
-            c_string = CFCUtil_sprintf("const %s*", self->specifier);
-        }
-        else {
-            c_string = CFCUtil_sprintf("%s*", self->specifier);
-        }
-    }
-    else {
-        if (CFCType_const(self)) {
-            c_string = CFCUtil_sprintf("const %s", self->specifier);
-        }
-        else {
-            c_string = CFCUtil_strdup(self->specifier);
-        }
-    }
-
-    self->c_string = c_string;
-
-    return c_string;
-}
-
-size_t
-CFCType_get_width(CFCType *self) {
-    return self->width;
-}
-
-const char*
-CFCType_get_array(CFCType *self) {
-    return self->array;
-}
-
-int
-CFCType_const(CFCType *self) {
-    return !!(self->flags & CFCTYPE_CONST);
-}
-
-void
-CFCType_set_nullable(CFCType *self, int nullable) {
-    if (nullable) {
-        self->flags |= CFCTYPE_NULLABLE;
-    }
-    else {
-        self->flags &= ~CFCTYPE_NULLABLE;
-    }
-}
-
-int
-CFCType_nullable(CFCType *self) {
-    return !!(self->flags & CFCTYPE_NULLABLE);
-}
-
-int
-CFCType_incremented(CFCType *self) {
-    return !!(self->flags & CFCTYPE_INCREMENTED);
-}
-
-int
-CFCType_decremented(CFCType *self) {
-    return !!(self->flags & CFCTYPE_DECREMENTED);
-}
-
-int
-CFCType_is_void(CFCType *self) {
-    return !!(self->flags & CFCTYPE_VOID);
-}
-
-int
-CFCType_is_object(CFCType *self) {
-    return !!(self->flags & CFCTYPE_OBJECT);
-}
-
-int
-CFCType_is_primitive(CFCType *self) {
-    return !!(self->flags & CFCTYPE_PRIMITIVE);
-}
-
-int
-CFCType_is_integer(CFCType *self) {
-    return !!(self->flags & CFCTYPE_INTEGER);
-}
-
-int
-CFCType_is_floating(CFCType *self) {
-    return !!(self->flags & CFCTYPE_FLOATING);
-}
-
-int
-CFCType_is_string_type(CFCType *self) {
-    return !!(self->flags & CFCTYPE_STRING_TYPE);
-}
-
-int
-CFCType_is_va_list(CFCType *self) {
-    return !!(self->flags & CFCTYPE_VA_LIST);
-}
-
-int
-CFCType_is_arbitrary(CFCType *self) {
-    return !!(self->flags & CFCTYPE_ARBITRARY);
-}
-
-int
-CFCType_is_composite(CFCType *self) {
-    return !!(self->flags & CFCTYPE_COMPOSITE);
-}
-


[lucy-commits] [45/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Change type of SortEx members.

Posted by ma...@apache.org.
Change type of SortEx members.

Change slice_starts and scratch to limit element types to Obj.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/90cfcac8
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/90cfcac8
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/90cfcac8

Branch: refs/heads/sortex_ptr_only
Commit: 90cfcac84a776fdd0555711f40f7e280eb739be3
Parents: 9ed7692
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jan 8 14:24:14 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 12:01:25 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Util/SortExternal.c   | 14 +++++++-------
 core/Lucy/Util/SortExternal.cfh |  4 ++--
 2 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/90cfcac8/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index 9f0c30e..4d68664 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -136,8 +136,8 @@ SortEx_Sort_Cache_IMP(SortExternal *self) {
         if (ivars->scratch_cap < ivars->cache_cap) {
             ivars->scratch_cap = ivars->cache_cap;
             ivars->scratch
-                = (uint8_t*)REALLOCATE(ivars->scratch,
-                                       ivars->scratch_cap * sizeof(Obj*));
+                = (Obj**)REALLOCATE(ivars->scratch,
+                                    ivars->scratch_cap * sizeof(Obj*));
         }
         Sort_mergesort(ivars->cache, ivars->scratch, ivars->cache_max,
                        sizeof(Obj*), compare, self);
@@ -159,8 +159,8 @@ SortEx_Add_Run_IMP(SortExternal *self, SortExternal *run) {
         = (uint32_t*)REALLOCATE(ivars->slice_sizes,
                                 num_runs * sizeof(uint32_t));
     ivars->slice_starts
-        = (uint8_t**)REALLOCATE(ivars->slice_starts,
-                                num_runs * sizeof(uint8_t*));
+        = (Obj**)REALLOCATE(ivars->slice_starts,
+                                num_runs * sizeof(Obj*));
 }
 
 static void
@@ -223,7 +223,7 @@ static void
 S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
                 uint8_t *endpost) {
     uint32_t    num_runs     = VA_Get_Size(ivars->runs);
-    uint8_t   **slice_starts = ivars->slice_starts;
+    Obj       **slice_starts = ivars->slice_starts;
     uint32_t   *slice_sizes  = ivars->slice_sizes;
     VTable     *vtable       = SortEx_Get_VTable(self);
     CFISH_Sort_Compare_t compare
@@ -258,7 +258,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     // Transform slice starts from ticks to pointers.
     uint32_t total = 0;
     for (uint32_t i = 0; i < ivars->num_slices; i++) {
-        slice_starts[i] = ivars->cache + total * sizeof(Obj*);
+        slice_starts[i] = (Obj*)(ivars->cache + total * sizeof(Obj*));
         total += slice_sizes[i];
     }
 
@@ -266,7 +266,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     // but exploit the fact that each slice is already sorted.
     if (ivars->scratch_cap < ivars->cache_cap) {
         ivars->scratch_cap = ivars->cache_cap;
-        ivars->scratch = (uint8_t*)REALLOCATE(
+        ivars->scratch = (Obj**)REALLOCATE(
                             ivars->scratch, ivars->scratch_cap * sizeof(Obj*));
     }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/90cfcac8/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index a27f2c2..b1af4ad 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -53,11 +53,11 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     uint32_t       cache_cap;
     uint32_t       cache_max;
     uint32_t       cache_tick;
-    uint8_t       *scratch;
+    Obj          **scratch;
     uint32_t       scratch_cap;
     VArray        *runs;
     uint32_t       num_slices;
-    uint8_t      **slice_starts;
+    Obj          **slice_starts;
     uint32_t      *slice_sizes;
     uint32_t       mem_thresh;
     bool           flipped;


[lucy-commits] [15/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCHierarchy.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCHierarchy.c b/clownfish/compiler/src/CFCHierarchy.c
deleted file mode 100644
index e059546..0000000
--- a/clownfish/compiler/src/CFCHierarchy.c
+++ /dev/null
@@ -1,541 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <ctype.h>
-
-#ifndef true
-    #define true 1
-    #define false 0
-#endif
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCHierarchy.h"
-#include "CFCClass.h"
-#include "CFCFile.h"
-#include "CFCFileSpec.h"
-#include "CFCParcel.h"
-#include "CFCSymbol.h"
-#include "CFCUtil.h"
-#include "CFCParser.h"
-
-struct CFCHierarchy {
-    CFCBase base;
-    size_t num_sources;
-    char **sources;
-    size_t num_includes;
-    char **includes;
-    char *dest;
-    char *inc_dest;
-    char *src_dest;
-    CFCParser *parser;
-    CFCClass **trees;
-    size_t num_trees;
-    CFCFile **files;
-    size_t num_files;
-    CFCClass **classes;
-    size_t classes_cap;
-    size_t num_classes;
-};
-
-typedef struct CFCParseParcelFilesContext {
-    int is_included;
-} CFCParseParcelFilesContext;
-
-// CFCUtil_walk() callback which parses .cfp files.
-static void
-S_parse_parcel_files(const char *path, void *context);
-
-static void
-S_do_make_path(const char *path);
-
-static void
-S_parse_cf_files(CFCHierarchy *self, const char *source_dir, int is_included);
-
-static void
-S_connect_classes(CFCHierarchy *self);
-
-static void
-S_add_file(CFCHierarchy *self, CFCFile *file);
-
-static void
-S_add_tree(CFCHierarchy *self, CFCClass *klass);
-
-static CFCFile*
-S_fetch_file(CFCHierarchy *self, const char *path_part);
-
-// Recursive helper function for CFCUtil_propagate_modified.
-static int
-S_do_propagate_modified(CFCHierarchy *self, CFCClass *klass, int modified);
-
-static const CFCMeta CFCHIERARCHY_META = {
-    "Clownfish::CFC::Model::Hierarchy",
-    sizeof(CFCHierarchy),
-    (CFCBase_destroy_t)CFCHierarchy_destroy
-};
-
-CFCHierarchy*
-CFCHierarchy_new(const char *dest) {
-    CFCHierarchy *self = (CFCHierarchy*)CFCBase_allocate(&CFCHIERARCHY_META);
-    return CFCHierarchy_init(self, dest);
-}
-
-CFCHierarchy*
-CFCHierarchy_init(CFCHierarchy *self, const char *dest) {
-    if (!dest || !strlen(dest)) {
-        CFCUtil_die("'dest' is required");
-    }
-    self->sources      = (char**)CALLOCATE(1, sizeof(char*));
-    self->num_sources  = 0;
-    self->includes     = (char**)CALLOCATE(1, sizeof(char*));
-    self->num_includes = 0;
-    self->dest         = CFCUtil_strdup(dest);
-    self->trees        = (CFCClass**)CALLOCATE(1, sizeof(CFCClass*));
-    self->num_trees    = 0;
-    self->files        = (CFCFile**)CALLOCATE(1, sizeof(CFCFile*));
-    self->num_files    = 0;
-    self->classes_cap  = 10;
-    self->classes      = (CFCClass**)CALLOCATE(
-                            (self->classes_cap + 1), sizeof(CFCClass*));
-    self->num_classes  = 0;
-    self->parser       = CFCParser_new();
-
-    self->inc_dest = CFCUtil_sprintf("%s" CHY_DIR_SEP "include", self->dest);
-    self->src_dest = CFCUtil_sprintf("%s" CHY_DIR_SEP "source", self->dest);
-    S_do_make_path(self->inc_dest);
-    S_do_make_path(self->src_dest);
-
-    return self;
-}
-
-void
-CFCHierarchy_destroy(CFCHierarchy *self) {
-    for (size_t i = 0; self->trees[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->trees[i]);
-    }
-    for (size_t i = 0; self->files[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->files[i]);
-    }
-    for (size_t i = 0; self->classes[i] != NULL; i++) {
-        CFCBase_decref((CFCBase*)self->classes[i]);
-    }
-    for (size_t i = 0; self->sources[i] != NULL; i++) {
-        FREEMEM(self->sources[i]);
-    }
-    for (size_t i = 0; self->includes[i] != NULL; i++) {
-        FREEMEM(self->includes[i]);
-    }
-    FREEMEM(self->trees);
-    FREEMEM(self->files);
-    FREEMEM(self->classes);
-    FREEMEM(self->sources);
-    FREEMEM(self->includes);
-    FREEMEM(self->dest);
-    FREEMEM(self->inc_dest);
-    FREEMEM(self->src_dest);
-    CFCBase_decref((CFCBase*)self->parser);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-static void
-S_do_make_path(const char *path) {
-    if (!CFCUtil_is_dir(path)) {
-        CFCUtil_make_path(path);
-        if (!CFCUtil_is_dir(path)) {
-            CFCUtil_die("Can't make path %s", path);
-        }
-    }
-}
-
-void
-CFCHierarchy_add_source_dir(CFCHierarchy *self, const char *source_dir) {
-    size_t n = self->num_sources;
-    size_t size = (n + 2) * sizeof(char*);
-    self->sources      = (char**)REALLOCATE(self->sources, size);
-    self->sources[n]   = CFCUtil_strdup(source_dir);
-    self->sources[n+1] = NULL;
-    self->num_sources  = n + 1;
-}
-
-void
-CFCHierarchy_add_include_dir(CFCHierarchy *self, const char *include_dir) {
-    size_t n = self->num_includes;
-    size_t size = (n + 2) * sizeof(char*);
-    self->includes      = (char**)REALLOCATE(self->includes, size);
-    self->includes[n]   = CFCUtil_strdup(include_dir);
-    self->includes[n+1] = NULL;
-    self->num_includes  = n + 1;
-}
-
-void
-CFCHierarchy_build(CFCHierarchy *self) {
-    CFCParseParcelFilesContext context;
-    context.is_included = false;
-    for (size_t i = 0; self->sources[i] != NULL; i++) {
-        CFCUtil_walk(self->sources[i], S_parse_parcel_files, &context);
-    }
-    context.is_included = true;
-    for (size_t i = 0; self->includes[i] != NULL; i++) {
-        CFCUtil_walk(self->includes[i], S_parse_parcel_files, &context);
-    }
-    for (size_t i = 0; self->sources[i] != NULL; i++) {
-        S_parse_cf_files(self, self->sources[i], 0);
-    }
-    for (size_t i = 0; self->includes[i] != NULL; i++) {
-        S_parse_cf_files(self, self->includes[i], 1);
-    }
-    for (int i = 0; self->classes[i] != NULL; i++) {
-        CFCClass_resolve_types(self->classes[i], self->classes);
-    }
-    S_connect_classes(self);
-    for (size_t i = 0; self->trees[i] != NULL; i++) {
-        CFCClass_grow_tree(self->trees[i]);
-    }
-}
-
-static void
-S_parse_parcel_files(const char *path, void *arg) {
-    CFCParseParcelFilesContext *context = (CFCParseParcelFilesContext*)arg;
-
-    // Ignore hidden files.
-    if (strstr(path, CHY_DIR_SEP ".") != NULL) {
-        return;
-    }
-
-    // Parse .cfp files and register the parcels they define.
-    size_t path_len = strlen(path);
-    if (path_len > 4 && (strcmp((path + path_len - 4), ".cfp") == 0)) {
-        CFCParcel *parcel = CFCParcel_new_from_file(path,
-                                                    context->is_included);
-        CFCParcel *existing = CFCParcel_fetch(CFCParcel_get_name(parcel));
-        if (existing) {
-            if (!CFCParcel_equals(parcel, existing)) {
-                CFCUtil_die("Incompatible parcel '%s' already registered",
-                            CFCParcel_get_name(parcel));
-            }
-        }
-        else {
-            CFCParcel_register(parcel);
-        }
-        CFCBase_decref((CFCBase*)parcel);
-    }
-}
-
-static void
-S_find_cfh(const char *path, void *context) {
-    char ***cfh_ptr = (char***)context;
-    char **cfh_list = *cfh_ptr;
-    // Ignore updirs and hidden files.
-    if (strstr(path, CHY_DIR_SEP ".") != NULL) {
-        return;
-    }
-    size_t path_len = strlen(path);
-    if (path_len > 4 && (strcmp((path + path_len - 4), ".cfh") == 0)) {
-        size_t num_cfh = 0;
-        while (cfh_list[num_cfh] != NULL) { num_cfh++; }
-        size_t size = (num_cfh + 2) * sizeof(char*);
-        cfh_list = (char**)REALLOCATE(cfh_list, size);
-        cfh_list[num_cfh] = CFCUtil_strdup(path);
-        cfh_list[num_cfh + 1] = NULL;
-    }
-
-    *cfh_ptr = cfh_list;
-}
-
-static void
-S_parse_cf_files(CFCHierarchy *self, const char *source_dir, int is_included) {
-    char **all_source_paths = (char**)CALLOCATE(1, sizeof(char*));
-    CFCUtil_walk(source_dir, S_find_cfh, &all_source_paths);
-    size_t source_dir_len  = strlen(source_dir);
-    char *path_part = NULL;
-    size_t path_part_max = 0;
-
-    // Process any file that has at least one class declaration.
-    for (int i = 0; all_source_paths[i] != NULL; i++) {
-        // Derive the name of the class that owns the module file.
-        char *source_path = all_source_paths[i];
-        size_t source_path_len = strlen(source_path);
-        if (strncmp(source_path, source_dir, source_dir_len) != 0) {
-            CFCUtil_die("'%s' doesn't start with '%s'", source_path,
-                        source_dir);
-        }
-        size_t path_part_len = source_path_len
-                               - source_dir_len
-                               - strlen(".cfh");
-        if (path_part_max < path_part_len + 1) {
-            path_part_max = path_part_len + 1;
-            path_part = (char*)REALLOCATE(path_part, path_part_max);
-        }
-        const char *src = source_path + source_dir_len;
-        while (*src == CHY_DIR_SEP_CHAR) {
-            ++src;
-            --path_part_len;
-        }
-        memcpy(path_part, src, path_part_len);
-        path_part[path_part_len] = '\0';
-
-        // Make sure path_part is unique
-        CFCFile *existing = S_fetch_file(self, path_part);
-        if (existing) {
-            if (is_included && !CFCFile_included(existing)) {
-                // Allow filename clash between source and include dirs
-                CFCUtil_warn("Warning: File %s.cfh from source dir takes "
-                             "precedence over file from include dir",
-                             path_part);
-                // Ignore file
-                continue;
-            }
-            else {
-                CFCUtil_die("File %s.cfh already registered", path_part);
-            }
-        }
-
-        CFCFileSpec *file_spec = CFCFileSpec_new(source_dir, path_part,
-                                                 is_included);
-
-        // Slurp, parse, add parsed file to pool.
-        size_t unused;
-        char *content = CFCUtil_slurp_text(source_path, &unused);
-        CFCFile *file = CFCParser_parse_file(self->parser, content, file_spec);
-        FREEMEM(content);
-        if (!file) {
-            CFCUtil_die("parser error for %s", source_path);
-        }
-        S_add_file(self, file);
-
-        CFCClass **classes_in_file = CFCFile_classes(file);
-        for (size_t j = 0; classes_in_file[j] != NULL; j++) {
-            if (self->num_classes == self->classes_cap) {
-                self->classes_cap += 10;
-                self->classes = (CFCClass**)REALLOCATE(
-                                  self->classes,
-                                  (self->classes_cap + 1) * sizeof(CFCClass*));
-            }
-            self->classes[self->num_classes++]
-                = (CFCClass*)CFCBase_incref((CFCBase*)classes_in_file[j]);
-            self->classes[self->num_classes] = NULL;
-        }
-        CFCBase_decref((CFCBase*)file);
-        CFCBase_decref((CFCBase*)file_spec);
-    }
-    self->classes[self->num_classes] = NULL;
-
-    for (int i = 0; all_source_paths[i] != NULL; i++) {
-        FREEMEM(all_source_paths[i]);
-    }
-    FREEMEM(all_source_paths);
-    FREEMEM(path_part);
-}
-
-static void
-S_connect_classes(CFCHierarchy *self) {
-    // Wrangle the classes into hierarchies and figure out inheritance.
-    for (int i = 0; self->classes[i] != NULL; i++) {
-        CFCClass *klass = self->classes[i];
-        const char *parent_name = CFCClass_get_parent_class_name(klass);
-        if (parent_name) {
-            for (size_t j = 0; ; j++) {
-                CFCClass *maybe_parent = self->classes[j];
-                if (!maybe_parent) {
-                    CFCUtil_die("Parent class '%s' not defined", parent_name);
-                }
-                const char *maybe_parent_name
-                    = CFCClass_get_class_name(maybe_parent);
-                if (strcmp(parent_name, maybe_parent_name) == 0) {
-                    CFCClass_add_child(maybe_parent, klass);
-                    break;
-                }
-            }
-        }
-        else {
-            S_add_tree(self, klass);
-        }
-    }
-}
-
-int
-CFCHierarchy_propagate_modified(CFCHierarchy *self, int modified) {
-    // Seed the recursive write.
-    int somebody_is_modified = false;
-    for (size_t i = 0; self->trees[i] != NULL; i++) {
-        CFCClass *tree = self->trees[i];
-        if (S_do_propagate_modified(self, tree, modified)) {
-            somebody_is_modified = true;
-        }
-    }
-    if (somebody_is_modified || modified) {
-        return true;
-    }
-    else {
-        return false;
-    }
-}
-
-int
-S_do_propagate_modified(CFCHierarchy *self, CFCClass *klass, int modified) {
-    const char *path_part = CFCClass_get_path_part(klass);
-    CFCUTIL_NULL_CHECK(path_part);
-    CFCFile *file = S_fetch_file(self, path_part);
-    CFCUTIL_NULL_CHECK(file);
-    const char *source_dir = CFCFile_get_source_dir(file);
-    CFCUTIL_NULL_CHECK(source_dir);
-    char *source_path = CFCFile_cfh_path(file, source_dir);
-    char *h_path      = CFCFile_h_path(file, self->inc_dest);
-
-    if (!CFCUtil_current(source_path, h_path)) {
-        modified = true;
-    }
-    FREEMEM(h_path);
-    FREEMEM(source_path);
-    if (modified) {
-        CFCFile_set_modified(file, modified);
-    }
-
-    // Proceed to the next generation.
-    int somebody_is_modified = modified;
-    CFCClass **children = CFCClass_children(klass);
-    for (size_t i = 0; children[i] != NULL; i++) {
-        CFCClass *kid = children[i];
-        if (CFCClass_final(klass)) {
-            CFCUtil_die("Attempt to inherit from final class '%s' by '%s'",
-                        CFCClass_get_class_name(klass),
-                        CFCClass_get_class_name(kid));
-        }
-        if (S_do_propagate_modified(self, kid, modified)) {
-            somebody_is_modified = 1;
-        }
-    }
-
-    return somebody_is_modified;
-}
-
-static void
-S_add_tree(CFCHierarchy *self, CFCClass *klass) {
-    CFCUTIL_NULL_CHECK(klass);
-    const char *full_struct_sym = CFCClass_full_struct_sym(klass);
-    for (size_t i = 0; self->trees[i] != NULL; i++) {
-        const char *existing = CFCClass_full_struct_sym(self->trees[i]);
-        if (strcmp(full_struct_sym, existing) == 0) {
-            CFCUtil_die("Tree '%s' alread added", full_struct_sym);
-        }
-    }
-    self->num_trees++;
-    size_t size = (self->num_trees + 1) * sizeof(CFCClass*);
-    self->trees = (CFCClass**)REALLOCATE(self->trees, size);
-    self->trees[self->num_trees - 1]
-        = (CFCClass*)CFCBase_incref((CFCBase*)klass);
-    self->trees[self->num_trees] = NULL;
-}
-
-CFCClass**
-CFCHierarchy_ordered_classes(CFCHierarchy *self) {
-    size_t num_classes = 0;
-    size_t max_classes = 10;
-    CFCClass **ladder = (CFCClass**)MALLOCATE(
-                            (max_classes + 1) * sizeof(CFCClass*));
-    for (size_t i = 0; self->trees[i] != NULL; i++) {
-        CFCClass *tree = self->trees[i];
-        CFCClass **child_ladder = CFCClass_tree_to_ladder(tree);
-        for (size_t j = 0; child_ladder[j] != NULL; j++) {
-            if (num_classes == max_classes) {
-                max_classes += 10;
-                ladder = (CFCClass**)REALLOCATE(
-                             ladder, (max_classes + 1) * sizeof(CFCClass*));
-            }
-            ladder[num_classes++] = child_ladder[j];
-        }
-        FREEMEM(child_ladder);
-    }
-    ladder[num_classes] = NULL;
-    return ladder;
-}
-
-static CFCFile*
-S_fetch_file(CFCHierarchy *self, const char *path_part) {
-    for (size_t i = 0; self->files[i] != NULL; i++) {
-        const char *existing = CFCFile_get_path_part(self->files[i]);
-        if (strcmp(path_part, existing) == 0) {
-            return self->files[i];
-        }
-    }
-    return NULL;
-}
-
-static void
-S_add_file(CFCHierarchy *self, CFCFile *file) {
-    CFCUTIL_NULL_CHECK(file);
-    CFCClass **classes = CFCFile_classes(file);
-    for (size_t i = 0; self->files[i] != NULL; i++) {
-        CFCFile *existing = self->files[i];
-        CFCClass **existing_classes = CFCFile_classes(existing);
-        for (size_t j = 0; classes[j] != NULL; j++) {
-            const char *new_class_name = CFCClass_get_class_name(classes[j]);
-            for (size_t k = 0; existing_classes[k] != NULL; k++) {
-                const char *existing_class_name
-                    = CFCClass_get_class_name(existing_classes[k]);
-                if (strcmp(new_class_name, existing_class_name) == 0) {
-                    CFCUtil_die("Class '%s' already registered",
-                                new_class_name);
-                }
-            }
-        }
-    }
-    self->num_files++;
-    size_t size = (self->num_files + 1) * sizeof(CFCFile*);
-    self->files = (CFCFile**)REALLOCATE(self->files, size);
-    self->files[self->num_files - 1]
-        = (CFCFile*)CFCBase_incref((CFCBase*)file);
-    self->files[self->num_files] = NULL;
-}
-
-struct CFCFile**
-CFCHierarchy_files(CFCHierarchy *self) {
-    return self->files;
-}
-
-const char**
-CFCHierarchy_get_source_dirs(CFCHierarchy *self) {
-    return (const char **)self->sources;
-}
-
-const char**
-CFCHierarchy_get_include_dirs(CFCHierarchy *self) {
-    return (const char **)self->includes;
-}
-
-const char*
-CFCHierarchy_get_dest(CFCHierarchy *self) {
-    return self->dest;
-}
-
-const char*
-CFCHierarchy_get_include_dest(CFCHierarchy *self) {
-    return self->inc_dest;
-}
-
-const char*
-CFCHierarchy_get_source_dest(CFCHierarchy *self) {
-    return self->src_dest;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCHierarchy.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCHierarchy.h b/clownfish/compiler/src/CFCHierarchy.h
deleted file mode 100644
index f04edb6..0000000
--- a/clownfish/compiler/src/CFCHierarchy.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Model::Hierarchy - A class hierarchy.
- *
- * A Clownfish::CFC::Model::Hierarchy consists of all the classes defined in
- * files within a source directory and its subdirectories.
- *
- * There may be more than one tree within the Hierarchy, since all "inert"
- * classes are root nodes, and since Clownfish does not officially define any
- * core classes itself from which all instantiable classes must descend.
- */
-
-#ifndef H_CFCHIERARCHY
-#define H_CFCHIERARCHY
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCHierarchy CFCHierarchy;
-struct CFCClass;
-struct CFCFile;
-
-/**
- * @param dest The directory where the autogenerated files will be written.
- */
-CFCHierarchy*
-CFCHierarchy_new(const char *dest);
-
-CFCHierarchy*
-CFCHierarchy_init(CFCHierarchy *self, const char *dest);
-
-void
-CFCHierarchy_destroy(CFCHierarchy *self);
-
-/** Add path C<source_dir> to the list of source directories.
- */
-void
-CFCHierarchy_add_source_dir(CFCHierarchy *self, const char *source_dir);
-
-/** Add path C<include_dir> to the list of include directories.
- */
-void
-CFCHierarchy_add_include_dir(CFCHierarchy *self, const char *include_dir);
-
-/** Parse every Clownfish header file which can be found under any of the
- * source and include directories, building up the object hierarchy.
- */
-void
-CFCHierarchy_build(CFCHierarchy *self);
-
-/** Visit all File objects in the hierarchy.  If a parent node is modified, mark
- * all of its children as modified.
- *
- * If the supplied argument is true, mark all Files as modified.
- */
-int
-CFCHierarchy_propagate_modified(CFCHierarchy *self, int modified);
-
-/** Return all Classes as an array with the property that every parent class
- * will precede all of its children.
- */
-struct CFCClass**
-CFCHierarchy_ordered_classes(CFCHierarchy *self);
-
-struct CFCFile**
-CFCHierarchy_files(CFCHierarchy *self);
-
-const char**
-CFCHierarchy_get_source_dirs(CFCHierarchy *self);
-
-const char**
-CFCHierarchy_get_include_dirs(CFCHierarchy *self);
-
-const char*
-CFCHierarchy_get_dest(CFCHierarchy *self);
-
-const char*
-CFCHierarchy_get_include_dest(CFCHierarchy *self);
-
-const char*
-CFCHierarchy_get_source_dest(CFCHierarchy *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCHIERARCHY */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCLexHeader.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCLexHeader.c b/clownfish/compiler/src/CFCLexHeader.c
deleted file mode 100644
index b4362a8..0000000
--- a/clownfish/compiler/src/CFCLexHeader.c
+++ /dev/null
@@ -1,2045 +0,0 @@
-#line 2 "../src/CFCLexHeader.c"
-
-#line 4 "../src/CFCLexHeader.c"
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index.  If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
- */
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN (yy_start) = 1 + 2 *
-
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START (((yy_start) - 1) / 2)
-#define YYSTATE YY_START
-
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin  )
-
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t yyleng;
-
-extern FILE *yyin, *yyout;
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
-     *       access to the local variable yy_act. Since yyless() is a macro, it would break
-     *       existing scanners that call yyless() from OUTSIDE yylex. 
-     *       One obvious solution it to make yy_act a global. I tried that, and saw
-     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
-     *       normally declared as a register variable-- so it is not worth it.
-     */
-    #define  YY_LESS_LINENO(n) \
-            do { \
-                yy_size_t yyl;\
-                for ( yyl = n; yyl < yyleng; ++yyl )\
-                    if ( yytext[yyl] == '\n' )\
-                        --yylineno;\
-            }while(0)
-    
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		*yy_cp = (yy_hold_char); \
-		YY_RESTORE_YY_MORE_OFFSET \
-		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
-		} \
-	while ( 0 )
-
-#define unput(c) yyunput( c, (yytext_ptr)  )
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	yy_size_t yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-
-#define YY_BUFFER_NEW 0
-#define YY_BUFFER_NORMAL 1
-	/* When an EOF's been seen but there's still some text to process
-	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-	 * shouldn't try reading from the input source any more.  We might
-	 * still have a bunch of tokens to match, though, because of
-	 * possible backing-up.
-	 *
-	 * When we actually see the EOF, we change the status to "new"
-	 * (via yyrestart()), so that the user can continue scanning by
-	 * just pointing yyin at a new input file.
-	 */
-#define YY_BUFFER_EOF_PENDING 2
-
-	};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* Stack of input buffers. */
-static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
-static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
-static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
-                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
-                          : NULL)
-
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
-
-/* yy_hold_char holds the character lost when yytext is formed. */
-static char yy_hold_char;
-static yy_size_t yy_n_chars;		/* number of characters read into yy_ch_buf */
-yy_size_t yyleng;
-
-/* Points to current character in buffer. */
-static char *yy_c_buf_p = (char *) 0;
-static int yy_init = 0;		/* whether we need to initialize */
-static int yy_start = 0;	/* start state number */
-
-/* Flag which is used to allow yywrap()'s to do buffer switches
- * instead of setting up a fresh yyin.  A bit of a hack ...
- */
-static int yy_did_buffer_switch_on_eof;
-
-void yyrestart (FILE *input_file  );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
-void yy_delete_buffer (YY_BUFFER_STATE b  );
-void yy_flush_buffer (YY_BUFFER_STATE b  );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void yypop_buffer_state (void );
-
-static void yyensure_buffer_stack (void );
-static void yy_load_buffer_state (void );
-static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
-
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
-
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
-
-void *yyalloc (yy_size_t  );
-void *yyrealloc (void *,yy_size_t  );
-void yyfree (void *  );
-
-#define yy_new_buffer yy_create_buffer
-
-#define yy_set_interactive(is_interactive) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){ \
-        yyensure_buffer_stack (); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
-	}
-
-#define yy_set_bol(at_bol) \
-	{ \
-	if ( ! YY_CURRENT_BUFFER ){\
-        yyensure_buffer_stack (); \
-		YY_CURRENT_BUFFER_LVALUE =    \
-            yy_create_buffer(yyin,YY_BUF_SIZE ); \
-	} \
-	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
-	}
-
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define yywrap(n) 1
-#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
-
-FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
-
-typedef int yy_state_type;
-
-extern int yylineno;
-
-int yylineno = 1;
-
-extern char *yytext;
-#define yytext_ptr yytext
-
-static yy_state_type yy_get_previous_state (void );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
-static int yy_get_next_buffer (void );
-static void yy_fatal_error (yyconst char msg[]  );
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION \
-	(yytext_ptr) = yy_bp; \
-	yyleng = (yy_size_t) (yy_cp - yy_bp); \
-	(yy_hold_char) = *yy_cp; \
-	*yy_cp = '\0'; \
-	(yy_c_buf_p) = yy_cp;
-
-#define YY_NUM_RULES 27
-#define YY_END_OF_BUFFER 28
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-	{
-	flex_int32_t yy_verify;
-	flex_int32_t yy_nxt;
-	};
-static yyconst flex_int16_t yy_accept[76] =
-    {   0,
-        0,    0,    0,    0,   28,   26,   25,   25,   26,    7,
-        8,    2,   10,   26,   26,   26,   15,   15,   26,   11,
-       12,   17,    5,    6,   17,    3,    4,   21,   21,   22,
-        0,   16,    0,   15,   15,    0,    0,    0,    0,    1,
-       17,   17,   21,   22,    9,    0,    0,   14,   13,   17,
-        0,   22,    0,    0,    0,   24,   17,    0,   24,    0,
-        0,   23,    0,    0,   17,    0,   23,   23,   18,    0,
-        0,    0,   20,   19,    0
-    } ;
-
-static yyconst flex_int32_t yy_ec[256] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
-        4,    4,    2,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    2,    1,    5,    1,    1,    1,    1,    1,    6,
-        7,    8,    1,    9,   10,   11,   12,   13,   14,   14,
-       14,   14,   14,   14,   14,   14,   14,   15,   16,    1,
-       17,    1,    1,    1,   18,   18,   19,   20,   21,   18,
-       22,   22,   22,   22,   22,   22,   22,   23,   22,   22,
-       22,   22,   22,   22,   22,   22,   22,   22,   22,   22,
-       24,   25,   26,    1,   27,    1,   18,   18,   18,   18,
-
-       18,   18,   22,   22,   22,   22,   22,   22,   22,   22,
-       22,   22,   22,   22,   22,   22,   22,   22,   22,   28,
-       22,   22,   29,    1,   30,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1
-    } ;
-
-static yyconst flex_int32_t yy_meta[31] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    2,    2,    1,    1,    1,    2,    2,    2,
-        2,    3,    3,    1,    1,    1,    4,    3,    1,    1
-    } ;
-
-static yyconst flex_int16_t yy_base[85] =
-    {   0,
-        0,    0,   28,   29,  130,  131,  131,  131,   28,  131,
-      131,  131,  131,   21,  118,  120,   26,   30,  112,  131,
-      131,    0,  131,  131,   99,  131,  131,    0,    0,   98,
-       33,  131,  121,   34,   38,  112,  114,   46,    0,  131,
-        0,  102,    0,   15,  131,  112,   38,   50,    0,   92,
-       95,   90,  104,  107,   49,  106,   86,   92,  131,   99,
-       57,  102,  101,   96,   64,   80,  131,  131,   68,   87,
-       78,   77,  131,  131,  131,   72,   76,   79,   83,   86,
-      101,   90,   94,   98
-    } ;
-
-static yyconst flex_int16_t yy_def[85] =
-    {   0,
-       75,    1,   76,   76,   75,   75,   75,   75,   77,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   78,   75,   75,   78,   75,   75,   79,   79,   75,
-       77,   75,   77,   75,   75,   75,   80,   75,   81,   75,
-       78,   78,   79,   75,   75,   80,   82,   75,   81,   78,
-       75,   75,   80,   82,   82,   83,   78,   75,   75,   82,
-       82,   80,   83,   83,   78,   75,   75,   75,   75,   75,
-       75,   84,   75,   75,    0,   75,   75,   75,   75,   75,
-       75,   75,   75,   75
-    } ;
-
-static yyconst flex_int16_t yy_nxt[162] =
-    {   0,
-        6,    7,    8,    6,    9,   10,   11,   12,   13,   14,
-       15,   16,   17,   18,   19,   20,   21,   22,   22,   22,
-       22,   22,   22,   23,    6,   24,   25,   22,   26,   27,
-       29,   29,   32,   34,   35,   51,   38,   32,   35,   35,
-       38,   52,   35,   35,   38,   55,   35,   35,   38,   56,
-       35,   35,   33,   39,   30,   30,   61,   33,   48,   48,
-       62,   39,   48,   48,   55,   69,   69,   69,   56,   69,
-       69,   69,   28,   28,   28,   28,   31,   31,   31,   31,
-       41,   41,   41,   43,   43,   43,   46,   46,   46,   46,
-       54,   54,   54,   54,   63,   63,   63,   63,   73,   73,
-
-       73,   73,   49,   74,   72,   71,   70,   68,   64,   53,
-       67,   66,   65,   64,   60,   59,   52,   58,   57,   53,
-       50,   47,   45,   75,   44,   42,   40,   37,   36,   75,
-        5,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75
-    } ;
-
-static yyconst flex_int16_t yy_chk[162] =
-    {   0,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        3,    4,    9,   14,   14,   44,   17,   31,   17,   17,
-       18,   44,   18,   18,   34,   47,   34,   34,   35,   47,
-       35,   35,    9,   17,    3,    4,   55,   31,   38,   38,
-       55,   34,   48,   48,   61,   65,   65,   65,   61,   69,
-       69,   69,   76,   76,   76,   76,   77,   77,   77,   77,
-       78,   78,   78,   79,   79,   79,   80,   80,   80,   80,
-       82,   82,   82,   82,   83,   83,   83,   83,   84,   84,
-
-       84,   84,   81,   72,   71,   70,   66,   64,   63,   62,
-       60,   58,   57,   56,   54,   53,   52,   51,   50,   46,
-       42,   37,   36,   33,   30,   25,   19,   16,   15,    5,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75,   75,   75,   75,   75,   75,   75,   75,   75,   75,
-       75
-    } ;
-
-/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[28] =
-    {   0,
-0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 
-    1, 1, 0, 1, 1, 1, 0, 0,     };
-
-static yy_state_type yy_last_accepting_state;
-static char *yy_last_accepting_cpos;
-
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
-#line 1 "../src/CFCLexHeader.l"
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#line 18 "../src/CFCLexHeader.l"
-    #include "CFC.h"
-    #include "CFCParseHeader.h"
-
-    /* Dupe yytext and invoke Lemon-generated parser. */
-    #define PARSE(token_type) \
-        CFCParseHeader(CFCParser_current_parser, token_type, \
-			CFCParser_dupe(CFCParser_current_state, yytext), \
-			CFCParser_current_state)
-
-    struct cfc_StringID {
-        const char *string;
-        int token_type;
-    };
-    struct cfc_StringID reserved_word_map[] = {
-        {"NULL", CFC_TOKENTYPE_NULL },
-        {"abstract", CFC_TOKENTYPE_ABSTRACT },
-        {"bool", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"char", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"class", CFC_TOKENTYPE_CLASS },
-        {"cnick", CFC_TOKENTYPE_CNICK },
-        {"const", CFC_TOKENTYPE_CONST },
-        {"decremented", CFC_TOKENTYPE_DECREMENTED },
-        {"double", CFC_TOKENTYPE_FLOAT_TYPE_NAME },
-        {"false", CFC_TOKENTYPE_FALSE },
-        {"final", CFC_TOKENTYPE_FINAL },
-        {"float", CFC_TOKENTYPE_FLOAT_TYPE_NAME },
-        {"incremented", CFC_TOKENTYPE_INCREMENTED },
-        {"inert", CFC_TOKENTYPE_INERT },
-        {"inherits", CFC_TOKENTYPE_INHERITS },
-        {"inline", CFC_TOKENTYPE_INLINE },
-        {"int", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"int16_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"int32_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"int64_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"int8_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"long", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"nullable", CFC_TOKENTYPE_NULLABLE },
-        {"parcel", CFC_TOKENTYPE_PARCEL },
-        {"public", CFC_TOKENTYPE_PUBLIC },
-        {"short", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"size_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"true", CFC_TOKENTYPE_TRUE },
-        {"uint16_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"uint32_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"uint64_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"uint8_t", CFC_TOKENTYPE_INTEGER_TYPE_NAME },
-        {"va_list", CFC_TOKENTYPE_VA_LIST },
-        {"void", CFC_TOKENTYPE_VOID },
-    };
-    #define NUM_RESERVED_WORDS \
-        (sizeof(reserved_word_map) / sizeof(struct cfc_StringID))
-
-    static int
-    S_compare(const void *va, const void *vb) {
-        const char *a = (const char*)va;
-        struct cfc_StringID *b
-            = (struct cfc_StringID*)vb;
-        return strcmp(a, b->string);
-    }
-
-    static int
-    S_identifier_or_keyword(const char *word) {
-        struct cfc_StringID *got = (struct cfc_StringID*)
-            bsearch(word, reserved_word_map, NUM_RESERVED_WORDS,
-                    sizeof(struct cfc_StringID), S_compare);
-        if (got) {
-            return got->token_type;
-        }
-        else {
-            return CFC_TOKENTYPE_IDENTIFIER;
-        }
-    }
-
-#line 621 "../src/CFCLexHeader.c"
-
-#define INITIAL 0
-#define CBLOCK 1
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-static int yy_init_globals (void );
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy (void );
-
-int yyget_debug (void );
-
-void yyset_debug (int debug_flag  );
-
-YY_EXTRA_TYPE yyget_extra (void );
-
-void yyset_extra (YY_EXTRA_TYPE user_defined  );
-
-FILE *yyget_in (void );
-
-void yyset_in  (FILE * in_str  );
-
-FILE *yyget_out (void );
-
-void yyset_out  (FILE * out_str  );
-
-yy_size_t yyget_leng (void );
-
-char *yyget_text (void );
-
-int yyget_lineno (void );
-
-void yyset_lineno (int line_number  );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap (void );
-#else
-extern int yywrap (void );
-#endif
-#endif
-
-    static void yyunput (int c,char *buf_ptr  );
-    
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#ifdef __cplusplus
-static int yyinput (void );
-#else
-static int input (void );
-#endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#define YY_INPUT(buf,result,max_size) \
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
-		{ \
-		int c = '*'; \
-		yy_size_t n; \
-		for ( n = 0; n < max_size && \
-			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
-			buf[n] = (char) c; \
-		if ( c == '\n' ) \
-			buf[n++] = (char) c; \
-		if ( c == EOF && ferror( yyin ) ) \
-			YY_FATAL_ERROR( "input in flex scanner failed" ); \
-		result = n; \
-		} \
-	else \
-		{ \
-		errno=0; \
-		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
-			{ \
-			if( errno != EINTR) \
-				{ \
-				YY_FATAL_ERROR( "input in flex scanner failed" ); \
-				break; \
-				} \
-			errno=0; \
-			clearerr(yyin); \
-			} \
-		}\
-\
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int yylex (void);
-
-#define YY_DECL int yylex (void)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#define YY_BREAK break;
-#endif
-
-#define YY_RULE_SETUP \
-	YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp, *yy_bp;
-	register int yy_act;
-    
-#line 99 "../src/CFCLexHeader.l"
-
-#line 798 "../src/CFCLexHeader.c"
-
-	if ( !(yy_init) )
-		{
-		(yy_init) = 1;
-
-#ifdef YY_USER_INIT
-		YY_USER_INIT;
-#endif
-
-		if ( ! (yy_start) )
-			(yy_start) = 1;	/* first start state */
-
-		if ( ! yyin )
-			yyin = stdin;
-
-		if ( ! yyout )
-			yyout = stdout;
-
-		if ( ! YY_CURRENT_BUFFER ) {
-			yyensure_buffer_stack ();
-			YY_CURRENT_BUFFER_LVALUE =
-				yy_create_buffer(yyin,YY_BUF_SIZE );
-		}
-
-		yy_load_buffer_state( );
-		}
-
-	while ( 1 )		/* loops until end-of-file is reached */
-		{
-		yy_cp = (yy_c_buf_p);
-
-		/* Support of yytext. */
-		*yy_cp = (yy_hold_char);
-
-		/* yy_bp points to the position in yy_ch_buf of the start of
-		 * the current run.
-		 */
-		yy_bp = yy_cp;
-
-		yy_current_state = (yy_start);
-yy_match:
-		do
-			{
-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-			if ( yy_accept[yy_current_state] )
-				{
-				(yy_last_accepting_state) = yy_current_state;
-				(yy_last_accepting_cpos) = yy_cp;
-				}
-			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-				{
-				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 76 )
-					yy_c = yy_meta[(unsigned int) yy_c];
-				}
-			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-			++yy_cp;
-			}
-		while ( yy_current_state != 75 );
-		yy_cp = (yy_last_accepting_cpos);
-		yy_current_state = (yy_last_accepting_state);
-
-yy_find_action:
-		yy_act = yy_accept[yy_current_state];
-
-		YY_DO_BEFORE_ACTION;
-
-		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
-			{
-			yy_size_t yyl;
-			for ( yyl = 0; yyl < yyleng; ++yyl )
-				if ( yytext[yyl] == '\n' )
-					   
-    yylineno++;
-;
-			}
-
-do_action:	/* This label is used only to access EOF actions. */
-
-		switch ( yy_act )
-	{ /* beginning of action switch */
-			case 0: /* must back up */
-			/* undo the effects of YY_DO_BEFORE_ACTION */
-			*yy_cp = (yy_hold_char);
-			yy_cp = (yy_last_accepting_cpos);
-			yy_current_state = (yy_last_accepting_state);
-			goto yy_find_action;
-
-case 1:
-YY_RULE_SETUP
-#line 100 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_SCOPE_OP); }
-	YY_BREAK
-case 2:
-YY_RULE_SETUP
-#line 101 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_ASTERISK); }
-	YY_BREAK
-case 3:
-YY_RULE_SETUP
-#line 102 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_LEFT_CURLY_BRACE); }
-	YY_BREAK
-case 4:
-YY_RULE_SETUP
-#line 103 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_RIGHT_CURLY_BRACE); }
-	YY_BREAK
-case 5:
-YY_RULE_SETUP
-#line 104 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_LEFT_SQUARE_BRACKET); }
-	YY_BREAK
-case 6:
-YY_RULE_SETUP
-#line 105 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_RIGHT_SQUARE_BRACKET); }
-	YY_BREAK
-case 7:
-YY_RULE_SETUP
-#line 106 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_LEFT_PAREN); }
-	YY_BREAK
-case 8:
-YY_RULE_SETUP
-#line 107 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_RIGHT_PAREN); }
-	YY_BREAK
-case 9:
-YY_RULE_SETUP
-#line 108 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_ELLIPSIS); }
-	YY_BREAK
-case 10:
-YY_RULE_SETUP
-#line 109 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_COMMA); }
-	YY_BREAK
-case 11:
-YY_RULE_SETUP
-#line 110 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_SEMICOLON); }
-	YY_BREAK
-case 12:
-YY_RULE_SETUP
-#line 111 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_EQUALS); }
-	YY_BREAK
-case 13:
-YY_RULE_SETUP
-#line 113 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_HEX_LITERAL); }
-	YY_BREAK
-case 14:
-YY_RULE_SETUP
-#line 114 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_FLOAT_LITERAL); }
-	YY_BREAK
-case 15:
-YY_RULE_SETUP
-#line 115 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_INTEGER_LITERAL); }
-	YY_BREAK
-case 16:
-/* rule 16 can match eol */
-YY_RULE_SETUP
-#line 116 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_STRING_LITERAL); }
-	YY_BREAK
-case 17:
-YY_RULE_SETUP
-#line 118 "../src/CFCLexHeader.l"
-{ PARSE(S_identifier_or_keyword(yytext)); }
-	YY_BREAK
-case 18:
-/* rule 18 can match eol */
-YY_RULE_SETUP
-#line 120 "../src/CFCLexHeader.l"
-{ BEGIN(CBLOCK);  PARSE(CFC_TOKENTYPE_CBLOCK_START); }
-	YY_BREAK
-case 19:
-YY_RULE_SETUP
-#line 121 "../src/CFCLexHeader.l"
-{ BEGIN(INITIAL); PARSE(CFC_TOKENTYPE_CBLOCK_CLOSE); }
-	YY_BREAK
-case 20:
-/* rule 20 can match eol */
-YY_RULE_SETUP
-#line 122 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_BLOB); }
-	YY_BREAK
-case 21:
-/* rule 21 can match eol */
-YY_RULE_SETUP
-#line 123 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_BLOB); }
-	YY_BREAK
-case 22:
-YY_RULE_SETUP
-#line 124 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_BLOB); }
-	YY_BREAK
-/* Parse docucomments, but skip ordinary comments */
-case 23:
-/* rule 23 can match eol */
-YY_RULE_SETUP
-#line 127 "../src/CFCLexHeader.l"
-{ PARSE(CFC_TOKENTYPE_DOCUCOMMENT); }
-	YY_BREAK
-case 24:
-/* rule 24 can match eol */
-YY_RULE_SETUP
-#line 128 "../src/CFCLexHeader.l"
-
-	YY_BREAK
-case 25:
-/* rule 25 can match eol */
-YY_RULE_SETUP
-#line 130 "../src/CFCLexHeader.l"
-/* Skip whitespace. */
-	YY_BREAK
-case 26:
-YY_RULE_SETUP
-#line 131 "../src/CFCLexHeader.l"
-{ 
-                printf("Bad input character '%s' at line %d\n", yytext, yylineno);
-                yyterminate();
-           }
-	YY_BREAK
-case YY_STATE_EOF(INITIAL):
-case YY_STATE_EOF(CBLOCK):
-#line 135 "../src/CFCLexHeader.l"
-{ yyterminate(); }
-	YY_BREAK
-case 27:
-YY_RULE_SETUP
-#line 136 "../src/CFCLexHeader.l"
-YY_FATAL_ERROR( "flex scanner jammed" );
-	YY_BREAK
-#line 1038 "../src/CFCLexHeader.c"
-
-	case YY_END_OF_BUFFER:
-		{
-		/* Amount of text matched not including the EOB char. */
-		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
-
-		/* Undo the effects of YY_DO_BEFORE_ACTION. */
-		*yy_cp = (yy_hold_char);
-		YY_RESTORE_YY_MORE_OFFSET
-
-		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
-			{
-			/* We're scanning a new file or input source.  It's
-			 * possible that this happened because the user
-			 * just pointed yyin at a new source and called
-			 * yylex().  If so, then we have to assure
-			 * consistency between YY_CURRENT_BUFFER and our
-			 * globals.  Here is the right place to do so, because
-			 * this is the first action (other than possibly a
-			 * back-up) that will match for the new input source.
-			 */
-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-			}
-
-		/* Note that here we test for yy_c_buf_p "<=" to the position
-		 * of the first EOB in the buffer, since yy_c_buf_p will
-		 * already have been incremented past the NUL character
-		 * (since all states make transitions on EOB to the
-		 * end-of-buffer state).  Contrast this with the test
-		 * in input().
-		 */
-		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-			{ /* This was really a NUL. */
-			yy_state_type yy_next_state;
-
-			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
-
-			yy_current_state = yy_get_previous_state(  );
-
-			/* Okay, we're now positioned to make the NUL
-			 * transition.  We couldn't have
-			 * yy_get_previous_state() go ahead and do it
-			 * for us because it doesn't know how to deal
-			 * with the possibility of jamming (and we don't
-			 * want to build jamming into it because then it
-			 * will run more slowly).
-			 */
-
-			yy_next_state = yy_try_NUL_trans( yy_current_state );
-
-			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-
-			if ( yy_next_state )
-				{
-				/* Consume the NUL. */
-				yy_cp = ++(yy_c_buf_p);
-				yy_current_state = yy_next_state;
-				goto yy_match;
-				}
-
-			else
-				{
-				yy_cp = (yy_last_accepting_cpos);
-				yy_current_state = (yy_last_accepting_state);
-				goto yy_find_action;
-				}
-			}
-
-		else switch ( yy_get_next_buffer(  ) )
-			{
-			case EOB_ACT_END_OF_FILE:
-				{
-				(yy_did_buffer_switch_on_eof) = 0;
-
-				if ( yywrap( ) )
-					{
-					/* Note: because we've taken care in
-					 * yy_get_next_buffer() to have set up
-					 * yytext, we can now set up
-					 * yy_c_buf_p so that if some total
-					 * hoser (like flex itself) wants to
-					 * call the scanner after we return the
-					 * YY_NULL, it'll still work - another
-					 * YY_NULL will get returned.
-					 */
-					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
-
-					yy_act = YY_STATE_EOF(YY_START);
-					goto do_action;
-					}
-
-				else
-					{
-					if ( ! (yy_did_buffer_switch_on_eof) )
-						YY_NEW_FILE;
-					}
-				break;
-				}
-
-			case EOB_ACT_CONTINUE_SCAN:
-				(yy_c_buf_p) =
-					(yytext_ptr) + yy_amount_of_matched_text;
-
-				yy_current_state = yy_get_previous_state(  );
-
-				yy_cp = (yy_c_buf_p);
-				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-				goto yy_match;
-
-			case EOB_ACT_LAST_MATCH:
-				(yy_c_buf_p) =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
-
-				yy_current_state = yy_get_previous_state(  );
-
-				yy_cp = (yy_c_buf_p);
-				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
-				goto yy_find_action;
-			}
-		break;
-		}
-
-	default:
-		YY_FATAL_ERROR(
-			"fatal flex scanner internal error--no action found" );
-	} /* end of action switch */
-		} /* end of scanning one token */
-} /* end of yylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer (void)
-{
-    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-	register char *source = (yytext_ptr);
-	register int number_to_move, i;
-	int ret_val;
-
-	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
-		YY_FATAL_ERROR(
-		"fatal flex scanner internal error--end of buffer missed" );
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
-		{ /* Don't try to fill the buffer, so this is an EOF. */
-		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
-			{
-			/* We matched a single character, the EOB, so
-			 * treat this as a final EOF.
-			 */
-			return EOB_ACT_END_OF_FILE;
-			}
-
-		else
-			{
-			/* We matched some text prior to the EOB, first
-			 * process it.
-			 */
-			return EOB_ACT_LAST_MATCH;
-			}
-		}
-
-	/* Try to read more data. */
-
-	/* First move last chars to start of buffer. */
-	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
-
-	for ( i = 0; i < number_to_move; ++i )
-		*(dest++) = *(source++);
-
-	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
-		/* don't do the read, it's not guaranteed to return an EOF,
-		 * just force an EOF
-		 */
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
-
-	else
-		{
-			yy_size_t num_to_read =
-			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-		while ( num_to_read <= 0 )
-			{ /* Not enough room in the buffer - grow it. */
-
-			/* just a shorter name for the current buffer */
-			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
-
-			int yy_c_buf_p_offset =
-				(int) ((yy_c_buf_p) - b->yy_ch_buf);
-
-			if ( b->yy_is_our_buffer )
-				{
-				yy_size_t new_size = b->yy_buf_size * 2;
-
-				if ( new_size <= 0 )
-					b->yy_buf_size += b->yy_buf_size / 8;
-				else
-					b->yy_buf_size *= 2;
-
-				b->yy_ch_buf = (char *)
-					/* Include room in for 2 EOB chars. */
-					yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
-				}
-			else
-				/* Can't grow it, we don't own it. */
-				b->yy_ch_buf = 0;
-
-			if ( ! b->yy_ch_buf )
-				YY_FATAL_ERROR(
-				"fatal error - scanner input buffer overflow" );
-
-			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
-						number_to_move - 1;
-
-			}
-
-		if ( num_to_read > YY_READ_BUF_SIZE )
-			num_to_read = YY_READ_BUF_SIZE;
-
-		/* Read in more data. */
-		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			(yy_n_chars), num_to_read );
-
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	if ( (yy_n_chars) == 0 )
-		{
-		if ( number_to_move == YY_MORE_ADJ )
-			{
-			ret_val = EOB_ACT_END_OF_FILE;
-			yyrestart(yyin  );
-			}
-
-		else
-			{
-			ret_val = EOB_ACT_LAST_MATCH;
-			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
-				YY_BUFFER_EOF_PENDING;
-			}
-		}
-
-	else
-		ret_val = EOB_ACT_CONTINUE_SCAN;
-
-	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
-		/* Extend the array by 50%, plus the number we really need. */
-		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
-		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
-		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
-	}
-
-	(yy_n_chars) += number_to_move;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
-	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
-
-	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-	return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-    static yy_state_type yy_get_previous_state (void)
-{
-	register yy_state_type yy_current_state;
-	register char *yy_cp;
-    
-	yy_current_state = (yy_start);
-
-	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
-		{
-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-		if ( yy_accept[yy_current_state] )
-			{
-			(yy_last_accepting_state) = yy_current_state;
-			(yy_last_accepting_cpos) = yy_cp;
-			}
-		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-			{
-			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 76 )
-				yy_c = yy_meta[(unsigned int) yy_c];
-			}
-		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-		}
-
-	return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
-{
-	register int yy_is_jam;
-    	register char *yy_cp = (yy_c_buf_p);
-
-	register YY_CHAR yy_c = 1;
-	if ( yy_accept[yy_current_state] )
-		{
-		(yy_last_accepting_state) = yy_current_state;
-		(yy_last_accepting_cpos) = yy_cp;
-		}
-	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
-		{
-		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 76 )
-			yy_c = yy_meta[(unsigned int) yy_c];
-		}
-	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 75);
-
-	return yy_is_jam ? 0 : yy_current_state;
-}
-
-    static void yyunput (int c, register char * yy_bp )
-{
-	register char *yy_cp;
-    
-    yy_cp = (yy_c_buf_p);
-
-	/* undo effects of setting up yytext */
-	*yy_cp = (yy_hold_char);
-
-	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-		{ /* need to shift things up to make room */
-		/* +2 for EOB chars. */
-		register yy_size_t number_to_move = (yy_n_chars) + 2;
-		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
-					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
-		register char *source =
-				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
-
-		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
-			*--dest = *--source;
-
-		yy_cp += (int) (dest - source);
-		yy_bp += (int) (dest - source);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
-			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
-
-		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
-			YY_FATAL_ERROR( "flex scanner push-back overflow" );
-		}
-
-	*--yy_cp = (char) c;
-
-    if ( c == '\n' ){
-        --yylineno;
-    }
-
-	(yytext_ptr) = yy_bp;
-	(yy_hold_char) = *yy_cp;
-	(yy_c_buf_p) = yy_cp;
-}
-
-#ifndef YY_NO_INPUT
-#ifdef __cplusplus
-    static int yyinput (void)
-#else
-    static int input  (void)
-#endif
-
-{
-	int c;
-    
-	*(yy_c_buf_p) = (yy_hold_char);
-
-	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
-		{
-		/* yy_c_buf_p now points to the character we want to return.
-		 * If this occurs *before* the EOB characters, then it's a
-		 * valid NUL; if not, then we've hit the end of the buffer.
-		 */
-		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
-			/* This was really a NUL. */
-			*(yy_c_buf_p) = '\0';
-
-		else
-			{ /* need more input */
-			yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
-			++(yy_c_buf_p);
-
-			switch ( yy_get_next_buffer(  ) )
-				{
-				case EOB_ACT_LAST_MATCH:
-					/* This happens because yy_g_n_b()
-					 * sees that we've accumulated a
-					 * token and flags that we need to
-					 * try matching the token before
-					 * proceeding.  But for input(),
-					 * there's no matching to consider.
-					 * So convert the EOB_ACT_LAST_MATCH
-					 * to EOB_ACT_END_OF_FILE.
-					 */
-
-					/* Reset buffer status. */
-					yyrestart(yyin );
-
-					/*FALLTHROUGH*/
-
-				case EOB_ACT_END_OF_FILE:
-					{
-					if ( yywrap( ) )
-						return 0;
-
-					if ( ! (yy_did_buffer_switch_on_eof) )
-						YY_NEW_FILE;
-#ifdef __cplusplus
-					return yyinput();
-#else
-					return input();
-#endif
-					}
-
-				case EOB_ACT_CONTINUE_SCAN:
-					(yy_c_buf_p) = (yytext_ptr) + offset;
-					break;
-				}
-			}
-		}
-
-	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
-	*(yy_c_buf_p) = '\0';	/* preserve yytext */
-	(yy_hold_char) = *++(yy_c_buf_p);
-
-	if ( c == '\n' )
-		   
-    yylineno++;
-;
-
-	return c;
-}
-#endif	/* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * 
- * @note This function does not reset the start condition to @c INITIAL .
- */
-    void yyrestart  (FILE * input_file )
-{
-    
-	if ( ! YY_CURRENT_BUFFER ){
-        yyensure_buffer_stack ();
-		YY_CURRENT_BUFFER_LVALUE =
-            yy_create_buffer(yyin,YY_BUF_SIZE );
-	}
-
-	yy_init_buffer(YY_CURRENT_BUFFER,input_file );
-	yy_load_buffer_state( );
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * 
- */
-    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
-{
-    
-	/* TODO. We should be able to replace this entire function body
-	 * with
-	 *		yypop_buffer_state();
-	 *		yypush_buffer_state(new_buffer);
-     */
-	yyensure_buffer_stack ();
-	if ( YY_CURRENT_BUFFER == new_buffer )
-		return;
-
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*(yy_c_buf_p) = (yy_hold_char);
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-	yy_load_buffer_state( );
-
-	/* We don't actually know whether we did this switch during
-	 * EOF (yywrap()) processing, but the only time this flag
-	 * is looked at is after yywrap() is called, so it's safe
-	 * to go ahead and always set it.
-	 */
-	(yy_did_buffer_switch_on_eof) = 1;
-}
-
-static void yy_load_buffer_state  (void)
-{
-    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-	(yy_hold_char) = *(yy_c_buf_p);
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * 
- * @return the allocated buffer state.
- */
-    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
-{
-	YY_BUFFER_STATE b;
-    
-	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_buf_size = size;
-
-	/* yy_ch_buf has to be 2 characters longer than the size given because
-	 * we need to put in 2 end-of-buffer characters.
-	 */
-	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
-	if ( ! b->yy_ch_buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
-
-	b->yy_is_our_buffer = 1;
-
-	yy_init_buffer(b,file );
-
-	return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- * 
- */
-    void yy_delete_buffer (YY_BUFFER_STATE  b )
-{
-    
-	if ( ! b )
-		return;
-
-	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
-		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
-
-	if ( b->yy_is_our_buffer )
-		yyfree((void *) b->yy_ch_buf  );
-
-	yyfree((void *) b  );
-}
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
-    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
-
-{
-	int oerrno = errno;
-    
-	yy_flush_buffer(b );
-
-	b->yy_input_file = file;
-	b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then yy_init_buffer was _probably_
-     * called from yyrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER){
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-        b->yy_is_interactive = 0;
-    
-	errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * 
- */
-    void yy_flush_buffer (YY_BUFFER_STATE  b )
-{
-    	if ( ! b )
-		return;
-
-	b->yy_n_chars = 0;
-
-	/* We always need two end-of-buffer characters.  The first causes
-	 * a transition to the end-of-buffer state.  The second causes
-	 * a jam in that state.
-	 */
-	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-	b->yy_buf_pos = &b->yy_ch_buf[0];
-
-	b->yy_at_bol = 1;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	if ( b == YY_CURRENT_BUFFER )
-		yy_load_buffer_state( );
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  
- */
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
-{
-    	if (new_buffer == NULL)
-		return;
-
-	yyensure_buffer_stack();
-
-	/* This block is copied from yy_switch_to_buffer. */
-	if ( YY_CURRENT_BUFFER )
-		{
-		/* Flush out information for old buffer. */
-		*(yy_c_buf_p) = (yy_hold_char);
-		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
-		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
-		}
-
-	/* Only push if top exists. Otherwise, replace top. */
-	if (YY_CURRENT_BUFFER)
-		(yy_buffer_stack_top)++;
-	YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-	/* copied from yy_switch_to_buffer. */
-	yy_load_buffer_state( );
-	(yy_did_buffer_switch_on_eof) = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  
- */
-void yypop_buffer_state (void)
-{
-    	if (!YY_CURRENT_BUFFER)
-		return;
-
-	yy_delete_buffer(YY_CURRENT_BUFFER );
-	YY_CURRENT_BUFFER_LVALUE = NULL;
-	if ((yy_buffer_stack_top) > 0)
-		--(yy_buffer_stack_top);
-
-	if (YY_CURRENT_BUFFER) {
-		yy_load_buffer_state( );
-		(yy_did_buffer_switch_on_eof) = 1;
-	}
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void yyensure_buffer_stack (void)
-{
-	yy_size_t num_to_alloc;
-    
-	if (!(yy_buffer_stack)) {
-
-		/* First allocation is just for 2 elements, since we don't know if this
-		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
-		 * immediate realloc on the next call.
-         */
-		num_to_alloc = 1;
-		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
-								(num_to_alloc * sizeof(struct yy_buffer_state*)
-								);
-		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-								  
-		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-				
-		(yy_buffer_stack_max) = num_to_alloc;
-		(yy_buffer_stack_top) = 0;
-		return;
-	}
-
-	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
-
-		/* Increase the buffer to prepare for a possible push. */
-		int grow_size = 8 /* arbitrary grow size */;
-
-		num_to_alloc = (yy_buffer_stack_max) + grow_size;
-		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
-								((yy_buffer_stack),
-								num_to_alloc * sizeof(struct yy_buffer_state*)
-								);
-		if ( ! (yy_buffer_stack) )
-			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
-
-		/* zero only the new slots.*/
-		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
-		(yy_buffer_stack_max) = num_to_alloc;
-	}
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * 
- * @return the newly allocated buffer state object. 
- */
-YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
-{
-	YY_BUFFER_STATE b;
-    
-	if ( size < 2 ||
-	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
-	     base[size-1] != YY_END_OF_BUFFER_CHAR )
-		/* They forgot to leave room for the EOB's. */
-		return 0;
-
-	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
-	if ( ! b )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
-
-	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
-	b->yy_buf_pos = b->yy_ch_buf = base;
-	b->yy_is_our_buffer = 0;
-	b->yy_input_file = 0;
-	b->yy_n_chars = b->yy_buf_size;
-	b->yy_is_interactive = 0;
-	b->yy_at_bol = 1;
-	b->yy_fill_buffer = 0;
-	b->yy_buffer_status = YY_BUFFER_NEW;
-
-	yy_switch_to_buffer(b  );
-
-	return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * 
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
-{
-    
-	return yy_scan_bytes(yystr,strlen(yystr) );
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
- * scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
- * 
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len )
-{
-	YY_BUFFER_STATE b;
-	char *buf;
-	yy_size_t n, i;
-    
-	/* Get memory for full buffer, including space for trailing EOB's. */
-	n = _yybytes_len + 2;
-	buf = (char *) yyalloc(n  );
-	if ( ! buf )
-		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
-
-	for ( i = 0; i < _yybytes_len; ++i )
-		buf[i] = yybytes[i];
-
-	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
-
-	b = yy_scan_buffer(buf,n );
-	if ( ! b )
-		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
-
-	/* It's okay to grow etc. this buffer, and we should throw it
-	 * away when we're done.
-	 */
-	b->yy_is_our_buffer = 1;
-
-	return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#define YY_EXIT_FAILURE 2
-#endif
-
-static void yy_fatal_error (yyconst char* msg )
-{
-    	(void) fprintf( stderr, "%s\n", msg );
-	exit( YY_EXIT_FAILURE );
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n) \
-	do \
-		{ \
-		/* Undo effects of setting up yytext. */ \
-        int yyless_macro_arg = (n); \
-        YY_LESS_LINENO(yyless_macro_arg);\
-		yytext[yyleng] = (yy_hold_char); \
-		(yy_c_buf_p) = yytext + yyless_macro_arg; \
-		(yy_hold_char) = *(yy_c_buf_p); \
-		*(yy_c_buf_p) = '\0'; \
-		yyleng = yyless_macro_arg; \
-		} \
-	while ( 0 )
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the current line number.
- * 
- */
-int yyget_lineno  (void)
-{
-        
-    return yylineno;
-}
-
-/** Get the input stream.
- * 
- */
-FILE *yyget_in  (void)
-{
-        return yyin;
-}
-
-/** Get the output stream.
- * 
- */
-FILE *yyget_out  (void)
-{
-        return yyout;
-}
-
-/** Get the length of the current token.
- * 
- */
-yy_size_t yyget_leng  (void)
-{
-        return yyleng;
-}
-
-/** Get the current token.
- * 
- */
-
-char *yyget_text  (void)
-{
-        return yytext;
-}
-
-/** Set the current line number.
- * @param line_number
- * 
- */
-void yyset_lineno (int  line_number )
-{
-    
-    yylineno = line_number;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param in_str A readable stream.
- * 
- * @see yy_switch_to_buffer
- */
-void yyset_in (FILE *  in_str )
-{
-        yyin = in_str ;
-}
-
-void yyset_out (FILE *  out_str )
-{
-        yyout = out_str ;
-}
-
-int yyget_debug  (void)
-{
-        return yy_flex_debug;
-}
-
-void yyset_debug (int  bdebug )
-{
-        yy_flex_debug = bdebug ;
-}
-
-static int yy_init_globals (void)
-{
-        /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from yylex_destroy(), so don't allocate here.
-     */
-
-    /* We do not touch yylineno unless the option is enabled. */
-    yylineno =  1;
-    
-    (yy_buffer_stack) = 0;
-    (yy_buffer_stack_top) = 0;
-    (yy_buffer_stack_max) = 0;
-    (yy_c_buf_p) = (char *) 0;
-    (yy_init) = 0;
-    (yy_start) = 0;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    yyin = stdin;
-    yyout = stdout;
-#else
-    yyin = (FILE *) 0;
-    yyout = (FILE *) 0;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * yylex_init()
-     */
-    return 0;
-}
-
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy  (void)
-{
-    
-    /* Pop the buffer stack, destroying each element. */
-	while(YY_CURRENT_BUFFER){
-		yy_delete_buffer(YY_CURRENT_BUFFER  );
-		YY_CURRENT_BUFFER_LVALUE = NULL;
-		yypop_buffer_state();
-	}
-
-	/* Destroy the stack itself. */
-	yyfree((yy_buffer_stack) );
-	(yy_buffer_stack) = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * yylex() is called, initialization will occur. */
-    yy_init_globals( );
-
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
-{
-	register int i;
-	for ( i = 0; i < n; ++i )
-		s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s )
-{
-	register int n;
-	for ( n = 0; s[n]; ++n )
-		;
-
-	return n;
-}
-#endif
-
-void *yyalloc (yy_size_t  size )
-{
-	return (void *) malloc( size );
-}
-
-void *yyrealloc  (void * ptr, yy_size_t  size )
-{
-	/* The cast to (char *) in the following accommodates both
-	 * implementations that use char* generic pointers, and those
-	 * that use void* generic pointers.  It works with the latter
-	 * because both ANSI C and C++ allow castless assignment from
-	 * any pointer type to void*, and deal with argument conversions
-	 * as though doing an assignment.
-	 */
-	return (void *) realloc( (char *) ptr, size );
-}
-
-void yyfree (void * ptr )
-{
-	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-#line 136 "../src/CFCLexHeader.l"
-
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCLexHeader.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCLexHeader.h b/clownfish/compiler/src/CFCLexHeader.h
deleted file mode 100644
index 16b76f2..0000000
--- a/clownfish/compiler/src/CFCLexHeader.h
+++ /dev/null
@@ -1,315 +0,0 @@
-#ifndef yyHEADER_H
-#define yyHEADER_H 1
-#define yyIN_HEADER 1
-
-#line 6 "../src/CFCLexHeader.h"
-
-#line 8 "../src/CFCLexHeader.h"
-
-#define  YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#define FLEX_BETA
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types. 
- */
-#ifndef __STDC_LIMIT_MACROS
-#define __STDC_LIMIT_MACROS 1
-#endif
-
-#include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
-#else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t; 
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
-
-/* Limits of integral types. */
-#ifndef INT8_MIN
-#define INT8_MIN               (-128)
-#endif
-#ifndef INT16_MIN
-#define INT16_MIN              (-32767-1)
-#endif
-#ifndef INT32_MIN
-#define INT32_MIN              (-2147483647-1)
-#endif
-#ifndef INT8_MAX
-#define INT8_MAX               (127)
-#endif
-#ifndef INT16_MAX
-#define INT16_MAX              (32767)
-#endif
-#ifndef INT32_MAX
-#define INT32_MAX              (2147483647)
-#endif
-#ifndef UINT8_MAX
-#define UINT8_MAX              (255U)
-#endif
-#ifndef UINT16_MAX
-#define UINT16_MAX             (65535U)
-#endif
-#ifndef UINT32_MAX
-#define UINT32_MAX             (4294967295U)
-#endif
-
-#endif /* ! FLEXINT_H */
-
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else	/* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif	/* defined (__STDC__) */
-#endif	/* ! __cplusplus */
-
-#ifdef YY_USE_CONST
-#define yyconst const
-#else
-#define yyconst
-#endif
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#define YY_BUF_SIZE 16384
-#endif
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-extern yy_size_t yyleng;
-
-extern FILE *yyin, *yyout;
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-	{
-	FILE *yy_input_file;
-
-	char *yy_ch_buf;		/* input buffer */
-	char *yy_buf_pos;		/* current position in input buffer */
-
-	/* Size of input buffer in bytes, not including room for EOB
-	 * characters.
-	 */
-	yy_size_t yy_buf_size;
-
-	/* Number of characters read into yy_ch_buf, not including EOB
-	 * characters.
-	 */
-	yy_size_t yy_n_chars;
-
-	/* Whether we "own" the buffer - i.e., we know we created it,
-	 * and can realloc() it to grow it, and should free() it to
-	 * delete it.
-	 */
-	int yy_is_our_buffer;
-
-	/* Whether this is an "interactive" input source; if so, and
-	 * if we're using stdio for input, then we want to use getc()
-	 * instead of fread(), to make sure we stop fetching input after
-	 * each newline.
-	 */
-	int yy_is_interactive;
-
-	/* Whether we're considered to be at the beginning of a line.
-	 * If so, '^' rules will be active on the next match, otherwise
-	 * not.
-	 */
-	int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-    
-	/* Whether to try to fill the input buffer when we reach the
-	 * end of it.
-	 */
-	int yy_fill_buffer;
-
-	int yy_buffer_status;
-
-	};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-void yyrestart (FILE *input_file  );
-void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
-YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
-void yy_delete_buffer (YY_BUFFER_STATE b  );
-void yy_flush_buffer (YY_BUFFER_STATE b  );
-void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
-void yypop_buffer_state (void );
-
-YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
-YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  );
-
-void *yyalloc (yy_size_t  );
-void *yyrealloc (void *,yy_size_t  );
-void yyfree (void *  );
-
-/* Begin user sect3 */
-
-#define yywrap(n) 1
-#define YY_SKIP_YYWRAP
-
-extern int yylineno;
-
-extern char *yytext;
-#define yytext_ptr yytext
-
-#ifdef YY_HEADER_EXPORT_START_CONDITIONS
-#define INITIAL 0
-#define CBLOCK 1
-
-#endif
-
-#ifndef YY_EXTRA_TYPE
-#define YY_EXTRA_TYPE void *
-#endif
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy (void );
-
-int yyget_debug (void );
-
-void yyset_debug (int debug_flag  );
-
-YY_EXTRA_TYPE yyget_extra (void );
-
-void yyset_extra (YY_EXTRA_TYPE user_defined  );
-
-FILE *yyget_in (void );
-
-void yyset_in  (FILE * in_str  );
-
-FILE *yyget_out (void );
-
-void yyset_out  (FILE * out_str  );
-
-yy_size_t yyget_leng (void );
-
-char *yyget_text (void );
-
-int yyget_lineno (void );
-
-void yyset_lineno (int line_number  );
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#ifdef __cplusplus
-extern "C" int yywrap (void );
-#else
-extern int yywrap (void );
-#endif
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int );
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * );
-#endif
-
-#ifndef YY_NO_INPUT
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#define YY_READ_BUF_SIZE 8192
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#define YY_START_STACK_INCR 25
-#endif
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#define YY_DECL_IS_OURS 1
-
-extern int yylex (void);
-
-#define YY_DECL int yylex (void)
-#endif /* !YY_DECL */
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-#undef YY_NEW_FILE
-#undef YY_FLUSH_BUFFER
-#undef yy_set_bol
-#undef yy_new_buffer
-#undef yy_set_interactive
-#undef YY_DO_BEFORE_ACTION
-
-#ifdef YY_DECL_IS_OURS
-#undef YY_DECL_IS_OURS
-#undef YY_DECL
-#endif
-
-#line 136 "../src/CFCLexHeader.l"
-
-
-#line 314 "../src/CFCLexHeader.h"
-#undef yyIN_HEADER
-#endif /* yyHEADER_H */


[lucy-commits] [47/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Change type for SortEx buffer.

Posted by ma...@apache.org.
Change type for SortEx buffer.

Change buffer for SortExternal to an array of objects instead of
addresses.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/c09c1dca
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/c09c1dca
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/c09c1dca

Branch: refs/heads/sortex_ptr_only
Commit: c09c1dcab745ed5ecdaa66e1e1c1a276263e418f
Parents: 7392ca1
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Tue Jan 8 17:11:59 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 13:48:18 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/PostingPool.c   |  9 ++++-----
 core/Lucy/Util/BBSortEx.c       |  7 +++----
 core/Lucy/Util/SortExternal.c   | 23 ++++++++++-------------
 core/Lucy/Util/SortExternal.cfh |  4 ++--
 4 files changed, 19 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/c09c1dca/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 6628fc3..55eecc9 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -202,7 +202,7 @@ PostPool_Flip_IMP(PostingPool *self) {
         PostPool_Grow_Cache(run, num_items);
         PostingPoolIVARS *const run_ivars = PostPool_IVARS(run);
 
-        memcpy(run_ivars->cache, ((Obj**)ivars->cache) + ivars->cache_tick,
+        memcpy(run_ivars->cache, (ivars->cache) + ivars->cache_tick,
                num_items * sizeof(Obj*));
         run_ivars->cache_max = num_items;
         PostPool_Add_Run(self, (SortExternal*)run);
@@ -266,10 +266,10 @@ PostPool_Shrink_IMP(PostingPool *self) {
         size_t cache_count = PostPool_Cache_Count(self);
         size_t size        = cache_count * sizeof(Obj*);
         if (ivars->cache_tick > 0) {
-            Obj **start = ((Obj**)ivars->cache) + ivars->cache_tick;
+            Obj **start = ivars->cache + ivars->cache_tick;
             memmove(ivars->cache, start, size);
         }
-        ivars->cache      = (uint8_t*)REALLOCATE(ivars->cache, size);
+        ivars->cache      = (Obj**)REALLOCATE(ivars->cache, size);
         ivars->cache_tick = 0;
         ivars->cache_max  = cache_count;
         ivars->cache_cap  = cache_count;
@@ -549,8 +549,7 @@ PostPool_Refill_IMP(PostingPool *self) {
             size_t new_cap = Memory_oversize(num_elems + 1, sizeof(Obj*));
             PostPool_Grow_Cache(self, new_cap);
         }
-        Obj **cache = (Obj**)ivars->cache;
-        cache[num_elems] = (Obj*)rawpost;
+        ivars->cache[num_elems] = (Obj*)rawpost;
         num_elems++;
     }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c09c1dca/core/Lucy/Util/BBSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.c b/core/Lucy/Util/BBSortEx.c
index fb50522..40238cf 100644
--- a/core/Lucy/Util/BBSortEx.c
+++ b/core/Lucy/Util/BBSortEx.c
@@ -52,7 +52,7 @@ BBSortEx_Destroy_IMP(BBSortEx *self) {
 void
 BBSortEx_Clear_Cache_IMP(BBSortEx *self) {
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
-    Obj **const cache = (Obj**)ivars->cache;
+    Obj **const cache = ivars->cache;
     for (uint32_t i = ivars->cache_tick, max = ivars->cache_max; i < max; i++) {
         DECREF(cache[i]);
     }
@@ -81,7 +81,7 @@ void
 BBSortEx_Flush_IMP(BBSortEx *self) {
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
     uint32_t     cache_count = ivars->cache_max - ivars->cache_tick;
-    Obj        **cache = (Obj**)ivars->cache;
+    Obj        **cache = ivars->cache;
     VArray      *elems;
 
     if (!cache_count) { return; }
@@ -136,8 +136,7 @@ BBSortEx_Refill_IMP(BBSortEx *self) {
                                 Memory_oversize(ivars->cache_max + 1,
                                                 sizeof(Obj*)));
         }
-        Obj **cache = (Obj**)ivars->cache;
-        cache[ivars->cache_max++] = INCREF(elem);
+        ivars->cache[ivars->cache_max++] = INCREF(elem);
     }
 
     return ivars->cache_max;

http://git-wip-us.apache.org/repos/asf/lucy/blob/c09c1dca/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index 3aa3334..434c34d 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -89,8 +89,7 @@ SortEx_Feed_IMP(SortExternal *self, Obj *item) {
         size_t amount = Memory_oversize(ivars->cache_max + 1, sizeof(Obj*));
         SortEx_Grow_Cache(self, amount);
     }
-    Obj **elems = (Obj**)ivars->cache;
-    elems[ivars->cache_max] = item;
+    ivars->cache[ivars->cache_max] = item;
     ivars->cache_max++;
 }
 
@@ -101,8 +100,7 @@ SI_peek(SortExternal *self, SortExternalIVARS *ivars) {
     }
 
     if (ivars->cache_max > 0) {
-        Obj **elems = (Obj**)ivars->cache;
-        return elems[ivars->cache_tick];
+        return ivars->cache[ivars->cache_tick];
     }
     else {
         return NULL;
@@ -159,8 +157,7 @@ SortEx_Add_Run_IMP(SortExternal *self, SortExternal *run) {
         = (uint32_t*)REALLOCATE(ivars->slice_sizes,
                                 num_runs * sizeof(uint32_t));
     ivars->slice_starts
-        = (Obj**)REALLOCATE(ivars->slice_starts,
-                                num_runs * sizeof(Obj*));
+        = (Obj***)REALLOCATE(ivars->slice_starts, num_runs * sizeof(Obj**));
 }
 
 static void
@@ -203,7 +200,7 @@ S_find_endpost(SortExternal *self, SortExternalIVARS *ivars) {
         else {
             // Cache item with the highest sort value currently held in memory
             // by the run.
-            Obj **candidate = (Obj**)run_ivars->cache + tick;
+            Obj **candidate = run_ivars->cache + tick;
 
             // If it's the first run, item is automatically the new endpost.
             if (i == 0) {
@@ -223,7 +220,7 @@ static void
 S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
                 Obj **endpost) {
     uint32_t    num_runs     = VA_Get_Size(ivars->runs);
-    Obj       **slice_starts = ivars->slice_starts;
+    Obj      ***slice_starts = ivars->slice_starts;
     uint32_t   *slice_sizes  = ivars->slice_sizes;
     VTable     *vtable       = SortEx_Get_VTable(self);
     CFISH_Sort_Compare_t compare
@@ -244,8 +241,8 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
                                              sizeof(Obj*));
                 SortEx_Grow_Cache(self, cap);
             }
-            memcpy(ivars->cache + ivars->cache_max * sizeof(Obj*),
-                   run_ivars->cache + run_ivars->cache_tick * sizeof(Obj*),
+            memcpy(ivars->cache + ivars->cache_max,
+                   run_ivars->cache + run_ivars->cache_tick,
                    slice_size * sizeof(Obj*));
             run_ivars->cache_tick += slice_size;
             ivars->cache_max += slice_size;
@@ -258,7 +255,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
     // Transform slice starts from ticks to pointers.
     uint32_t total = 0;
     for (uint32_t i = 0; i < ivars->num_slices; i++) {
-        slice_starts[i] = (Obj*)(ivars->cache + total * sizeof(Obj*));
+        slice_starts[i] = ivars->cache + total;
         total += slice_sizes[i];
     }
 
@@ -307,7 +304,7 @@ void
 SortEx_Grow_Cache_IMP(SortExternal *self, uint32_t size) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     if (size > ivars->cache_cap) {
-        ivars->cache = (uint8_t*)REALLOCATE(ivars->cache, size * sizeof(Obj*));
+        ivars->cache = (Obj**)REALLOCATE(ivars->cache, size * sizeof(Obj*));
         ivars->cache_cap = size;
     }
 }
@@ -317,7 +314,7 @@ S_find_slice_size(SortExternal *self, SortExternalIVARS *ivars,
                   Obj **endpost) {
     int32_t          lo      = ivars->cache_tick - 1;
     int32_t          hi      = ivars->cache_max;
-    Obj            **cache   = (Obj**)ivars->cache;
+    Obj            **cache   = ivars->cache;
     SortEx_Compare_t compare
         = METHOD_PTR(SortEx_Get_VTable(self), LUCY_SortEx_Compare);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c09c1dca/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index b1af4ad..13d3009 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -49,7 +49,7 @@ __END_C__
 abstract class Lucy::Util::SortExternal nickname SortEx
     inherits Clownfish::Obj {
 
-    uint8_t       *cache;
+    Obj          **cache;
     uint32_t       cache_cap;
     uint32_t       cache_max;
     uint32_t       cache_tick;
@@ -57,7 +57,7 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     uint32_t       scratch_cap;
     VArray        *runs;
     uint32_t       num_slices;
-    Obj          **slice_starts;
+    Obj         ***slice_starts;
     uint32_t      *slice_sizes;
     uint32_t       mem_thresh;
     bool           flipped;


[lucy-commits] [37/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Remove Clownfish files from rat-excludes

Posted by ma...@apache.org.
Remove Clownfish files from rat-excludes


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/920dca8b
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/920dca8b
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/920dca8b

Branch: refs/heads/sortex_ptr_only
Commit: 920dca8b4129d91790b9fb481cff7bdf7b10d0ca
Parents: c3a9a7c
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Apr 23 16:38:51 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Apr 23 16:38:51 2014 +0200

----------------------------------------------------------------------
 devel/conf/rat-excludes | 23 -----------------------
 1 file changed, 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/920dca8b/devel/conf/rat-excludes
----------------------------------------------------------------------
diff --git a/devel/conf/rat-excludes b/devel/conf/rat-excludes
index 209311e..676f566 100644
--- a/devel/conf/rat-excludes
+++ b/devel/conf/rat-excludes
@@ -18,18 +18,11 @@
 
 # CHANGES and MANIFEST files do not require license headers.
 CHANGES
-clownfish/compiler/perl/MANIFEST
-clownfish/runtime/perl/MANIFEST
 perl/MANIFEST
 
 # doc file does not require license.
 CONTRIBUTING
 
-# These files are autogenerated by running CFCLexHeader.l through Flex.
-# Flex's licensing explicitly disclaims copyright on generated lexers.
-clownfish/compiler/src/CFCLexHeader.h
-clownfish/compiler/src/CFCLexHeader.c
-
 # The Lemon parser generator is in the public domain.  See LUCY-173.
 lemon/lemon.c
 lemon/lempar.c
@@ -76,27 +69,11 @@ perl/sample/us_constitution/*.txt
 # Clownfish parcel files (.cfp) are in JSON format and cannot have comments.
 core/Lucy.cfp
 core/TestLucy.cfp
-clownfish/compiler/c/t/cfbase/Animal.cfp
-clownfish/compiler/c/t/cfext/AnimalExtension.cfp
-clownfish/compiler/perl/t/cfbase/Animal.cfp
-clownfish/compiler/perl/t/cfclash/bar/Bar.cfp
-clownfish/compiler/perl/t/cfclash/class/AnimalExtension.cfp
-clownfish/compiler/perl/t/cfclash/foo/Foo.cfp
-clownfish/compiler/perl/t/cfext/AnimalExtension.cfp
-clownfish/runtime/core/Clownfish.cfp
-clownfish/runtime/core/TestClownfish.cfp
 
 # gitignore files should be ignored
 .gitignore
 c/.gitignore
 charmonizer/.gitignore
-clownfish/.gitignore
-clownfish/compiler/.gitignore
-clownfish/compiler/c/.gitignore
-clownfish/compiler/perl/.gitignore
-clownfish/devel/benchmarks/method_dispatch/.gitignore
-clownfish/runtime/c/.gitignore
-clownfish/runtime/perl/.gitignore
 core/Lucy/Util/Json/.gitignore
 lemon/.gitignore
 perl/.gitignore


[lucy-commits] [24/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Remove bundled Clownfish.

Posted by ma...@apache.org.
Remove bundled Clownfish.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/1704c275
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/1704c275
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/1704c275

Branch: refs/heads/sortex_ptr_only
Commit: 1704c2750437d29a2b4055457ad15abe0b1b14d4
Parents: f71ac45
Author: Tim Wilkens <ti...@gmail.com>
Authored: Fri Mar 21 16:19:42 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 12 00:38:34 2014 -0600

----------------------------------------------------------------------
 clownfish/compiler/.gitignore                   |    4 -
 clownfish/compiler/c/.gitignore                 |    5 -
 clownfish/compiler/c/INSTALL                    |   44 -
 clownfish/compiler/c/cfc.c                      |  211 -
 clownfish/compiler/c/configure                  |   49 -
 clownfish/compiler/c/configure.bat              |   45 -
 clownfish/compiler/c/t/cfbase/Animal.cfh        |   21 -
 clownfish/compiler/c/t/cfbase/Animal.cfp        |    4 -
 clownfish/compiler/c/t/cfbase/Animal/Dog.cfh    |   28 -
 clownfish/compiler/c/t/cfbase/Animal/Util.cfh   |   23 -
 .../compiler/c/t/cfext/Animal/Rottweiler.cfh    |   31 -
 .../compiler/c/t/cfext/AnimalExtension.cfp      |    5 -
 clownfish/compiler/c/t/test_cfc.c               |   33 -
 clownfish/compiler/common/charmonizer.c         | 7284 -----------------
 clownfish/compiler/common/charmonizer.main      |  286 -
 clownfish/compiler/include/CFC.h                |   53 -
 clownfish/compiler/perl/.gitignore              |    9 -
 clownfish/compiler/perl/Build.PL                |   50 -
 clownfish/compiler/perl/MANIFEST                |    7 -
 .../perl/buildlib/Clownfish/CFC/Build.pm        |  150 -
 clownfish/compiler/perl/lib/Clownfish.pod       |  187 -
 clownfish/compiler/perl/lib/Clownfish/CFC.pm    |  900 ---
 clownfish/compiler/perl/lib/Clownfish/CFC.xs    | 2556 ------
 .../compiler/perl/lib/Clownfish/CFC/Base.pm     |   20 -
 .../perl/lib/Clownfish/CFC/Binding/Core.pm      |   20 -
 .../lib/Clownfish/CFC/Binding/Core/Aliases.pm   |   20 -
 .../lib/Clownfish/CFC/Binding/Core/Class.pm     |   20 -
 .../perl/lib/Clownfish/CFC/Binding/Core/File.pm |   20 -
 .../lib/Clownfish/CFC/Binding/Core/Function.pm  |   20 -
 .../lib/Clownfish/CFC/Binding/Core/Method.pm    |   20 -
 .../perl/lib/Clownfish/CFC/Binding/Perl.pm      |   20 -
 .../lib/Clownfish/CFC/Binding/Perl/Class.pm     |   20 -
 .../Clownfish/CFC/Binding/Perl/Constructor.pm   |   20 -
 .../lib/Clownfish/CFC/Binding/Perl/Method.pm    |   20 -
 .../perl/lib/Clownfish/CFC/Binding/Perl/Pod.pm  |   20 -
 .../Clownfish/CFC/Binding/Perl/Subroutine.pm    |   20 -
 .../lib/Clownfish/CFC/Binding/Perl/TypeMap.pm   |   20 -
 .../perl/lib/Clownfish/CFC/Model/CBlock.pm      |   20 -
 .../perl/lib/Clownfish/CFC/Model/Class.pm       |   20 -
 .../perl/lib/Clownfish/CFC/Model/DocuComment.pm |   20 -
 .../perl/lib/Clownfish/CFC/Model/File.pm        |   20 -
 .../perl/lib/Clownfish/CFC/Model/FileSpec.pm    |   20 -
 .../perl/lib/Clownfish/CFC/Model/Function.pm    |   20 -
 .../perl/lib/Clownfish/CFC/Model/Hierarchy.pm   |   20 -
 .../perl/lib/Clownfish/CFC/Model/Method.pm      |   20 -
 .../perl/lib/Clownfish/CFC/Model/ParamList.pm   |   20 -
 .../perl/lib/Clownfish/CFC/Model/Parcel.pm      |   20 -
 .../perl/lib/Clownfish/CFC/Model/Symbol.pm      |   20 -
 .../perl/lib/Clownfish/CFC/Model/Type.pm        |   20 -
 .../perl/lib/Clownfish/CFC/Model/Variable.pm    |   20 -
 .../compiler/perl/lib/Clownfish/CFC/Parser.pm   |   20 -
 .../perl/lib/Clownfish/CFC/Perl/Build.pm        |  679 --
 .../lib/Clownfish/CFC/Perl/Build/Charmonic.pm   |  116 -
 .../compiler/perl/lib/Clownfish/CFC/Test.pm     |   20 -
 .../compiler/perl/lib/Clownfish/CFC/Util.pm     |   20 -
 clownfish/compiler/perl/t/000-load.t            |   39 -
 clownfish/compiler/perl/t/001-util.t            |   69 -
 clownfish/compiler/perl/t/050-docucomment.t     |   58 -
 clownfish/compiler/perl/t/051-symbol.t          |   84 -
 clownfish/compiler/perl/t/052-version.t         |   41 -
 clownfish/compiler/perl/t/100-type.t            |   42 -
 clownfish/compiler/perl/t/101-primitive_type.t  |   36 -
 clownfish/compiler/perl/t/102-integer_type.t    |   82 -
 clownfish/compiler/perl/t/103-float_type.t      |   48 -
 clownfish/compiler/perl/t/104-void_type.t       |   52 -
 clownfish/compiler/perl/t/105-object_type.t     |  132 -
 clownfish/compiler/perl/t/106-va_list_type.t    |   37 -
 clownfish/compiler/perl/t/107-arbitrary_type.t  |   60 -
 clownfish/compiler/perl/t/108-composite_type.t  |   92 -
 clownfish/compiler/perl/t/200-function.t        |   60 -
 clownfish/compiler/perl/t/201-method.t          |  139 -
 .../compiler/perl/t/202-overridden_method.t     |   46 -
 clownfish/compiler/perl/t/203-final_method.t    |   40 -
 clownfish/compiler/perl/t/300-variable.t        |   86 -
 clownfish/compiler/perl/t/301-param_list.t      |   57 -
 clownfish/compiler/perl/t/400-file_spec.t       |   39 -
 clownfish/compiler/perl/t/401-class.t           |  274 -
 clownfish/compiler/perl/t/402-c_block.t         |   36 -
 clownfish/compiler/perl/t/403-parcel.t          |  112 -
 clownfish/compiler/perl/t/404-file.t            |   99 -
 clownfish/compiler/perl/t/500-hierarchy.t       |  105 -
 clownfish/compiler/perl/t/501-include_dir.t     |  102 -
 clownfish/compiler/perl/t/502-clash.t           |  115 -
 clownfish/compiler/perl/t/600-parser.t          |  167 -
 clownfish/compiler/perl/t/cfbase/Animal.cfh     |   21 -
 clownfish/compiler/perl/t/cfbase/Animal.cfp     |    4 -
 clownfish/compiler/perl/t/cfbase/Animal/Dog.cfh |   28 -
 .../compiler/perl/t/cfbase/Animal/Util.cfh      |   23 -
 clownfish/compiler/perl/t/cfclash/bar/Bar.cfh   |   25 -
 clownfish/compiler/perl/t/cfclash/bar/Bar.cfp   |    4 -
 clownfish/compiler/perl/t/cfclash/bar/Baz.cfh   |   25 -
 .../perl/t/cfclash/class/Animal/DogClash.cfh    |   28 -
 .../perl/t/cfclash/class/AnimalExtension.cfp    |    5 -
 .../compiler/perl/t/cfclash/file/Animal/Dog.cfh |   28 -
 clownfish/compiler/perl/t/cfclash/foo/Foo.cfh   |   25 -
 clownfish/compiler/perl/t/cfclash/foo/Foo.cfp   |    4 -
 .../compiler/perl/t/cfext/Animal/Rottweiler.cfh |   31 -
 .../compiler/perl/t/cfext/AnimalExtension.cfp   |    5 -
 clownfish/compiler/perl/t/core/001-util.t       |   25 -
 .../compiler/perl/t/core/050-docucomment.t      |   25 -
 clownfish/compiler/perl/t/core/051-symbol.t     |   25 -
 clownfish/compiler/perl/t/core/052-version.t    |   25 -
 clownfish/compiler/perl/t/core/100-type.t       |   25 -
 clownfish/compiler/perl/t/core/200-function.t   |   25 -
 clownfish/compiler/perl/t/core/201-method.t     |   25 -
 clownfish/compiler/perl/t/core/300-variable.t   |   25 -
 clownfish/compiler/perl/t/core/301-param_list.t |   25 -
 clownfish/compiler/perl/t/core/400-file_spec.t  |   25 -
 clownfish/compiler/perl/t/core/401-class.t      |   25 -
 clownfish/compiler/perl/t/core/402-c_block.t    |   25 -
 clownfish/compiler/perl/t/core/403-parcel.t     |   25 -
 clownfish/compiler/perl/t/core/404-file.t       |   25 -
 clownfish/compiler/perl/t/core/500-hierarchy.t  |   25 -
 clownfish/compiler/perl/t/core/600-parser.t     |   25 -
 clownfish/compiler/perl/typemap                 |  154 -
 clownfish/compiler/python/clownfish/_cfc.c      |  143 -
 .../compiler/python/clownfish/cfc/__init__.py   |   17 -
 clownfish/compiler/python/setup.py              |  203 -
 clownfish/compiler/ruby/Rakefile                |  184 -
 clownfish/compiler/ruby/ext/Clownfish/CFC.c     |  203 -
 .../compiler/ruby/ext/Clownfish/extconf.rb      |   29 -
 clownfish/compiler/ruby/ext/example.rb          |   25 -
 clownfish/compiler/src/CFCBase.c                |   62 -
 clownfish/compiler/src/CFCBase.h                |   89 -
 clownfish/compiler/src/CFCBindAliases.c         |   53 -
 clownfish/compiler/src/CFCBindAliases.h         |   33 -
 clownfish/compiler/src/CFCBindClass.c           |  719 --
 clownfish/compiler/src/CFCBindClass.h           |   72 -
 clownfish/compiler/src/CFCBindCore.c            |  749 --
 clownfish/compiler/src/CFCBindCore.h            |   72 -
 clownfish/compiler/src/CFCBindFile.c            |  120 -
 clownfish/compiler/src/CFCBindFile.h            |   58 -
 clownfish/compiler/src/CFCBindFunction.c        |   39 -
 clownfish/compiler/src/CFCBindFunction.h        |   40 -
 clownfish/compiler/src/CFCBindMethod.c          |  309 -
 clownfish/compiler/src/CFCBindMethod.h          |   90 -
 clownfish/compiler/src/CFCC.c                   |  198 -
 clownfish/compiler/src/CFCC.h                   |   67 -
 clownfish/compiler/src/CFCCBlock.c              |   56 -
 clownfish/compiler/src/CFCCBlock.h              |   71 -
 clownfish/compiler/src/CFCCClass.c              |  552 --
 clownfish/compiler/src/CFCCClass.h              |   41 -
 clownfish/compiler/src/CFCClass.c               |  833 --
 clownfish/compiler/src/CFCClass.h               |  305 -
 clownfish/compiler/src/CFCDocuComment.c         |  265 -
 clownfish/compiler/src/CFCDocuComment.h         |   61 -
 clownfish/compiler/src/CFCFile.c                |  232 -
 clownfish/compiler/src/CFCFile.h                |  119 -
 clownfish/compiler/src/CFCFileSpec.c            |   86 -
 clownfish/compiler/src/CFCFileSpec.h            |   69 -
 clownfish/compiler/src/CFCFunction.c            |  144 -
 clownfish/compiler/src/CFCFunction.h            |  124 -
 clownfish/compiler/src/CFCHierarchy.c           |  541 --
 clownfish/compiler/src/CFCHierarchy.h           |  103 -
 clownfish/compiler/src/CFCLexHeader.c           | 2045 -----
 clownfish/compiler/src/CFCLexHeader.h           |  315 -
 clownfish/compiler/src/CFCLexHeader.l           |  137 -
 clownfish/compiler/src/CFCMemPool.c             |   84 -
 clownfish/compiler/src/CFCMemPool.h             |   43 -
 clownfish/compiler/src/CFCMethod.c              |  439 --
 clownfish/compiler/src/CFCMethod.h              |  244 -
 clownfish/compiler/src/CFCParamList.c           |  178 -
 clownfish/compiler/src/CFCParamList.h           |   95 -
 clownfish/compiler/src/CFCParcel.c              |  626 --
 clownfish/compiler/src/CFCParcel.h              |  151 -
 clownfish/compiler/src/CFCParseHeader.y         |  648 --
 clownfish/compiler/src/CFCParser.c              |  207 -
 clownfish/compiler/src/CFCParser.h              |  114 -
 clownfish/compiler/src/CFCPerl.c                |  600 --
 clownfish/compiler/src/CFCPerl.h                |  120 -
 clownfish/compiler/src/CFCPerlClass.c           |  582 --
 clownfish/compiler/src/CFCPerlClass.h           |  175 -
 clownfish/compiler/src/CFCPerlConstructor.c     |  148 -
 clownfish/compiler/src/CFCPerlConstructor.h     |   63 -
 clownfish/compiler/src/CFCPerlMethod.c          |  666 --
 clownfish/compiler/src/CFCPerlMethod.h          |   69 -
 clownfish/compiler/src/CFCPerlPod.c             |  391 -
 clownfish/compiler/src/CFCPerlPod.h             |  125 -
 clownfish/compiler/src/CFCPerlSub.c             |  262 -
 clownfish/compiler/src/CFCPerlSub.h             |  120 -
 clownfish/compiler/src/CFCPerlTypeMap.c         |  306 -
 clownfish/compiler/src/CFCPerlTypeMap.h         |   76 -
 clownfish/compiler/src/CFCRuby.c                |  264 -
 clownfish/compiler/src/CFCRuby.h                |   98 -
 clownfish/compiler/src/CFCSymbol.c              |  280 -
 clownfish/compiler/src/CFCSymbol.h              |  158 -
 clownfish/compiler/src/CFCTest.c                |  497 --
 clownfish/compiler/src/CFCTest.h                |  174 -
 clownfish/compiler/src/CFCTestCBlock.c          |   60 -
 clownfish/compiler/src/CFCTestClass.c           |  360 -
 clownfish/compiler/src/CFCTestDocuComment.c     |  107 -
 clownfish/compiler/src/CFCTestFile.c            |  149 -
 clownfish/compiler/src/CFCTestFileSpec.c        |   53 -
 clownfish/compiler/src/CFCTestFunction.c        |   76 -
 clownfish/compiler/src/CFCTestHierarchy.c       |  236 -
 clownfish/compiler/src/CFCTestMethod.c          |  286 -
 clownfish/compiler/src/CFCTestParamList.c       |   96 -
 clownfish/compiler/src/CFCTestParcel.c          |  106 -
 clownfish/compiler/src/CFCTestParser.c          |  331 -
 clownfish/compiler/src/CFCTestSymbol.c          |  150 -
 clownfish/compiler/src/CFCTestType.c            |  545 --
 clownfish/compiler/src/CFCTestUtil.c            |  120 -
 clownfish/compiler/src/CFCTestVariable.c        |  108 -
 clownfish/compiler/src/CFCTestVersion.c         |   69 -
 clownfish/compiler/src/CFCType.c                |  535 --
 clownfish/compiler/src/CFCType.h                |  281 -
 clownfish/compiler/src/CFCUtil.c                |  539 --
 clownfish/compiler/src/CFCUtil.h                |  193 -
 clownfish/compiler/src/CFCVariable.c            |  166 -
 clownfish/compiler/src/CFCVariable.h            |  114 -
 clownfish/compiler/src/CFCVersion.c             |  122 -
 clownfish/compiler/src/CFCVersion.h             |   62 -
 .../devel/benchmarks/method_dispatch/.gitignore |    3 -
 .../benchmarks/method_dispatch/Makefile.darwin  |   31 -
 .../benchmarks/method_dispatch/Makefile.linux   |   31 -
 .../devel/benchmarks/method_dispatch/dso.c      |   67 -
 .../devel/benchmarks/method_dispatch/dso.h      |   34 -
 .../devel/benchmarks/method_dispatch/exe.c      |  182 -
 clownfish/devel/benchmarks/method_dispatch/oo.h |   40 -
 clownfish/runtime/c/.gitignore                  |    9 -
 clownfish/runtime/c/INSTALL                     |   46 -
 clownfish/runtime/c/cfc_header                  |   23 -
 clownfish/runtime/c/configure                   |   52 -
 clownfish/runtime/c/configure.bat               |   50 -
 clownfish/runtime/c/install.sh                  |   91 -
 clownfish/runtime/c/src/Clownfish/Err.c         |  107 -
 .../runtime/c/src/Clownfish/LockFreeRegistry.c  |   33 -
 clownfish/runtime/c/src/Clownfish/Obj.c         |   62 -
 clownfish/runtime/c/src/Clownfish/VTable.c      |   79 -
 clownfish/runtime/c/t/test_cfish.c              |   39 -
 clownfish/runtime/common/charmonizer.c          | 7427 ------------------
 clownfish/runtime/common/charmonizer.main       |  429 -
 clownfish/runtime/core/Clownfish.c              |   27 -
 clownfish/runtime/core/Clownfish.cfp            |    5 -
 clownfish/runtime/core/Clownfish/ByteBuf.c      |  254 -
 clownfish/runtime/core/Clownfish/ByteBuf.cfh    |  159 -
 clownfish/runtime/core/Clownfish/CharBuf.c      |  409 -
 clownfish/runtime/core/Clownfish/CharBuf.cfh    |  152 -
 clownfish/runtime/core/Clownfish/Err.c          |  272 -
 clownfish/runtime/core/Clownfish/Err.cfh        |  254 -
 clownfish/runtime/core/Clownfish/Hash.c         |  368 -
 clownfish/runtime/core/Clownfish/Hash.cfh       |  153 -
 .../runtime/core/Clownfish/LockFreeRegistry.c   |  129 -
 .../runtime/core/Clownfish/LockFreeRegistry.cfh |   45 -
 clownfish/runtime/core/Clownfish/Method.c       |   83 -
 clownfish/runtime/core/Clownfish/Method.cfh     |   59 -
 clownfish/runtime/core/Clownfish/Num.c          |  396 -
 clownfish/runtime/core/Clownfish/Num.cfh        |  277 -
 clownfish/runtime/core/Clownfish/Obj.c          |  102 -
 clownfish/runtime/core/Clownfish/Obj.cfh        |  192 -
 clownfish/runtime/core/Clownfish/String.c       |  921 ---
 clownfish/runtime/core/Clownfish/String.cfh     |  449 --
 clownfish/runtime/core/Clownfish/Test.c         |   60 -
 clownfish/runtime/core/Clownfish/Test.cfh       |   26 -
 .../runtime/core/Clownfish/Test/TestByteBuf.c   |  156 -
 .../runtime/core/Clownfish/Test/TestByteBuf.cfh |   29 -
 .../runtime/core/Clownfish/Test/TestCharBuf.c   |  300 -
 .../runtime/core/Clownfish/Test/TestCharBuf.cfh |   29 -
 clownfish/runtime/core/Clownfish/Test/TestErr.c |   50 -
 .../runtime/core/Clownfish/Test/TestErr.cfh     |   28 -
 .../runtime/core/Clownfish/Test/TestHash.c      |  234 -
 .../runtime/core/Clownfish/Test/TestHash.cfh    |   29 -
 .../core/Clownfish/Test/TestLockFreeRegistry.c  |   85 -
 .../Clownfish/Test/TestLockFreeRegistry.cfh     |   40 -
 clownfish/runtime/core/Clownfish/Test/TestNum.c |  285 -
 .../runtime/core/Clownfish/Test/TestNum.cfh     |   29 -
 clownfish/runtime/core/Clownfish/Test/TestObj.c |  182 -
 .../runtime/core/Clownfish/Test/TestObj.cfh     |   29 -
 .../runtime/core/Clownfish/Test/TestString.c    |  527 --
 .../runtime/core/Clownfish/Test/TestString.cfh  |   29 -
 .../runtime/core/Clownfish/Test/TestVArray.c    |  312 -
 .../runtime/core/Clownfish/Test/TestVArray.cfh  |   29 -
 .../core/Clownfish/Test/Util/TestAtomic.c       |   65 -
 .../core/Clownfish/Test/Util/TestAtomic.cfh     |   29 -
 .../core/Clownfish/Test/Util/TestMemory.c       |  120 -
 .../core/Clownfish/Test/Util/TestMemory.cfh     |   29 -
 .../core/Clownfish/Test/Util/TestNumberUtils.c  |  377 -
 .../Clownfish/Test/Util/TestNumberUtils.cfh     |   29 -
 .../core/Clownfish/Test/Util/TestStringHelper.c |  300 -
 .../Clownfish/Test/Util/TestStringHelper.cfh    |   29 -
 .../core/Clownfish/TestHarness/TestBatch.cfh    |   28 -
 .../Clownfish/TestHarness/TestBatchRunner.c     |  306 -
 .../Clownfish/TestHarness/TestBatchRunner.cfh   |  135 -
 .../core/Clownfish/TestHarness/TestFormatter.c  |  193 -
 .../Clownfish/TestHarness/TestFormatter.cfh     |  142 -
 .../core/Clownfish/TestHarness/TestSuite.c      |  111 -
 .../core/Clownfish/TestHarness/TestSuite.cfh    |   43 -
 .../Clownfish/TestHarness/TestSuiteRunner.c     |   96 -
 .../Clownfish/TestHarness/TestSuiteRunner.cfh   |   76 -
 .../core/Clownfish/TestHarness/TestUtils.c      |  120 -
 .../core/Clownfish/TestHarness/TestUtils.cfh    |   65 -
 clownfish/runtime/core/Clownfish/Util/Atomic.c  |   43 -
 .../runtime/core/Clownfish/Util/Atomic.cfh      |  109 -
 clownfish/runtime/core/Clownfish/Util/Memory.c  |  112 -
 .../runtime/core/Clownfish/Util/Memory.cfh      |   73 -
 .../runtime/core/Clownfish/Util/NumberUtils.c   |   35 -
 .../runtime/core/Clownfish/Util/NumberUtils.cfh |  474 --
 .../runtime/core/Clownfish/Util/SortUtils.c     |  462 --
 .../runtime/core/Clownfish/Util/SortUtils.cfh   |   68 -
 .../runtime/core/Clownfish/Util/StringHelper.c  |  231 -
 .../core/Clownfish/Util/StringHelper.cfh        |   83 -
 clownfish/runtime/core/Clownfish/VArray.c       |  312 -
 clownfish/runtime/core/Clownfish/VArray.cfh     |  169 -
 clownfish/runtime/core/Clownfish/VTable.c       |  446 --
 clownfish/runtime/core/Clownfish/VTable.cfh     |  155 -
 clownfish/runtime/core/TestClownfish.c          |   20 -
 clownfish/runtime/core/TestClownfish.cfp        |    5 -
 clownfish/runtime/perl/.gitignore               |   16 -
 clownfish/runtime/perl/Build.PL                 |   73 -
 clownfish/runtime/perl/INSTALL                  |   15 -
 clownfish/runtime/perl/MANIFEST                 |    7 -
 clownfish/runtime/perl/MANIFEST.SKIP            |   64 -
 .../runtime/perl/buildlib/Clownfish/Build.pm    |  281 -
 .../perl/buildlib/Clownfish/Build/Binding.pm    |  730 --
 clownfish/runtime/perl/lib/Clownfish.pm         |  225 -
 clownfish/runtime/perl/lib/Clownfish.pod        |  618 --
 clownfish/runtime/perl/lib/Clownfish/ByteBuf.pm |   25 -
 clownfish/runtime/perl/lib/Clownfish/CharBuf.pm |   25 -
 clownfish/runtime/perl/lib/Clownfish/Err.pm     |   25 -
 clownfish/runtime/perl/lib/Clownfish/Hash.pm    |   25 -
 .../perl/lib/Clownfish/LockFreeRegistry.pm      |   25 -
 clownfish/runtime/perl/lib/Clownfish/Num.pm     |   25 -
 clownfish/runtime/perl/lib/Clownfish/Obj.pm     |   25 -
 clownfish/runtime/perl/lib/Clownfish/Test.pm    |   25 -
 .../perl/lib/Clownfish/Util/StringHelper.pm     |   25 -
 clownfish/runtime/perl/lib/Clownfish/VArray.pm  |   25 -
 clownfish/runtime/perl/lib/Clownfish/VTable.pm  |   25 -
 clownfish/runtime/perl/t/002-clownfish.t        |   52 -
 clownfish/runtime/perl/t/018-host.t             |   42 -
 clownfish/runtime/perl/t/021-vtable.t           |   57 -
 clownfish/runtime/perl/t/binding/016-varray.t   |   29 -
 clownfish/runtime/perl/t/binding/017-hash.t     |   32 -
 clownfish/runtime/perl/t/binding/019-obj.t      |   96 -
 clownfish/runtime/perl/t/binding/029-charbuf.t  |   43 -
 clownfish/runtime/perl/t/binding/034-err.t      |   70 -
 .../perl/t/binding/038-lock_free_registry.t     |   75 -
 .../runtime/perl/t/binding/801-pod_checker.t    |   54 -
 clownfish/runtime/perl/t/core/016-varray.t      |   23 -
 clownfish/runtime/perl/t/core/017-hash.t        |   23 -
 clownfish/runtime/perl/t/core/019-obj.t         |   23 -
 clownfish/runtime/perl/t/core/020-err.t         |   23 -
 clownfish/runtime/perl/t/core/022-bytebuf.t     |   23 -
 clownfish/runtime/perl/t/core/023-string.t      |   23 -
 clownfish/runtime/perl/t/core/029-charbuf.t     |   23 -
 .../runtime/perl/t/core/030-number_utils.t      |   25 -
 clownfish/runtime/perl/t/core/031-num.t         |   23 -
 .../runtime/perl/t/core/032-string_helper.t     |   25 -
 clownfish/runtime/perl/t/core/037-atomic.t      |   23 -
 .../perl/t/core/038-lock_free_registry.t        |   25 -
 clownfish/runtime/perl/t/core/039-memory.t      |   23 -
 clownfish/runtime/perl/xs/XSBind.c              |  928 ---
 clownfish/runtime/perl/xs/XSBind.h              |  352 -
 clownfish/runtime/ruby/Rakefile                 |  148 -
 clownfish/runtime/ruby/Rakefile.common          |  140 -
 clownfish/runtime/ruby/ext/Bind.c               |   64 -
 clownfish/runtime/ruby/ext/Bind.h               |   45 -
 clownfish/runtime/ruby/ext/Clownfish.c          |   50 -
 clownfish/runtime/ruby/ext/Clownfish.h          |   21 -
 clownfish/runtime/ruby/ext/extconf.rb           |   24 -
 clownfish/runtime/ruby/tests/029-charbuf.t      |   17 -
 360 files changed, 65146 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/.gitignore
----------------------------------------------------------------------
diff --git a/clownfish/compiler/.gitignore b/clownfish/compiler/.gitignore
deleted file mode 100644
index 586acd2..0000000
--- a/clownfish/compiler/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-include/ppport.h
-src/CFCParseHeader.c
-src/CFCParseHeader.h
-src/CFCParseHeader.out

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/.gitignore
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/.gitignore b/clownfish/compiler/c/.gitignore
deleted file mode 100644
index b5fef9b..0000000
--- a/clownfish/compiler/c/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-/Makefile
-/cfc
-/charmonizer
-/charmony.h
-/t/test_cfc

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/INSTALL
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/INSTALL b/clownfish/compiler/c/INSTALL
deleted file mode 100644
index 838563c..0000000
--- a/clownfish/compiler/c/INSTALL
+++ /dev/null
@@ -1,44 +0,0 @@
-Build instructions for the Clownfish compiler
-=============================================
-
-Building under UNIX and derivatives or Cygwin
----------------------------------------------
-
-    $ ./configure
-    $ make
-    $ make test
-
-Building under Windows
-----------------------
-
-You need MSVC or gcc as C compiler and nmake or mingw32-make as make utility.
-
-When using cmd.exe configure with:
-
-    $ configure.bat
-
-When using the MSYS shell configure with:
-
-    $ ./configure
-
-When building with nmake run:
-
-    $ nmake
-    $ nmake test
-
-When building with mingw32-make run:
-
-    $ mingw32-make
-    $ mingw32-make test
-
-Configuration
--------------
-
-    ./configure [ options ] [ -- cflags ]
-
-Options include
-
-    --enable-coverage
-        Enable code coverage. Create HTML pages with coverage data using
-        lcov by running "make coverage".
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/cfc.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/cfc.c b/clownfish/compiler/c/cfc.c
deleted file mode 100644
index 3fef3ec..0000000
--- a/clownfish/compiler/c/cfc.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "CFCBase.h"
-#include "CFCBindCore.h"
-#include "CFCC.h"
-#include "CFCClass.h"
-#include "CFCLexHeader.h"
-#include "CFCHierarchy.h"
-#include "CFCParcel.h"
-#include "CFCUtil.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-struct CFCArgs {
-    char  *dest;
-    int    num_source_dirs;
-    char **source_dirs;
-    int    num_include_dirs;
-    char **include_dirs;
-    char  *header_filename;
-    char  *footer_filename;
-};
-typedef struct CFCArgs CFCArgs;
-
-static int
-S_parse_string_argument(const char *arg, const char *name, char **result) {
-    size_t arg_len  = strlen(arg);
-    size_t name_len = strlen(name);
-
-    if (arg_len < name_len
-        || memcmp(arg, name, name_len) != 0
-        || arg[name_len] != '='
-       ) {
-        return 0;
-    }
-
-    if (*result != NULL) {
-        fprintf(stderr, "Duplicate %s argument\n", name);
-        exit(EXIT_FAILURE);
-    }
-    *result = CFCUtil_strdup(arg + name_len + 1);
-
-    return 1;
-}
-
-static int
-S_parse_string_array_argument(const char *arg, const char *name,
-                              int *num_results, char ***results) {
-    size_t   arg_len  = strlen(arg);
-    size_t   name_len = strlen(name);
-    int      new_num_results;
-    char   **new_results;
-
-    if (arg_len < name_len
-        || memcmp(arg, name, name_len) != 0
-        || arg[name_len] != '='
-       ) {
-        return 0;
-    }
-
-    new_num_results = *num_results + 1;
-    new_results     = (char **)REALLOCATE(*results,
-                              (new_num_results + 1) * sizeof(char *));
-    new_results[new_num_results-1] = CFCUtil_strdup(arg + name_len + 1);
-    new_results[new_num_results]   = NULL;
-    *num_results = new_num_results;
-    *results     = new_results;
-
-    return 1;
-}
-
-/* Parse command line arguments. */
-static void
-S_parse_arguments(int argc, char **argv, CFCArgs *args) {
-    int i;
-
-    memset(args, 0, sizeof(CFCArgs));
-    args->source_dirs     = (char **)MALLOCATE(sizeof(char *));
-    args->source_dirs[0]  = NULL;
-    args->include_dirs    = (char **)MALLOCATE(sizeof(char *));
-    args->include_dirs[0] = NULL;
-
-    for (i = 1; i < argc; i++) {
-        char *arg = argv[i];
-
-        if (S_parse_string_argument(arg, "--dest", &args->dest)) {
-            continue;
-        }
-        if (S_parse_string_argument(arg, "--header", &args->header_filename)) {
-            continue;
-        }
-        if (S_parse_string_argument(arg, "--footer", &args->footer_filename)) {
-            continue;
-        }
-        if (S_parse_string_array_argument(arg, "--source",
-                                          &args->num_source_dirs,
-                                          &args->source_dirs)
-           ) {
-            continue;
-        }
-        if (S_parse_string_array_argument(arg, "--include",
-                                          &args->num_include_dirs,
-                                          &args->include_dirs)
-           ) {
-            continue;
-        }
-
-        fprintf(stderr, "Invalid argument '%s'\n", arg);
-        exit(EXIT_FAILURE);
-    }
-
-    if (!args->dest) {
-        fprintf(stderr, "Mandatory argument --dest missing\n");
-        exit(EXIT_FAILURE);
-    }
-}
-
-static void S_free_arguments(CFCArgs *args) {
-    int i;
-
-    if (args->dest)            { FREEMEM(args->dest); }
-    if (args->header_filename) { FREEMEM(args->header_filename); }
-    if (args->footer_filename) { FREEMEM(args->footer_filename); }
-
-    for (i = 0; args->source_dirs[i]; ++i) {
-        FREEMEM(args->source_dirs[i]);
-    }
-    FREEMEM(args->source_dirs);
-
-    for (i = 0; args->include_dirs[i]; ++i) {
-        FREEMEM(args->include_dirs[i]);
-    }
-    FREEMEM(args->include_dirs);
-}
-
-int
-main(int argc, char **argv) {
-    int           i;
-    size_t        file_len;
-    CFCArgs       args;
-    CFCHierarchy *hierarchy;
-    CFCBindCore  *core_binding;
-    CFCC         *c_binding;
-    char         *header = NULL;
-    char         *footer = NULL;
-
-    S_parse_arguments(argc, argv, &args);
-
-    hierarchy = CFCHierarchy_new(args.dest);
-
-    for (i = 0; args.source_dirs[i]; ++i) {
-        CFCHierarchy_add_source_dir(hierarchy, args.source_dirs[i]);
-    }
-    for (i = 0; args.include_dirs[i]; ++i) {
-        CFCHierarchy_add_include_dir(hierarchy, args.include_dirs[i]);
-    }
-
-    CFCHierarchy_build(hierarchy);
-
-    if (args.header_filename) {
-        header = CFCUtil_slurp_text(args.header_filename, &file_len);
-    }
-    else {
-        header = CFCUtil_strdup("");
-    }
-    if (args.footer_filename) {
-        footer = CFCUtil_slurp_text(args.footer_filename, &file_len);
-    }
-    else {
-        footer = CFCUtil_strdup("");
-    }
-
-    core_binding = CFCBindCore_new(hierarchy, header, footer);
-    CFCBindCore_write_all_modified(core_binding, 0);
-
-    c_binding = CFCC_new(hierarchy, header, footer);
-    CFCC_write_callbacks(c_binding);
-    CFCC_write_hostdefs(c_binding);
-    CFCC_write_man_pages(c_binding);
-
-    CFCBase_decref((CFCBase*)c_binding);
-    CFCBase_decref((CFCBase*)core_binding);
-    CFCBase_decref((CFCBase*)hierarchy);
-    FREEMEM(header);
-    FREEMEM(footer);
-
-    CFCClass_clear_registry();
-    CFCParcel_reap_singletons();
-    yylex_destroy();
-
-    S_free_arguments(&args);
-
-    return EXIT_SUCCESS;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/configure
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/configure b/clownfish/compiler/c/configure
deleted file mode 100755
index 412e707..0000000
--- a/clownfish/compiler/c/configure
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-echo Configuring Clownfish compiler...
-
-probe_clang() { clang -v; }
-probe_gcc()   { gcc -v; }
-
-if [ -z "$CC" ]; then
-    case $(uname) in
-        Darwin*) compilers="clang gcc";;
-        *)       compilers="gcc clang";;
-    esac
-
-    for compiler in $compilers; do
-        if probe_$compiler >/dev/null 2>&1; then
-            CC=$compiler
-            break
-        fi
-    done
-
-    if [ -z "$CC" ]; then
-        CC=cc
-    fi
-fi
-
-echo "Using C compiler '$CC'"
-
-command="$CC ../common/charmonizer.c -o charmonizer"
-echo $command
-$command || exit
-
-echo Running charmonizer
-./charmonizer --cc=$CC --enable-c --enable-makefile $@
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/configure.bat
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/configure.bat b/clownfish/compiler/c/configure.bat
deleted file mode 100644
index cd1fc60..0000000
--- a/clownfish/compiler/c/configure.bat
+++ /dev/null
@@ -1,45 +0,0 @@
-@echo off
-
-rem Licensed to the Apache Software Foundation (ASF) under one or more
-rem contributor license agreements.  See the NOTICE file distributed with
-rem this work for additional information regarding copyright ownership.
-rem The ASF licenses this file to You under the Apache License, Version 2.0
-rem (the "License"); you may not use this file except in compliance with
-rem the License.  You may obtain a copy of the License at
-rem
-rem     http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-echo Configuring Clownfish compiler...
-
-cl >nul 2>nul
-if not errorlevel 1 goto found_cl
-
-gcc -v >nul 2>nul
-if not errorlevel 1 goto found_gcc
-
-echo No C compiler found
-exit /b 1
-
-:found_cl
-echo Using C compiler 'cl'
-echo cl /nologo ..\common\charmonizer.c
-cl /nologo ..\common\charmonizer.c
-if errorlevel 1 exit /b 1
-echo Running charmonizer
-charmonizer.exe --cc=cl --enable-c --enable-makefile %*
-exit /b
-
-:found_gcc
-echo Using C compiler 'gcc'
-echo gcc ..\common\charmonizer.c -o charmonizer.exe
-gcc ..\common\charmonizer.c -o charmonizer.exe
-if errorlevel 1 exit /b 1
-echo Running charmonizer
-charmonizer.exe --cc=gcc --enable-c --enable-makefile %*
-exit /b

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/t/cfbase/Animal.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/t/cfbase/Animal.cfh b/clownfish/compiler/c/t/cfbase/Animal.cfh
deleted file mode 100644
index 46130b7..0000000
--- a/clownfish/compiler/c/t/cfbase/Animal.cfh
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Animal;
-
-class Clownfish::Obj { }
-
-abstract class Animal { }

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/t/cfbase/Animal.cfp
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/t/cfbase/Animal.cfp b/clownfish/compiler/c/t/cfbase/Animal.cfp
deleted file mode 100644
index e2b5ab5..0000000
--- a/clownfish/compiler/c/t/cfbase/Animal.cfp
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-    "name": "Animal",
-    "version": "v0.1.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/t/cfbase/Animal/Dog.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/t/cfbase/Animal/Dog.cfh b/clownfish/compiler/c/t/cfbase/Animal/Dog.cfh
deleted file mode 100644
index 6d54baa..0000000
--- a/clownfish/compiler/c/t/cfbase/Animal/Dog.cfh
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Animal;
-
-class Animal::Dog inherits Animal {
-    public inert incremented Dog*
-    new();
-
-    public inert Dog*
-    init(Dog *self);
-
-    public void
-    Bark(Dog *self);
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/t/cfbase/Animal/Util.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/t/cfbase/Animal/Util.cfh b/clownfish/compiler/c/t/cfbase/Animal/Util.cfh
deleted file mode 100644
index f5688a5..0000000
--- a/clownfish/compiler/c/t/cfbase/Animal/Util.cfh
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Animal;
-
-inert class Animal::Util {
-    inert void
-    groom(Animal *animal);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/t/cfext/Animal/Rottweiler.cfh
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/t/cfext/Animal/Rottweiler.cfh b/clownfish/compiler/c/t/cfext/Animal/Rottweiler.cfh
deleted file mode 100644
index 9e78b58..0000000
--- a/clownfish/compiler/c/t/cfext/Animal/Rottweiler.cfh
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel AnimalExtension;
-
-class Animal::Rottweiler inherits Animal::Dog {
-    public inert incremented Rottweiler*
-    new();
-
-    public inert Rottweiler*
-    init(Rottweiler *self);
-
-    public void
-    Bark(Rottweiler *self);
-
-    public void
-    Bite(Rottweiler *self);
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/t/cfext/AnimalExtension.cfp
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/t/cfext/AnimalExtension.cfp b/clownfish/compiler/c/t/cfext/AnimalExtension.cfp
deleted file mode 100644
index 76f31d3..0000000
--- a/clownfish/compiler/c/t/cfext/AnimalExtension.cfp
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-    "name": "AnimalExtension",
-    "nickname": "AniExt",
-    "version": "v0.1.0"
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/c/t/test_cfc.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/c/t/test_cfc.c b/clownfish/compiler/c/t/test_cfc.c
deleted file mode 100644
index f8da717..0000000
--- a/clownfish/compiler/c/t/test_cfc.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-
-#include "CFCBase.h"
-#include "CFCLexHeader.h"
-#include "CFCTest.h"
-
-int
-main() {
-    CFCTest *test = CFCTest_new("clownfish");
-    CFCTest_run_all(test);
-    int pass = CFCTest_finish(test);
-    CFCBase_decref((CFCBase*)test);
-    yylex_destroy();
-
-    return pass ? EXIT_SUCCESS : EXIT_FAILURE;
-}
-


[lucy-commits] [04/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c b/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
deleted file mode 100644
index 5840c34..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
+++ /dev/null
@@ -1,377 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <time.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Test/Util/TestNumberUtils.h"
-
-#include "Clownfish/Err.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestUtils.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/Util/NumberUtils.h"
-#include "Clownfish/VTable.h"
-
-TestNumberUtils*
-TestNumUtil_new() {
-    return (TestNumberUtils*)VTable_Make_Obj(TESTNUMBERUTILS);
-}
-
-static void
-test_u1(TestBatchRunner *runner) {
-    size_t    count   = 64;
-    uint64_t *ints    = TestUtils_random_u64s(NULL, count, 0, 2);
-    size_t    amount  = count / 8;
-    uint8_t  *bits    = (uint8_t*)CALLOCATE(amount, sizeof(uint8_t));
-
-    for (size_t i = 0; i < count; i++) {
-        if (ints[i]) { NumUtil_u1set(bits, i); }
-    }
-    for (size_t i = 0; i < count; i++) {
-        TEST_INT_EQ(runner, NumUtil_u1get(bits, i), (long)ints[i],
-                    "u1 set/get");
-    }
-
-    for (size_t i = 0; i < count; i++) {
-        NumUtil_u1flip(bits, i);
-    }
-    for (size_t i = 0; i < count; i++) {
-        TEST_INT_EQ(runner, NumUtil_u1get(bits, i), !ints[i], "u1 flip");
-    }
-
-    FREEMEM(bits);
-    FREEMEM(ints);
-}
-
-static void
-test_u2(TestBatchRunner *runner) {
-    size_t    count = 32;
-    uint64_t *ints = TestUtils_random_u64s(NULL, count, 0, 4);
-    uint8_t  *bits = (uint8_t*)CALLOCATE((count / 4), sizeof(uint8_t));
-
-    for (size_t i = 0; i < count; i++) {
-        NumUtil_u2set(bits, i, (uint8_t)ints[i]);
-    }
-    for (size_t i = 0; i < count; i++) {
-        TEST_INT_EQ(runner, NumUtil_u2get(bits, i), (long)ints[i], "u2");
-    }
-
-    FREEMEM(bits);
-    FREEMEM(ints);
-}
-
-static void
-test_u4(TestBatchRunner *runner) {
-    size_t    count = 128;
-    uint64_t *ints  = TestUtils_random_u64s(NULL, count, 0, 16);
-    uint8_t  *bits  = (uint8_t*)CALLOCATE((count / 2), sizeof(uint8_t));
-
-    for (size_t i = 0; i < count; i++) {
-        NumUtil_u4set(bits, i, (uint8_t)ints[i]);
-    }
-    for (size_t i = 0; i < count; i++) {
-        TEST_INT_EQ(runner, NumUtil_u4get(bits, i), (long)ints[i], "u4");
-    }
-
-    FREEMEM(bits);
-    FREEMEM(ints);
-}
-
-static void
-test_c32(TestBatchRunner *runner) {
-    uint64_t  mins[]   = { 0,   0x4000 - 100, (uint32_t)INT32_MAX - 100, UINT32_MAX - 10 };
-    uint64_t  limits[] = { 500, 0x4000 + 100, (uint32_t)INT32_MAX + 100, UINT32_MAX      };
-    uint32_t  set_num;
-    uint32_t  num_sets  = sizeof(mins) / sizeof(uint64_t);
-    size_t    count     = 64;
-    uint64_t *ints      = NULL;
-    size_t    amount    = count * C32_MAX_BYTES;
-    char     *encoded   = (char*)CALLOCATE(amount, sizeof(char));
-    char     *target    = encoded;
-    char     *limit     = target + amount;
-
-    for (set_num = 0; set_num < num_sets; set_num++) {
-        char *skip;
-        ints = TestUtils_random_u64s(ints, count,
-                                     mins[set_num], limits[set_num]);
-        target = encoded;
-        for (size_t i = 0; i < count; i++) {
-            NumUtil_encode_c32((uint32_t)ints[i], &target);
-        }
-        target = encoded;
-        skip   = encoded;
-        for (size_t i = 0; i < count; i++) {
-            TEST_INT_EQ(runner, NumUtil_decode_c32(&target), (long)ints[i],
-                        "c32 %lu", (long)ints[i]);
-            NumUtil_skip_cint(&skip);
-            if (target > limit) { THROW(ERR, "overrun"); }
-        }
-        TEST_TRUE(runner, skip == target, "skip %lu == %lu",
-                  (unsigned long)skip, (unsigned long)target);
-
-        target = encoded;
-        for (size_t i = 0; i < count; i++) {
-            NumUtil_encode_padded_c32((uint32_t)ints[i], &target);
-        }
-        TEST_TRUE(runner, target == limit,
-                  "padded c32 uses 5 bytes (%lu == %lu)", (unsigned long)target,
-                  (unsigned long)limit);
-        target = encoded;
-        skip   = encoded;
-        for (size_t i = 0; i < count; i++) {
-            TEST_INT_EQ(runner, NumUtil_decode_c32(&target), (long)ints[i],
-                        "padded c32 %lu", (long)ints[i]);
-            NumUtil_skip_cint(&skip);
-            if (target > limit) { THROW(ERR, "overrun"); }
-        }
-        TEST_TRUE(runner, skip == target, "skip padded %lu == %lu",
-                  (unsigned long)skip, (unsigned long)target);
-    }
-
-    target = encoded;
-    NumUtil_encode_c32(UINT32_MAX, &target);
-    target = encoded;
-    TEST_INT_EQ(runner, NumUtil_decode_c32(&target), UINT32_MAX, "c32 UINT32_MAX");
-
-    FREEMEM(encoded);
-    FREEMEM(ints);
-}
-
-static void
-test_c64(TestBatchRunner *runner) {
-    uint64_t  mins[]    = { 0,   0x4000 - 100, (uint64_t)UINT32_MAX - 100,  UINT64_MAX - 10 };
-    uint64_t  limits[]  = { 500, 0x4000 + 100, (uint64_t)UINT32_MAX + 1000, UINT64_MAX      };
-    uint32_t  set_num;
-    uint32_t  num_sets  = sizeof(mins) / sizeof(uint64_t);
-    size_t    count     = 64;
-    uint64_t *ints      = NULL;
-    size_t    amount    = count * C64_MAX_BYTES;
-    char     *encoded   = (char*)CALLOCATE(amount, sizeof(char));
-    char     *target    = encoded;
-    char     *limit     = target + amount;
-
-    for (set_num = 0; set_num < num_sets; set_num++) {
-        char *skip;
-        ints = TestUtils_random_u64s(ints, count,
-                                     mins[set_num], limits[set_num]);
-        target = encoded;
-        for (size_t i = 0; i < count; i++) {
-            NumUtil_encode_c64(ints[i], &target);
-        }
-        target = encoded;
-        skip   = encoded;
-        for (size_t i = 0; i < count; i++) {
-            uint64_t got = NumUtil_decode_c64(&target);
-            TEST_TRUE(runner, got == ints[i],
-                      "c64 %" PRIu64 " == %" PRIu64, got, ints[i]);
-            if (target > limit) { THROW(ERR, "overrun"); }
-            NumUtil_skip_cint(&skip);
-        }
-        TEST_TRUE(runner, skip == target, "skip %lu == %lu",
-                  (unsigned long)skip, (unsigned long)target);
-    }
-
-    target = encoded;
-    NumUtil_encode_c64(UINT64_MAX, &target);
-    target = encoded;
-
-    uint64_t got = NumUtil_decode_c64(&target);
-    TEST_TRUE(runner, got == UINT64_MAX, "c64 UINT64_MAX");
-
-    FREEMEM(encoded);
-    FREEMEM(ints);
-}
-
-static void
-test_bigend_u16(TestBatchRunner *runner) {
-    size_t    count     = 32;
-    uint64_t *ints      = TestUtils_random_u64s(NULL, count, 0, UINT16_MAX + 1);
-    size_t    amount    = (count + 1) * sizeof(uint16_t);
-    char     *allocated = (char*)CALLOCATE(amount, sizeof(char));
-    char     *encoded   = allocated + 1; // Intentionally misaligned.
-    char     *target    = encoded;
-
-    for (size_t i = 0; i < count; i++) {
-        NumUtil_encode_bigend_u16((uint16_t)ints[i], &target);
-        target += sizeof(uint16_t);
-    }
-    target = encoded;
-    for (size_t i = 0; i < count; i++) {
-        uint16_t got = NumUtil_decode_bigend_u16(target);
-        TEST_INT_EQ(runner, got, (long)ints[i], "bigend u16");
-        target += sizeof(uint16_t);
-    }
-
-    target = encoded;
-    NumUtil_encode_bigend_u16(1, &target);
-    TEST_INT_EQ(runner, encoded[0], 0, "Truly big-endian u16");
-    TEST_INT_EQ(runner, encoded[1], 1, "Truly big-endian u16");
-
-    FREEMEM(allocated);
-    FREEMEM(ints);
-}
-
-static void
-test_bigend_u32(TestBatchRunner *runner) {
-    size_t    count     = 32;
-    uint64_t *ints      = TestUtils_random_u64s(NULL, count, 0, UINT64_C(1) + UINT32_MAX);
-    size_t    amount    = (count + 1) * sizeof(uint32_t);
-    char     *allocated = (char*)CALLOCATE(amount, sizeof(char));
-    char     *encoded   = allocated + 1; // Intentionally misaligned.
-    char     *target    = encoded;
-
-    for (size_t i = 0; i < count; i++) {
-        NumUtil_encode_bigend_u32((uint32_t)ints[i], &target);
-        target += sizeof(uint32_t);
-    }
-    target = encoded;
-    for (size_t i = 0; i < count; i++) {
-        uint32_t got = NumUtil_decode_bigend_u32(target);
-        TEST_INT_EQ(runner, got, (long)ints[i], "bigend u32");
-        target += sizeof(uint32_t);
-    }
-
-    target = encoded;
-    NumUtil_encode_bigend_u32(1, &target);
-    TEST_INT_EQ(runner, encoded[0], 0, "Truly big-endian u32");
-    TEST_INT_EQ(runner, encoded[3], 1, "Truly big-endian u32");
-
-    FREEMEM(allocated);
-    FREEMEM(ints);
-}
-
-static void
-test_bigend_u64(TestBatchRunner *runner) {
-    size_t    count     = 32;
-    uint64_t *ints      = TestUtils_random_u64s(NULL, count, 0, UINT64_MAX);
-    size_t    amount    = (count + 1) * sizeof(uint64_t);
-    char     *allocated = (char*)CALLOCATE(amount, sizeof(char));
-    char     *encoded   = allocated + 1; // Intentionally misaligned.
-    char     *target    = encoded;
-
-    for (size_t i = 0; i < count; i++) {
-        NumUtil_encode_bigend_u64(ints[i], &target);
-        target += sizeof(uint64_t);
-    }
-    target = encoded;
-    for (size_t i = 0; i < count; i++) {
-        uint64_t got = NumUtil_decode_bigend_u64(target);
-        TEST_TRUE(runner, got == ints[i], "bigend u64");
-        target += sizeof(uint64_t);
-    }
-
-    target = encoded;
-    NumUtil_encode_bigend_u64(1, &target);
-    TEST_INT_EQ(runner, encoded[0], 0, "Truly big-endian");
-    TEST_INT_EQ(runner, encoded[7], 1, "Truly big-endian");
-
-    FREEMEM(allocated);
-    FREEMEM(ints);
-}
-
-static void
-test_bigend_f32(TestBatchRunner *runner) {
-    float    source[]  = { -1.3f, 0.0f, 100.2f };
-    size_t   count     = 3;
-    size_t   amount    = (count + 1) * sizeof(float);
-    uint8_t *allocated = (uint8_t*)CALLOCATE(amount, sizeof(uint8_t));
-    uint8_t *encoded   = allocated + 1; // Intentionally misaligned.
-    uint8_t *target    = encoded;
-
-    for (size_t i = 0; i < count; i++) {
-        NumUtil_encode_bigend_f32(source[i], &target);
-        target += sizeof(float);
-    }
-    target = encoded;
-    for (size_t i = 0; i < count; i++) {
-        float got = NumUtil_decode_bigend_f32(target);
-        TEST_TRUE(runner, got == source[i], "bigend f32");
-        target += sizeof(float);
-    }
-
-    target = encoded;
-    NumUtil_encode_bigend_f32(-2.0f, &target);
-    TEST_INT_EQ(runner, (encoded[0] & 0x80), 0x80,
-                "Truly big-endian (IEEE 754 sign bit set for negative number)");
-    TEST_INT_EQ(runner, encoded[0], 0xC0,
-                "IEEE 754 representation of -2.0f, byte 0");
-    for (size_t i = 1; i < sizeof(float); i++) {
-        TEST_INT_EQ(runner, encoded[i], 0,
-                    "IEEE 754 representation of -2.0f, byte %d", (int)i);
-    }
-
-    FREEMEM(allocated);
-}
-
-static void
-test_bigend_f64(TestBatchRunner *runner) {
-    double   source[]  = { -1.3, 0.0, 100.2 };
-    size_t   count     = 3;
-    size_t   amount    = (count + 1) * sizeof(double);
-    uint8_t *allocated = (uint8_t*)CALLOCATE(amount, sizeof(uint8_t));
-    uint8_t *encoded   = allocated + 1; // Intentionally misaligned.
-    uint8_t *target    = encoded;
-
-    for (size_t i = 0; i < count; i++) {
-        NumUtil_encode_bigend_f64(source[i], &target);
-        target += sizeof(double);
-    }
-    target = encoded;
-    for (size_t i = 0; i < count; i++) {
-        double got = NumUtil_decode_bigend_f64(target);
-        TEST_TRUE(runner, got == source[i], "bigend f64");
-        target += sizeof(double);
-    }
-
-    target = encoded;
-    NumUtil_encode_bigend_f64(-2.0, &target);
-    TEST_INT_EQ(runner, (encoded[0] & 0x80), 0x80,
-                "Truly big-endian (IEEE 754 sign bit set for negative number)");
-    TEST_INT_EQ(runner, encoded[0], 0xC0,
-                "IEEE 754 representation of -2.0, byte 0");
-    for (size_t i = 1; i < sizeof(double); i++) {
-        TEST_INT_EQ(runner, encoded[i], 0,
-                    "IEEE 754 representation of -2.0, byte %d", (int)i);
-    }
-
-    FREEMEM(allocated);
-}
-
-void
-TestNumUtil_Run_IMP(TestNumberUtils *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 1196);
-    srand((unsigned int)time((time_t*)NULL));
-    test_u1(runner);
-    test_u2(runner);
-    test_u4(runner);
-    test_c32(runner);
-    test_c64(runner);
-    test_bigend_u16(runner);
-    test_bigend_u32(runner);
-    test_bigend_u64(runner);
-    test_bigend_f32(runner);
-    test_bigend_f64(runner);
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh
deleted file mode 100644
index cd9e165..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::Util::TestNumberUtils cnick TestNumUtil
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestNumberUtils*
-    new();
-
-    void
-    Run(TestNumberUtils *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c b/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
deleted file mode 100644
index 339de02..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
+++ /dev/null
@@ -1,300 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "Clownfish/Test/Util/TestStringHelper.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/Util/StringHelper.h"
-#include "Clownfish/VTable.h"
-
-/* This alternative implementation of utf8_valid() is (presumably) slower, but
- * it implements the standard in a more linear, easy-to-grok way.
- */
-#define TRAIL_OK(n) (n >= 0x80 && n <= 0xBF)
-TestStringHelper*
-TestStrHelp_new() {
-    return (TestStringHelper*)VTable_Make_Obj(TESTSTRINGHELPER);
-}
-
-static bool
-S_utf8_valid_alt(const char *maybe_utf8, size_t size) {
-    const uint8_t *string = (const uint8_t*)maybe_utf8;
-    const uint8_t *const end = string + size;
-    while (string < end) {
-        int count = StrHelp_UTF8_COUNT[*string];
-        bool valid = false;
-        if (count == 1) {
-            if (string[0] <= 0x7F) {
-                valid = true;
-            }
-        }
-        else if (count == 2) {
-            if (string[0] >= 0xC2 && string[0] <= 0xDF) {
-                if (TRAIL_OK(string[1])) {
-                    valid = true;
-                }
-            }
-        }
-        else if (count == 3) {
-            if (string[0] == 0xE0) {
-                if (string[1] >= 0xA0 && string[1] <= 0xBF
-                    && TRAIL_OK(string[2])
-                   ) {
-                    valid = true;
-                }
-            }
-            else if (string[0] >= 0xE1 && string[0] <= 0xEC) {
-                if (TRAIL_OK(string[1])
-                    && TRAIL_OK(string[2])
-                   ) {
-                    valid = true;
-                }
-            }
-            else if (string[0] == 0xED) {
-                if (string[1] >= 0x80 && string[1] <= 0x9F
-                    && TRAIL_OK(string[2])
-                   ) {
-                    valid = true;
-                }
-            }
-            else if (string[0] >= 0xEE && string[0] <= 0xEF) {
-                if (TRAIL_OK(string[1])
-                    && TRAIL_OK(string[2])
-                   ) {
-                    valid = true;
-                }
-            }
-        }
-        else if (count == 4) {
-            if (string[0] == 0xF0) {
-                if (string[1] >= 0x90 && string[1] <= 0xBF
-                    && TRAIL_OK(string[2])
-                    && TRAIL_OK(string[3])
-                   ) {
-                    valid = true;
-                }
-            }
-            else if (string[0] >= 0xF1 && string[0] <= 0xF3) {
-                if (TRAIL_OK(string[1])
-                    && TRAIL_OK(string[2])
-                    && TRAIL_OK(string[3])
-                   ) {
-                    valid = true;
-                }
-            }
-            else if (string[0] == 0xF4) {
-                if (string[1] >= 0x80 && string[1] <= 0x8F
-                    && TRAIL_OK(string[2])
-                    && TRAIL_OK(string[3])
-                   ) {
-                    valid = true;
-                }
-            }
-        }
-
-        if (!valid) {
-            return false;
-        }
-        string += count;
-    }
-
-    if (string != end) {
-        return false;
-    }
-
-    return true;
-}
-
-static void
-test_overlap(TestBatchRunner *runner) {
-    int32_t result;
-    result = StrHelp_overlap("", "", 0, 0);
-    TEST_INT_EQ(runner, result, 0, "two empty strings");
-    result = StrHelp_overlap("", "foo", 0, 3);
-    TEST_INT_EQ(runner, result, 0, "first string is empty");
-    result = StrHelp_overlap("foo", "", 3, 0);
-    TEST_INT_EQ(runner, result, 0, "second string is empty");
-    result = StrHelp_overlap("foo", "foo", 3, 3);
-    TEST_INT_EQ(runner, result, 3, "equal strings");
-    result = StrHelp_overlap("foo bar", "foo", 7, 3);
-    TEST_INT_EQ(runner, result, 3, "first string is longer");
-    result = StrHelp_overlap("foo", "foo bar", 3, 7);
-    TEST_INT_EQ(runner, result, 3, "second string is longer");
-}
-
-
-static void
-test_to_base36(TestBatchRunner *runner) {
-    char buffer[StrHelp_MAX_BASE36_BYTES];
-    StrHelp_to_base36(UINT64_MAX, buffer);
-    TEST_STR_EQ(runner, "3w5e11264sgsf", buffer, "base36 UINT64_MAX");
-    StrHelp_to_base36(1, buffer);
-    TEST_STR_EQ(runner, "1", buffer, "base36 1");
-    TEST_INT_EQ(runner, buffer[1], 0, "base36 NULL termination");
-}
-
-static void
-test_utf8_round_trip(TestBatchRunner *runner) {
-    int32_t code_point;
-    for (code_point = 0; code_point <= 0x10FFFF; code_point++) {
-        char buffer[4];
-        uint32_t size = StrHelp_encode_utf8_char(code_point, buffer);
-        char *start = buffer;
-        char *end   = start + size;
-
-        // Verify length returned by encode_utf8_char().
-        if (size != StrHelp_UTF8_COUNT[(unsigned char)buffer[0]]) {
-            break;
-        }
-        // Verify that utf8_valid() agrees with alternate implementation.
-        if (!!StrHelp_utf8_valid(start, size)
-            != !!S_utf8_valid_alt(start, size)
-           ) {
-            break;
-        }
-
-        // Verify back_utf8_char().
-        if (StrHelp_back_utf8_char(end, start) != start) {
-            break;
-        }
-
-        // Verify round trip of encode/decode.
-        if (StrHelp_decode_utf8_char(buffer) != code_point) {
-            break;
-        }
-    }
-    if (code_point == 0x110000) {
-        PASS(runner, "Successfully round tripped 0 - 0x10FFFF");
-    }
-    else {
-        FAIL(runner, "Failed round trip at 0x%.1X", (unsigned)code_point);
-    }
-}
-
-static void
-S_test_validity(TestBatchRunner *runner, const char *content, size_t size,
-                bool expected, const char *description) {
-    bool sane = StrHelp_utf8_valid(content, size);
-    bool double_check = S_utf8_valid_alt(content, size);
-    if (sane != double_check) {
-        FAIL(runner, "Disagreement: %s", description);
-    }
-    else {
-        TEST_TRUE(runner, sane == expected, "%s", description);
-    }
-}
-
-static void
-test_utf8_valid(TestBatchRunner *runner) {
-    // Musical symbol G clef:
-    // Code point: U+1D11E
-    // UTF-16:     0xD834 0xDD1E
-    // UTF-8       0xF0 0x9D 0x84 0x9E
-    S_test_validity(runner, "\xF0\x9D\x84\x9E", 4, true,
-                    "Musical symbol G clef");
-    S_test_validity(runner, "\xED\xA0\xB4\xED\xB4\x9E", 6, false,
-                    "G clef as UTF-8 encoded UTF-16 surrogates");
-    S_test_validity(runner, ".\xED\xA0\xB4.", 5, false,
-                    "Isolated high surrogate");
-    S_test_validity(runner, ".\xED\xB4\x9E.", 5, false,
-                    "Isolated low surrogate");
-
-    // Shortest form.
-    S_test_validity(runner, ".\xC1\x9C.", 4, false,
-                    "Non-shortest form ASCII backslash");
-    S_test_validity(runner, ".\xC0\xAF.", 4, false,
-                    "Non-shortest form ASCII slash");
-    S_test_validity(runner, ".\xC0\x80.", 4, false,
-                    "Non-shortest form ASCII NUL character");
-
-    // Range.
-    S_test_validity(runner, "\xF8\x88\x80\x80\x80", 5, false, "5-byte UTF-8");
-
-    // Bad continuations.
-    S_test_validity(runner, "\xE2\x98\xBA\xE2\x98\xBA", 6, true,
-                    "SmileySmiley");
-    S_test_validity(runner, "\xE2\xBA\xE2\x98\xBA", 5, false,
-                    "missing first continuation byte");
-    S_test_validity(runner, "\xE2\x98\xE2\x98\xBA", 5, false,
-                    "missing second continuation byte");
-    S_test_validity(runner, "\xE2\xE2\x98\xBA", 4, false,
-                    "missing both continuation bytes");
-    S_test_validity(runner, "\xBA\xE2\x98\xBA\xE2\xBA", 5, false,
-                    "missing first continuation byte (end)");
-    S_test_validity(runner, "\xE2\x98\xBA\xE2\x98", 5, false,
-                    "missing second continuation byte (end)");
-    S_test_validity(runner, "\xE2\x98\xBA\xE2", 4, false,
-                    "missing both continuation bytes (end)");
-    S_test_validity(runner, "\xBA\xE2\x98\xBA", 4, false,
-                    "isolated continuation byte 0xBA");
-    S_test_validity(runner, "\x98\xE2\x98\xBA", 4, false,
-                    "isolated continuation byte 0x98");
-    S_test_validity(runner, "\xE2\x98\xBA\xBA", 4, false,
-                    "isolated continuation byte 0xBA (end)");
-    S_test_validity(runner, "\xE2\x98\xBA\x98", 4, false,
-                    "isolated continuation byte 0x98 (end)");
-}
-
-static void
-test_is_whitespace(TestBatchRunner *runner) {
-    TEST_TRUE(runner, StrHelp_is_whitespace(' '), "space is whitespace");
-    TEST_TRUE(runner, StrHelp_is_whitespace('\n'), "newline is whitespace");
-    TEST_TRUE(runner, StrHelp_is_whitespace('\t'), "tab is whitespace");
-    TEST_TRUE(runner, StrHelp_is_whitespace('\v'),
-              "vertical tab is whitespace");
-    TEST_TRUE(runner, StrHelp_is_whitespace(0x180E),
-              "Mongolian vowel separator is whitespace");
-    TEST_FALSE(runner, StrHelp_is_whitespace('a'), "'a' isn't whitespace");
-    TEST_FALSE(runner, StrHelp_is_whitespace(0), "NULL isn't whitespace");
-    TEST_FALSE(runner, StrHelp_is_whitespace(0x263A),
-               "Smiley isn't whitespace");
-}
-
-static void
-test_back_utf8_char(TestBatchRunner *runner) {
-    char buffer[4];
-    char *buf = buffer + 1;
-    uint32_t len = StrHelp_encode_utf8_char(0x263A, buffer);
-    char *end = buffer + len;
-    TEST_TRUE(runner, StrHelp_back_utf8_char(end, buffer) == buffer,
-              "back_utf8_char");
-    TEST_TRUE(runner, StrHelp_back_utf8_char(end, buf) == NULL,
-              "back_utf8_char returns NULL rather than back up beyond start");
-    TEST_TRUE(runner, StrHelp_back_utf8_char(buffer, buffer) == NULL,
-              "back_utf8_char returns NULL when end == start");
-}
-
-void
-TestStrHelp_Run_IMP(TestStringHelper *self, TestBatchRunner *runner) {
-    TestBatchRunner_Plan(runner, (TestBatch*)self, 40);
-    test_overlap(runner);
-    test_to_base36(runner);
-    test_utf8_round_trip(runner);
-    test_utf8_valid(runner);
-    test_is_whitespace(runner);
-    test_back_utf8_char(runner);
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh
deleted file mode 100644
index 0f8351a..0000000
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel TestClownfish;
-
-class Clownfish::Test::Util::TestStringHelper cnick TestStrHelp
-    inherits Clownfish::TestHarness::TestBatch {
-
-    inert incremented TestStringHelper*
-    new();
-
-    void
-    Run(TestStringHelper *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestBatch.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestBatch.cfh b/clownfish/runtime/core/Clownfish/TestHarness/TestBatch.cfh
deleted file mode 100644
index 21b1117..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestBatch.cfh
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Abstract base class for test modules.
- */
-abstract class Clownfish::TestHarness::TestBatch inherits Clownfish::Obj {
-    /** Run the tests of the test batch.
-     */
-    abstract void
-    Run(TestBatch *self, TestBatchRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c b/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
deleted file mode 100644
index 72cebf2..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.c
+++ /dev/null
@@ -1,306 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#define C_CFISH_TESTBATCHRUNNER
-#define CFISH_USE_SHORT_NAMES
-
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/TestHarness/TestBatch.h"
-#include "Clownfish/TestHarness/TestFormatter.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
-
-struct try_run_tests_context {
-    TestBatchRunner *runner;
-    TestBatch       *batch;
-};
-
-static void
-S_try_run_tests(void *context);
-
-static bool
-S_vtest_true(TestBatchRunner *self, bool condition, const char *pattern,
-             va_list args);
-
-TestBatchRunner*
-TestBatchRunner_new(TestFormatter *formatter) {
-    TestBatchRunner *self = (TestBatchRunner*)VTable_Make_Obj(TESTBATCHRUNNER);
-    return TestBatchRunner_init(self, formatter);
-}
-
-TestBatchRunner*
-TestBatchRunner_init(TestBatchRunner *self, TestFormatter *formatter) {
-    // Assign.
-    self->formatter   = (TestFormatter*)INCREF(formatter);
-
-    // Initialize.
-    self->num_planned = 0;
-    self->test_num    = 0;
-    self->num_passed  = 0;
-    self->num_failed  = 0;
-    self->num_skipped = 0;
-
-    return self;
-}
-
-void
-TestBatchRunner_Destroy_IMP(TestBatchRunner *self) {
-    DECREF(self->formatter);
-    SUPER_DESTROY(self, TESTBATCHRUNNER);
-}
-
-bool
-TestBatchRunner_Run_Batch_IMP(TestBatchRunner *self, TestBatch *batch) {
-    struct try_run_tests_context args;
-    args.runner = self;
-    args.batch  = batch;
-    Err *err = Err_trap(S_try_run_tests, &args);
-
-    bool failed = false;
-    if (err) {
-        failed = true;
-        String *mess = Err_Get_Mess(err);
-        Err_warn_mess((String*)INCREF(mess));
-    }
-    if (self->num_failed > 0) {
-        failed = true;
-        TestFormatter_batch_comment(self->formatter, "%d/%d tests failed.\n",
-                                    self->num_failed, self->test_num);
-    }
-    if (self->test_num != self->num_planned) {
-        failed = true;
-        TestFormatter_batch_comment(self->formatter,
-                                    "Bad plan: You planned %d tests but ran"
-                                    " %d.\n",
-                                    self->num_planned, self->test_num);
-    }
-
-    return !failed;
-}
-
-static void
-S_try_run_tests(void *context) {
-    struct try_run_tests_context *args
-        = (struct try_run_tests_context*)context;
-    TestBatch_Run(args->batch, args->runner);
-}
-
-void
-TestBatchRunner_Plan_IMP(TestBatchRunner *self, TestBatch *batch,
-                         uint32_t num_planned) {
-    self->num_planned = num_planned;
-    TestFormatter_Batch_Prologue(self->formatter, batch, num_planned);
-}
-
-uint32_t
-TestBatchRunner_Get_Num_Planned_IMP(TestBatchRunner *self) {
-    return self->num_planned;
-}
-
-uint32_t
-TestBatchRunner_Get_Num_Tests_IMP(TestBatchRunner *self) {
-    return self->test_num;
-}
-
-uint32_t
-TestBatchRunner_Get_Num_Failed_IMP(TestBatchRunner *self) {
-    return self->num_failed;
-}
-
-bool
-TestBatchRunner_test_true(TestBatchRunner *self, bool condition,
-                          const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    bool result = TestBatchRunner_VTest_True(self, condition, pattern, args);
-    va_end(args);
-    return result;
-}
-
-bool
-TestBatchRunner_test_false(TestBatchRunner *self, bool condition,
-                           const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    bool result = TestBatchRunner_VTest_False(self, condition, pattern, args);
-    va_end(args);
-    return result;
-}
-
-bool
-TestBatchRunner_test_int_equals(TestBatchRunner *self, long got, long expected,
-                                const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    bool result = TestBatchRunner_VTest_Int_Equals(self, got, expected,
-                                                   pattern, args);
-    va_end(args);
-    return result;
-}
-
-bool
-TestBatchRunner_test_float_equals(TestBatchRunner *self, double got,
-                                  double expected, const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    bool result = TestBatchRunner_VTest_Float_Equals(self, got, expected,
-                                                     pattern, args);
-    va_end(args);
-    return result;
-}
-
-bool
-TestBatchRunner_test_string_equals(TestBatchRunner *self, const char *got,
-                                   const char *expected, const char *pattern,
-                                   ...) {
-    va_list args;
-    va_start(args, pattern);
-    bool result = TestBatchRunner_VTest_String_Equals(self, got, expected,
-                                                      pattern, args);
-    va_end(args);
-    return result;
-}
-
-bool
-TestBatchRunner_pass(TestBatchRunner *self, const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    bool result = TestBatchRunner_VPass(self, pattern, args);
-    va_end(args);
-    return result;
-}
-
-bool
-TestBatchRunner_fail(TestBatchRunner *self, const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    bool result = TestBatchRunner_VFail(self, pattern, args);
-    va_end(args);
-    return result;
-}
-
-void
-TestBatchRunner_skip(TestBatchRunner *self, const char *pattern, ...) {
-    va_list args;
-    va_start(args, pattern);
-    TestBatchRunner_VSkip(self, pattern, args);
-    va_end(args);
-}
-
-bool
-TestBatchRunner_VTest_True_IMP(TestBatchRunner *self, bool condition,
-                               const char *pattern, va_list args) {
-    return S_vtest_true(self, condition, pattern, args);
-}
-
-bool
-TestBatchRunner_VTest_False_IMP(TestBatchRunner *self, bool condition,
-                                const char *pattern, va_list args) {
-    return S_vtest_true(self, !condition, pattern, args);
-}
-
-bool
-TestBatchRunner_VTest_Int_Equals_IMP(TestBatchRunner *self, long got,
-                                     long expected, const char *pattern,
-                                     va_list args) {
-    bool pass = (got == expected);
-    S_vtest_true(self, pass, pattern, args);
-    if (!pass) {
-        TestFormatter_test_comment(self->formatter,
-                                   "Expected '%ld', got '%ld'.\n",
-                                   expected, got);
-    }
-    return pass;
-}
-
-bool
-TestBatchRunner_VTest_Float_Equals_IMP(TestBatchRunner *self, double got,
-                                       double expected, const char *pattern,
-                                       va_list args) {
-    double relative_error = got / expected - 1.0;
-    bool   pass           = (fabs(relative_error) < 1e-6);
-    S_vtest_true(self, pass, pattern, args);
-    if (!pass) {
-        TestFormatter_test_comment(self->formatter,
-                                   "Expected '%e', got '%e'.\n",
-                                   expected, got);
-    }
-    return pass;
-}
-
-bool
-TestBatchRunner_VTest_String_Equals_IMP(TestBatchRunner *self, const char *got,
-                                        const char *expected,
-                                        const char *pattern, va_list args) {
-    bool pass = (strcmp(got, expected) == 0);
-    S_vtest_true(self, pass, pattern, args);
-    if (!pass) {
-        TestFormatter_test_comment(self->formatter,
-                                   "Expected '%s', got '%s'.\n",
-                                   expected, got);
-    }
-    return pass;
-}
-
-bool
-TestBatchRunner_VPass_IMP(TestBatchRunner *self, const char *pattern,
-                          va_list args) {
-    return S_vtest_true(self, true, pattern, args);
-}
-
-bool
-TestBatchRunner_VFail_IMP(TestBatchRunner *self, const char *pattern,
-                          va_list args) {
-    return S_vtest_true(self, false, pattern, args);
-}
-
-void
-TestBatchRunner_VSkip_IMP(TestBatchRunner *self, const char *pattern,
-                          va_list args) {
-    self->test_num++;
-    // TODO: Add a VTest_Skip method to TestFormatter
-    TestFormatter_VTest_Result(self->formatter, true, self->test_num,
-                               pattern, args);
-    self->num_skipped++;
-}
-
-static bool
-S_vtest_true(TestBatchRunner* self, bool condition, const char *pattern,
-             va_list args) {
-    // Increment test number.
-    self->test_num++;
-
-    if (condition) {
-        self->num_passed++;
-    }
-    else {
-        self->num_failed++;
-    }
-
-    TestFormatter_VTest_Result(self->formatter, condition, self->test_num,
-                               pattern, args);
-
-    return condition;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.cfh b/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.cfh
deleted file mode 100644
index cde51f7..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestBatchRunner.cfh
+++ /dev/null
@@ -1,135 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Run a single test batch and collect statistics.
- */
-class Clownfish::TestHarness::TestBatchRunner inherits Clownfish::Obj {
-    TestFormatter *formatter;
-    uint32_t       test_num;
-    uint32_t       num_planned;
-    uint32_t       num_passed;
-    uint32_t       num_failed;
-    uint32_t       num_skipped;
-
-    inert incremented TestBatchRunner*
-    new(TestFormatter *formatter);
-
-    inert TestBatchRunner*
-    init(TestBatchRunner *self, TestFormatter *formatter);
-
-    public void
-    Destroy(TestBatchRunner *self);
-
-    /** Run the test batch and print test output and diagnosis.
-     *
-     * @return true if the test batch passed.
-     */
-    bool
-    Run_Batch(TestBatchRunner *self, TestBatch *batch);
-
-    void
-    Plan(TestBatchRunner *self, TestBatch *batch, uint32_t num_planned);
-
-    /** Return the number of tests planned.
-     */
-    uint32_t
-    Get_Num_Planned(TestBatchRunner *self);
-
-    /** Return the number of tests run.
-     */
-    uint32_t
-    Get_Num_Tests(TestBatchRunner *self);
-
-    /** Return the number of failed tests.
-     */
-    uint32_t
-    Get_Num_Failed(TestBatchRunner *self);
-
-    inert bool
-    test_true(TestBatchRunner *self, bool condition, const char *pattern, ...);
-
-    inert bool
-    test_false(TestBatchRunner *self, bool condition, const char *pattern,
-               ...);
-
-    inert bool
-    test_int_equals(TestBatchRunner *self, long got, long expected,
-                    const char *pattern, ...);
-
-    inert bool
-    test_float_equals(TestBatchRunner *self, double got, double expected,
-                      const char *pattern, ...);
-
-    inert bool
-    test_string_equals(TestBatchRunner *self, const char *got,
-                       const char *expected, const char *pattern, ...);
-
-    inert bool
-    pass(TestBatchRunner *self, const char *pattern, ...);
-
-    inert bool
-    fail(TestBatchRunner *self, const char *pattern, ...);
-
-    inert void
-    skip(TestBatchRunner *self, const char *pattern, ...);
-
-    bool
-    VTest_True(TestBatchRunner *self, bool condition, const char *pattern,
-               va_list args);
-
-    bool
-    VTest_False(TestBatchRunner *self, bool condition, const char *pattern,
-                va_list args);
-
-    bool
-    VTest_Int_Equals(TestBatchRunner *self, long got, long expected,
-                     const char *pattern, va_list args);
-
-    bool
-    VTest_Float_Equals(TestBatchRunner *self, double got, double expected,
-                       const char *pattern, va_list args);
-
-    bool
-    VTest_String_Equals(TestBatchRunner *self, const char *got,
-                        const char *expected, const char *pattern,
-                        va_list args);
-
-    bool
-    VPass(TestBatchRunner *self, const char *pattern, va_list args);
-
-    bool
-    VFail(TestBatchRunner *self, const char *pattern, va_list args);
-
-    void
-    VSkip(TestBatchRunner *self, const char *pattern, va_list args);
-}
-
-__C__
-#ifdef CFISH_USE_SHORT_NAMES
-  #define TEST_TRUE            cfish_TestBatchRunner_test_true
-  #define TEST_FALSE           cfish_TestBatchRunner_test_false
-  #define TEST_INT_EQ          cfish_TestBatchRunner_test_int_equals
-  #define TEST_FLOAT_EQ        cfish_TestBatchRunner_test_float_equals
-  #define TEST_STR_EQ          cfish_TestBatchRunner_test_string_equals
-  #define PASS                 cfish_TestBatchRunner_pass
-  #define FAIL                 cfish_TestBatchRunner_fail
-  #define SKIP                 cfish_TestBatchRunner_skip
-#endif
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c b/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
deleted file mode 100644
index c5016be..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.c
+++ /dev/null
@@ -1,193 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-
-#define C_CFISH_TESTFORMATTER
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/TestHarness/TestFormatter.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/TestHarness/TestBatch.h"
-#include "Clownfish/TestHarness/TestSuiteRunner.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/VTable.h"
-
-TestFormatter*
-TestFormatter_init(TestFormatter *self) {
-    ABSTRACT_CLASS_CHECK(self, TESTFORMATTER);
-    return self;
-}
-
-void
-TestFormatter_test_result(TestFormatter *self, bool pass, uint32_t test_num,
-                          const char *fmt, ...) {
-    va_list args;
-    va_start(args, fmt);
-    TestFormatter_VTest_Result(self, pass, test_num, fmt, args);
-    va_end(args);
-}
-
-void
-TestFormatter_test_comment(TestFormatter *self, const char *fmt, ...) {
-    va_list args;
-    va_start(args, fmt);
-    TestFormatter_VTest_Comment(self, fmt, args);
-    va_end(args);
-}
-
-void
-TestFormatter_batch_comment(TestFormatter *self, const char *fmt, ...) {
-    va_list args;
-    va_start(args, fmt);
-    TestFormatter_VBatch_Comment(self, fmt, args);
-    va_end(args);
-}
-
-TestFormatterCF*
-TestFormatterCF_new() {
-    TestFormatterCF *self
-        = (TestFormatterCF*)VTable_Make_Obj(TESTFORMATTERCF);
-    return TestFormatterCF_init(self);
-}
-
-TestFormatterCF*
-TestFormatterCF_init(TestFormatterCF *self) {
-    return (TestFormatterCF*)TestFormatter_init((TestFormatter*)self);
-}
-
-void
-TestFormatterCF_Batch_Prologue_IMP(TestFormatterCF *self, TestBatch *batch,
-                                   uint32_t num_planned) {
-    UNUSED_VAR(self);
-    UNUSED_VAR(num_planned);
-    String *class_name = TestBatch_Get_Class_Name(batch);
-    char *utf8 = Str_To_Utf8(class_name);
-    printf("Running %s...\n", utf8);
-    FREEMEM(utf8);
-}
-
-void
-TestFormatterCF_VTest_Result_IMP(TestFormatterCF *self, bool pass,
-                                 uint32_t test_num, const char *fmt,
-                                 va_list args) {
-    UNUSED_VAR(self);
-    if (!pass) {
-        printf("  Failed test %u: ", test_num);
-        vprintf(fmt, args);
-        printf("\n");
-    }
-}
-
-void
-TestFormatterCF_VTest_Comment_IMP(TestFormatterCF *self, const char *fmt,
-                                  va_list args) {
-    UNUSED_VAR(self);
-    printf("    ");
-    vprintf(fmt, args);
-}
-
-void
-TestFormatterCF_VBatch_Comment_IMP(TestFormatterCF *self, const char *fmt,
-                                   va_list args) {
-    UNUSED_VAR(self);
-    printf("  ");
-    vprintf(fmt, args);
-}
-
-void
-TestFormatterCF_Summary_IMP(TestFormatterCF *self, TestSuiteRunner *runner) {
-    UNUSED_VAR(self);
-    uint32_t num_batches = TestSuiteRunner_Get_Num_Batches(runner);
-    uint32_t num_batches_failed
-        = TestSuiteRunner_Get_Num_Batches_Failed(runner);
-    uint32_t num_tests = TestSuiteRunner_Get_Num_Tests(runner);
-    uint32_t num_tests_failed = TestSuiteRunner_Get_Num_Tests_Failed(runner);
-
-    if (num_batches == 0) {
-        printf("No tests planned or run.\n");
-    }
-    else if (num_batches_failed == 0) {
-        printf("%u batches passed. %u tests passed.\n", num_batches,
-               num_tests);
-        printf("Result: PASS\n");
-    }
-    else {
-        printf("%u/%u batches failed. %u/%u tests failed.\n",
-               num_batches_failed, num_batches, num_tests_failed, num_tests);
-        printf("Result: FAIL\n");
-    }
-}
-
-TestFormatterTAP*
-TestFormatterTAP_new() {
-    TestFormatterTAP *self
-        = (TestFormatterTAP*)VTable_Make_Obj(TESTFORMATTERTAP);
-    return TestFormatterTAP_init(self);
-}
-
-TestFormatterTAP*
-TestFormatterTAP_init(TestFormatterTAP *self) {
-    return (TestFormatterTAP*)TestFormatter_init((TestFormatter*)self);
-}
-
-void
-TestFormatterTAP_Batch_Prologue_IMP(TestFormatterTAP *self, TestBatch *batch,
-                                uint32_t num_planned) {
-    UNUSED_VAR(self);
-    UNUSED_VAR(batch);
-    printf("1..%u\n", num_planned);
-}
-
-void
-TestFormatterTAP_VTest_Result_IMP(TestFormatterTAP *self, bool pass,
-                                  uint32_t test_num, const char *fmt,
-                                  va_list args) {
-    UNUSED_VAR(self);
-    const char *result = pass ? "ok" : "not ok";
-    printf("%s %u - ", result, test_num);
-    vprintf(fmt, args);
-    printf("\n");
-}
-
-void
-TestFormatterTAP_VTest_Comment_IMP(TestFormatterTAP *self, const char *fmt,
-                                   va_list args) {
-    UNUSED_VAR(self);
-    printf("#   ");
-    vprintf(fmt, args);
-}
-
-void
-TestFormatterTAP_VBatch_Comment_IMP(TestFormatterTAP *self, const char *fmt,
-                                    va_list args) {
-    UNUSED_VAR(self);
-    printf("# ");
-    vprintf(fmt, args);
-}
-
-void
-TestFormatterTAP_Summary_IMP(TestFormatterTAP *self, TestSuiteRunner *runner) {
-    UNUSED_VAR(self);
-    UNUSED_VAR(runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.cfh b/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.cfh
deleted file mode 100644
index 92ca911..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestFormatter.cfh
+++ /dev/null
@@ -1,142 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Abstract base class for Clownfish test formatters.
- */
-abstract class Clownfish::TestHarness::TestFormatter inherits Clownfish::Obj {
-    inert TestFormatter*
-    init(TestFormatter *self);
-
-    inert void
-    test_result(TestFormatter *self, bool pass, uint32_t test_num,
-                const char *fmt, ...);
-
-    inert void
-    test_comment(TestFormatter *self, const char *fmt, ...);
-
-    inert void
-    batch_comment(TestFormatter *self, const char *fmt, ...);
-
-    /** Print output at the beginning of a test batch.
-     *
-     * @param batch The test batch.
-     */
-    abstract void
-    Batch_Prologue(TestFormatter *self, TestBatch *batch,
-                   uint32_t num_planned);
-
-    /** Print the result of a single test.
-     *
-     * @param pass True if the test passed, false otherwise.
-     * @param test_num The sequence number of the test.
-     * @param fmt printf-style format string.
-     * @param args Additional arguments.
-     */
-    abstract void
-    VTest_Result(TestFormatter *self, bool pass, uint32_t test_num,
-                 const char *fmt, va_list args);
-
-    /** Print additional diagnosis for a test.
-     *
-     * @param fmt printf-style format string.
-     * @param args Additional arguments.
-     */
-    abstract void
-    VTest_Comment(TestFormatter *self, const char *fmt, va_list args);
-
-    /** Print additional diagnosis for a test batch.
-     *
-     * @param fmt printf-style format string.
-     * @param args Additional arguments.
-     */
-    abstract void
-    VBatch_Comment(TestFormatter *self, const char *fmt, va_list args);
-
-    /** Print test summary after running all test batches.
-     *
-     * @param runner The test runner.
-     */
-    abstract void
-    Summary(TestFormatter *self, TestSuiteRunner *runner);
-}
-
-/** TestFormatter for "Clownfish" format.
- *
- * A TestFormatter that produces human-readable output in a custom
- * "Clownfish" format.
- */
-class Clownfish::Test::Formatter::TestFormatterCF
-    inherits Clownfish::TestHarness::TestFormatter {
-
-    inert incremented TestFormatterCF*
-    new();
-
-    inert TestFormatterCF*
-    init(TestFormatterCF *self);
-
-    void
-    Batch_Prologue(TestFormatterCF *self, TestBatch *batch,
-                   uint32_t num_planned);
-
-    void
-    VTest_Result(TestFormatterCF *self, bool pass, uint32_t test_num,
-                 const char *fmt, va_list args);
-
-    void
-    VTest_Comment(TestFormatterCF *self, const char *fmt, va_list args);
-
-    void
-    VBatch_Comment(TestFormatterCF *self, const char *fmt, va_list args);
-
-    void
-    Summary(TestFormatterCF *self, TestSuiteRunner *runner);
-}
-
-/** TestFormatter for TAP output.
- *
- * A TestFormatter that produces TAP output (Test Anything Protocol).
- * See http://testanything.org/
- */
-class Clownfish::Test::Formatter::TestFormatterTAP
-    inherits Clownfish::TestHarness::TestFormatter {
-
-    inert incremented TestFormatterTAP*
-    new();
-
-    inert TestFormatterTAP*
-    init(TestFormatterTAP *self);
-
-    void
-    Batch_Prologue(TestFormatterTAP *self, TestBatch *batch,
-                   uint32_t num_planned);
-
-    void
-    VTest_Result(TestFormatterTAP *self, bool pass, uint32_t test_num,
-                 const char *fmt, va_list args);
-
-    void
-    VTest_Comment(TestFormatterTAP *self, const char *fmt, va_list args);
-
-    void
-    VBatch_Comment(TestFormatterTAP *self, const char *fmt, va_list args);
-
-    void
-    Summary(TestFormatterTAP *self, TestSuiteRunner *runner);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c b/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c
deleted file mode 100644
index a396b16..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.c
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-
-#define C_CFISH_TESTSUITE
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-#define TESTCFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/TestHarness/TestSuite.h"
-
-#include "Clownfish/String.h"
-#include "Clownfish/Err.h"
-#include "Clownfish/TestHarness/TestBatch.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestFormatter.h"
-#include "Clownfish/TestHarness/TestSuiteRunner.h"
-#include "Clownfish/VArray.h"
-#include "Clownfish/VTable.h"
-
-static void
-S_unbuffer_stdout();
-
-TestSuite*
-TestSuite_new() {
-    TestSuite *self = (TestSuite*)VTable_Make_Obj(TESTSUITE);
-    return TestSuite_init(self);
-}
-
-TestSuite*
-TestSuite_init(TestSuite *self) {
-    self->batches = VA_new(0);
-    return self;
-}
-
-void
-TestSuite_Destroy_IMP(TestSuite *self) {
-    DECREF(self->batches);
-    SUPER_DESTROY(self, TESTSUITE);
-}
-
-void
-TestSuite_Add_Batch_IMP(TestSuite *self, TestBatch *batch) {
-    VA_Push(self->batches, (Obj*)batch);
-}
-
-bool
-TestSuite_Run_Batch_IMP(TestSuite *self, String *class_name,
-                    TestFormatter *formatter) {
-    S_unbuffer_stdout();
-
-    uint32_t size = VA_Get_Size(self->batches);
-
-    for (uint32_t i = 0; i < size; ++i) {
-        TestBatch *batch = (TestBatch*)VA_Fetch(self->batches, i);
-
-        if (Str_Equals(TestBatch_Get_Class_Name(batch), (Obj*)class_name)) {
-            TestBatchRunner *runner = TestBatchRunner_new(formatter);
-            bool result = TestBatchRunner_Run_Batch(runner, batch);
-            DECREF(runner);
-            return result;
-        }
-    }
-
-    THROW(ERR, "Couldn't find test class '%o'", class_name);
-    UNREACHABLE_RETURN(bool);
-}
-
-bool
-TestSuite_Run_All_Batches_IMP(TestSuite *self, TestFormatter *formatter) {
-    S_unbuffer_stdout();
-
-    TestSuiteRunner *runner = TestSuiteRunner_new(formatter);
-    uint32_t size = VA_Get_Size(self->batches);
-
-    for (uint32_t i = 0; i < size; ++i) {
-        TestBatch *batch = (TestBatch*)VA_Fetch(self->batches, i);
-        TestSuiteRunner_Run_Batch(runner, batch);
-    }
-
-    bool result = TestSuiteRunner_Finish(runner);
-
-    DECREF(runner);
-    return result;
-}
-
-static void
-S_unbuffer_stdout() {
-    int check_val = setvbuf(stdout, NULL, _IONBF, 0);
-    if (check_val != 0) {
-        fprintf(stderr, "Failed when trying to unbuffer stdout\n");
-    }
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.cfh b/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.cfh
deleted file mode 100644
index 52bfa2c..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestSuite.cfh
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Manage a collection of test batches.
- */
-class Clownfish::TestHarness::TestSuite inherits Clownfish::Obj {
-    VArray *batches;
-
-    inert incremented TestSuite*
-    new();
-
-    inert TestSuite*
-    init(TestSuite *self);
-
-    public void
-    Destroy(TestSuite *self);
-
-    void
-    Add_Batch(TestSuite *self, decremented TestBatch *batch);
-
-    bool
-    Run_Batch(TestSuite *self, String *class_name, TestFormatter *formatter);
-
-    bool
-    Run_All_Batches(TestSuite *self, TestFormatter *formatter);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c b/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
deleted file mode 100644
index 64be5bd..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_TESTSUITERUNNER
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "Clownfish/TestHarness/TestSuiteRunner.h"
-
-#include "Clownfish/Err.h"
-#include "Clownfish/TestHarness/TestBatch.h"
-#include "Clownfish/TestHarness/TestBatchRunner.h"
-#include "Clownfish/TestHarness/TestFormatter.h"
-#include "Clownfish/VTable.h"
-
-TestSuiteRunner*
-TestSuiteRunner_new(TestFormatter *formatter) {
-    TestSuiteRunner *self = (TestSuiteRunner*)VTable_Make_Obj(TESTSUITERUNNER);
-    return TestSuiteRunner_init(self, formatter);
-}
-
-TestSuiteRunner*
-TestSuiteRunner_init(TestSuiteRunner *self, TestFormatter *formatter) {
-    self->formatter          = (TestFormatter*)INCREF(formatter);
-    self->num_tests          = 0;
-    self->num_tests_failed   = 0;
-    self->num_batches        = 0;
-    self->num_batches_failed = 0;
-
-    return self;
-}
-
-void
-TestSuiteRunner_Destroy_IMP(TestSuiteRunner *self) {
-    DECREF(self->formatter);
-    SUPER_DESTROY(self, TESTSUITERUNNER);
-}
-
-bool
-TestSuiteRunner_Run_Batch_IMP(TestSuiteRunner *self, TestBatch *batch) {
-    TestBatchRunner *batch_runner = TestBatchRunner_new(self->formatter);
-    bool success = TestBatchRunner_Run_Batch(batch_runner, batch);
-
-    self->num_tests        += TestBatchRunner_Get_Num_Tests(batch_runner);
-    self->num_tests_failed += TestBatchRunner_Get_Num_Failed(batch_runner);
-    self->num_batches      += 1;
-
-    if (!success) {
-        self->num_batches_failed += 1;
-    }
-
-    DECREF(batch_runner);
-    return success;
-}
-
-bool
-TestSuiteRunner_Finish_IMP(TestSuiteRunner *self) {
-    TestFormatter_Summary(self->formatter, self);
-
-    return self->num_batches != 0 && self->num_batches_failed == 0;
-}
-
-uint32_t
-TestSuiteRunner_Get_Num_Tests_IMP(TestSuiteRunner *self) {
-    return self->num_tests;
-}
-
-uint32_t
-TestSuiteRunner_Get_Num_Tests_Failed_IMP(TestSuiteRunner *self) {
-    return self->num_tests_failed;
-}
-
-uint32_t
-TestSuiteRunner_Get_Num_Batches_IMP(TestSuiteRunner *self) {
-    return self->num_batches;
-}
-
-uint32_t
-TestSuiteRunner_Get_Num_Batches_Failed_IMP(TestSuiteRunner *self) {
-    return self->num_batches_failed;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.cfh b/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.cfh
deleted file mode 100644
index e9202f1..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestSuiteRunner.cfh
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Run multiple test batches and collect statistics.
- */
-class Clownfish::TestHarness::TestSuiteRunner inherits Clownfish::Obj {
-    TestFormatter *formatter;
-    uint32_t       num_tests;
-    uint32_t       num_tests_failed;
-    uint32_t       num_batches;
-    uint32_t       num_batches_failed;
-
-    inert incremented TestSuiteRunner*
-    new(TestFormatter *formatter);
-
-    /**
-     * @param formatter The test formatter to format the test output.
-     */
-    inert TestSuiteRunner*
-    init(TestSuiteRunner *self, TestFormatter *formatter);
-
-    public void
-    Destroy(TestSuiteRunner *self);
-
-    /** Run a test batch and collect statistics.
-     *
-     * @param batch The test batch.
-     * @return true if the test batch passed.
-     */
-    bool
-    Run_Batch(TestSuiteRunner *self, TestBatch *batch);
-
-    /** Print a summary after running all test batches.
-     *
-     * @return true if any tests were run and all test batches passed.
-     */
-    bool
-    Finish(TestSuiteRunner *self);
-
-    /** Return the number of tests run.
-     */
-    uint32_t
-    Get_Num_Tests(TestSuiteRunner *self);
-
-    /** Return the number of failed tests.
-     */
-    uint32_t
-    Get_Num_Tests_Failed(TestSuiteRunner *self);
-
-    /** Return the number of test batches run.
-     */
-    uint32_t
-    Get_Num_Batches(TestSuiteRunner *self);
-
-    /** Return the number of failed test batches.
-     */
-    uint32_t
-    Get_Num_Batches_Failed(TestSuiteRunner *self);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c b/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c
deleted file mode 100644
index 3bf4d12..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#define CHY_USE_SHORT_NAMES
-#define CFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/TestHarness/TestUtils.h"
-
-#include "Clownfish/CharBuf.h"
-#include "Clownfish/String.h"
-#include "Clownfish/Util/Memory.h"
-
-uint64_t
-TestUtils_random_u64() {
-    uint64_t num = ((uint64_t)(rand()   & 0x7FFF) << 60)
-                   | ((uint64_t)(rand() & 0x7FFF) << 45)
-                   | ((uint64_t)(rand() & 0x7FFF) << 30)
-                   | ((uint64_t)(rand() & 0x7FFF) << 15)
-                   | ((uint64_t)(rand() & 0x7FFF) << 0);
-    return num;
-}
-
-int64_t*
-TestUtils_random_i64s(int64_t *buf, size_t count, int64_t min,
-                      int64_t limit) {
-    uint64_t  range = min < limit ? (uint64_t)limit - (uint64_t)min : 0;
-    int64_t *ints = buf ? buf : (int64_t*)CALLOCATE(count, sizeof(int64_t));
-    for (size_t i = 0; i < count; i++) {
-        ints[i] = min + TestUtils_random_u64() % range;
-    }
-    return ints;
-}
-
-uint64_t*
-TestUtils_random_u64s(uint64_t *buf, size_t count, uint64_t min,
-                      uint64_t limit) {
-    uint64_t  range = min < limit ? limit - min : 0;
-    uint64_t *ints = buf ? buf : (uint64_t*)CALLOCATE(count, sizeof(uint64_t));
-    for (size_t i = 0; i < count; i++) {
-        ints[i] = min + TestUtils_random_u64() % range;
-    }
-    return ints;
-}
-
-double*
-TestUtils_random_f64s(double *buf, size_t count) {
-    double *f64s = buf ? buf : (double*)CALLOCATE(count, sizeof(double));
-    for (size_t i = 0; i < count; i++) {
-        uint64_t num = TestUtils_random_u64();
-        f64s[i] = U64_TO_DOUBLE(num) / UINT64_MAX;
-    }
-    return f64s;
-}
-
-static int32_t
-S_random_code_point(void) {
-    int32_t code_point = 0;
-    while (1) {
-        uint8_t chance = (rand() % 9) + 1;
-        switch (chance) {
-            case 1: case 2: case 3:
-                code_point = rand() % 0x80;
-                break;
-            case 4: case 5: case 6:
-                code_point = (rand() % (0x0800  - 0x0080)) + 0x0080;
-                break;
-            case 7: case 8:
-                code_point = (rand() % (0x10000 - 0x0800)) + 0x0800;
-                break;
-            case 9: {
-                    uint64_t num = TestUtils_random_u64();
-                    code_point = (num % (0x10FFFF - 0x10000)) + 0x10000;
-                }
-        }
-        if (code_point > 0x10FFFF) {
-            continue; // Too high.
-        }
-        if (code_point > 0xD7FF && code_point < 0xE000) {
-            continue; // UTF-16 surrogate.
-        }
-        break;
-    }
-    return code_point;
-}
-
-String*
-TestUtils_random_string(size_t length) {
-    CharBuf *buf = CB_new(length);
-    while (length--) {
-        CB_Cat_Char(buf, S_random_code_point());
-    }
-    String *string = CB_Yield_String(buf);
-    DECREF(buf);
-    return string;
-}
-
-String*
-TestUtils_get_str(const char *ptr) {
-    return Str_new_from_utf8(ptr, strlen(ptr));
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.cfh b/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.cfh
deleted file mode 100644
index 90a9e36..0000000
--- a/clownfish/runtime/core/Clownfish/TestHarness/TestUtils.cfh
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-inert class Clownfish::TestHarness::TestUtils  {
-
-    /** Testing-only String factory which uses strlen().
-     */
-    inert incremented String*
-    get_str(const char *utf8);
-
-    /** Return a random unsigned 64-bit integer.
-     */
-    inert uint64_t
-    random_u64();
-
-    /** Return an array of <code>count</code> random 64-bit integers where
-     * <code>min <= n < limit</code>.
-     *
-     * If <code>buf</code> is NULL, it will be allocated, otherwise it will
-     * be used.
-     */
-    inert int64_t*
-    random_i64s(int64_t *buf, size_t count, int64_t min, int64_t limit);
-
-    /** Return an array of <code>count</code> random unsigned, 64-bit integers
-     * where <code>min <= n < limit</code>.
-     *
-     * If <code>buf</code> is NULL, it will be allocated, otherwise it will
-     * be used.
-     */
-    inert uint64_t*
-    random_u64s(uint64_t *buf, size_t count, uint64_t min, uint64_t limit);
-
-    /** Return an array of <code>count</code> random double-precision floating
-     * point numbers between 0 and 1.
-     *
-     * If <code>buf</code> is NULL, it will be allocated, otherwise it will
-     * be used.
-     */
-    inert double*
-    random_f64s(double *buf, size_t count);
-
-    /** Return a string with a random (legal) sequence of code points.
-     * @param length Length of the string in code points.
-     */
-    inert incremented String*
-    random_string(size_t length);
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/Atomic.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/Atomic.c b/clownfish/runtime/core/Clownfish/Util/Atomic.c
deleted file mode 100644
index 730cd41..0000000
--- a/clownfish/runtime/core/Clownfish/Util/Atomic.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_ATOMIC
-#define CFISH_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include "Clownfish/Util/Atomic.h"
-
-/********************************** Windows ********************************/
-#ifdef CHY_HAS_WINDOWS_H
-#include <windows.h>
-
-bool
-cfish_Atomic_wrapped_cas_ptr(void *volatile *target, void *old_value,
-                            void *new_value) {
-    return InterlockedCompareExchangePointer(target, new_value, old_value)
-           == old_value;
-}
-
-/************************** Fall back to ptheads ***************************/
-#elif defined(CHY_HAS_PTHREAD_H)
-
-#include <pthread.h>
-pthread_mutex_t cfish_Atomic_mutex = PTHREAD_MUTEX_INITIALIZER;
-
-#endif
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/Atomic.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/Atomic.cfh b/clownfish/runtime/core/Clownfish/Util/Atomic.cfh
deleted file mode 100644
index 2d3bf64..0000000
--- a/clownfish/runtime/core/Clownfish/Util/Atomic.cfh
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-/** Provide atomic memory operations.
- */
-inert class Clownfish::Util::Atomic { }
-
-__C__
-
-/** Compare and swap a pointer.  Test whether the value at <code>target</code>
- * matches <code>old_value</code>.  If it does, set <code>target</code> to
- * <code>new_value</code> and return true.  Otherwise, return false.
- */
-static CFISH_INLINE bool
-cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value);
-
-/************************** Single threaded *******************************/
-#ifdef CFISH_NOTHREADS
-
-static CFISH_INLINE bool
-cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value) {
-    if (*target == old_value) {
-        *target = new_value;
-        return true;
-    }
-    else {
-        return false;
-    }
-}
-
-/************************** Mac OS X 10.4 and later ***********************/
-#elif defined(CFISH_HAS_OSATOMIC_CAS_PTR)
-#include <libkern/OSAtomic.h>
-
-static CFISH_INLINE bool
-cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value) {
-    return OSAtomicCompareAndSwapPtr(old_value, new_value, target);
-}
-
-/********************************** Windows *******************************/
-#elif defined(CFISH_HAS_WINDOWS_H)
-
-bool
-cfish_Atomic_wrapped_cas_ptr(void *volatile *target, void *old_value,
-                            void *new_value);
-
-static CFISH_INLINE bool
-cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value) {
-    return cfish_Atomic_wrapped_cas_ptr(target, old_value, new_value);
-}
-
-/**************************** Solaris 10 and later ************************/
-#elif defined(CFISH_HAS_SYS_ATOMIC_H)
-#include <sys/atomic.h>
-
-static CFISH_INLINE bool
-cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value) {
-    return atomic_cas_ptr(target, old_value, new_value) == old_value;
-}
-
-/************************ Fall back to pthread.h. **************************/
-#elif defined(CFISH_HAS_PTHREAD_H)
-#include <pthread.h>
-
-extern pthread_mutex_t cfish_Atomic_mutex;
-
-static CFISH_INLINE bool
-cfish_Atomic_cas_ptr(void *volatile *target, void *old_value, void *new_value) {
-    pthread_mutex_lock(&cfish_Atomic_mutex);
-    if (*target == old_value) {
-        *target = new_value;
-        pthread_mutex_unlock(&cfish_Atomic_mutex);
-        return true;
-    }
-    else {
-        pthread_mutex_unlock(&cfish_Atomic_mutex);
-        return false;
-    }
-}
-
-/******************** No support for atomics at all. ***********************/
-#else
-
-#error "No support for atomic operations."
-
-#endif // Big platform if-else chain.
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define Atomic_cas_ptr cfish_Atomic_cas_ptr
-#endif
-
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/Memory.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/Memory.c b/clownfish/runtime/core/Clownfish/Util/Memory.c
deleted file mode 100644
index dcf3214..0000000
--- a/clownfish/runtime/core/Clownfish/Util/Memory.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_MEMORY
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "charmony.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#include "Clownfish/Util/Memory.h"
-
-void*
-Memory_wrapped_malloc(size_t count) {
-    void *pointer = malloc(count);
-    if (pointer == NULL && count != 0) {
-        fprintf(stderr, "Can't malloc %" PRIu64 " bytes.\n", (uint64_t)count);
-        exit(1);
-    }
-    return pointer;
-}
-
-void*
-Memory_wrapped_calloc(size_t count, size_t size) {
-    void *pointer = calloc(count, size);
-    if (pointer == NULL && count != 0) {
-        fprintf(stderr, "Can't calloc %" PRIu64 " elements of size %" PRIu64 ".\n",
-                (uint64_t)count, (uint64_t)size);
-        exit(1);
-    }
-    return pointer;
-}
-
-void*
-Memory_wrapped_realloc(void *ptr, size_t size) {
-    void *pointer = realloc(ptr, size);
-    if (pointer == NULL && size != 0) {
-        fprintf(stderr, "Can't realloc %" PRIu64 " bytes.\n", (uint64_t)size);
-        exit(1);
-    }
-    return pointer;
-}
-
-void
-Memory_wrapped_free(void *ptr) {
-    free(ptr);
-}
-
-size_t
-Memory_oversize(size_t minimum, size_t width) {
-    // For larger arrays, grow by an excess of 1/8; grow faster when the array
-    // is small.
-    size_t extra = minimum / 8;
-    if (extra < 3) {
-        extra = 3;
-    }
-    size_t amount = minimum + extra;
-
-    // Detect wraparound and return SIZE_MAX instead.
-    if (amount + 7 < minimum) {
-        return SIZE_MAX;
-    }
-
-    // Round up for small widths so that the number of bytes requested will be
-    // a multiple of the machine's word size.
-    if (sizeof(size_t) == 8) { // 64-bit
-        switch (width) {
-            case 1:
-                amount = (amount + 7) & INT64_C(0xFFFFFFFFFFFFFFF8);
-                break;
-            case 2:
-                amount = (amount + 3) & INT64_C(0xFFFFFFFFFFFFFFFC);
-                break;
-            case 4:
-                amount = (amount + 1) & INT64_C(0xFFFFFFFFFFFFFFFE);
-                break;
-            default:
-                break;
-        }
-    }
-    else { // 32-bit
-        switch (width) {
-            case 1:
-                amount = (amount + 3) & ((size_t)0xFFFFFFFC);
-                break;
-            case 2:
-                amount = (amount + 1) & ((size_t)0xFFFFFFFE);
-                break;
-            default:
-                break;
-        }
-    }
-
-    return amount;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/Memory.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/Memory.cfh b/clownfish/runtime/core/Clownfish/Util/Memory.cfh
deleted file mode 100644
index 69ae85f..0000000
--- a/clownfish/runtime/core/Clownfish/Util/Memory.cfh
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-inert class Clownfish::Util::Memory {
-
-    /** Attempt to allocate memory with malloc, but print an error and exit if the
-     * call fails.
-     */
-    inert nullable void*
-    wrapped_malloc(size_t count);
-
-    /** Attempt to allocate memory with calloc, but print an error and exit if the
-     * call fails.
-     */
-    inert nullable void*
-    wrapped_calloc(size_t count, size_t size);
-
-    /** Attempt to allocate memory with realloc, but print an error and exit if
-     * the call fails.
-     */
-    inert nullable void*
-    wrapped_realloc(void *ptr, size_t size);
-
-    /** Free memory.  (Wrapping is necessary in cases where memory allocated
-     * within the Clownfish library has to be freed in an external environment
-     * where "free" may have been redefined.)
-     */
-    inert void
-    wrapped_free(void *ptr);
-
-    /** Provide a number which is somewhat larger than the supplied number, so
-     * that incremental array growth does not trigger pathological
-     * reallocation.
-     *
-     * @param minimum The minimum number of array elements.
-     * @param width The size of each array element in bytes.
-     */
-    inert size_t
-    oversize(size_t minimum, size_t width);
-}
-
-__C__
-
-#define CFISH_MALLOCATE    cfish_Memory_wrapped_malloc
-#define CFISH_CALLOCATE    cfish_Memory_wrapped_calloc
-#define CFISH_REALLOCATE   cfish_Memory_wrapped_realloc
-#define CFISH_FREEMEM      cfish_Memory_wrapped_free
-
-#ifdef CFISH_USE_SHORT_NAMES
-  #define MALLOCATE                       CFISH_MALLOCATE
-  #define CALLOCATE                       CFISH_CALLOCATE
-  #define REALLOCATE                      CFISH_REALLOCATE
-  #define FREEMEM                         CFISH_FREEMEM
-#endif
-
-__END_C__
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/runtime/core/Clownfish/Util/NumberUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Util/NumberUtils.c b/clownfish/runtime/core/Clownfish/Util/NumberUtils.c
deleted file mode 100644
index dd65059..0000000
--- a/clownfish/runtime/core/Clownfish/Util/NumberUtils.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define C_CFISH_NUMBERUTILS
-#define CFISH_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include <string.h>
-
-#include "Clownfish/Util/NumberUtils.h"
-
-const uint8_t NumUtil_u1masks[8] = {
-    0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80
-};
-
-const uint8_t NumUtil_u2shifts[4] = { 0x0, 0x2, 0x4,  0x6  };
-const uint8_t NumUtil_u2masks[4]  = { 0x3, 0xC, 0x30, 0xC0 };
-
-const uint8_t NumUtil_u4shifts[2] = { 0x00, 0x04 };
-const uint8_t NumUtil_u4masks[2]  = { 0x0F, 0xF0 };
-
-


[lucy-commits] [13/54] [abbrv] Remove bundled Clownfish.

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCParseHeader.y
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCParseHeader.y b/clownfish/compiler/src/CFCParseHeader.y
deleted file mode 100644
index 40530be..0000000
--- a/clownfish/compiler/src/CFCParseHeader.y
+++ /dev/null
@@ -1,648 +0,0 @@
-%name CFCParseHeader
-
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-%token_type {char*}
-%token_prefix CFC_TOKENTYPE_
-
-%extra_argument { CFCParser *state }
-
-%include {
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <stdlib.h>
-#include "CFC.h"
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-static CFCClass*
-S_start_class(CFCParser *state, CFCDocuComment *docucomment, char *exposure,
-              char *modifiers, char *class_name, char *class_cnick,
-              char *inheritance) {
-    CFCFileSpec *file_spec = CFCParser_get_file_spec(state);
-    int is_final = false;
-    int is_inert = false;
-    if (modifiers) {
-        /* TODO: Decide how to handle abstract classes. */
-        if (strstr(modifiers, "inline")) {
-            CFCUtil_die("Illegal class modifiers: '%s'", modifiers);
-        }
-        is_final = !!strstr(modifiers, "final");
-        is_inert = !!strstr(modifiers, "inert");
-    }
-    CFCParser_set_class_name(state, class_name);
-    CFCParser_set_class_cnick(state, class_cnick);
-    CFCClass *klass = CFCClass_create(CFCParser_get_parcel(state), exposure,
-                                      class_name, class_cnick, NULL,
-                                      docucomment, file_spec, inheritance,
-                                      is_final, is_inert);
-    CFCBase_decref((CFCBase*)docucomment);
-    return klass;
-}
-
-static CFCVariable*
-S_new_var(CFCParser *state, char *exposure, char *modifiers, CFCType *type,
-          char *name) {
-    int inert = false;
-    if (modifiers) {
-        if (strcmp(modifiers, "inert") != 0) {
-            CFCUtil_die("Illegal variable modifiers: '%s'", modifiers);
-        }
-        inert = true;
-    }
-
-    CFCParcel  *parcel      = NULL;
-    const char *class_name  = NULL;
-    const char *class_cnick = NULL;
-    if (exposure && strcmp(exposure, "local") != 0) {
-        parcel      = CFCParser_get_parcel(state);
-        class_name  = CFCParser_get_class_name(state);
-        class_cnick = CFCParser_get_class_cnick(state);
-    }
-    CFCVariable *var = CFCVariable_new(parcel, exposure, class_name,
-                                       class_cnick, name, type, inert);
-
-    /* Consume tokens. */
-    CFCBase_decref((CFCBase*)type);
-
-    return var;
-}
-
-static CFCBase*
-S_new_sub(CFCParser *state, CFCDocuComment *docucomment, 
-          char *exposure, char *modifiers, CFCType *type, char *name,
-          CFCParamList *param_list) {
-    CFCParcel  *parcel      = CFCParser_get_parcel(state);
-    const char *class_name  = CFCParser_get_class_name(state);
-    const char *class_cnick = CFCParser_get_class_cnick(state);
-
-    /* Find modifiers by scanning the list. */
-    int is_abstract = false;
-    int is_final    = false;
-    int is_inline   = false;
-    int is_inert    = false;
-    if (modifiers) {
-        is_abstract = !!strstr(modifiers, "abstract");
-        is_final    = !!strstr(modifiers, "final");
-        is_inline   = !!strstr(modifiers, "inline");
-        is_inert    = !!strstr(modifiers, "inert");
-    }
-
-    /* If "inert", it's a function, otherwise it's a method. */
-    CFCBase *sub;
-    if (is_inert) {
-        if (is_abstract) {
-            CFCUtil_die("Inert functions must not be abstract");
-        }
-        if (is_final) {
-            CFCUtil_die("Inert functions must not be final");
-        }
-        sub = (CFCBase*)CFCFunction_new(parcel, exposure, class_name,
-                                         class_cnick, name, type, param_list,
-                                         docucomment, is_inline);
-    }
-    else {
-        if (is_inline) {
-            CFCUtil_die("Methods must not be inline");
-        }
-        sub = (CFCBase*)CFCMethod_new(parcel, exposure, class_name,
-                                       class_cnick, name, type, param_list,
-                                       docucomment, is_final, is_abstract);
-    }
-
-    /* Consume tokens. */
-    CFCBase_decref((CFCBase*)docucomment);
-    CFCBase_decref((CFCBase*)type);
-    CFCBase_decref((CFCBase*)param_list);
-
-    return sub;
-}
-
-static CFCType*
-S_new_type(CFCParser *state, int flags, char *type_name,
-           char *asterisk_postfix, char *array_postfix) {
-    (void)state; /* unused */
-    CFCType *type = NULL;
-    size_t type_name_len = strlen(type_name);
-    int indirection = asterisk_postfix ? (int)strlen(asterisk_postfix) : 0;
-
-    /* Apply "nullable" to outermost pointer, but "const", etc to innermost
-     * type. This is an ugly kludge and the Clownfish header language needs to
-     * be fixed, either to support C's terrible pointer type syntax, or to do
-     * something better. */
-    int composite_flags = 0;
-    if (indirection) {
-        composite_flags = flags & CFCTYPE_NULLABLE;
-        flags &= ~CFCTYPE_NULLABLE;
-    }
-
-    if (!strcmp(type_name, "int8_t")
-        || !strcmp(type_name, "int16_t")
-        || !strcmp(type_name, "int32_t")
-        || !strcmp(type_name, "int64_t")
-        || !strcmp(type_name, "uint8_t")
-        || !strcmp(type_name, "uint16_t")
-        || !strcmp(type_name, "uint32_t")
-        || !strcmp(type_name, "uint64_t")
-        || !strcmp(type_name, "char")
-        || !strcmp(type_name, "short")
-        || !strcmp(type_name, "int")
-        || !strcmp(type_name, "long")
-        || !strcmp(type_name, "size_t")
-        || !strcmp(type_name, "bool")
-       ) {
-        type = CFCType_new_integer(flags, type_name);
-    }
-    else if (!strcmp(type_name, "float")
-             || !strcmp(type_name, "double")
-            ) {
-        type = CFCType_new_float(flags, type_name);
-    }
-    else if (!strcmp(type_name, "void")) {
-        type = CFCType_new_void(!!(flags & CFCTYPE_CONST));
-    }
-    else if (!strcmp(type_name, "va_list")) {
-        type = CFCType_new_va_list();
-    }
-    else if (type_name_len > 2
-             && !strcmp(type_name + type_name_len - 2, "_t")
-            ) {
-        type = CFCType_new_arbitrary(CFCParser_get_parcel(state), type_name);
-    }
-    else if (indirection > 0) {
-        /* The only remaining possibility is an object type, and we can let
-         * the constructor perform the complex validation of the type name. */
-        indirection--;
-        if (indirection == 0) {
-            flags |= composite_flags;
-            composite_flags = 0;
-        }
-        type = CFCType_new_object(flags, CFCParser_get_parcel(state), type_name, 1);
-    }
-    else {
-        CFCUtil_die("Invalid type specification at/near '%s'", type_name);
-    }
-
-    if (indirection) {
-        CFCType *composite = CFCType_new_composite(composite_flags, type,
-                                                   indirection, NULL);
-        CFCBase_decref((CFCBase*)type);
-        type = composite;
-    }
-    else if (array_postfix) {
-        CFCType *composite = CFCType_new_composite(composite_flags, type,
-                                                   0, array_postfix);
-        CFCBase_decref((CFCBase*)type);
-        type = composite;
-    }
-
-    return type;
-}
-
-} /* End include block. */
-
-%syntax_error {
-    (void)yymajor;
-    (void)yyminor;
-    CFCParser_set_errors(state, true);
-}
-
-%type result                            {CFCBase*}
-%type file                              {CFCFile*}
-%type major_block                       {CFCBase*}
-%type parcel_definition                 {CFCParcel*}
-%type class_declaration                 {CFCClass*}
-%type class_head                        {CFCClass*}
-%type class_defs                        {CFCClass*}
-%type var_declaration_statement         {CFCVariable*}
-%type subroutine_declaration_statement  {CFCBase*}
-%type type                              {CFCType*}
-%type param_variable                    {CFCVariable*}
-%type param_list                        {CFCParamList*}
-%type param_list_elems                  {CFCParamList*}
-%type docucomment                       {CFCDocuComment*}
-%type cblock                            {CFCCBlock*}
-%type type_qualifier                    {int}
-%type type_qualifier_list               {int}
-
-%destructor result                            { CFCBase_decref((CFCBase*)$$); }
-%destructor file                              { CFCBase_decref((CFCBase*)$$); }
-%destructor major_block                       { CFCBase_decref((CFCBase*)$$); }
-%destructor parcel_definition                 { CFCBase_decref((CFCBase*)$$); }
-%destructor class_declaration                 { CFCBase_decref((CFCBase*)$$); }
-%destructor class_head                        { CFCBase_decref((CFCBase*)$$); }
-%destructor class_defs                        { CFCBase_decref((CFCBase*)$$); }
-%destructor var_declaration_statement         { CFCBase_decref((CFCBase*)$$); }
-%destructor subroutine_declaration_statement  { CFCBase_decref((CFCBase*)$$); }
-%destructor type                              { CFCBase_decref((CFCBase*)$$); }
-%destructor param_variable                    { CFCBase_decref((CFCBase*)$$); }
-%destructor param_list                        { CFCBase_decref((CFCBase*)$$); }
-%destructor param_list_elems                  { CFCBase_decref((CFCBase*)$$); }
-%destructor docucomment                       { CFCBase_decref((CFCBase*)$$); }
-%destructor cblock                            { CFCBase_decref((CFCBase*)$$); }
-
-result ::= type(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= param_list(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= param_variable(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= docucomment(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= parcel_definition(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= cblock(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= var_declaration_statement(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= subroutine_declaration_statement(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= class_declaration(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-result ::= file(A).
-{
-    CFCParser_set_result(state, (CFCBase*)A);
-    CFCBase_decref((CFCBase*)A);
-}
-
-file(A) ::= FILE_START. /* Pseudo token, not passed by lexer. */
-{
-    A = CFCFile_new(CFCParser_get_file_spec(state));
-}
-file(A) ::= file(B) major_block(C).
-{
-    A = B;
-    CFCFile_add_block(A, C);
-    CFCBase_decref((CFCBase*)C);
-}
-
-major_block(A) ::= class_declaration(B). { A = (CFCBase*)B; }
-major_block(A) ::= cblock(B).            { A = (CFCBase*)B; }
-major_block(A) ::= parcel_definition(B). { A = (CFCBase*)B; }
-
-parcel_definition(A) ::= PARCEL qualified_id(B) SEMICOLON.
-{
-    A = CFCParcel_fetch(B);
-    if (!A) {
-        CFCFileSpec *file_spec = CFCParser_get_file_spec(state);
-        int is_included = false;
-        if (file_spec) {
-            is_included = CFCFileSpec_included(file_spec);
-        }
-        A = CFCParcel_new(B, NULL, NULL, is_included);
-        CFCParcel_register(A);
-        CFCBase_decref((CFCBase*)A);
-    }
-    CFCBase_incref((CFCBase*)A);
-    CFCParser_set_parcel(state, A);
-}
-
-class_declaration(A) ::= class_defs(B) RIGHT_CURLY_BRACE.
-{
-    A = B;
-    CFCParser_set_class_name(state, NULL);
-    CFCParser_set_class_cnick(state, NULL);
-}
-
-class_head(A) ::= docucomment(B) exposure_specifier(C) declaration_modifier_list(D) CLASS qualified_id(E) cnick(F) class_inheritance(G).  { A = S_start_class(state, B,    C,    D,    E,    F,    G   ); }
-class_head(A) ::=                exposure_specifier(C) declaration_modifier_list(D) CLASS qualified_id(E) cnick(F) class_inheritance(G).  { A = S_start_class(state, NULL, C,    D,    E,    F,    G   ); }
-class_head(A) ::= docucomment(B)                       declaration_modifier_list(D) CLASS qualified_id(E) cnick(F) class_inheritance(G).  { A = S_start_class(state, B,    NULL, D,    E,    F,    G   ); }
-class_head(A) ::=                                      declaration_modifier_list(D) CLASS qualified_id(E) cnick(F) class_inheritance(G).  { A = S_start_class(state, NULL, NULL, D,    E,    F,    G   ); }
-class_head(A) ::= docucomment(B) exposure_specifier(C)                              CLASS qualified_id(E) cnick(F) class_inheritance(G).  { A = S_start_class(state, B,    C,    NULL, E,    F,    G   ); }
-class_head(A) ::=                exposure_specifier(C)                              CLASS qualified_id(E) cnick(F) class_inheritance(G).  { A = S_start_class(state, NULL, C,    NULL, E,    F,    G   ); }
-class_head(A) ::= docucomment(B)                                                    CLASS qualified_id(E) cnick(F) class_inheritance(G).  { A = S_start_class(state, B,    NULL, NULL, E,    F,    G   ); }
-class_head(A) ::=                                                                   CLASS qualified_id(E) cnick(F) class_inheritance(G).  { A = S_start_class(state, NULL, NULL, NULL, E,    F,    G   ); }
-class_head(A) ::= docucomment(B) exposure_specifier(C) declaration_modifier_list(D) CLASS qualified_id(E)          class_inheritance(G).  { A = S_start_class(state, B,    C,    D,    E,    NULL, G   ); }
-class_head(A) ::=                exposure_specifier(C) declaration_modifier_list(D) CLASS qualified_id(E)          class_inheritance(G).  { A = S_start_class(state, NULL, C,    D,    E,    NULL, G   ); }
-class_head(A) ::= docucomment(B)                       declaration_modifier_list(D) CLASS qualified_id(E)          class_inheritance(G).  { A = S_start_class(state, B,    NULL, D,    E,    NULL, G   ); }
-class_head(A) ::=                                      declaration_modifier_list(D) CLASS qualified_id(E)          class_inheritance(G).  { A = S_start_class(state, NULL, NULL, D,    E,    NULL, G   ); }
-class_head(A) ::= docucomment(B) exposure_specifier(C)                              CLASS qualified_id(E)          class_inheritance(G).  { A = S_start_class(state, B,    C,    NULL, E,    NULL, G   ); }
-class_head(A) ::=                exposure_specifier(C)                              CLASS qualified_id(E)          class_inheritance(G).  { A = S_start_class(state, NULL, C,    NULL, E,    NULL, G   ); }
-class_head(A) ::= docucomment(B)                                                    CLASS qualified_id(E)          class_inheritance(G).  { A = S_start_class(state, B,    NULL, NULL, E,    NULL, G   ); }
-class_head(A) ::=                                                                   CLASS qualified_id(E)          class_inheritance(G).  { A = S_start_class(state, NULL, NULL, NULL, E,    NULL, G   ); }
-class_head(A) ::= docucomment(B) exposure_specifier(C) declaration_modifier_list(D) CLASS qualified_id(E) cnick(F)                     .  { A = S_start_class(state, B,    C,    D,    E,    F,    NULL ); }
-class_head(A) ::=                exposure_specifier(C) declaration_modifier_list(D) CLASS qualified_id(E) cnick(F)                     .  { A = S_start_class(state, NULL, C,    D,    E,    F,    NULL ); }
-class_head(A) ::= docucomment(B)                       declaration_modifier_list(D) CLASS qualified_id(E) cnick(F)                     .  { A = S_start_class(state, B,    NULL, D,    E,    F,    NULL ); }
-class_head(A) ::=                                      declaration_modifier_list(D) CLASS qualified_id(E) cnick(F)                     .  { A = S_start_class(state, NULL, NULL, D,    E,    F,    NULL ); }
-class_head(A) ::= docucomment(B) exposure_specifier(C)                              CLASS qualified_id(E) cnick(F)                     .  { A = S_start_class(state, B,    C,    NULL, E,    F,    NULL ); }
-class_head(A) ::=                exposure_specifier(C)                              CLASS qualified_id(E) cnick(F)                     .  { A = S_start_class(state, NULL, C,    NULL, E,    F,    NULL ); }
-class_head(A) ::= docucomment(B)                                                    CLASS qualified_id(E) cnick(F)                     .  { A = S_start_class(state, B,    NULL, NULL, E,    F,    NULL ); }
-class_head(A) ::=                                                                   CLASS qualified_id(E) cnick(F)                     .  { A = S_start_class(state, NULL, NULL, NULL, E,    F,    NULL ); }
-class_head(A) ::= docucomment(B) exposure_specifier(C) declaration_modifier_list(D) CLASS qualified_id(E)                              .  { A = S_start_class(state, B,    C,    D,    E,    NULL, NULL ); }
-class_head(A) ::=                exposure_specifier(C) declaration_modifier_list(D) CLASS qualified_id(E)                              .  { A = S_start_class(state, NULL, C,    D,    E,    NULL, NULL ); }
-class_head(A) ::= docucomment(B)                       declaration_modifier_list(D) CLASS qualified_id(E)                              .  { A = S_start_class(state, B,    NULL, D,    E,    NULL, NULL ); }
-class_head(A) ::=                                      declaration_modifier_list(D) CLASS qualified_id(E)                              .  { A = S_start_class(state, NULL, NULL, D,    E,    NULL, NULL ); }
-class_head(A) ::= docucomment(B) exposure_specifier(C)                              CLASS qualified_id(E)                              .  { A = S_start_class(state, B,    C,    NULL, E,    NULL, NULL ); }
-class_head(A) ::=                exposure_specifier(C)                              CLASS qualified_id(E)                              .  { A = S_start_class(state, NULL, C,    NULL, E,    NULL, NULL ); }
-class_head(A) ::= docucomment(B)                                                    CLASS qualified_id(E)                              .  { A = S_start_class(state, B,    NULL, NULL, E,    NULL, NULL ); }
-class_head(A) ::=                                                                   CLASS qualified_id(E)                              .  { A = S_start_class(state, NULL, NULL, NULL, E,    NULL, NULL ); }
-
-class_defs(A) ::= class_head(B) LEFT_CURLY_BRACE.
-{
-    A = B;
-}
-class_defs(A) ::= class_defs(B) var_declaration_statement(C).
-{
-    A = B;
-    if (CFCVariable_inert(C)) {
-        CFCClass_add_inert_var(A, C);
-    }
-    else {
-        CFCClass_add_member_var(A, C);
-    }
-    CFCBase_decref((CFCBase*)C);
-}
-class_defs(A) ::= class_defs(B) subroutine_declaration_statement(C).
-{
-    A = B;
-    if (strcmp(CFCBase_get_cfc_class(C), "Clownfish::CFC::Model::Function") == 0) {
-        CFCClass_add_function(A, (CFCFunction*)C);
-    }
-    else {
-        CFCClass_add_method(A, (CFCMethod*)C);
-    }
-    CFCBase_decref((CFCBase*)C);
-}
-
-var_declaration_statement(A) ::= 
-    type(D) declarator(E) SEMICOLON.
-{
-    A = S_new_var(state, CFCParser_dupe(state, "private"), NULL, D, E);
-}
-var_declaration_statement(A) ::= 
-    declaration_modifier_list(C)
-    type(D) declarator(E) SEMICOLON.
-{
-    A = S_new_var(state, CFCParser_dupe(state, "parcel"), C, D, E);
-}
-var_declaration_statement(A) ::= 
-    exposure_specifier(B)
-    declaration_modifier_list(C)
-    type(D) declarator(E) SEMICOLON.
-{
-    A = S_new_var(state, B, C, D, E);
-}
-
-subroutine_declaration_statement(A) ::= 
-    type(E) declarator(F) param_list(G) SEMICOLON.
-{
-    A = S_new_sub(state, NULL, NULL, NULL, E, F, G);
-}
-subroutine_declaration_statement(A) ::= 
-    declaration_modifier_list(D)
-    type(E) declarator(F) param_list(G) SEMICOLON.
-{
-    A = S_new_sub(state, NULL, NULL, D, E, F, G);
-}
-subroutine_declaration_statement(A) ::= 
-    exposure_specifier(C)
-    declaration_modifier_list(D)
-    type(E) declarator(F) param_list(G) SEMICOLON.
-{
-    A = S_new_sub(state, NULL, C, D, E, F, G);
-}
-subroutine_declaration_statement(A) ::= 
-    exposure_specifier(C)
-    type(E) declarator(F) param_list(G) SEMICOLON.
-{
-    A = S_new_sub(state, NULL, C, NULL, E, F, G);
-}
-subroutine_declaration_statement(A) ::= 
-    docucomment(B)
-    type(E) declarator(F) param_list(G) SEMICOLON.
-{
-    A = S_new_sub(state, B, NULL, NULL, E, F, G);
-}
-subroutine_declaration_statement(A) ::= 
-    docucomment(B)
-    declaration_modifier_list(D)
-    type(E) declarator(F) param_list(G) SEMICOLON.
-{
-    A = S_new_sub(state, B, NULL, D, E, F, G);
-}
-subroutine_declaration_statement(A) ::= 
-    docucomment(B)
-    exposure_specifier(C)
-    declaration_modifier_list(D)
-    type(E) declarator(F) param_list(G) SEMICOLON.
-{
-    A = S_new_sub(state, B, C, D, E, F, G);
-}
-subroutine_declaration_statement(A) ::= 
-    docucomment(B)
-    exposure_specifier(C)
-    type(E) declarator(F) param_list(G) SEMICOLON.
-{
-    A = S_new_sub(state, B, C, NULL, E, F, G);
-}
-
-type(A) ::= type_name(C).
-{
-    A = S_new_type(state, 0, C, NULL, NULL);
-}
-type(A) ::= type_name(C) asterisk_postfix(D).
-{
-    A = S_new_type(state, 0, C, D, NULL);
-}
-type(A) ::= type_name(C) array_postfix(E).
-{
-    A = S_new_type(state, 0, C, NULL, E);
-}
-type(A) ::= type_qualifier_list(B) type_name(C).
-{
-    A = S_new_type(state, B, C, NULL, NULL);
-}
-type(A) ::= type_qualifier_list(B) type_name(C) asterisk_postfix(D).
-{
-    A = S_new_type(state, B, C, D, NULL);
-}
-type(A) ::= type_qualifier_list(B) type_name(C) array_postfix(E).
-{
-    A = S_new_type(state, B, C, NULL, E);
-}
-
-type_name(A) ::= VOID(B).               { A = B; }
-type_name(A) ::= VA_LIST(B).            { A = B; }
-type_name(A) ::= INTEGER_TYPE_NAME(B).  { A = B; }
-type_name(A) ::= FLOAT_TYPE_NAME(B).    { A = B; }
-type_name(A) ::= IDENTIFIER(B).         { A = B; }
-
-exposure_specifier(A) ::= PUBLIC(B).  { A = B; }
-
-type_qualifier(A) ::= CONST.       { A = CFCTYPE_CONST; }
-type_qualifier(A) ::= NULLABLE.    { A = CFCTYPE_NULLABLE; }
-type_qualifier(A) ::= INCREMENTED. { A = CFCTYPE_INCREMENTED; }
-type_qualifier(A) ::= DECREMENTED. { A = CFCTYPE_DECREMENTED; }
-
-type_qualifier_list(A) ::= type_qualifier(B).
-{
-    A = B;
-}
-type_qualifier_list(A) ::= type_qualifier_list(B) type_qualifier(C).
-{
-    A = B;
-    A |= C;
-}
-
-declaration_modifier(A) ::= INERT(B).      { A = B; }
-declaration_modifier(A) ::= INLINE(B).     { A = B; }
-declaration_modifier(A) ::= ABSTRACT(B).   { A = B; }
-declaration_modifier(A) ::= FINAL(B).      { A = B; }
-
-declaration_modifier_list(A) ::= declaration_modifier(B). { A = B; }
-declaration_modifier_list(A) ::= declaration_modifier_list(B) declaration_modifier(C).
-{
-    size_t size = strlen(B) + strlen(C) + 2;
-    A = (char*)CFCParser_allocate(state, size);
-    sprintf(A, "%s %s", B, C);
-}
-
-asterisk_postfix(A) ::= ASTERISK(B). { A = B; }
-asterisk_postfix(A) ::= asterisk_postfix(B) ASTERISK.
-{
-    size_t size = strlen(B) + 2;
-    A = (char*)CFCParser_allocate(state, size);
-    sprintf(A, "%s*", B);
-}
-
-array_postfix_elem(A) ::= LEFT_SQUARE_BRACKET RIGHT_SQUARE_BRACKET.
-{
-    A = CFCParser_dupe(state, "[]");
-}
-array_postfix_elem(A) ::= LEFT_SQUARE_BRACKET INTEGER_LITERAL(B) RIGHT_SQUARE_BRACKET.
-{
-    size_t size = strlen(B) + 3;
-    A = (char*)CFCParser_allocate(state, size);
-    sprintf(A, "[%s]", B);
-}
-
-array_postfix(A) ::= array_postfix_elem(B). { A = B; }
-array_postfix(A) ::= array_postfix(B) array_postfix_elem(C).
-{
-    size_t size = strlen(B) + strlen(C) + 1;
-    A = (char*)CFCParser_allocate(state, size);
-    sprintf(A, "%s%s", B, C);
-}
-
-scalar_constant(A) ::= HEX_LITERAL(B).     { A = B; }
-scalar_constant(A) ::= FLOAT_LITERAL(B).   { A = B; }
-scalar_constant(A) ::= INTEGER_LITERAL(B). { A = B; }
-scalar_constant(A) ::= STRING_LITERAL(B).  { A = B; }
-scalar_constant(A) ::= TRUE(B).            { A = B; }
-scalar_constant(A) ::= FALSE(B).           { A = B; }
-scalar_constant(A) ::= NULL(B).            { A = B; }
-
-declarator(A) ::= IDENTIFIER(B).
-{
-    A = B;
-}
-
-param_variable(A) ::= type(B) declarator(C).
-{
-    A = S_new_var(state, NULL, NULL, B, C);
-}
-
-param_list(A) ::= LEFT_PAREN RIGHT_PAREN.
-{
-    A = CFCParamList_new(false);
-}
-param_list(A) ::= LEFT_PAREN param_list_elems(B) RIGHT_PAREN.
-{
-    A = B;
-}
-param_list(A) ::= LEFT_PAREN param_list_elems(B) COMMA ELLIPSIS RIGHT_PAREN.
-{
-    A = B;
-    CFCParamList_set_variadic(A, true);
-}
-param_list_elems(A) ::= param_list_elems(B) COMMA param_variable(C).
-{
-    A = B;
-    CFCParamList_add_param(A, C, NULL);
-    CFCBase_decref((CFCBase*)C);
-}
-param_list_elems(A) ::= param_list_elems(B) COMMA param_variable(C) EQUALS scalar_constant(D).
-{
-    A = B;
-    CFCParamList_add_param(A, C, D);
-    CFCBase_decref((CFCBase*)C);
-}
-param_list_elems(A) ::= param_variable(B).
-{
-    A = CFCParamList_new(false);
-    CFCParamList_add_param(A, B, NULL);
-    CFCBase_decref((CFCBase*)B);
-}
-param_list_elems(A) ::= param_variable(B) EQUALS scalar_constant(C).
-{
-    A = CFCParamList_new(false);
-    CFCParamList_add_param(A, B, C);
-    CFCBase_decref((CFCBase*)B);
-}
-
-qualified_id(A) ::= IDENTIFIER(B). { A = B; }
-qualified_id(A) ::= qualified_id(B) SCOPE_OP IDENTIFIER(C).
-{
-    size_t size = strlen(B) + strlen(C) + 3;
-    A = (char*)CFCParser_allocate(state, size);
-    sprintf(A, "%s::%s", B, C);
-}
-
-docucomment(A)       ::= DOCUCOMMENT(B).                     { A = CFCDocuComment_parse(B); }
-class_inheritance(A) ::= INHERITS qualified_id(B).           { A = B; }
-cnick(A)             ::= CNICK IDENTIFIER(B).                { A = B; }
-cblock(A)            ::= CBLOCK_START blob(B) CBLOCK_CLOSE.  { A = CFCCBlock_new(B); }
-cblock(A)            ::= CBLOCK_START CBLOCK_CLOSE.          { A = CFCCBlock_new(""); }
-
-blob(A) ::= BLOB(B). { A = B; }
-blob(A) ::= blob(B) BLOB(C).
-{
-    size_t size = strlen(B) + strlen(C) + 1;
-    A = (char*)CFCParser_allocate(state, size);
-    sprintf(A, "%s%s", B, C);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCParser.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCParser.c b/clownfish/compiler/src/CFCParser.c
deleted file mode 100644
index 0a16d65..0000000
--- a/clownfish/compiler/src/CFCParser.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCParser.h"
-#include "CFCParcel.h"
-#include "CFCFile.h"
-#include "CFCFileSpec.h"
-#include "CFCUtil.h"
-#include "CFCMemPool.h"
-#include "CFCLexHeader.h"
-#include "CFCParseHeader.h"
-
-#ifndef true
-  #define true 1
-  #define false 0
-#endif
-
-struct CFCParser {
-    CFCBase base;
-    void *header_parser;
-    struct CFCBase *result;
-    int errors;
-    char *class_name;
-    char *class_cnick;
-    CFCFileSpec *file_spec;
-    CFCMemPool *pool;
-    CFCParcel  *parcel;
-};
-
-static const CFCMeta CFCPARSER_META = {
-    "Clownfish::CFC::Parser",
-    sizeof(CFCParser),
-    (CFCBase_destroy_t)CFCParser_destroy
-};
-
-CFCParser*
-CFCParser_new(void) {
-    CFCParser *self = (CFCParser*)CFCBase_allocate(&CFCPARSER_META);
-    return CFCParser_init(self);
-}
-
-CFCParser*
-CFCParser_init(CFCParser *self) {
-    self->header_parser = CFCParseHeaderAlloc(malloc);
-    if (self->header_parser == NULL) {
-        CFCUtil_die("Failed to allocate header parser");
-    }
-    self->result       = NULL;
-    self->errors       = false;
-    self->class_name   = NULL;
-    self->class_cnick  = NULL;
-    self->file_spec    = NULL;
-    self->pool         = NULL;
-    self->parcel       = NULL;
-    return self;
-}
-
-void
-CFCParser_destroy(CFCParser *self) {
-    CFCParseHeaderFree(self->header_parser, free);
-    FREEMEM(self->class_name);
-    FREEMEM(self->class_cnick);
-    CFCBase_decref((CFCBase*)self->file_spec);
-    CFCBase_decref((CFCBase*)self->pool);
-    CFCBase_decref(self->result);
-    CFCBase_decref((CFCBase*)self->parcel);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-CFCParser *CFCParser_current_state  = NULL;
-void      *CFCParser_current_parser = NULL;
-
-CFCBase*
-CFCParser_parse(CFCParser *self, const char *string) {
-    self->pool = CFCMemPool_new(0);
-
-    // Make Lemon-based parser and parser state available from Flex-based scanner.
-    CFCParser_current_state  = self;
-    CFCParser_current_parser = self->header_parser;
-
-    // Zero out, then parse.
-    self->errors = false;
-    YY_BUFFER_STATE buffer = yy_scan_bytes(string, (int)strlen(string));
-    yylex();
-    yy_delete_buffer(buffer);
-
-    // Finish up.
-    CFCParseHeader(CFCParser_current_parser, 0, NULL, self);
-    CFCBase_decref((CFCBase*)self->pool);
-    self->pool = NULL;
-    CFCBase *result = self->result;
-    self->result = NULL;
-    if (self->errors) {
-        CFCBase_decref((CFCBase*)result);
-        result = NULL;
-    }
-    return result;
-}
-
-CFCFile*
-CFCParser_parse_file(CFCParser *self, const char *string,
-                     CFCFileSpec *file_spec) {
-    CFCParser_set_parcel(self, NULL);
-    CFCParser_set_file_spec(self, file_spec);
-    CFCParseHeader(self->header_parser, CFC_TOKENTYPE_FILE_START, NULL, self);
-    CFCFile *result = (CFCFile*)CFCParser_parse(self, string);
-    CFCParser_set_file_spec(self, NULL);
-    return result;
-}
-
-char*
-CFCParser_dupe(CFCParser *self, const char *string) {
-    size_t len = strlen(string);
-    char *dupe = (char*)CFCMemPool_allocate(self->pool, len + 1);
-    memcpy(dupe, string, len + 1);
-    return dupe;
-}
-
-void*
-CFCParser_allocate(CFCParser *self, size_t size) {
-    return CFCMemPool_allocate(self->pool, size);
-}
-
-void
-CFCParser_set_result(CFCParser *self, CFCBase *result) {
-    CFCBase_decref(self->result);
-    self->result = CFCBase_incref(result);
-}
-
-void
-CFCParser_set_errors(CFCParser *self, int errors) {
-    self->errors = errors;
-}
-
-void
-CFCParser_set_parcel(CFCParser *self, CFCParcel *parcel) {
-    CFCBase_incref((CFCBase*)parcel);
-    CFCBase_decref((CFCBase*)self->parcel);
-    self->parcel = parcel;
-}
-
-CFCParcel*
-CFCParser_get_parcel(CFCParser *self) {
-    return self->parcel;
-}
-
-void
-CFCParser_set_class_name(CFCParser *self, const char *class_name) {
-    FREEMEM(self->class_name);
-    if (class_name) {
-        self->class_name = CFCUtil_strdup(class_name);
-    }
-    else {
-        self->class_name = NULL;
-    }
-}
-
-const char*
-CFCParser_get_class_name(CFCParser *self) {
-    return self->class_name;
-}
-
-void
-CFCParser_set_class_cnick(CFCParser *self, const char *class_cnick) {
-    FREEMEM(self->class_cnick);
-    if (class_cnick) {
-        self->class_cnick = CFCUtil_strdup(class_cnick);
-    }
-    else {
-        self->class_cnick = NULL;
-    }
-}
-
-const char*
-CFCParser_get_class_cnick(CFCParser *self) {
-    return self->class_cnick;
-}
-
-void
-CFCParser_set_file_spec(CFCParser *self, CFCFileSpec *file_spec) {
-    CFCBase_decref((CFCBase*)self->file_spec);
-    self->file_spec = (CFCFileSpec*)CFCBase_incref((CFCBase*)file_spec);
-}
-
-CFCFileSpec*
-CFCParser_get_file_spec(CFCParser *self) {
-    return self->file_spec;
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCParser.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCParser.h b/clownfish/compiler/src/CFCParser.h
deleted file mode 100644
index 19300cf..0000000
--- a/clownfish/compiler/src/CFCParser.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/** Clownfish::CFC::Parser - Parse Clownfish header files.
- *
- * Clownfish::CFC::Parser is a combined lexer/parser which parses Clownfish header
- * files.  It is not at all strict, as it relies heavily on the C parser to
- * pick up errors such as misspelled type names.
- */
-
-#ifndef H_CFCPARSER
-#define H_CFCPARSER
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCParser CFCParser;
-struct CFCBase;
-struct CFCParcel;
-struct CFCFile;
-struct CFCFileSpec;
-
-extern CFCParser *CFCParser_current_state;
-extern void      *CFCParser_current_parser;
-
-CFCParser*
-CFCParser_new(void);
-
-CFCParser*
-CFCParser_init(CFCParser *self);
-
-void
-CFCParser_destroy(CFCParser *self);
-
-struct CFCBase*
-CFCParser_parse(CFCParser *self, const char *string);
-
-struct CFCFile*
-CFCParser_parse_file(CFCParser *self, const char *string,
-                     struct CFCFileSpec *file_spec);
-
-char*
-CFCParser_dupe(CFCParser *self, const char *string);
-
-void*
-CFCParser_allocate(CFCParser *self, size_t size);
-
-void
-CFCParser_set_result(CFCParser *self, struct CFCBase *result);
-
-void
-CFCParser_set_errors(CFCParser *self, int errors);
-
-void
-CFCParser_set_text(CFCParser *self, const char *text, size_t len);
-
-const char*
-CFCParser_get_text(CFCParser *self);
-
-void
-CFCParser_set_parcel(CFCParser *self, struct CFCParcel *parcel);
-
-struct CFCParcel*
-CFCParser_get_parcel(CFCParser *self);
-
-void
-CFCParser_set_class_name(CFCParser *self, const char *class_name);
-
-const char*
-CFCParser_get_class_name(CFCParser *self);
-
-void
-CFCParser_set_class_cnick(CFCParser *self, const char *class_cnick);
-
-const char*
-CFCParser_get_class_cnick(CFCParser *self);
-
-void
-CFCParser_set_file_spec(CFCParser *self, struct CFCFileSpec *file_spec);
-
-struct CFCFileSpec*
-CFCParser_get_file_spec(CFCParser *self);
-
-/* Routines generated by Lemon. */
-void*
-CFCParseHeaderAlloc(void * (*allocate)(size_t));
-
-void
-CFCParseHeader(void *header_parser, int token_type, char *value,
-               CFCParser *state);
-
-void
-CFCParseHeaderFree(void *header_parser, void(*freemem)(void*));
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPARSER */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerl.c b/clownfish/compiler/src/CFCPerl.c
deleted file mode 100644
index 3f51df2..0000000
--- a/clownfish/compiler/src/CFCPerl.c
+++ /dev/null
@@ -1,600 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "charmony.h"
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCPerl.h"
-#include "CFCParcel.h"
-#include "CFCClass.h"
-#include "CFCMethod.h"
-#include "CFCHierarchy.h"
-#include "CFCUtil.h"
-#include "CFCPerlClass.h"
-#include "CFCPerlSub.h"
-#include "CFCPerlConstructor.h"
-#include "CFCPerlMethod.h"
-#include "CFCPerlTypeMap.h"
-#include "CFCBindCore.h"
-
-struct CFCPerl {
-    CFCBase base;
-    CFCHierarchy *hierarchy;
-    char *lib_dir;
-    char *boot_class;
-    char *header;
-    char *footer;
-    char *xs_path;
-    char *boot_func;
-};
-
-// Modify a string in place, swapping out "::" for the supplied character.
-static void
-S_replace_double_colons(char *text, char replacement);
-
-static void
-S_write_callbacks_c(CFCPerl *self);
-
-static const CFCMeta CFCPERL_META = {
-    "Clownfish::CFC::Binding::Perl",
-    sizeof(CFCPerl),
-    (CFCBase_destroy_t)CFCPerl_destroy
-};
-
-CFCPerl*
-CFCPerl_new(CFCHierarchy *hierarchy, const char *lib_dir,
-            const char *boot_class, const char *header, const char *footer) {
-    CFCPerl *self = (CFCPerl*)CFCBase_allocate(&CFCPERL_META);
-    return CFCPerl_init(self, hierarchy, lib_dir, boot_class, header, footer);
-}
-
-CFCPerl*
-CFCPerl_init(CFCPerl *self, CFCHierarchy *hierarchy, const char *lib_dir,
-             const char *boot_class, const char *header, const char *footer) {
-    CFCUTIL_NULL_CHECK(hierarchy);
-    CFCUTIL_NULL_CHECK(lib_dir);
-    CFCUTIL_NULL_CHECK(boot_class);
-    CFCUTIL_NULL_CHECK(header);
-    CFCUTIL_NULL_CHECK(footer);
-    self->hierarchy  = (CFCHierarchy*)CFCBase_incref((CFCBase*)hierarchy);
-    self->lib_dir    = CFCUtil_strdup(lib_dir);
-    self->boot_class = CFCUtil_strdup(boot_class);
-    self->header     = CFCUtil_strdup(header);
-    self->footer     = CFCUtil_strdup(footer);
-
-    // Derive path to generated .xs file.
-    self->xs_path = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s.xs", lib_dir,
-                                    boot_class);
-    S_replace_double_colons(self->xs_path, CHY_DIR_SEP_CHAR);
-
-    // Derive the name of the bootstrap function.
-    self->boot_func = CFCUtil_sprintf("cfish_%s_bootstrap", boot_class);
-    for (int i = 0; self->boot_func[i] != 0; i++) {
-        if (!isalnum(self->boot_func[i])) {
-            self->boot_func[i] = '_';
-        }
-    }
-
-    return self;
-}
-
-void
-CFCPerl_destroy(CFCPerl *self) {
-    CFCBase_decref((CFCBase*)self->hierarchy);
-    FREEMEM(self->lib_dir);
-    FREEMEM(self->boot_class);
-    FREEMEM(self->header);
-    FREEMEM(self->footer);
-    FREEMEM(self->xs_path);
-    FREEMEM(self->boot_func);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-static void
-S_replace_double_colons(char *text, char replacement) {
-    size_t pos = 0;
-    for (char *ptr = text; *ptr != '\0'; ptr++) {
-        if (strncmp(ptr, "::", 2) == 0) {
-            text[pos++] = replacement;
-            ptr++;
-        }
-        else {
-            text[pos++] = *ptr;
-        }
-    }
-    text[pos] = '\0';
-}
-
-char**
-CFCPerl_write_pod(CFCPerl *self) {
-    CFCPerlClass **registry  = CFCPerlClass_registry();
-    size_t num_registered = 0;
-    while (registry[num_registered] != NULL) { num_registered++; }
-    char     **pod_paths = (char**)CALLOCATE(num_registered + 1, sizeof(char*));
-    char     **pods      = (char**)CALLOCATE(num_registered + 1, sizeof(char*));
-    size_t     count     = 0;
-
-    // Generate POD, but don't write.  That way, if there's an error while
-    // generating pod, we leak memory but don't clutter up the file system.
-    for (size_t i = 0; i < num_registered; i++) {
-        const char *class_name = CFCPerlClass_get_class_name(registry[i]);
-        char *pod = CFCPerlClass_create_pod(registry[i]);
-        if (!pod) { continue; }
-        char *pod_path = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s.pod",
-                                         self->lib_dir, class_name);
-        S_replace_double_colons(pod_path, CHY_DIR_SEP_CHAR);
-
-        pods[count] = pod;
-        pod_paths[count] = pod_path;
-        count++;
-    }
-
-    // Write out any POD files that have changed.
-    size_t num_written = 0;
-    for (size_t i = 0; i < count; i++) {
-        char *pod      = pods[i];
-        char *pod_path = pod_paths[i];
-        if (CFCUtil_write_if_changed(pod_path, pod, strlen(pod))) {
-            pod_paths[num_written] = pod_path;
-            num_written++;
-        }
-        else {
-            FREEMEM(pod_path);
-        }
-        FREEMEM(pod);
-    }
-    pod_paths[num_written] = NULL;
-
-    return pod_paths;
-}
-
-static void
-S_write_boot_h(CFCPerl *self) {
-    char *guard = CFCUtil_sprintf("%s_BOOT", self->boot_class);
-    S_replace_double_colons(guard, '_');
-    for (char *ptr = guard; *ptr != '\0'; ptr++) {
-        if (isalpha(*ptr)) {
-            *ptr = toupper(*ptr);
-        }
-    }
-
-    const char pattern[] = 
-        "%s\n"
-        "\n"
-        "#ifndef %s\n"
-        "#define %s 1\n"
-        "\n"
-        "void\n"
-        "%s();\n"
-        "\n"
-        "#endif /* %s */\n"
-        "\n"
-        "%s\n";
-    char *content
-        = CFCUtil_sprintf(pattern, self->header, guard, guard, self->boot_func,
-                          guard, self->footer);
-
-    const char *inc_dest = CFCHierarchy_get_include_dest(self->hierarchy);
-    char *boot_h_path = CFCUtil_sprintf("%s" CHY_DIR_SEP "boot.h", inc_dest);
-    CFCUtil_write_file(boot_h_path, content, strlen(content));
-    FREEMEM(boot_h_path);
-
-    FREEMEM(content);
-    FREEMEM(guard);
-}
-
-static void
-S_write_boot_c(CFCPerl *self) {
-    CFCClass  **ordered   = CFCHierarchy_ordered_classes(self->hierarchy);
-    CFCParcel **parcels   = CFCParcel_all_parcels();
-    char *pound_includes  = CFCUtil_strdup("");
-    char *bootstrap_code  = CFCUtil_strdup("");
-    char *alias_adds      = CFCUtil_strdup("");
-    char *isa_pushes      = CFCUtil_strdup("");
-
-    for (size_t i = 0; parcels[i]; ++i) {
-        if (!CFCParcel_included(parcels[i])) {
-            const char *prefix = CFCParcel_get_prefix(parcels[i]);
-            bootstrap_code = CFCUtil_cat(bootstrap_code, "    ", prefix,
-                                         "bootstrap_parcel();\n", NULL);
-        }
-    }
-
-    for (size_t i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        if (CFCClass_included(klass)) { continue; }
-
-        const char *class_name = CFCClass_get_class_name(klass);
-        const char *include_h  = CFCClass_include_h(klass);
-        pound_includes = CFCUtil_cat(pound_includes, "#include \"",
-                                     include_h, "\"\n", NULL);
-
-        if (CFCClass_inert(klass)) { continue; }
-
-        // Add aliases for selected KinoSearch classes which allow old indexes
-        // to be read.
-        CFCPerlClass *class_binding = CFCPerlClass_singleton(class_name);
-        if (class_binding) {
-            const char *vtable_var = CFCClass_full_vtable_var(klass);
-            const char **aliases
-                = CFCPerlClass_get_class_aliases(class_binding);
-            for (size_t j = 0; aliases[j] != NULL; j++) {
-                const char *alias = aliases[j];
-                size_t alias_len  = strlen(alias);
-                const char pattern[] =
-                    "    cfish_VTable_add_alias_to_registry("
-                    "%s, \"%s\", %u);\n";
-                char *alias_add
-                    = CFCUtil_sprintf(pattern, vtable_var, alias,
-                                      (unsigned)alias_len);
-                alias_adds = CFCUtil_cat(alias_adds, alias_add, NULL);
-                FREEMEM(alias_add);
-            }
-
-            char *metadata_code
-                = CFCPerlClass_method_metadata_code(class_binding);
-            alias_adds = CFCUtil_cat(alias_adds, metadata_code, NULL);
-            FREEMEM(metadata_code);
-        }
-
-        CFCClass *parent = CFCClass_get_parent(klass);
-        if (parent) {
-            const char *parent_class_name = CFCClass_get_class_name(parent);
-            isa_pushes
-                = CFCUtil_cat(isa_pushes, "    isa = get_av(\"",
-                              class_name, "::ISA\", 1);\n", NULL);
-            isa_pushes
-                = CFCUtil_cat(isa_pushes, "    av_push(isa, newSVpv(\"", 
-                              parent_class_name, "\", 0));\n", NULL);
-        }
-    }
-
-    const char pattern[] =
-        "%s\n"
-        "\n"
-        "#include \"cfish_parcel.h\"\n"
-        "#include \"EXTERN.h\"\n"
-        "#include \"perl.h\"\n"
-        "#include \"XSUB.h\"\n"
-        "#include \"boot.h\"\n"
-        "#include \"Clownfish/String.h\"\n"
-        "#include \"Clownfish/VTable.h\"\n"
-        "%s\n"
-        "\n"
-        "void\n"
-        "%s() {\n"
-        "%s"
-        "\n"
-        "%s"
-        "\n"
-        "    AV *isa;\n"
-        "%s"
-        "}\n"
-        "\n"
-        "%s\n"
-        "\n";
-    char *content
-        = CFCUtil_sprintf(pattern, self->header, pound_includes,
-                          self->boot_func, bootstrap_code, alias_adds,
-                          isa_pushes, self->footer);
-
-    const char *src_dest = CFCHierarchy_get_source_dest(self->hierarchy);
-    char *boot_c_path = CFCUtil_sprintf("%s" CHY_DIR_SEP "boot.c", src_dest);
-    CFCUtil_write_file(boot_c_path, content, strlen(content));
-    FREEMEM(boot_c_path);
-
-    FREEMEM(content);
-    FREEMEM(isa_pushes);
-    FREEMEM(alias_adds);
-    FREEMEM(bootstrap_code);
-    FREEMEM(pound_includes);
-    FREEMEM(parcels);
-    FREEMEM(ordered);
-}
-
-void
-CFCPerl_write_hostdefs(CFCPerl *self) {
-    const char pattern[] =
-        "%s\n"
-        "\n"
-        "#ifndef H_CFISH_HOSTDEFS\n"
-        "#define H_CFISH_HOSTDEFS 1\n"
-        "\n"
-        "/* Refcount / host object */\n"
-        "typedef union {\n"
-        "    size_t  count;\n"
-        "    void   *host_obj;\n"
-        "} cfish_ref_t;\n"
-        "\n"
-        "#define CFISH_OBJ_HEAD\\\n"
-        "   cfish_ref_t ref;\n"
-        "\n"
-        "#endif /* H_CFISH_HOSTDEFS */\n"
-        "\n"
-        "%s\n";
-    char *content
-        = CFCUtil_sprintf(pattern, self->header, self->footer);
-
-    // Unlink then write file.
-    const char *inc_dest = CFCHierarchy_get_include_dest(self->hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "cfish_hostdefs.h",
-                                     inc_dest);
-    remove(filepath);
-    CFCUtil_write_file(filepath, content, strlen(content));
-    FREEMEM(filepath);
-
-    FREEMEM(content);
-}
-
-void
-CFCPerl_write_boot(CFCPerl *self) {
-    S_write_boot_h(self);
-    S_write_boot_c(self);
-}
-
-static char*
-S_xs_file_contents(CFCPerl *self, const char *generated_xs,
-                   const char *xs_init, const char *hand_rolled_xs) {
-    const char pattern[] =
-        "%s"
-        "\n"
-        "#include \"XSBind.h\"\n"
-        "#include \"boot.h\"\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "MODULE = %s   PACKAGE = %s\n"
-        "\n"
-        "void\n"
-        "_init_autobindings()\n"
-        "PPCODE:\n"
-        "{\n"
-        "    const char* file = __FILE__;\n"
-        "    CFISH_UNUSED_VAR(cv);\n"
-        "    CFISH_UNUSED_VAR(items); %s\n"
-        "}\n"
-        "\n"
-        "%s\n"
-        "\n"
-        "%s";
-    char *contents
-        = CFCUtil_sprintf(pattern, self->header, generated_xs,
-                          self->boot_class, self->boot_class, xs_init,
-                          hand_rolled_xs, self->footer);
-
-    return contents;
-}
-
-static char*
-S_add_xs_init(char *xs_init, CFCPerlSub *xsub) {
-    const char *c_name = CFCPerlSub_c_name(xsub);
-    const char *perl_name = CFCPerlSub_perl_name(xsub);
-    if (strlen(xs_init)) {
-        xs_init = CFCUtil_cat(xs_init, "\n    ", NULL);
-    }
-    xs_init = CFCUtil_cat(xs_init, "newXS(\"", perl_name, "\", ", c_name,
-                          ", file);", NULL);
-    return xs_init;
-}
-
-void
-CFCPerl_write_bindings(CFCPerl *self) {
-    CFCClass **ordered = CFCHierarchy_ordered_classes(self->hierarchy);
-    CFCPerlClass **registry = CFCPerlClass_registry();
-    char *hand_rolled_xs   = CFCUtil_strdup("");
-    char *generated_xs     = CFCUtil_strdup("");
-    char *xs_init          = CFCUtil_strdup("");
-
-    // Pound-includes for generated headers.
-    for (size_t i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        // TODO: Don't include headers for parcels the source parcels don't
-        // depend on.
-        const char *include_h = CFCClass_include_h(klass);
-        generated_xs = CFCUtil_cat(generated_xs, "#include \"", include_h,
-                                   "\"\n", NULL);
-    }
-    generated_xs = CFCUtil_cat(generated_xs, "\n", NULL);
-
-    for (size_t i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        if (CFCClass_included(klass)) { continue; }
-
-        // Constructors.
-        CFCPerlConstructor **constructors
-            = CFCPerlClass_constructor_bindings(klass);
-        for (size_t j = 0; constructors[j] != NULL; j++) {
-            CFCPerlSub *xsub = (CFCPerlSub*)constructors[j];
-
-            // Add the XSUB function definition.
-            char *xsub_def = CFCPerlConstructor_xsub_def(constructors[j]);
-            generated_xs = CFCUtil_cat(generated_xs, xsub_def, "\n",
-                                       NULL);
-            FREEMEM(xsub_def);
-
-            // Add XSUB initialization at boot.
-            xs_init = S_add_xs_init(xs_init, xsub);
-        }
-        FREEMEM(constructors);
-
-        // Methods.
-        CFCPerlMethod **methods = CFCPerlClass_method_bindings(klass);
-        for (size_t j = 0; methods[j] != NULL; j++) {
-            CFCPerlSub *xsub = (CFCPerlSub*)methods[j];
-
-            // Add the XSUB function definition.
-            char *xsub_def = CFCPerlMethod_xsub_def(methods[j]);
-            generated_xs = CFCUtil_cat(generated_xs, xsub_def, "\n",
-                                       NULL);
-            FREEMEM(xsub_def);
-
-            // Add XSUB initialization at boot.
-            xs_init = S_add_xs_init(xs_init, xsub);
-        }
-        FREEMEM(methods);
-    }
-
-    // Hand-rolled XS.
-    for (size_t i = 0; registry[i] != NULL; i++) {
-        const char *xs = CFCPerlClass_get_xs_code(registry[i]);
-        hand_rolled_xs = CFCUtil_cat(hand_rolled_xs, xs, "\n", NULL);
-    }
-
-    // Write out if there have been any changes.
-    char *xs_file_contents
-        = S_xs_file_contents(self, generated_xs, xs_init, hand_rolled_xs);
-    CFCUtil_write_if_changed(self->xs_path, xs_file_contents,
-                             strlen(xs_file_contents));
-
-    FREEMEM(xs_file_contents);
-    FREEMEM(hand_rolled_xs);
-    FREEMEM(xs_init);
-    FREEMEM(generated_xs);
-    FREEMEM(ordered);
-}
-
-void
-CFCPerl_write_callbacks(CFCPerl *self) {
-    CFCBindCore *core_binding
-        = CFCBindCore_new(self->hierarchy, self->header, self->footer);
-    CFCBindCore_write_callbacks_h(core_binding);
-    CFCBase_decref((CFCBase*)core_binding);
-
-    S_write_callbacks_c(self);
-}
-
-static void
-S_write_callbacks_c(CFCPerl *self) {
-    CFCClass **ordered = CFCHierarchy_ordered_classes(self->hierarchy);
-    static const char pattern[] =
-        "%s"
-        "\n"
-        "#include \"XSBind.h\"\n"
-        "#include \"callbacks.h\"\n"
-        "\n"
-        "static void\n"
-        "S_finish_callback_void(const char *meth_name) {\n"
-        "    int count = call_method(meth_name, G_VOID | G_DISCARD);\n"
-        "    if (count != 0) {\n"
-        "        CFISH_THROW(CFISH_ERR, \"Bad callback to '%%s': %%i32\",\n"
-        "                    meth_name, (int32_t)count);\n"
-        "    }\n"
-        "    FREETMPS;\n"
-        "    LEAVE;\n"
-        "}\n"
-        "\n"
-        "static CFISH_INLINE SV*\n"
-        "SI_do_callback_sv(const char *meth_name) {\n"
-        "    int count = call_method(meth_name, G_SCALAR);\n"
-        "    if (count != 1) {\n"
-        "        CFISH_THROW(CFISH_ERR, \"Bad callback to '%%s': %%i32\",\n"
-        "                    meth_name, (int32_t)count);\n"
-        "    }\n"
-        "    dSP;\n"
-        "    SV *return_sv = POPs;\n"
-        "    PUTBACK;\n"
-        "    return return_sv;\n"
-        "}\n"
-        "\n"
-        "static int64_t\n"
-        "S_finish_callback_i64(const char *meth_name) {\n"
-        "    SV *return_sv = SI_do_callback_sv(meth_name);\n"
-        "    int64_t retval;\n"
-        "    if (sizeof(IV) == 8) {\n"
-        "        retval = (int64_t)SvIV(return_sv);\n"
-        "    }\n"
-        "    else {\n"
-        "        if (SvIOK(return_sv)) {\n"
-        "            // It's already no more than 32 bits, so don't convert.\n"
-        "            retval = SvIV(return_sv);\n"
-        "        }\n"
-        "        else {\n"
-        "            // Maybe lossy.\n"
-        "            double temp = SvNV(return_sv);\n"
-        "            retval = (int64_t)temp;\n"
-        "        }\n"
-        "    }\n"
-        "    FREETMPS;\n"
-        "    LEAVE;\n"
-        "    return retval;\n"
-        "}\n"
-        "\n"
-        "static double\n"
-        "S_finish_callback_f64(const char *meth_name) {\n"
-        "    SV *return_sv = SI_do_callback_sv(meth_name);\n"
-        "    double retval = SvNV(return_sv);\n"
-        "    FREETMPS;\n"
-        "    LEAVE;\n"
-        "    return retval;\n"
-        "}\n"
-        "\n"
-        "static cfish_Obj*\n"
-        "S_finish_callback_obj(void *vself, const char *meth_name,\n"
-        "                      int nullable) {\n"
-        "    SV *return_sv = SI_do_callback_sv(meth_name);\n"
-        "    cfish_Obj *retval = XSBind_perl_to_cfish(return_sv);\n"
-        "    FREETMPS;\n"
-        "    LEAVE;\n"
-        "    if (!nullable && !retval) {\n"
-        "        CFISH_THROW(CFISH_ERR, \"%%o#%%s cannot return NULL\",\n"
-        "                    CFISH_Obj_Get_Class_Name((cfish_Obj*)vself),\n"
-        "                    meth_name);\n"
-        "    }\n"
-        "    return retval;\n"
-        "}\n"
-        "\n";
-    char *content = CFCUtil_sprintf(pattern, self->header);
-
-    for (size_t i = 0; ordered[i] != NULL; i++) {
-        CFCClass *klass = ordered[i];
-        if (CFCClass_included(klass) || CFCClass_inert(klass)) { continue; }
-
-        CFCMethod **fresh_methods = CFCClass_fresh_methods(klass);
-        for (int meth_num = 0; fresh_methods[meth_num] != NULL; meth_num++) {
-            CFCMethod *method = fresh_methods[meth_num];
-
-            // Define callback.
-            if (CFCMethod_novel(method) && !CFCMethod_final(method)) {
-                char *cb_def = CFCPerlMethod_callback_def(method);
-                content = CFCUtil_cat(content, cb_def, "\n", NULL);
-                FREEMEM(cb_def);
-            }
-        }
-        FREEMEM(fresh_methods);
-    }
-
-    content = CFCUtil_cat(content, self->footer, NULL);
-
-    // Write if changed.
-    const char *src_dest = CFCHierarchy_get_source_dest(self->hierarchy);
-    char *filepath = CFCUtil_sprintf("%s" CHY_DIR_SEP "callbacks.c",
-                                     src_dest);
-    CFCUtil_write_if_changed(filepath, content, strlen(content));
-
-    FREEMEM(filepath);
-    FREEMEM(content);
-    FREEMEM(ordered);
-}
-
-void
-CFCPerl_write_xs_typemap(CFCPerl *self) {
-    CFCPerlTypeMap_write_xs_typemap(self->hierarchy);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerl.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerl.h b/clownfish/compiler/src/CFCPerl.h
deleted file mode 100644
index eef10ac..0000000
--- a/clownfish/compiler/src/CFCPerl.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCPERL
-#define H_CFCPERL
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCPerl CFCPerl;
-struct CFCParcel;
-struct CFCHierarchy;
-
-/** Clownfish::CFC::Binding::Perl - Perl bindings for a
- * Clownfish::CFC::Model::Hierarchy.
- * 
- * Clownfish::CFC::Binding::Perl presents an interface for auto-generating XS
- * and Perl code to bind C code for a Clownfish class hierarchy to Perl.
- * 
- * In theory this module could be much more flexible and its API could be more
- * elegant.  There are many ways which you could walk the parsed parcels,
- * classes, methods, etc. in a Clownfish::CFC::Model::Hierarchy and generate
- * binding code.  However, our needs are very limited, so we are content with
- * a "one size fits one" solution.
- * 
- * In particular, this module assumes that the XS bindings for all classes in
- * the hierarchy should be assembled into a single shared object which belongs
- * to the primary, "boot" class.  There's no reason why it could not write one
- * .xs file per class, or one per parcel, instead.
- * 
- * The files written by this class are derived from the name of the boot class.
- * If it is "Crustacean", the following files will be generated.
- * 
- *     # Generated by write_bindings()
- *     $lib_dir/Crustacean.xs
- * 
- *     # Generated by write_boot()
- *     $hierarchy_dest_dir/crust_boot.h
- *     $hierarchy_dest_dir/crust_boot.c
- */
-
-/** 
- * @param parcel The L<Clownfish::CFC::Model::Parcel> to which the
- * C<boot_class> belongs.
- * @param hierarchy A Clownfish::CFC::Model::Hierarchy.
- * @param lib_dir location of the Perl lib directory to which files will be
- * written.
- * @param boot_class The name of the main class, which will own the shared
- * object.
- * @param header Text which will be prepended to generated C/XS files --
- * typically, an "autogenerated file" warning.
- * @param footer Text to be appended to the end of generated C/XS files --
- * typically copyright information.
- */
-CFCPerl*
-CFCPerl_new(struct CFCHierarchy *hierarchy, const char *lib_dir,
-            const char *boot_class, const char *header, const char *footer);
-
-CFCPerl*
-CFCPerl_init(CFCPerl *self, struct CFCHierarchy *hierarchy,
-             const char *lib_dir, const char *boot_class, const char *header,
-             const char *footer);
-
-void
-CFCPerl_destroy(CFCPerl *self);
-
-/** Auto-generate POD for all class bindings where pod specs were created.
- * See whether a .pod file exists and is up-to-date; if not, write it out.
- * 
- * @return an array of filepaths where POD was written out.
- */
-char**
-CFCPerl_write_pod(CFCPerl *self);
-
-/** Write out "boot" files to the Hierarchy's "dest_dir" which contain code
- * for bootstrapping Clownfish classes.
- */
-void
-CFCPerl_write_boot(CFCPerl *self);
-
-/** Generate the XS bindings for all classes in the hierarchy.
- */
-void
-CFCPerl_write_bindings(CFCPerl *self);
-
-/** Generate routines which call back from C into Perl for all methods.
- */
-void
-CFCPerl_write_callbacks(CFCPerl *self);
-
-/** Generate hostdefs file.
- */
-void
-CFCPerl_write_hostdefs(CFCPerl *self);
-
-/** Generate the "typemap" file needed by the XS compiler.
- */
-void
-CFCPerl_write_xs_typemap(CFCPerl *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPERL */
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlClass.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.c b/clownfish/compiler/src/CFCPerlClass.c
deleted file mode 100644
index ca44a3b..0000000
--- a/clownfish/compiler/src/CFCPerlClass.c
+++ /dev/null
@@ -1,582 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <stdio.h>
-#define CFC_NEED_BASE_STRUCT_DEF
-#include "CFCBase.h"
-#include "CFCPerlClass.h"
-#include "CFCUtil.h"
-#include "CFCClass.h"
-#include "CFCMethod.h"
-#include "CFCParcel.h"
-#include "CFCParamList.h"
-#include "CFCFunction.h"
-#include "CFCDocuComment.h"
-#include "CFCSymbol.h"
-#include "CFCVariable.h"
-#include "CFCType.h"
-#include "CFCPerlPod.h"
-#include "CFCPerlMethod.h"
-#include "CFCPerlConstructor.h"
-#include "CFCPerlTypeMap.h"
-
-struct CFCPerlClass {
-    CFCBase base;
-    CFCParcel *parcel;
-    char *class_name;
-    CFCClass *client;
-    char *xs_code;
-    CFCPerlPod *pod_spec;
-    char **cons_aliases;
-    char **cons_inits;
-    size_t num_cons;
-    int    exclude_cons;
-    char **class_aliases;
-    size_t num_class_aliases;
-};
-
-static CFCPerlClass **registry = NULL;
-static size_t registry_size = 0;
-static size_t registry_cap  = 0;
-
-static const CFCMeta CFCPERLCLASS_META = {
-    "Clownfish::CFC::Binding::Perl::Class",
-    sizeof(CFCPerlClass),
-    (CFCBase_destroy_t)CFCPerlClass_destroy
-};
-
-CFCPerlClass*
-CFCPerlClass_new(CFCParcel *parcel, const char *class_name) {
-    CFCPerlClass *self = (CFCPerlClass*)CFCBase_allocate(&CFCPERLCLASS_META);
-    return CFCPerlClass_init(self, parcel, class_name);
-}
-
-CFCPerlClass*
-CFCPerlClass_init(CFCPerlClass *self, CFCParcel *parcel,
-                  const char *class_name) {
-    CFCUTIL_NULL_CHECK(parcel);
-    CFCUTIL_NULL_CHECK(class_name);
-    self->parcel = (CFCParcel*)CFCBase_incref((CFCBase*)parcel);
-    self->class_name = CFCUtil_strdup(class_name);
-    // Client may be NULL, since fetch_singleton() does not always succeed.
-    self->client = CFCClass_fetch_singleton(parcel, class_name); 
-    self->pod_spec          = NULL;
-    self->xs_code           = NULL;
-    self->cons_aliases      = NULL;
-    self->cons_inits        = NULL;
-    self->num_cons          = 0;
-    self->exclude_cons      = 0;
-    self->class_aliases     = (char**)CALLOCATE(1, sizeof(char*));
-    self->num_class_aliases = 0;
-    return self;
-}
-
-void
-CFCPerlClass_destroy(CFCPerlClass *self) {
-    CFCBase_decref((CFCBase*)self->parcel);
-    CFCBase_decref((CFCBase*)self->client);
-    CFCBase_decref((CFCBase*)self->pod_spec);
-    FREEMEM(self->class_name);
-    FREEMEM(self->xs_code);
-    for (size_t i = 0; i < self->num_cons; i++) {
-        FREEMEM(self->cons_aliases[i]);
-        FREEMEM(self->cons_inits[i]);
-    }
-    FREEMEM(self->cons_aliases);
-    FREEMEM(self->cons_inits);
-    for (size_t i = 0; i < self->num_class_aliases; i++) {
-        FREEMEM(self->class_aliases[i]);
-    }
-    FREEMEM(self->class_aliases);
-    CFCBase_destroy((CFCBase*)self);
-}
-
-static int
-S_compare_cfcperlclass(const void *va, const void *vb) {
-    CFCPerlClass *a = *(CFCPerlClass**)va;
-    CFCPerlClass *b = *(CFCPerlClass**)vb;
-    return strcmp(a->class_name, b->class_name);
-}
-
-void
-CFCPerlClass_add_to_registry(CFCPerlClass *self) {
-    if (registry_size == registry_cap) {
-        size_t new_cap = registry_cap + 10;
-        registry = (CFCPerlClass**)REALLOCATE(registry,
-                                              (new_cap + 1) * sizeof(CFCPerlClass*));
-        for (size_t i = registry_cap; i <= new_cap; i++) {
-            registry[i] = NULL;
-        }
-        registry_cap = new_cap;
-    }
-    CFCPerlClass *existing = CFCPerlClass_singleton(self->class_name);
-    if (existing) {
-        CFCUtil_die("Class '%s' already registered", self->class_name);
-    }
-    registry[registry_size] = (CFCPerlClass*)CFCBase_incref((CFCBase*)self);
-    registry_size++;
-    qsort(registry, registry_size, sizeof(CFCPerlClass*),
-          S_compare_cfcperlclass);
-}
-
-CFCPerlClass*
-CFCPerlClass_singleton(const char *class_name) {
-    CFCUTIL_NULL_CHECK(class_name);
-    for (size_t i = 0; i < registry_size; i++) {
-        CFCPerlClass *existing = registry[i];
-        if (strcmp(class_name, existing->class_name) == 0) {
-            return existing;
-        }
-    }
-    return NULL;
-}
-
-CFCPerlClass**
-CFCPerlClass_registry() {
-    return registry;
-}
-
-void
-CFCPerlClass_clear_registry(void) {
-    for (size_t i = 0; i < registry_size; i++) {
-        CFCBase_decref((CFCBase*)registry[i]);
-    }
-    FREEMEM(registry);
-    registry_size = 0;
-    registry_cap  = 0;
-    registry      = NULL;
-}
-
-void
-CFCPerlClass_bind_method(CFCPerlClass *self, const char *alias,
-                         const char *meth_name) {
-    if (!self->client) {
-        CFCUtil_die("Can't bind_method %s -- can't find client for %s",
-                    alias, self->class_name);
-    }
-    CFCMethod *method = CFCClass_method(self->client, meth_name);
-    if (!method) {
-        CFCUtil_die("Can't bind_method %s -- can't find method %s in %s",
-                    alias, meth_name, self->class_name);
-    }
-    if (strcmp(CFCMethod_get_class_name(method), self->class_name) != 0) {
-        CFCUtil_die("Can't bind_method %s -- method %s not fresh in %s",
-                    alias, meth_name, self->class_name);
-    }
-    CFCMethod_set_host_alias(method, alias);
-}
-
-void
-CFCPerlClass_exclude_method(CFCPerlClass *self, const char *meth_name) {
-    if (!self->client) {
-        CFCUtil_die("Can't exclude_method %s -- can't find client for %s",
-                    meth_name, self->class_name);
-    }
-    CFCMethod *method = CFCClass_method(self->client, meth_name);
-    if (!method) {
-        CFCUtil_die("Can't exclude_method %s -- method not found in %s",
-                    meth_name, self->class_name);
-    }
-    if (strcmp(CFCMethod_get_class_name(method), self->class_name) != 0) {
-        CFCUtil_die("Can't exclude_method %s -- method not fresh in %s",
-                    meth_name, self->class_name);
-    }
-    CFCMethod_exclude_from_host(method);
-}
-
-void
-CFCPerlClass_bind_constructor(CFCPerlClass *self, const char *alias,
-                              const char *initializer) {
-    alias       = alias       ? alias       : "new";
-    initializer = initializer ? initializer : "init";
-    size_t size = (self->num_cons + 1) * sizeof(char*);
-    self->cons_aliases = (char**)REALLOCATE(self->cons_aliases, size);
-    self->cons_inits   = (char**)REALLOCATE(self->cons_inits,   size);
-    self->cons_aliases[self->num_cons] = (char*)CFCUtil_strdup(alias);
-    self->cons_inits[self->num_cons]   = (char*)CFCUtil_strdup(initializer);
-    self->num_cons++;
-    if (!self->client) {
-        CFCUtil_die("Can't bind_constructor %s -- can't find client for %s",
-                    alias, self->class_name);
-    }
-}
-
-void
-CFCPerlClass_exclude_constructor(CFCPerlClass *self) {
-    self->exclude_cons = 1;
-}
-
-static int
-S_can_be_bound(CFCParamList *param_list, CFCType *return_type) {
-    int success = 1;
-    CFCVariable **arg_vars = CFCParamList_get_variables(param_list);
-
-    for (size_t i = 0; arg_vars[i] != NULL; i++) {
-        CFCType *type = CFCVariable_get_type(arg_vars[i]);
-        char *conversion = CFCPerlTypeMap_from_perl(type, "foo");
-        if (conversion) { FREEMEM(conversion); }
-        else            { success = 0; }
-    }
-    if (!CFCType_is_void(return_type)) {
-        char *conversion = CFCPerlTypeMap_to_perl(return_type, "foo");
-        if (conversion) { FREEMEM(conversion); }
-        else            { success = 0; }
-    }
-
-    return success;
-}
-
-CFCPerlMethod**
-CFCPerlClass_method_bindings(CFCClass *klass) {
-    CFCClass       *parent        = CFCClass_get_parent(klass);
-    size_t          num_bound     = 0;
-    CFCMethod     **fresh_methods = CFCClass_fresh_methods(klass);
-    CFCPerlMethod **bound 
-        = (CFCPerlMethod**)CALLOCATE(1, sizeof(CFCPerlMethod*));
-
-     // Iterate over the class's fresh methods.
-    for (size_t i = 0; fresh_methods[i] != NULL; i++) {
-        CFCMethod *method = fresh_methods[i];
-
-        // Skip private methods.
-        if (CFCSymbol_private((CFCSymbol*)method)) { continue; }
-
-        CFCMethod *novel_method;
-        if (CFCMethod_novel(method)) {
-            novel_method = method;
-        }
-        else {
-            const char *meth_name = CFCMethod_get_macro_sym(method);
-            novel_method = CFCClass_find_novel_method(parent, meth_name);
-            if (!novel_method) {
-                CFCUtil_die("Novel method not found");
-            }
-        }
-
-        // Skip methods which have been explicitly excluded.
-        if (CFCMethod_excluded_from_host(novel_method)) {
-            continue;
-        }
-
-        // Skip methods with types which cannot be mapped automatically.
-        CFCParamList *param_list  = CFCMethod_get_param_list(method);
-        CFCType      *return_type = CFCMethod_get_return_type(method);
-        if (!S_can_be_bound(param_list, return_type)) {
-            continue;
-        }
-
-        // See if the user wants the method to have a specific alias.
-        const char *alias = CFCMethod_get_host_alias(novel_method);
-        if (!alias) {
-            alias = CFCMethod_micro_sym(method);
-        }
-
-        /* Create the binding, add it to the array.
-         *
-         * Also create an XSub binding for each override.  Each of these
-         * directly calls the implementing function, rather than invokes the
-         * method on the object using VTable method dispatch.  Doing things
-         * this way allows SUPER:: invocations from Perl-space to work
-         * properly.
-         */
-        CFCPerlMethod *meth_binding = CFCPerlMethod_new(method, alias);
-        size_t size = (num_bound + 2) * sizeof(CFCPerlMethod*);
-        bound = (CFCPerlMethod**)REALLOCATE(bound, size);
-        bound[num_bound] = meth_binding;
-        num_bound++;
-        bound[num_bound] = NULL;
-    }
-
-    FREEMEM(fresh_methods);
-
-    return bound;
-}
-
-static const char NEW[] = "new";
-
-CFCPerlConstructor**
-CFCPerlClass_constructor_bindings(CFCClass *klass) {
-    const char    *class_name = CFCClass_get_class_name(klass);
-    CFCPerlClass  *perl_class = CFCPerlClass_singleton(class_name);
-    CFCFunction  **functions  = CFCClass_functions(klass);
-    size_t         num_bound  = 0;
-    CFCPerlConstructor **bound 
-        = (CFCPerlConstructor**)CALLOCATE(1, sizeof(CFCPerlConstructor*));
-
-    // Iterate over the list of possible initialization functions.
-    for (size_t i = 0; functions[i] != NULL; i++) {
-        CFCFunction  *function    = functions[i];
-        const char   *micro_sym   = CFCFunction_micro_sym(function);
-        CFCParamList *param_list  = CFCFunction_get_param_list(function);
-        CFCType      *return_type = CFCFunction_get_return_type(function);
-        const char   *alias       = NULL;
-
-        // Find user-specified alias.
-        if (perl_class == NULL) {
-            // Bind init() to new() when possible.
-            if (strcmp(micro_sym, "init") == 0
-                && S_can_be_bound(param_list, return_type)
-               ) {
-                alias = NEW;
-            }
-        }
-        else {
-            for (size_t j = 0; j < perl_class->num_cons; j++) {
-                if (strcmp(micro_sym, perl_class->cons_inits[j]) == 0) {
-                    alias = perl_class->cons_aliases[j];
-                    if (!S_can_be_bound(param_list, return_type)) {
-                        CFCUtil_die("Can't bind %s as %s"
-                                    " -- types can't be mapped",
-                                    micro_sym, alias);
-                    }
-                    break;
-                }
-            }
-
-            // Automatically bind init() to new() when possible.
-            if (!alias
-                && !perl_class->exclude_cons
-                && strcmp(micro_sym, "init") == 0
-                && S_can_be_bound(param_list, return_type)
-               ) {
-                int saw_new = 0;
-                for (size_t j = 0; j < perl_class->num_cons; j++) {
-                    if (strcmp(perl_class->cons_aliases[j], "new") == 0) {
-                        saw_new = 1;
-                    }
-                }
-                if (!saw_new) {
-                    alias = NEW;
-                }
-            }
-        }
-
-        if (!alias) {
-            continue;
-        }
-
-        // Create the binding, add it to the array.
-        CFCPerlConstructor *cons_binding
-            = CFCPerlConstructor_new(klass, alias, micro_sym);
-        size_t size = (num_bound + 2) * sizeof(CFCPerlConstructor*);
-        bound = (CFCPerlConstructor**)REALLOCATE(bound, size);
-        bound[num_bound] = cons_binding;
-        num_bound++;
-        bound[num_bound] = NULL;
-    }
-
-    return bound;
-}
-
-char*
-CFCPerlClass_create_pod(CFCPerlClass *self) {
-    CFCPerlPod *pod_spec   = self->pod_spec;
-    const char *class_name = self->class_name;
-    CFCClass   *client     = self->client;
-    if (!pod_spec) {
-        return NULL;
-    }
-    if (!client) {
-        CFCUtil_die("No client for %s", class_name);
-    }
-    CFCDocuComment *docucom = CFCClass_get_docucomment(client);
-    if (!docucom) {
-        CFCUtil_die("No DocuComment for %s", class_name);
-    }
-
-    // Get the class's brief description.
-    const char *raw_brief = CFCDocuComment_get_brief(docucom);
-    char *brief = CFCPerlPod_perlify_doc_text(pod_spec, raw_brief);
-
-    // Get the class's long description.
-    const char *raw_description = CFCPerlPod_get_description(pod_spec);
-    if (!raw_description || !strlen(raw_description)) {
-        raw_description = CFCDocuComment_get_long(docucom);
-    }
-    char *description = CFCPerlPod_perlify_doc_text(pod_spec, raw_description);
-
-    // Create SYNOPSIS.
-    const char *raw_synopsis = CFCPerlPod_get_synopsis(pod_spec);
-    char *synopsis = CFCUtil_strdup("");
-    if (raw_synopsis && strlen(raw_synopsis)) {
-        synopsis = CFCUtil_cat(synopsis, "=head1 SYNOPSIS\n\n", raw_synopsis,
-                               "\n", NULL);
-    }
-
-    // Create CONSTRUCTORS.
-    char *constructor_pod = CFCPerlPod_constructors_pod(pod_spec, client);
-
-    // Create METHODS, possibly including an ABSTRACT METHODS section.
-    char *methods_pod = CFCPerlPod_methods_pod(pod_spec, client);
-
-    // Build an INHERITANCE section describing class ancestry.
-    char *inheritance = CFCUtil_strdup("");
-    if (CFCClass_get_parent(client)) {
-        inheritance = CFCUtil_cat(inheritance, "=head1 INHERITANCE\n\n",
-                                  class_name, NULL);
-        CFCClass *ancestor = client;
-        while (NULL != (ancestor = CFCClass_get_parent(ancestor))) {
-            const char *ancestor_klass = CFCClass_get_class_name(ancestor);
-            if (CFCPerlClass_singleton(ancestor_klass)) {
-                inheritance = CFCUtil_cat(inheritance, " isa L<",
-                                          ancestor_klass, ">", NULL);
-            }
-            else {
-                inheritance = CFCUtil_cat(inheritance, " isa ",
-                                          ancestor_klass, NULL);
-            }
-        }
-        inheritance = CFCUtil_cat(inheritance, ".\n", NULL);
-    }
-
-    // Put it all together.
-    const char pattern[] = 
-    "# Auto-generated file -- DO NOT EDIT!!!!!\n"
-    "\n"
-    "# Licensed to the Apache Software Foundation (ASF) under one or more\n"
-    "# contributor license agreements.  See the NOTICE file distributed with\n"
-    "# this work for additional information regarding copyright ownership.\n"
-    "# The ASF licenses this file to You under the Apache License, Version 2.0\n"
-    "# (the \"License\"); you may not use this file except in compliance with\n"
-    "# the License.  You may obtain a copy of the License at\n"
-    "#\n"
-    "#     http://www.apache.org/licenses/LICENSE-2.0\n"
-    "#\n"
-    "# Unless required by applicable law or agreed to in writing, software\n"
-    "# distributed under the License is distributed on an \"AS IS\" BASIS,\n"
-    "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"
-    "# See the License for the specific language governing permissions and\n"
-    "# limitations under the License.\n"
-    "\n"
-    "=head1 NAME\n"
-    "\n"
-    "%s - %s\n"
-    "\n"
-    "%s\n"
-    "\n"
-    "=head1 DESCRIPTION\n"
-    "\n"
-    "%s\n"
-    "\n"
-    "%s\n"
-    "\n"
-    "%s\n"
-    "\n"
-    "%s\n"
-    "\n"
-    "=cut\n"
-    "\n";
-    char *pod
-        = CFCUtil_sprintf(pattern, class_name, brief, synopsis, description,
-                          constructor_pod, methods_pod, inheritance);
-
-    FREEMEM(brief);
-    FREEMEM(synopsis);
-    FREEMEM(description);
-    FREEMEM(constructor_pod);
-    FREEMEM(methods_pod);
-    FREEMEM(inheritance);
-
-    return pod;
-}
-
-CFCClass*
-CFCPerlClass_get_client(CFCPerlClass *self) {
-    return self->client;
-}
-
-const char*
-CFCPerlClass_get_class_name(CFCPerlClass *self) {
-    return self->class_name;
-}
-
-void
-CFCPerlClass_append_xs(CFCPerlClass *self, const char *xs) {
-    if (!self->xs_code) {
-        self->xs_code = CFCUtil_strdup("");
-    }
-    self->xs_code = CFCUtil_cat(self->xs_code, xs, NULL);
-}
-
-const char*
-CFCPerlClass_get_xs_code(CFCPerlClass *self) {
-    return self->xs_code;
-}
-
-void
-CFCPerlClass_set_pod_spec(CFCPerlClass *self, CFCPerlPod *pod_spec) {
-    CFCPerlPod *old_pod_spec = self->pod_spec;
-    self->pod_spec = (CFCPerlPod*)CFCBase_incref((CFCBase*)pod_spec);
-    CFCBase_decref((CFCBase*)old_pod_spec);
-}
-
-CFCPerlPod*
-CFCPerlClass_get_pod_spec(CFCPerlClass *self) {
-    return self->pod_spec;
-}
-
-void
-CFCPerlClass_add_class_alias(CFCPerlClass *self, const char *alias) {
-    for (size_t i = 0; i < self->num_class_aliases; i++) {
-        if (strcmp(alias, self->class_aliases[i]) == 0) {
-            CFCUtil_die("Alias '%s' already added for class '%s'", alias,
-                        self->class_name);
-        }
-    }
-    size_t size = (self->num_class_aliases + 2) * sizeof(char*);
-    self->class_aliases = (char**)REALLOCATE(self->class_aliases, size);
-    self->class_aliases[self->num_class_aliases] = CFCUtil_strdup(alias);
-    self->num_class_aliases++;
-    self->class_aliases[self->num_class_aliases] = NULL;
-}
-
-const char**
-CFCPerlClass_get_class_aliases(CFCPerlClass *self) {
-    return (const char **)self->class_aliases;
-}
-
-// Generate C code which initializes method metadata.
-char*
-CFCPerlClass_method_metadata_code(CFCPerlClass *self) {
-    const char *vtable_var = CFCClass_full_vtable_var(self->client);
-    CFCMethod **fresh_methods = CFCClass_fresh_methods(self->client);
-    char *code = CFCUtil_strdup("");
-
-    for (int i = 0; fresh_methods[i] != NULL; i++) {
-        CFCMethod *method = fresh_methods[i];
-        if (!CFCMethod_novel(method)) { continue; }
-
-        const char *macro_sym = CFCMethod_get_macro_sym(method);
-        const char *alias     = CFCMethod_get_host_alias(method);
-        if (alias) {
-            code = CFCUtil_cat(code, "    CFISH_VTable_Add_Host_Method_Alias(",
-                               vtable_var, ", \"", alias, "\", \"", macro_sym,
-                               "\");\n", NULL);
-        }
-        if (CFCMethod_excluded_from_host(method)) {
-            code = CFCUtil_cat(code, "    CFISH_VTable_Exclude_Host_Method(",
-                               vtable_var, ", \"", macro_sym, "\");\n", NULL);
-        }
-    }
-
-    FREEMEM(fresh_methods);
-    return code;
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/1704c275/clownfish/compiler/src/CFCPerlClass.h
----------------------------------------------------------------------
diff --git a/clownfish/compiler/src/CFCPerlClass.h b/clownfish/compiler/src/CFCPerlClass.h
deleted file mode 100644
index 7051b82..0000000
--- a/clownfish/compiler/src/CFCPerlClass.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef H_CFCPERLCLASS
-#define H_CFCPERLCLASS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct CFCPerlClass CFCPerlClass;
-struct CFCParcel;
-struct CFCClass;
-struct CFCFunction;
-struct CFCPerlPod;
-struct CFCPerlMethod;
-struct CFCPerlConstructor;
-
-/** Clownfish::CFC::Binding::Perl::Class - Generate Perl binding code for a
- * Clownfish::CFC::Model::Class.
- */
-
-/** 
- * @param parcel A Clownfish::CFC::Model::Parcel.
- * @param class_name The name of the class to be registered.
- */
-CFCPerlClass*
-CFCPerlClass_new(struct CFCParcel *parcel, const char *class_name);
-
-CFCPerlClass*
-CFCPerlClass_init(CFCPerlClass *self, struct CFCParcel *parcel,
-                  const char *class_name);
-
-void
-CFCPerlClass_destroy(CFCPerlClass *self);
-
-/** Add a new class binding to the registry.  Each unique parcel/class-name
- * combination may only be registered once.
- */
-void
-CFCPerlClass_add_to_registry(CFCPerlClass *self);
-
-/** Given a class name, return a class binding if one exists.
- */
-CFCPerlClass*
-CFCPerlClass_singleton(const char *class_name);
-
-/** All registered class bindings.
- */
-CFCPerlClass**
-CFCPerlClass_registry();
-
-/** Release all memory and references held by the registry.
- */
-void
-CFCPerlClass_clear_registry(void);
-
-/** Override the specification for a method being made available from Perl.
- * The default spec is to make the method available under a lower-cased alias
- * of the Clownfish method name.
- *
- * @param alias The Perl name for the method.
- * @param method The Clownfish name for the method.
- */
-void
-CFCPerlClass_bind_method(CFCPerlClass *self, const char *alias,
-                         const char *method);
-
-/** Specify that a constructor should be made available from Perl-space.
- *
- * @param alias The Perl name for the constructor (default "new").
- * @param initializer The Clownfish name for the initialization function which
- * will be invoked (default "init").
- */
-void
-CFCPerlClass_bind_constructor(CFCPerlClass *self, const char *alias,
-                              const char *initializer);
-
-/** Block the automatic generation of a method binding.
- */
-void
-CFCPerlClass_exclude_method(CFCPerlClass *self, const char *method);
-
-/** Block the automatic generation of a constructor binding.
- */
-void
-CFCPerlClass_exclude_constructor(CFCPerlClass *self);
-
-/** Return an array of Clownfish::CFC::Binding::Perl::Method objects
- * representing all bound methods.
- */
-struct CFCPerlMethod**
-CFCPerlClass_method_bindings(struct CFCClass *klass);
-
-/** Return an array of Clownfish::CFC::Binding::Perl::Constructor objects
- * representing all bound constructors.
- */
-struct CFCPerlConstructor**
-CFCPerlClass_constructor_bindings(struct CFCClass *klass);
-
-/** Auto-generate POD according to the spec supplied via set_pod_spec().  If
- * no spec was supplied, return NULL.
- */
-char*
-CFCPerlClass_create_pod(CFCPerlClass *self);
-
-/** Accessor for the Clownfish::CFC::Model::Class module to be bound.
- */
-struct CFCClass*
-CFCPerlClass_get_client(CFCPerlClass *self);
-
-/** Accessor for class name. 
- */
-const char*
-CFCPerlClass_get_class_name(CFCPerlClass *self);
-
-/** Concatenate verbatim XS code.
- */
-void
-CFCPerlClass_append_xs(CFCPerlClass *self, const char *xs);
-
-/** Accessor for verbatim XS code.
- */
-const char*
-CFCPerlClass_get_xs_code(CFCPerlClass *self);
-
-/** Supply a specification which will cause POD to be generated for this class
- * binding.
- */
-void
-CFCPerlClass_set_pod_spec(CFCPerlClass *self, struct CFCPerlPod *pod_spec);
-
-/** Accessor for pod spec.
- */
-struct CFCPerlPod*
-CFCPerlClass_get_pod_spec(CFCPerlClass *self);
-
-/** Alias a class name to this class.
- *
- * TODO: remove this feature as soon as KinoSearch compatibility is no longer
- * necessary.
- */
-void
-CFCPerlClass_add_class_alias(CFCPerlClass *self, const char *alias);
-
-/** Return a NULL-terminated list of class names which will be aliased to this
- * class.
- */
-const char**
-CFCPerlClass_get_class_aliases(CFCPerlClass *self);
-
-/** Return C code which initializes method metadata.
- */
-char*
-CFCPerlClass_method_metadata_code(CFCPerlClass *self);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CFCPERLCLASS */
-


[lucy-commits] [52/54] [abbrv] git commit: refs/heads/sortex_ptr_only - Rename some methods in SortExternal.

Posted by ma...@apache.org.
Rename some methods in SortExternal.

Replace "cache" with "buffer" in a few method names.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/3b0c585b
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/3b0c585b
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/3b0c585b

Branch: refs/heads/sortex_ptr_only
Commit: 3b0c585b559bfc9cc8f84820c248c61223a8521a
Parents: 4cff84b
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Fri Jan 11 15:06:45 2013 -0800
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Sat Apr 26 16:01:52 2014 -0700

----------------------------------------------------------------------
 core/Lucy/Index/PostingPool.c       | 16 ++++++++--------
 core/Lucy/Index/SortFieldWriter.c   | 24 ++++++++++++------------
 core/Lucy/Index/SortFieldWriter.cfh |  2 +-
 core/Lucy/Util/BBSortEx.c           | 18 +++++++++---------
 core/Lucy/Util/BBSortEx.cfh         |  2 +-
 core/Lucy/Util/SortExternal.c       | 28 ++++++++++++++--------------
 core/Lucy/Util/SortExternal.cfh     |  8 ++++----
 perl/t/015-sort_external.t          | 20 ++++++++++----------
 8 files changed, 59 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/3b0c585b/core/Lucy/Index/PostingPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/PostingPool.c b/core/Lucy/Index/PostingPool.c
index 9c538ed..3088f34 100644
--- a/core/Lucy/Index/PostingPool.c
+++ b/core/Lucy/Index/PostingPool.c
@@ -190,16 +190,16 @@ PostPool_Flip_IMP(PostingPool *self) {
         DECREF(post_temp_path);
     }
 
-    PostPool_Sort_Cache(self);
+    PostPool_Sort_Buffer(self);
     if (num_runs && (ivars->buf_max - ivars->buf_tick) > 0) {
-        uint32_t num_items = PostPool_Cache_Count(self);
+        uint32_t num_items = PostPool_Buffer_Count(self);
         // Cheap imitation of flush. FIXME.
         PostingPool *run
             = PostPool_new(ivars->schema, ivars->snapshot, ivars->segment,
                            ivars->polyreader, ivars->field, ivars->lex_writer,
                            ivars->mem_pool, ivars->lex_temp_out,
                            ivars->post_temp_out, ivars->skip_out);
-        PostPool_Grow_Cache(run, num_items);
+        PostPool_Grow_Buffer(run, num_items);
         PostingPoolIVARS *const run_ivars = PostPool_IVARS(run);
 
         memcpy(run_ivars->buffer, (ivars->buffer) + ivars->buf_tick,
@@ -264,7 +264,7 @@ PostPool_Flush_IMP(PostingPool *self) {
     PostingPoolIVARS *const ivars = PostPool_IVARS(self);
 
     // Don't add a run unless we have data to put in it.
-    if (PostPool_Cache_Count(self) == 0) { return; }
+    if (PostPool_Buffer_Count(self) == 0) { return; }
 
     PostingPool *run
         = PostPool_new(ivars->schema, ivars->snapshot, ivars->segment,
@@ -288,7 +288,7 @@ PostPool_Flush_IMP(PostingPool *self) {
                               ivars->lex_temp_out);
     run_ivars->lex_start  = OutStream_Tell(ivars->lex_temp_out);
     run_ivars->post_start = OutStream_Tell(ivars->post_temp_out);
-    PostPool_Sort_Cache(self);
+    PostPool_Sort_Buffer(self);
     S_write_terms_and_postings(run, post_writer, NULL);
 
     run_ivars->lex_end  = OutStream_Tell(ivars->lex_temp_out);
@@ -300,7 +300,7 @@ PostPool_Flush_IMP(PostingPool *self) {
     run_ivars->buf_tick = 0;
     run_ivars->buf_max  = 0;
     run_ivars->buf_cap  = 0;
-    PostPool_Clear_Cache(self);
+    PostPool_Clear_Buffer(self);
 
     // Add the run to the array.
     PostPool_Add_Run(self, (SortExternal*)run);
@@ -517,7 +517,7 @@ PostPool_Refill_IMP(PostingPool *self) {
         // Add to the run's cache.
         if (num_elems >= ivars->buf_cap) {
             size_t new_cap = Memory_oversize(num_elems + 1, sizeof(Obj*));
-            PostPool_Grow_Cache(self, new_cap);
+            PostPool_Grow_Buffer(self, new_cap);
         }
         ivars->buffer[num_elems] = (Obj*)rawpost;
         num_elems++;
@@ -547,7 +547,7 @@ S_fresh_flip(PostingPool *self, InStream *lex_temp_in,
     ivars->flipped = true;
 
     // Sort RawPostings in cache, if any.
-    PostPool_Sort_Cache(self);
+    PostPool_Sort_Buffer(self);
 
     // Bail if never flushed.
     if (ivars->lex_end == 0) { return; }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3b0c585b/core/Lucy/Index/SortFieldWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.c b/core/Lucy/Index/SortFieldWriter.c
index 1a0d5ff..9cdf47a 100644
--- a/core/Lucy/Index/SortFieldWriter.c
+++ b/core/Lucy/Index/SortFieldWriter.c
@@ -127,7 +127,7 @@ SortFieldWriter_init(SortFieldWriter *self, Schema *schema,
 }
 
 void
-SortFieldWriter_Clear_Cache_IMP(SortFieldWriter *self) {
+SortFieldWriter_Clear_Buffer_IMP(SortFieldWriter *self) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
     if (ivars->uniq_vals) {
         if (ivars->last_val) {
@@ -137,9 +137,9 @@ SortFieldWriter_Clear_Cache_IMP(SortFieldWriter *self) {
         }
         Hash_Clear(ivars->uniq_vals);
     }
-    SortFieldWriter_Clear_Cache_t super_clear_cache
-        = SUPER_METHOD_PTR(SORTFIELDWRITER, LUCY_SortFieldWriter_Clear_Cache);
-    super_clear_cache(self);
+    SortFieldWriter_Clear_Buffer_t super_clear_buffer
+        = SUPER_METHOD_PTR(SORTFIELDWRITER, LUCY_SortFieldWriter_Clear_Buffer);
+    super_clear_buffer(self);
     // Note that we have not called MemPool_Release_All() on our memory pool.
     // This is because the pool is shared amongst multiple SortFieldWriters
     // which belong to a parent SortWriter; it is the responsibility of the
@@ -378,13 +378,13 @@ SortFieldWriter_Flush_IMP(SortFieldWriter *self) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
 
     // Don't add a run unless we have data to put in it.
-    if (SortFieldWriter_Cache_Count(self) == 0) { return; }
+    if (SortFieldWriter_Buffer_Count(self) == 0) { return; }
 
     OutStream *const temp_ord_out = ivars->temp_ord_out;
     OutStream *const temp_ix_out  = ivars->temp_ix_out;
     OutStream *const temp_dat_out = ivars->temp_dat_out;
 
-    SortFieldWriter_Sort_Cache(self);
+    SortFieldWriter_Sort_Buffer(self);
     SortFieldWriter *run
         = SortFieldWriter_new(ivars->schema, ivars->snapshot, ivars->segment,
                               ivars->polyreader, ivars->field, ivars->mem_pool,
@@ -415,7 +415,7 @@ SortFieldWriter_Flush_IMP(SortFieldWriter *self) {
     run_ivars->buf_tick  = 0;
     run_ivars->buf_cap   = 0;
     ivars->buf_tick = ivars->buf_max;
-    SortFieldWriter_Clear_Cache(self);
+    SortFieldWriter_Clear_Buffer(self);
 
     // Record stream ends.
     run_ivars->ord_end = OutStream_Tell(temp_ord_out);
@@ -434,12 +434,12 @@ SortFieldWriter_Refill_IMP(SortFieldWriter *self) {
     if (!ivars->sort_cache) { return 0; }
 
     // Sanity check, then reset the cache and prepare to start loading items.
-    uint32_t buf_count = SortFieldWriter_Cache_Count(self);
+    uint32_t buf_count = SortFieldWriter_Buffer_Count(self);
     if (buf_count) {
         THROW(ERR, "Refill called but cache contains %u32 items",
               buf_count);
     }
-    SortFieldWriter_Clear_Cache(self);
+    SortFieldWriter_Clear_Buffer(self);
     MemPool_Release_All(ivars->mem_pool);
     S_lazy_init_sorted_ids(self);
 
@@ -480,7 +480,7 @@ SortFieldWriter_Refill_IMP(SortFieldWriter *self) {
         ivars->run_tick++;
     }
     ivars->run_ord++;
-    SortFieldWriter_Sort_Cache(self);
+    SortFieldWriter_Sort_Buffer(self);
 
     if (ivars->run_ord >= ivars->run_cardinality) {
         DECREF(ivars->sort_cache);
@@ -493,7 +493,7 @@ SortFieldWriter_Refill_IMP(SortFieldWriter *self) {
 void
 SortFieldWriter_Flip_IMP(SortFieldWriter *self) {
     SortFieldWriterIVARS *const ivars = SortFieldWriter_IVARS(self);
-    uint32_t num_items = SortFieldWriter_Cache_Count(self);
+    uint32_t num_items = SortFieldWriter_Buffer_Count(self);
     uint32_t num_runs = VA_Get_Size(ivars->runs);
 
     if (ivars->flipped) { THROW(ERR, "Can't call Flip() twice"); }
@@ -506,7 +506,7 @@ SortFieldWriter_Flip_IMP(SortFieldWriter *self) {
     }
 
     if (num_items) {
-        SortFieldWriter_Sort_Cache(self);
+        SortFieldWriter_Sort_Buffer(self);
     }
     else if (num_runs) {
         Folder  *folder = PolyReader_Get_Folder(ivars->polyreader);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3b0c585b/core/Lucy/Index/SortFieldWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/SortFieldWriter.cfh b/core/Lucy/Index/SortFieldWriter.cfh
index 00e85c1..8f749cc 100644
--- a/core/Lucy/Index/SortFieldWriter.cfh
+++ b/core/Lucy/Index/SortFieldWriter.cfh
@@ -88,7 +88,7 @@ class Lucy::Index::SortFieldWriter
     Compare(SortFieldWriter *self, void *va, void *vb);
 
     void
-    Clear_Cache(SortFieldWriter *self);
+    Clear_Buffer(SortFieldWriter *self);
 
     int32_t
     Get_Null_Ord(SortFieldWriter *self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3b0c585b/core/Lucy/Util/BBSortEx.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.c b/core/Lucy/Util/BBSortEx.c
index 156ab02..662a570 100644
--- a/core/Lucy/Util/BBSortEx.c
+++ b/core/Lucy/Util/BBSortEx.c
@@ -50,12 +50,12 @@ BBSortEx_Destroy_IMP(BBSortEx *self) {
 }
 
 void
-BBSortEx_Clear_Cache_IMP(BBSortEx *self) {
+BBSortEx_Clear_Buffer_IMP(BBSortEx *self) {
     BBSortExIVARS *const ivars = BBSortEx_IVARS(self);
     ivars->mem_consumed = 0;
-    BBSortEx_Clear_Cache_t super_clear_cache
-        = SUPER_METHOD_PTR(BBSORTEX, LUCY_BBSortEx_Clear_Cache);
-    super_clear_cache(self);
+    BBSortEx_Clear_Buffer_t super_clear_buffer
+        = SUPER_METHOD_PTR(BBSORTEX, LUCY_BBSortEx_Clear_Buffer);
+    super_clear_buffer(self);
 }
 
 void
@@ -84,7 +84,7 @@ BBSortEx_Flush_IMP(BBSortEx *self) {
     else            { elems = VA_new(buf_count); }
 
     // Sort, then create a new run.
-    BBSortEx_Sort_Cache(self);
+    BBSortEx_Sort_Buffer(self);
     for (uint32_t i = ivars->buf_tick; i < ivars->buf_max; i++) {
         VA_Push(elems, buffer[i]);
     }
@@ -94,7 +94,7 @@ BBSortEx_Flush_IMP(BBSortEx *self) {
 
     // Blank the cache vars.
     ivars->buf_tick += buf_count;
-    BBSortEx_Clear_Cache(self);
+    BBSortEx_Clear_Buffer(self);
 }
 
 uint32_t
@@ -128,9 +128,9 @@ BBSortEx_Refill_IMP(BBSortEx *self) {
         }
 
         if (ivars->buf_max == ivars->buf_cap) {
-            BBSortEx_Grow_Cache(self,
-                                Memory_oversize(ivars->buf_max + 1,
-                                                sizeof(Obj*)));
+            BBSortEx_Grow_Buffer(self,
+                                 Memory_oversize(ivars->buf_max + 1,
+                                                 sizeof(Obj*)));
         }
         ivars->buffer[ivars->buf_max++] = INCREF(elem);
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3b0c585b/core/Lucy/Util/BBSortEx.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/BBSortEx.cfh b/core/Lucy/Util/BBSortEx.cfh
index 3ba7531..8ef64c8 100644
--- a/core/Lucy/Util/BBSortEx.cfh
+++ b/core/Lucy/Util/BBSortEx.cfh
@@ -43,7 +43,7 @@ class Lucy::Util::BBSortEx
     Refill(BBSortEx *self);
 
     void
-    Clear_Cache(BBSortEx *self);
+    Clear_Buffer(BBSortEx *self);
 
     void
     Flip(BBSortEx *self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3b0c585b/core/Lucy/Util/SortExternal.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.c b/core/Lucy/Util/SortExternal.c
index ce42550..c7dff90 100644
--- a/core/Lucy/Util/SortExternal.c
+++ b/core/Lucy/Util/SortExternal.c
@@ -21,7 +21,7 @@
 
 // Refill the main cache, drawing from the caches of all runs.
 static void
-S_refill_cache(SortExternal *self, SortExternalIVARS *ivars);
+S_refill_buffer(SortExternal *self, SortExternalIVARS *ivars);
 
 // Absorb all the items which are "in-range" from all the Runs into the main
 // cache.
@@ -68,7 +68,7 @@ SortEx_Destroy_IMP(SortExternal *self) {
     FREEMEM(ivars->slice_sizes);
     FREEMEM(ivars->slice_starts);
     if (ivars->buffer) {
-        SortEx_Clear_Cache(self);
+        SortEx_Clear_Buffer(self);
         FREEMEM(ivars->buffer);
     }
     DECREF(ivars->runs);
@@ -76,7 +76,7 @@ SortEx_Destroy_IMP(SortExternal *self) {
 }
 
 void
-SortEx_Clear_Cache_IMP(SortExternal *self) {
+SortEx_Clear_Buffer_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     Obj **const buffer = ivars->buffer;
     const uint32_t max = ivars->buf_max;
@@ -92,7 +92,7 @@ SortEx_Feed_IMP(SortExternal *self, Obj *item) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     if (ivars->buf_max == ivars->buf_cap) {
         size_t amount = Memory_oversize(ivars->buf_max + 1, sizeof(Obj*));
-        SortEx_Grow_Cache(self, amount);
+        SortEx_Grow_Buffer(self, amount);
     }
     ivars->buffer[ivars->buf_max] = item;
     ivars->buf_max++;
@@ -101,7 +101,7 @@ SortEx_Feed_IMP(SortExternal *self, Obj *item) {
 static CFISH_INLINE Obj*
 SI_peek(SortExternal *self, SortExternalIVARS *ivars) {
     if (ivars->buf_tick >= ivars->buf_max) {
-        S_refill_cache(self, ivars);
+        S_refill_buffer(self, ivars);
     }
 
     if (ivars->buf_max > 0) {
@@ -127,10 +127,10 @@ SortEx_Peek_IMP(SortExternal *self) {
 }
 
 void
-SortEx_Sort_Cache_IMP(SortExternal *self) {
+SortEx_Sort_Buffer_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     if (ivars->buf_tick != 0) {
-        THROW(ERR, "Cant Sort_Cache() after fetching %u32 items", ivars->buf_tick);
+        THROW(ERR, "Cant Sort_Buffer() after fetching %u32 items", ivars->buf_tick);
     }
     if (ivars->buf_max != 0) {
         VTable *vtable = SortEx_Get_VTable(self);
@@ -169,7 +169,7 @@ void
 SortEx_Shrink_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     if (ivars->buf_max - ivars->buf_tick > 0) {
-        size_t buf_count = SortEx_Cache_Count(self);
+        size_t buf_count = SortEx_Buffer_Count(self);
         size_t size        = buf_count * sizeof(Obj*);
         if (ivars->buf_tick > 0) {
             Obj **start = ivars->buffer + ivars->buf_tick;
@@ -198,15 +198,15 @@ SortEx_Shrink_IMP(SortExternal *self) {
 }
 
 static void
-S_refill_cache(SortExternal *self, SortExternalIVARS *ivars) {
+S_refill_buffer(SortExternal *self, SortExternalIVARS *ivars) {
     // Reset cache vars.
-    SortEx_Clear_Cache(self);
+    SortEx_Clear_Buffer(self);
 
     // Make sure all runs have at least one item in the cache.
     uint32_t i = 0;
     while (i < VA_Get_Size(ivars->runs)) {
         SortExternal *const run = (SortExternal*)VA_Fetch(ivars->runs, i);
-        if (SortEx_Cache_Count(run) > 0 || SortEx_Refill(run) > 0) {
+        if (SortEx_Buffer_Count(run) > 0 || SortEx_Refill(run) > 0) {
             i++; // Run has some elements, so keep.
         }
         else {
@@ -276,7 +276,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
             if (ivars->buf_max + slice_size > ivars->buf_cap) {
                 size_t cap = Memory_oversize(ivars->buf_max + slice_size,
                                              sizeof(Obj*));
-                SortEx_Grow_Cache(self, cap);
+                SortEx_Grow_Buffer(self, cap);
             }
             memcpy(ivars->buffer + ivars->buf_max,
                    run_ivars->buffer + run_ivars->buf_tick,
@@ -338,7 +338,7 @@ S_absorb_slices(SortExternal *self, SortExternalIVARS *ivars,
 }
 
 void
-SortEx_Grow_Cache_IMP(SortExternal *self, uint32_t cap) {
+SortEx_Grow_Buffer_IMP(SortExternal *self, uint32_t cap) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     if (cap > ivars->buf_cap) {
         ivars->buffer = (Obj**)REALLOCATE(ivars->buffer, cap * sizeof(Obj*));
@@ -375,7 +375,7 @@ SortEx_Set_Mem_Thresh_IMP(SortExternal *self, uint32_t mem_thresh) {
 }
 
 uint32_t
-SortEx_Cache_Count_IMP(SortExternal *self) {
+SortEx_Buffer_Count_IMP(SortExternal *self) {
     SortExternalIVARS *const ivars = SortEx_IVARS(self);
     return ivars->buf_max - ivars->buf_tick;
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/3b0c585b/core/Lucy/Util/SortExternal.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/SortExternal.cfh b/core/Lucy/Util/SortExternal.cfh
index 9674f92..917f5df 100644
--- a/core/Lucy/Util/SortExternal.cfh
+++ b/core/Lucy/Util/SortExternal.cfh
@@ -109,7 +109,7 @@ abstract class Lucy::Util::SortExternal nickname SortEx
     /** Sort all items currently in the main cache.
      */
     void
-    Sort_Cache(SortExternal *self);
+    Sort_Buffer(SortExternal *self);
 
     /** Reset cache variables so that cache gives the appearance of having
      * been initialized.
@@ -117,17 +117,17 @@ abstract class Lucy::Util::SortExternal nickname SortEx
      * Subclasses may take steps to release items held in cache, if any.
      */
     void
-    Clear_Cache(SortExternal *self);
+    Clear_Buffer(SortExternal *self);
 
     /** Return the number of items presently in the cache.
      */
     uint32_t
-    Cache_Count(SortExternal *self);
+    Buffer_Count(SortExternal *self);
 
     /** Allocate more memory to the cache.
      */
     void
-    Grow_Cache(SortExternal *self, uint32_t cap);
+    Grow_Buffer(SortExternal *self, uint32_t cap);
 
     void
     Set_Mem_Thresh(SortExternal *self, uint32_t mem_thresh);

http://git-wip-us.apache.org/repos/asf/lucy/blob/3b0c585b/perl/t/015-sort_external.t
----------------------------------------------------------------------
diff --git a/perl/t/015-sort_external.t b/perl/t/015-sort_external.t
index 134e7c7..b656abf 100644
--- a/perl/t/015-sort_external.t
+++ b/perl/t/015-sort_external.t
@@ -21,24 +21,24 @@ use List::Util qw( shuffle );
 use Lucy::Test;
 use bytes qw();
 
-my ( $sortex, $cache, @orig, @sort_output );
+my ( $sortex, $buffer, @orig, @sort_output );
 
 $sortex = Lucy::Util::BBSortEx->new( mem_thresh => 4 );
 $sortex->feed( new_bytebuf('c') );
-is( $sortex->cache_count, 1, "feed elem into cache" );
+is( $sortex->buffer_count, 1, "feed elem into buffer" );
 
 $sortex->feed( new_bytebuf('b') );
 $sortex->feed( new_bytebuf('d') );
-$sortex->sort_cache;
+$sortex->sort_buffer;
 SKIP: {
     skip( "Restore when porting test to C", 1 );
-    $cache = $sortex->_peek_cache;
-    is_deeply( $cache, [qw( b c d )], "sort cache" );
+    $buffer = $sortex->_peek_buffer;
+    is_deeply( $buffer, [qw( b c d )], "sort buffer" );
 }
 
 $sortex->feed( new_bytebuf('a') );
-is( $sortex->cache_count, 0,
-    "cache flushed automatically when mem_thresh crossed" );
+is( $sortex->buffer_count, 0,
+    "buffer flushed automatically when mem_thresh crossed" );
 #is( $sortex->get_num_runs, 1, "run added" );
 
 my @bytebufs = map { new_bytebuf($_) } qw( x y z );
@@ -55,8 +55,8 @@ is_deeply( \@sort_output, \@orig, "Add_Run" );
 
 $sortex = Lucy::Util::BBSortEx->new( mem_thresh => 4 );
 $sortex->feed( new_bytebuf('c') );
-$sortex->clear_cache;
-is( $sortex->cache_count, 0, "Clear_Cache" );
+$sortex->clear_buffer;
+is( $sortex->buffer_count, 0, "Clear_Buffer" );
 $sortex->feed( new_bytebuf('b') );
 $sortex->feed( new_bytebuf('a') );
 $sortex->flush;
@@ -68,7 +68,7 @@ while ( defined( my $result = $sortex->fetch ) ) {
     push @sort_output, $result;
 }
 is_deeply( \@sort_output, \@orig,
-    "elements cleared via Clear_Cache truly cleared" );
+    "elements cleared via Clear_Buffer truly cleared" );
 @orig        = ();
 @sort_output = ();