| 1 | 13 | ▶ | use strict; use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | package Pegex; | ||||||||||||||||||||||||||||
| 3 | 13 | our $VERSION = '0.75'; | |||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 13 | ▶ | use Pegex::Parser; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 13 | ▶ | use base 'Exporter'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 13 | our @EXPORT = 'pegex'; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 83 | ▶ | sub pegex { | ||||||||||||||||||||||||||
|
Subroutine
pegex: called CC=6 SCAR=18.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 83 | my ($grammar, $receiver) = @_; | |||||||||||||||||||||||||||
| 12 | 83 | ▶ | die "Argument 'grammar' required in function 'pegex'" | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 13 | unless $grammar; | ||||||||||||||||||||||||||||
| 14 | 83 | ▶ | if (not ref $grammar or $grammar->isa('Pegex::Input')) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not ref $grammar or $grammar->isa("Pegex::Input")
MC/DC0%0/2
not ref $grammar or $grammar->isa("Pegex::Input")
not ref $grammar
$grammar->isa("Pegex::Input")
Truth table66%2/3
not(A) or B
A= not ref $grammarB= $grammar->isa("Pegex::Input")
| |||||||||||||||||||||||||||||
| 15 | 83 | require Pegex::Grammar; | |||||||||||||||||||||||||||
| 16 | 83 | $grammar = Pegex::Grammar->new(text => $grammar), | |||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||
| 18 | 83 | ▶ | if (not defined $receiver) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 19 | 22 | require Pegex::Tree::Wrap; | |||||||||||||||||||||||||||
| 20 | 22 | $receiver = Pegex::Tree::Wrap->new; | |||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||
| 22 | elsif (not ref $receiver) { | ||||||||||||||||||||||||||||
| 23 | 61 | eval "require $receiver; 1"; | |||||||||||||||||||||||||||
| 24 | 61 | $receiver = $receiver->new; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | 83 | return Pegex::Parser->new( | |||||||||||||||||||||||||||
| 27 | grammar => $grammar, | ||||||||||||||||||||||||||||
| 28 | receiver => $receiver, | ||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 13 | 1; | |||||||||||||||||||||||||||