line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Header: /home/fergal/my/cvs/Code-Perl/lib/Code/Perl/Expr/DerefArray.pm,v 1.1 2003/06/17 14:14:21 fergal Exp $ |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Code::Perl::Expr::DerefArray; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
5
|
use base qw( Code::Perl::Expr::Base ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
94
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
use Class::MethodMaker ( |
10
|
1
|
|
|
|
|
8
|
get_set => [qw( -java Index Ref )] |
11
|
1
|
|
|
1
|
|
4
|
); |
|
1
|
|
|
|
|
2
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub eval |
14
|
|
|
|
|
|
|
{ |
15
|
2
|
|
|
2
|
0
|
3
|
my $self = shift; |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
324
|
my $array = $self->getRef->eval; |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
65
|
return $array->[$self->getIndex->eval]; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub perl |
23
|
|
|
|
|
|
|
{ |
24
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
70
|
my $array_perl = $self->getRef->perl; |
27
|
|
|
|
|
|
|
|
28
|
2
|
|
|
|
|
193
|
my $index = $self->getIndex->perl; |
29
|
2
|
|
|
|
|
31
|
return "($array_perl)->[$index]"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |