lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r930414 - in /lucene/lucy/trunk/clownfish: lib/ lib/Clownfish/ lib/Clownfish/Binding/ lib/Clownfish/Binding/Core/ lib/Clownfish/Binding/Perl/ lib/Clownfish/Type/ t/ t/bpsource/ t/cfsource/
Date Fri, 02 Apr 2010 22:14:11 GMT
Author: marvin
Date: Fri Apr  2 22:14:10 2010
New Revision: 930414

URL: http://svn.apache.org/viewvc?rev=930414&view=rev
Log:
Make superficial changes to Clownfish in preparation for changing the
Clownfish header suffix from ".bp" to ".cfh".

Added:
    lucene/lucy/trunk/clownfish/t/cfsource/
      - copied from r930343, lucene/lucy/trunk/clownfish/t/bpsource/
Removed:
    lucene/lucy/trunk/clownfish/t/bpsource/
Modified:
    lucene/lucy/trunk/clownfish/lib/Clownfish.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/File.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Method.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/CBlock.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/Class.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/Hierarchy.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/Parser.pm
    lucene/lucy/trunk/clownfish/lib/Clownfish/Type/Arbitrary.pm
    lucene/lucy/trunk/clownfish/t/500-hierarchy.t

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish.pm Fri Apr  2 22:14:10 2010
@@ -164,9 +164,9 @@ prefixes.
 =head2 Inclusion
 
 C header code generated by the Clownfish compiler is written to a file with
-whose name is the same as the .bp file, but with an extension of ".h".  C code
-should pound-include "Crustacean/Lobster.h" for a class defined in
-"Crustacean/Lobster.bp".
+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 AND LICENSE
 

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core.pm Fri Apr  2 22:14:10 2010
@@ -175,7 +175,7 @@ Clownfish::Binding::Core - Generate core
 =head1 SYNOPSIS
 
     my $hierarchy = Clownfish::Hierarchy->new(
-        source => '/path/to/bp/files',
+        source => '/path/to/clownfish/files',
         dest   => 'autogen',
     );
     $hierarchy->build;

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/File.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/File.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/File.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/File.pm Fri Apr  2 22:14:10 2010
@@ -144,17 +144,17 @@ __POD__
 
 =head1 NAME
 
-Clownfish::Binding::Core::File - Generate core C code for a .bp file.
+Clownfish::Binding::Core::File - Generate core C code for a Clownfish file.
 
 =head1 DESCRIPTION
 
 This module is the companion to Clownfish::File, generating the C code
-needed to implement the .bp file's specification.
+needed to implement the file's specification.
 
-There is a one-to-one mapping between .bp files and autogenerated .h and .c
-files.  If Foo.bp 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.
+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.
 
 =head1 CLASS METHODS
 

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Method.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Method.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Method.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Core/Method.pm Fri Apr  2 22:14:10 2010
@@ -271,7 +271,7 @@ END_CALLBACK_DEF
 
 # Create a function which throws a runtime error indicating that a method is
 # abstract.  This serves as the implementation for methods which are
-# declared as "abstract" in a .bp file.
+# declared as "abstract" in a Clownfish header file.
 sub abstract_method_def {
     my ( undef, $method ) = @_;
     my $params          = $method->get_param_list->to_c;

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/TypeMap.pm Fri Apr  2 22:14:10
2010
@@ -89,51 +89,51 @@ my %primitives_to_perl = (
 );
 
 # Extract a Clownfish object from a Perl SV.
-sub _sv_to_bp_obj {
-    my ( $type, $bp_var, $xs_var ) = @_;
+sub _sv_to_cf_obj {
+    my ( $type, $cf_var, $xs_var ) = @_;
     my $struct_sym = $type->get_specifier;
     my $vtable     = uc($struct_sym);
     if ( $struct_sym =~ /^[a-z_]*(Obj|CharBuf)$/ ) {
-        # Share buffers rather than copy between Perl scalars and BP string
-        # types.  Assume that the appropriate ZombieCharBuf has been declared
-        # on the stack.
-        return "$bp_var = ($struct_sym*)XSBind_sv_to_lucy_obj($xs_var, "
+        # Share buffers rather than copy between Perl scalars and Clownfish
+        # string types.  Assume that the appropriate ZombieCharBuf has been
+        # declared on the stack.
+        return "$cf_var = ($struct_sym*)XSBind_sv_to_lucy_obj($xs_var, "
             . "$vtable, alloca(lucy_ZCB_size()));"
     }
     else {
-        return "$bp_var = ($struct_sym*)XSBind_sv_to_lucy_obj($xs_var, "
+        return "$cf_var = ($struct_sym*)XSBind_sv_to_lucy_obj($xs_var, "
             . "$vtable, NULL);";
     }
 }
 
 sub _void_star_to_lucy {
-    my ( $type, $bp_var, $xs_var ) = @_;
+    my ( $type, $cf_var, $xs_var ) = @_;
     # Assume that void* is a reference SV -- either a hashref or an arrayref.
     return qq|if (SvROK($xs_var)) {
-            $bp_var = SvRV($xs_var);
+            $cf_var = SvRV($xs_var);
         }
         else {
-            $bp_var = NULL; /* avoid uninitialized compiler warning */
-            LUCY_THROW(LUCY_ERR, "$bp_var is not a reference");
+            $cf_var = NULL; /* avoid uninitialized compiler warning */
+            LUCY_THROW(LUCY_ERR, "$cf_var is not a reference");
         }\n|;
 }
 
 sub from_perl {
-    my ( $type, $bp_var, $xs_var ) = @_;
+    my ( $type, $cf_var, $xs_var ) = @_;
     confess("Not a Clownfish::Type")
         unless blessed($type) && $type->isa('Clownfish::Type');
 
     if ( $type->is_object ) {
-        return _sv_to_bp_obj( $type, $bp_var, $xs_var );
+        return _sv_to_cf_obj( $type, $cf_var, $xs_var );
     }
     elsif ( $type->is_primitive ) {
         if ( my $sub = $primitives_from_perl{ $type->to_c } ) {
-            return $sub->( $bp_var, $xs_var );
+            return $sub->( $cf_var, $xs_var );
         }
     }
     elsif ( $type->is_composite ) {
         if ( $type->to_c eq 'void*' ) {
-            return _void_star_to_lucy( $type, $bp_var, $xs_var );
+            return _void_star_to_lucy( $type, $cf_var, $xs_var );
         }
     }
 
@@ -141,25 +141,25 @@ sub from_perl {
 }
 
 sub to_perl {
-    my ( $type, $xs_var, $bp_var ) = @_;
+    my ( $type, $xs_var, $cf_var ) = @_;
     confess("Not a Clownfish::Type")
         unless ref($type) && $type->isa('Clownfish::Type');
     my $type_str = $type->to_c;
 
     if ( $type->is_object ) {
-        return "$xs_var = $bp_var == NULL ? newSV(0) : "
-            . "XSBind_lucy_to_perl((lucy_Obj*)$bp_var);";
+        return "$xs_var = $cf_var == NULL ? newSV(0) : "
+            . "XSBind_lucy_to_perl((lucy_Obj*)$cf_var);";
     }
     elsif ( $type->is_primitive ) {
         if ( my $sub = $primitives_to_perl{$type_str} ) {
-            return $sub->( $xs_var, $bp_var );
+            return $sub->( $xs_var, $cf_var );
         }
     }
     elsif ( $type->is_composite ) {
         if ( $type_str eq 'void*' ) {
             # Assume that void* is a reference SV -- either a hashref or an
             # arrayref.
-            return "$xs_var = newRV_inc( (SV*)($bp_var) );";
+            return "$xs_var = newRV_inc( (SV*)($cf_var) );";
         }
     }
 
@@ -296,7 +296,7 @@ __POD__
 
 =head1 NAME
 
-Clownfish::Binding::Perl::TypeMap - Convert between BP and Perl via XS.
+Clownfish::Binding::Perl::TypeMap - Convert between Clownfish and Perl via XS.
 
 =head1 DESCRIPTION
 
@@ -309,7 +309,7 @@ types using the XS "typemap" format docu
 
 =head2 from_perl
 
-    my $c_code = from_perl( $type, $bp_var, $xs_var );
+    my $c_code = from_perl( $type, $cf_var, $xs_var );
 
 Return C code which converts from a Perl scalar to a variable of type $type.
 
@@ -321,7 +321,7 @@ make any declarations itself.
 =item * B<type> - A Clownfish::Type, which will be used to select the
 mapping code.
 
-=item * B<bp_var> - The name of the variable being assigned to.
+=item * B<cf_var> - The name of the variable being assigned to.
 
 =item * B<xs_var> - The C name of the Perl scalar from which we are extracting
 a value.
@@ -330,7 +330,7 @@ a value.
 
 =head2 to_perl
 
-    my $c_code = to_perl( $type, $xs_var, $bp_var );
+    my $c_code = to_perl( $type, $xs_var, $cf_var );
 
 Return C code which converts from a variable of type $type to a Perl scalar.
 
@@ -344,7 +344,7 @@ mapping code.
 
 =item * B<xs_var> - The C name of the Perl scalar being assigned to.
 
-=item * B<bp_var> - The name of the variable from which we are extracting a
+=item * B<cf_var> - The name of the variable from which we are extracting a
 value.
 
 =back

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/CBlock.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/CBlock.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/CBlock.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/CBlock.pm Fri Apr  2 22:14:10 2010
@@ -31,7 +31,8 @@ Clownfish::CBlock - A block of embedded 
 
 =head1 DESCRIPTION
 
-CBlock exists to support embedding literal C code within .bp files:
+CBlock exists to support embedding literal C code within Clownfish header
+files:
 
     class Crustacean::Lobster {
         /* ... */

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Class.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Class.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Class.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Class.pm Fri Apr  2 22:14:10 2010
@@ -377,7 +377,7 @@ L<Clownfish::Symbol>.
 
 =item * B<source_class> - The name of the class that owns the file in which
 this class was declared.  Should be "Foo" if "Foo::FooJr" is defined in
-C<Foo.bp>.
+C<Foo.cfh>.
 
 =item * B<parent_class_name> - The name of this class's parent class.  Needed
 in order to establish the class hierarchy.

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Hierarchy.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Hierarchy.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Hierarchy.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Hierarchy.pm Fri Apr  2 22:14:10 2010
@@ -50,15 +50,15 @@ sub ordered_classes {
 
 sub files { values %{ shift->{files} } }
 
-# Slurp all .bp files.
+# Slurp all Clownfish header files.
 # Arrange the class objects into inheritance trees.
 sub build {
     my $self = shift;
-    $self->_parse_bp_files;
+    $self->_parse_cf_files;
     $_->grow_tree for values %{ $self->{trees} };
 }
 
-sub _parse_bp_files {
+sub _parse_cf_files {
     my $self   = shift;
     my $source = $self->{source};
 
@@ -200,8 +200,8 @@ core classes itself from which all insta
 
     $hierarchy->build;
 
-Parse every .bp file which can be found under C<source>, building up the
-object hierarchy.
+Parse every Clownfish header file which can be found under C<source>, building
+up the object hierarchy.
 
 =head2 ordered_classes
 

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Parser.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Parser.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Parser.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Parser.pm Fri Apr  2 22:14:10 2010
@@ -532,9 +532,9 @@ Clownfish::Parser - Parse Clownfish head
 
 =head1 DESCRIPTION
 
-Clownfish::Parser is a combined lexer/parser which parses .bp code.  It is
-not at all strict, as it relies heavily on the C parser to pick up errors such
-as misspelled type names.
+Clownfish::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.
 
 =head1 METHODS
 

Modified: lucene/lucy/trunk/clownfish/lib/Clownfish/Type/Arbitrary.pm
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/lib/Clownfish/Type/Arbitrary.pm?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/lib/Clownfish/Type/Arbitrary.pm (original)
+++ lucene/lucy/trunk/clownfish/lib/Clownfish/Type/Arbitrary.pm Fri Apr  2 22:14:10 2010
@@ -65,8 +65,8 @@ to create complex types in a C header fi
 
     typedef union { float f; int i; } floatint_t;
 
-... pound-include the C header, then use the resulting typedef in a .bp file
-and have it parse as an "arbitrary" type.
+... 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;
 

Modified: lucene/lucy/trunk/clownfish/t/500-hierarchy.t
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/clownfish/t/500-hierarchy.t?rev=930414&r1=930413&r2=930414&view=diff
==============================================================================
--- lucene/lucy/trunk/clownfish/t/500-hierarchy.t (original)
+++ lucene/lucy/trunk/clownfish/t/500-hierarchy.t Fri Apr  2 22:14:10 2010
@@ -10,8 +10,8 @@ use Fcntl;
 use File::Path qw( rmtree mkpath );
 
 my %args = (
-    source => 't/bpsource',
-    dest   => 't/bpdest',
+    source => 't/cfsource',
+    dest   => 't/cfdest',
 );
 
 # Clean up.
@@ -61,9 +61,9 @@ for my $file (@files) {
         or die "utime failed for '$h_path': $!";
 }
 
-my $path_to_animal_bp = $animal->bp_path( $args{source} );
-utime( undef, undef, $path_to_animal_bp )
-    or die "utime for '$path_to_animal_bp' failed";    # touch
+my $path_to_animal_cf = $animal->bp_path( $args{source} );
+utime( undef, undef, $path_to_animal_cf )
+    or die "utime for '$path_to_animal_cf' failed";    # touch
 
 $hierarchy->propagate_modified;
 



Mime
View raw message