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 2011/12/19 22:18:11 UTC

[lucy-commits] svn commit: r1220951 - in /incubator/lucy/trunk/clownfish: perl/lib/Clownfish.pm perl/lib/Clownfish.xs src/CFCHierarchy.c src/CFCHierarchy.h

Author: marvin
Date: Mon Dec 19 21:18:10 2011
New Revision: 1220951

URL: http://svn.apache.org/viewvc?rev=1220951&view=rev
Log:
Move all Parser code for Hierarchy to C.

Remove some vestigial code for creating Hierarchy's parser in Perl-space, no
longer needed because Parser is now fully implemented in C.

Modified:
    incubator/lucy/trunk/clownfish/perl/lib/Clownfish.pm
    incubator/lucy/trunk/clownfish/perl/lib/Clownfish.xs
    incubator/lucy/trunk/clownfish/src/CFCHierarchy.c
    incubator/lucy/trunk/clownfish/src/CFCHierarchy.h

Modified: incubator/lucy/trunk/clownfish/perl/lib/Clownfish.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/perl/lib/Clownfish.pm?rev=1220951&r1=1220950&r2=1220951&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/perl/lib/Clownfish.pm (original)
+++ incubator/lucy/trunk/clownfish/perl/lib/Clownfish.pm Mon Dec 19 21:18:10 2011
@@ -231,14 +231,7 @@ BEGIN { XSLoader::load( 'Clownfish', '0.
         my ( $either, %args ) = @_;
         confess "no subclassing allowed" unless $either eq __PACKAGE__;
         verify_args( \%new_PARAMS, %args ) or confess $@;
-        my $parser = Clownfish::Parser->new;
-        return _new( @args{qw( source dest )}, $parser );
-    }
-
-    sub _do_parse_file {
-        my ( $parser, $content, $source_class ) = @_;
-        $content = $parser->strip_plain_comments($content);
-        return $parser->file( $content, 0, source_class => $source_class, );
+        return _new( @args{qw( source dest )} );
     }
 }
 

Modified: incubator/lucy/trunk/clownfish/perl/lib/Clownfish.xs
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/perl/lib/Clownfish.xs?rev=1220951&r1=1220950&r2=1220951&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/perl/lib/Clownfish.xs (original)
+++ incubator/lucy/trunk/clownfish/perl/lib/Clownfish.xs Mon Dec 19 21:18:10 2011
@@ -691,12 +691,11 @@ PPCODE:
 MODULE = Clownfish    PACKAGE = Clownfish::Hierarchy
 
 SV*
-_new(source, dest, parser)
+_new(source, dest)
     const char *source;
     const char *dest;
-    CFCParser *parser;
 CODE:
-    CFCHierarchy *self = CFCHierarchy_new(source, dest, parser);
+    CFCHierarchy *self = CFCHierarchy_new(source, dest);
     RETVAL = S_cfcbase_to_perlref(self);
     CFCBase_decref((CFCBase*)self);
 OUTPUT: RETVAL

Modified: incubator/lucy/trunk/clownfish/src/CFCHierarchy.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCHierarchy.c?rev=1220951&r1=1220950&r2=1220951&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCHierarchy.c (original)
+++ incubator/lucy/trunk/clownfish/src/CFCHierarchy.c Mon Dec 19 21:18:10 2011
@@ -69,14 +69,13 @@ const static CFCMeta CFCHIERARCHY_META =
 };
 
 CFCHierarchy*
-CFCHierarchy_new(const char *source, const char *dest, CFCParser *parser) {
+CFCHierarchy_new(const char *source, const char *dest) {
     CFCHierarchy *self = (CFCHierarchy*)CFCBase_allocate(&CFCHIERARCHY_META);
-    return CFCHierarchy_init(self, source, dest, parser);
+    return CFCHierarchy_init(self, source, dest);
 }
 
 CFCHierarchy*
-CFCHierarchy_init(CFCHierarchy *self, const char *source, const char *dest,
-                  CFCParser *parser) {
+CFCHierarchy_init(CFCHierarchy *self, const char *source, const char *dest) {
     if (!source || !strlen(source) || !dest || !strlen(dest)) {
         CFCUtil_die("Both 'source' and 'dest' are required");
     }
@@ -86,7 +85,7 @@ CFCHierarchy_init(CFCHierarchy *self, co
     self->num_trees = 0;
     self->files     = (CFCFile**)CALLOCATE(1, sizeof(CFCFile*));
     self->num_files = 0;
-    self->parser    = (CFCParser*)CFCBase_incref((CFCBase*)parser);
+    self->parser    = CFCParser_new();
     return self;
 }
 

Modified: incubator/lucy/trunk/clownfish/src/CFCHierarchy.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/src/CFCHierarchy.h?rev=1220951&r1=1220950&r2=1220951&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/src/CFCHierarchy.h (original)
+++ incubator/lucy/trunk/clownfish/src/CFCHierarchy.h Mon Dec 19 21:18:10 2011
@@ -24,15 +24,12 @@ extern "C" {
 typedef struct CFCHierarchy CFCHierarchy;
 struct CFCClass;
 struct CFCFile;
-struct CFCParser;
 
 CFCHierarchy*
-CFCHierarchy_new(const char *source, const char *dest,
-                 struct CFCParser *parser);
+CFCHierarchy_new(const char *source, const char *dest);
 
 CFCHierarchy*
-CFCHierarchy_init(CFCHierarchy *self, const char *source, const char *dest,
-                  struct CFCParser *parser);
+CFCHierarchy_init(CFCHierarchy *self, const char *source, const char *dest);
 
 void
 CFCHierarchy_destroy(CFCHierarchy *self);