line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
7
|
|
|
7
|
|
439361
|
use strict; use warnings; |
|
7
|
|
|
7
|
|
82
|
|
|
7
|
|
|
|
|
200
|
|
|
7
|
|
|
|
|
35
|
|
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
350
|
|
2
|
|
|
|
|
|
|
package Pegex; |
3
|
|
|
|
|
|
|
our $VERSION = '0.75'; |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
2979
|
use Pegex::Parser; |
|
7
|
|
|
|
|
48
|
|
|
7
|
|
|
|
|
236
|
|
6
|
|
|
|
|
|
|
|
7
|
7
|
|
|
7
|
|
52
|
use base 'Exporter'; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
2192
|
|
8
|
|
|
|
|
|
|
our @EXPORT = 'pegex'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub pegex { |
11
|
7
|
|
|
7
|
0
|
917
|
my ($grammar, $receiver) = @_; |
12
|
7
|
50
|
|
|
|
26
|
die "Argument 'grammar' required in function 'pegex'" |
13
|
|
|
|
|
|
|
unless $grammar; |
14
|
7
|
50
|
66
|
|
|
37
|
if (not ref $grammar or $grammar->isa('Pegex::Input')) { |
15
|
7
|
|
|
|
|
2407
|
require Pegex::Grammar; |
16
|
7
|
|
|
|
|
51
|
$grammar = Pegex::Grammar->new(text => $grammar), |
17
|
|
|
|
|
|
|
} |
18
|
7
|
100
|
|
|
|
36
|
if (not defined $receiver) { |
|
|
50
|
|
|
|
|
|
19
|
6
|
|
|
|
|
2033
|
require Pegex::Tree::Wrap; |
20
|
6
|
|
|
|
|
40
|
$receiver = Pegex::Tree::Wrap->new; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
elsif (not ref $receiver) { |
23
|
1
|
|
|
|
|
67
|
eval "require $receiver; 1"; |
24
|
1
|
|
|
|
|
15
|
$receiver = $receiver->new; |
25
|
|
|
|
|
|
|
} |
26
|
7
|
|
|
|
|
58
|
return Pegex::Parser->new( |
27
|
|
|
|
|
|
|
grammar => $grammar, |
28
|
|
|
|
|
|
|
receiver => $receiver, |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |