line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VIC::Parser; |
2
|
33
|
|
|
33
|
|
126
|
use strict; |
|
33
|
|
|
|
|
38
|
|
|
33
|
|
|
|
|
748
|
|
3
|
33
|
|
|
33
|
|
101
|
use warnings; |
|
33
|
|
|
|
|
34
|
|
|
33
|
|
|
|
|
1294
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.29'; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
|
|
|
|
|
|
|
8
|
33
|
|
|
33
|
|
12728
|
use Pegex::Base; |
|
33
|
|
|
|
|
41709
|
|
|
33
|
|
|
|
|
321
|
|
9
|
|
|
|
|
|
|
extends 'Pegex::Parser'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub match_ref { |
12
|
35016
|
|
|
35016
|
0
|
704916
|
my ($self, $ref, $parent) = @_; |
13
|
|
|
|
|
|
|
# create a stack to track who is the parent of the current element being |
14
|
|
|
|
|
|
|
# matched |
15
|
35016
|
|
100
|
|
|
48745
|
my $stack = $self->{stack} ||= []; |
16
|
35016
|
|
|
|
|
27542
|
push @$stack, $ref; |
17
|
35016
|
|
|
|
|
43871
|
my $rc = $self->SUPER::match_ref($ref, $parent); |
18
|
35009
|
|
|
|
|
601784
|
pop @$stack; |
19
|
35009
|
|
|
|
|
40518
|
return $rc; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# easy access to the stack |
23
|
431
|
|
|
431
|
0
|
2175
|
sub stack { shift->{stack}; } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
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 |
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 |