File Coverage

blib/lib/POE/Filter/RecDescent.pm
Criterion Covered Total %
statement 19 21 90.4
branch n/a
condition n/a
subroutine 6 8 75.0
pod 0 4 0.0
total 25 33 75.7


line stmt bran cond sub pod time code
1             package POE::Filter::RecDescent;
2              
3 2     2   69623 use strict;
  2         7  
  2         70  
4 2     2   4415 use Parse::RecDescent;
  2         128232  
  2         18  
5 2     2   93 use Carp qw(croak);
  2         9  
  2         134  
6 2     2   8 use vars qw($VERSION);
  2         3  
  2         378  
7              
8             $VERSION = '0.02';
9              
10             sub DEBUG() { 0 };
11             #sub DEBUG() { 1 };
12              
13             # {{{ new
14             sub new {
15 1     1 0 14 my $type = shift;
16 1         2 my $grammar = shift;
17 1         11 my $self = {
18             parser => Parse::RecDescent->new($grammar),
19             buffer => '',
20             crlf => "\x0D\x0A",
21             };
22 1         4476 bless $self, $type;
23 1         6 return $self;
24             }
25             # }}}
26             # {{{ get
27             sub get {
28 1     1 0 6 my ($self, $stream) = @_;
29              
30 1         15 return [ $self->{parser}->startrule(join('',@$stream)) ];
31             }
32             # }}}
33             #sub get_one_start { }
34             #sub get_one { }
35 0     0 0   sub put { }
36 0     0 0   sub get_pending { }
37              
38             1;
39              
40             __END__