line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
14
|
use strict; use warnings; |
|
3
|
|
|
3
|
|
7
|
|
|
3
|
|
|
|
|
86
|
|
|
3
|
|
|
|
|
14
|
|
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
117
|
|
2
|
|
|
|
|
|
|
package Pegex; |
3
|
|
|
|
|
|
|
our $VERSION = '0.54'; |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
1514
|
use Pegex::Parser; |
|
3
|
|
|
|
|
46543
|
|
|
3
|
|
|
|
|
85
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
27
|
use Exporter 'import'; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
611
|
|
8
|
|
|
|
|
|
|
our @EXPORT = 'pegex'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub pegex { |
11
|
26
|
|
|
26
|
0
|
53
|
my ($grammar, $receiver) = @_; |
12
|
26
|
50
|
|
|
|
89
|
die "Argument 'grammar' required in function 'pegex'" |
13
|
|
|
|
|
|
|
unless $grammar; |
14
|
26
|
50
|
33
|
|
|
103
|
if (not ref $grammar or $grammar->isa('Pegex::Input')) { |
15
|
26
|
|
|
|
|
234
|
require Pegex::Grammar; |
16
|
26
|
|
|
|
|
182
|
$grammar = Pegex::Grammar->new(text => $grammar), |
17
|
|
|
|
|
|
|
} |
18
|
26
|
50
|
|
|
|
1475
|
if (not defined $receiver) { |
|
|
50
|
|
|
|
|
|
19
|
0
|
|
|
|
|
0
|
require Pegex::Tree::Wrap; |
20
|
0
|
|
|
|
|
0
|
$receiver = Pegex::Tree::Wrap->new; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
elsif (not ref $receiver) { |
23
|
26
|
|
|
|
|
1787
|
eval "require $receiver; 1"; |
24
|
26
|
|
|
|
|
263
|
$receiver = $receiver->new; |
25
|
|
|
|
|
|
|
} |
26
|
26
|
|
|
|
|
1481
|
return Pegex::Parser->new( |
27
|
|
|
|
|
|
|
grammar => $grammar, |
28
|
|
|
|
|
|
|
receiver => $receiver, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |