Debian Codegraph @

lib/Biblio/Citation/Parser.pm

raw
1 package Biblio::Citation::Parser;
2
3 ######################################################################
4 #
5 # Biblio::Citation::Parser;
6 #
7 ######################################################################
8 #
9 # This file was originally part of ParaCite Tools, based at
10 # http://paracite.eprints.org/developers/
11 #
12 #
13 # Copyright (c) 2004 University of Southampton, UK. SO17 1BJ.
14 #
15 # ParaTools is free software; you can redistribute it and/or modify
16 # it under the terms of the GNU General Public License as published by
17 # the Free Software Foundation; either version 2 of the License, or
18 # (at your option) any later version.
19 #
20 # ParaTools is distributed in the hope that it will be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
24 #
25 # You should have received a copy of the GNU General Public License
26 # along with ParaTools; if not, write to the Free Software
27 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #
29 ######################################################################
30
31 use strict;
32 use vars qw($VERSION);
33
34 require Exporter;
35 our @ISA = qw(Exporter);
36 our @EXPORT_OK = ( 'parse', 'new' );
37
38 $VERSION = "1.10";
39
40 =pod
41
42 =head1 NAME
43
44 B<Biblio::Citation::Parser> - citation parsing framework
45
46 =head1 DESCRIPTION
47
48 Biblio::Citation::Parser provides generic methods for reference parsers. This
49 class should not be used directly, but rather be overridden by specific
50 parsers. Parsers that extend the Parser class must provide at least
51 the two methods defined here to ensure compatibility.
52
53 =head1 METHODS
54
55 =over 4
56
57 =item $cite_parser = Biblio::Citation::Parser-E<gt>new()
58
59 The new() method creates a new parser instance.
60
61 =cut
62
63 sub new
64 {
65 my($class) = @_;
66 my $self = {};
67 return bless($self, $class);
68 }
69
70 =pod
71
72 =item $metadata = $parser-E<gt>parse($reference)
73
74 The parse() method takes a reference and returns the extracted metadata.
75
76 =cut
77
78 sub parse
79 {
80 my($self, $ref) = @_;
81 die "This method should be overridden.\n";
82 }
83
84 1;
85
86 __END__
87
88 =pod
89
90 =back
91
92 =head1 AUTHOR
93
94 Mike Jewell <[email protected]>
95
96 =cut