summaryrefslogtreecommitdiff
path: root/samwise/PerlSam/Parser.pm
blob: 08ce79a1f9134506dad7ac83fa3cd1ff9877e445 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# $Id$

package PerlSam::Parser;

use PerlSam::Parser::Simple;
use strict;

###############################################################################
# Global methods

# Return the default parser
sub GetDefault ()
{
    return 'simple';
}

###############################################################################
# Constructor

sub new ($)
{
    my $proto = shift;
    my $class = ref ($proto) || $proto;
    my $self = {};

    my $name = shift;

    if ($name eq 'simple') {
        $self->{PARSER} = new PerlSam::Parser::Simple;
    }
    else {
        print STDERR "Error: Unrecognized Parser <$name>\n";
        exit 1;
    }

    bless ($self, $class);
    return $self;
}

###############################################################################
# Methods

sub Parse ($\%)
{
    my $self = shift;

    return $self->{PARSER}->Parse (@_);
}

sub ParseLibraryFile ($\%)
{
    my $self = shift;

    return $self->{PARSER}->ParseLibraryFile (@_);
}

1;