VIC/Parser.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 93.3% 28 / 30 SCAR 6.9
CC
2
Cov
100%
match_ref
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« VIC/PIC/P16F677.pm ↑ Summary VIC/Grammar.pm »
1 package VIC::Parser;
2 33 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 33 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 33 our $VERSION = '0.29';
6 33 $VERSION = eval $VERSION;
7  
8 33 ▶use Pegex::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 33 extends 'Pegex::Parser';
10  
11 sub match_ref {
12 35016 ▶ my ($self, $ref, $parent) = @_;
Subroutine match_ref: called CC=2 SCAR=6.9
Pod undocumented
13 # create a stack to track who is the parent of the current element being
14 # matched
15 35016 ▶ my $stack = $self->{stack} ||= [];
Condition100%2/2
$self->{"stack"} ||= []
l!l
3498333
MC/DC100%1/1
$self->{"stack"} ||= []
$self->{"stack"}
Truth table100%2/2
A
A= $self->{"stack"}
Aresult
11
00
16 35016 push @$stack, $ref;
17 35016 my $rc = $self->SUPER::match_ref($ref, $parent);
18 35009 pop @$stack;
19 35009 return $rc;
20 }
21  
22 # easy access to the stack
23 431 ▶sub stack { shift->{stack}; }
Subroutine stack: called CC=1 SCAR=0.0
Pod undocumented
24  
25 33 1;
26  
27 =encoding utf8
28  
29 =head1 NAME
30  
31 VIC::Parser
32  
33 =head1 SYNOPSIS
34  
35 The Pegex::Parser class for handling the parser with some modifications.
36  
37 =head1 DESCRIPTION
38  
39 INTERNAL CLASS.
40  
41 =head1 AUTHOR
42  
43 Vikas N Kumar <vikas@cpan.org>
44  
45 =head1 COPYRIGHT
46  
47 Copyright (c) 2014. Vikas N Kumar
48  
49 This program is free software; you can redistribute it and/or modify it
50 under the same terms as Perl itself.
51  
52 See http://www.perl.com/perl/misc/Artistic.html
53  
54 =cut
« VIC/PIC/P16F677.pm ↑ Summary VIC/Grammar.pm »