line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VIC::Parser; |
2
|
33
|
|
|
33
|
|
126
|
use strict; |
|
33
|
|
|
|
|
45
|
|
|
33
|
|
|
|
|
903
|
|
3
|
33
|
|
|
33
|
|
112
|
use warnings; |
|
33
|
|
|
|
|
42
|
|
|
33
|
|
|
|
|
1487
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.31'; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
|
|
|
|
|
|
|
8
|
33
|
|
|
33
|
|
12717
|
use Pegex::Base; |
|
33
|
|
|
|
|
44695
|
|
|
33
|
|
|
|
|
347
|
|
9
|
|
|
|
|
|
|
extends 'Pegex::Parser'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub match_ref { |
12
|
35016
|
|
|
35016
|
0
|
720879
|
my ($self, $ref, $parent) = @_; |
13
|
|
|
|
|
|
|
# create a stack to track who is the parent of the current element being |
14
|
|
|
|
|
|
|
# matched |
15
|
35016
|
|
100
|
|
|
49283
|
my $stack = $self->{stack} ||= []; |
16
|
35016
|
|
|
|
|
28046
|
push @$stack, $ref; |
17
|
35016
|
|
|
|
|
44551
|
my $rc = $self->SUPER::match_ref($ref, $parent); |
18
|
35009
|
|
|
|
|
614535
|
pop @$stack; |
19
|
35009
|
|
|
|
|
40891
|
return $rc; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# easy access to the stack |
23
|
431
|
|
|
431
|
0
|
2152
|
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 |