line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
7
|
|
|
7
|
|
362867
|
use strict; use warnings; |
|
7
|
|
|
7
|
|
57
|
|
|
7
|
|
|
|
|
166
|
|
|
7
|
|
|
|
|
30
|
|
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
303
|
|
2
|
|
|
|
|
|
|
package Pegex; |
3
|
|
|
|
|
|
|
our $VERSION = '0.73'; |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
2416
|
use Pegex::Parser; |
|
7
|
|
|
|
|
43
|
|
|
7
|
|
|
|
|
203
|
|
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
41
|
use base 'Exporter'; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
1961
|
|
8
|
|
|
|
|
|
|
our @EXPORT = 'pegex'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub pegex { |
11
|
7
|
|
|
7
|
0
|
739
|
my ($grammar, $receiver) = @_; |
12
|
7
|
50
|
|
|
|
22
|
die "Argument 'grammar' required in function 'pegex'" |
13
|
|
|
|
|
|
|
unless $grammar; |
14
|
7
|
50
|
66
|
|
|
35
|
if (not ref $grammar or $grammar->isa('Pegex::Input')) { |
15
|
7
|
|
|
|
|
2049
|
require Pegex::Grammar; |
16
|
7
|
|
|
|
|
37
|
$grammar = Pegex::Grammar->new(text => $grammar), |
17
|
|
|
|
|
|
|
} |
18
|
7
|
100
|
|
|
|
27
|
if (not defined $receiver) { |
|
|
50
|
|
|
|
|
|
19
|
6
|
|
|
|
|
1605
|
require Pegex::Tree::Wrap; |
20
|
6
|
|
|
|
|
32
|
$receiver = Pegex::Tree::Wrap->new; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
elsif (not ref $receiver) { |
23
|
1
|
|
|
|
|
56
|
eval "require $receiver; 1"; |
24
|
1
|
|
|
|
|
12
|
$receiver = $receiver->new; |
25
|
|
|
|
|
|
|
} |
26
|
7
|
|
|
|
|
40
|
return Pegex::Parser->new( |
27
|
|
|
|
|
|
|
grammar => $grammar, |
28
|
|
|
|
|
|
|
receiver => $receiver, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |