lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [22/54] [abbrv] Remove bundled Clownfish.
Date Sat, 26 Apr 2014 23:11:52 GMT
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
-


Mime
View raw message