[
https://issues.apache.org/jira/browse/LUCY-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Marvin Humphrey updated LUCY-27:
--------------------------------
Attachment: Class.pm
Boilerplater::Binding::Perl::Class allows us to create highly customized
binding specifications for individual classes. The Perl code which
communicates the spec will be embedded in the individual Lucy Perl module
files, which will be mostly empty.
Here's a sample ANDQuery.pm file:
{code:none}
use Lucy;
1;
__END__
__BINDING__
my $synopsis = <<'END_SYNOPSIS';
my $foo_and_bar_query = Lucy::Search::ANDQuery->new(
children => [ $foo_query, $bar_query ],
);
my $hits = $searcher->hits( query => $foo_and_bar_query );
...
END_SYNOPSIS
my $constructor = <<'END_CONSTRUCTOR';
my $foo_and_bar_query = Lucy::Search::ANDQuery->new(
children => [ $foo_query, $bar_query ],
);
END_CONSTRUCTOR
Boilerplater::Binding::Perl::Class->register(
parcel => "Lucy",
class_name => "Lucy::Search::ANDQuery",
bind_constructors => ["new"],
make_pod => {
methods => [qw( add_child )],
synopsis => $synopsis,
constructor => { sample => $constructor },
},
);
__COPYRIGHT__
/**
* Copyright 2009 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
{code}
In addition to the XS bindings, most POD will be autogenerated, derived
from the JavaDoc-style documentation in the Boilerplater header files.
Other languages will be able to do something similar, allowing us to share
documentation text and only requiring that we create customized code
samples for individual host languages.
> Boilerplater Perl bindings
> --------------------------
>
> Key: LUCY-27
> URL: https://issues.apache.org/jira/browse/LUCY-27
> Project: Lucy
> Issue Type: Sub-task
> Components: Boilerplater
> Reporter: Marvin Humphrey
> Attachments: Class.pm, Constructor.pm, Method.pm, Perl.pm,
> Subroutine.pm, TypeMap.pm
>
>
> Iterate over the classes, methods, etc. in a Boilerplater::Hierarchy,
> auto-generating binding code to bridge Perl-space and C-space.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.