line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
7
|
|
|
7
|
|
368949
|
use strict; use warnings; |
|
7
|
|
|
7
|
|
55
|
|
|
7
|
|
|
|
|
206
|
|
|
7
|
|
|
|
|
32
|
|
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
304
|
|
2
|
|
|
|
|
|
|
package Pegex; |
3
|
|
|
|
|
|
|
our $VERSION = '0.74'; |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
2452
|
use Pegex::Parser; |
|
7
|
|
|
|
|
41
|
|
|
7
|
|
|
|
|
202
|
|
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
42
|
use base 'Exporter'; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
1841
|
|
8
|
|
|
|
|
|
|
our @EXPORT = 'pegex'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub pegex { |
11
|
7
|
|
|
7
|
0
|
750
|
my ($grammar, $receiver) = @_; |
12
|
7
|
50
|
|
|
|
23
|
die "Argument 'grammar' required in function 'pegex'" |
13
|
|
|
|
|
|
|
unless $grammar; |
14
|
7
|
50
|
66
|
|
|
40
|
if (not ref $grammar or $grammar->isa('Pegex::Input')) { |
15
|
7
|
|
|
|
|
2062
|
require Pegex::Grammar; |
16
|
7
|
|
|
|
|
36
|
$grammar = Pegex::Grammar->new(text => $grammar), |
17
|
|
|
|
|
|
|
} |
18
|
7
|
100
|
|
|
|
29
|
if (not defined $receiver) { |
|
|
50
|
|
|
|
|
|
19
|
6
|
|
|
|
|
1725
|
require Pegex::Tree::Wrap; |
20
|
6
|
|
|
|
|
35
|
$receiver = Pegex::Tree::Wrap->new; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
elsif (not ref $receiver) { |
23
|
1
|
|
|
|
|
50
|
eval "require $receiver; 1"; |
24
|
1
|
|
|
|
|
13
|
$receiver = $receiver->new; |
25
|
|
|
|
|
|
|
} |
26
|
7
|
|
|
|
|
39
|
return Pegex::Parser->new( |
27
|
|
|
|
|
|
|
grammar => $grammar, |
28
|
|
|
|
|
|
|
receiver => $receiver, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |