line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VIC::Parser; |
2
|
33
|
|
|
33
|
|
180
|
use strict; |
|
33
|
|
|
|
|
53
|
|
|
33
|
|
|
|
|
811
|
|
3
|
33
|
|
|
33
|
|
128
|
use warnings; |
|
33
|
|
|
|
|
55
|
|
|
33
|
|
|
|
|
1225
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.32'; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
|
|
|
|
|
|
|
8
|
33
|
|
|
33
|
|
13278
|
use Pegex::Base; |
|
33
|
|
|
|
|
48742
|
|
|
33
|
|
|
|
|
112
|
|
9
|
|
|
|
|
|
|
extends 'Pegex::Parser'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub match_ref { |
12
|
35016
|
|
|
35016
|
0
|
1088635
|
my ($self, $ref, $parent) = @_; |
13
|
|
|
|
|
|
|
# create a stack to track who is the parent of the current element being |
14
|
|
|
|
|
|
|
# matched |
15
|
35016
|
|
100
|
|
|
52140
|
my $stack = $self->{stack} ||= []; |
16
|
35016
|
|
|
|
|
37792
|
push @$stack, $ref; |
17
|
35016
|
|
|
|
|
50517
|
my $rc = $self->SUPER::match_ref($ref, $parent); |
18
|
35009
|
|
|
|
|
885284
|
pop @$stack; |
19
|
35009
|
|
|
|
|
46801
|
return $rc; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# easy access to the stack |
23
|
431
|
|
|
431
|
0
|
2639
|
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 |