| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Pegex::Module; |
|
2
|
1
|
|
|
1
|
|
875
|
use Pegex::Base; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
has parser_class => 'Pegex::Parser', lazy => 0; |
|
5
|
|
|
|
|
|
|
has grammar_class => ( |
|
6
|
|
|
|
|
|
|
default => sub { |
|
7
|
|
|
|
|
|
|
my $class = ref($_[0]); |
|
8
|
|
|
|
|
|
|
die "$class needs a 'grammar_class' property"; |
|
9
|
|
|
|
|
|
|
}, |
|
10
|
|
|
|
|
|
|
); |
|
11
|
|
|
|
|
|
|
has receiver_class => 'Pegex::Tree'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub parse { |
|
14
|
0
|
|
|
0
|
0
|
|
my ($self, $input) = @_; |
|
15
|
0
|
0
|
|
|
|
|
$self = $self->new unless ref $self; |
|
16
|
|
|
|
|
|
|
# use XXX; XXX $self; |
|
17
|
0
|
|
|
|
|
|
my $parser = $self->parser_class->new( |
|
18
|
|
|
|
|
|
|
grammar => $self->grammar_class->new, |
|
19
|
|
|
|
|
|
|
receiver => $self->receiver_class->new, |
|
20
|
|
|
|
|
|
|
); |
|
21
|
0
|
|
|
|
|
|
$parser->parse($input); |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |