line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JavaScript::Code::Expression::Arithmetic;
|
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict;
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
57
|
|
4
|
2
|
|
|
2
|
|
8
|
use vars qw[ $VERSION @EXPORT_OK ];
|
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
84
|
|
5
|
2
|
|
|
|
|
1070
|
use base qw[
|
6
|
|
|
|
|
|
|
JavaScript::Code::Expression
|
7
|
|
|
|
|
|
|
JavaScript::Code::Expression::Node::Arithmetic
|
8
|
|
|
|
|
|
|
Exporter
|
9
|
2
|
|
|
2
|
|
8
|
];
|
|
2
|
|
|
|
|
2
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
@EXPORT_OK = qw[ ADD SUB MUL DIV ];
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
$VERSION = '0.08';
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 NAME
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
JavaScript::Code::Expression::Arithmetic - A JavaScript Arithmetic Expression
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 METHODS
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=cut
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 $self->addition( ... )
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=cut
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub addition {
|
28
|
0
|
|
|
0
|
1
|
|
my $e = __PACKAGE__->new;
|
29
|
0
|
|
|
|
|
|
$e->command( 'Addition', @_ );
|
30
|
0
|
|
|
|
|
|
return $e;
|
31
|
|
|
|
|
|
|
}
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head2 $self->subtraction( ... )
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub subtraction {
|
38
|
0
|
|
|
0
|
1
|
|
my $e = __PACKAGE__->new;
|
39
|
0
|
|
|
|
|
|
$e->command( 'Subtraction', @_ );
|
40
|
0
|
|
|
|
|
|
return $e;
|
41
|
|
|
|
|
|
|
}
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 $self->multiplication( ... )
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub multiplication {
|
48
|
0
|
|
|
0
|
1
|
|
my $e = __PACKAGE__->new;
|
49
|
0
|
|
|
|
|
|
$e->command( 'Multiplication', @_ );
|
50
|
0
|
|
|
|
|
|
return $e;
|
51
|
|
|
|
|
|
|
}
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 $self->division( ... )
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub division {
|
58
|
0
|
|
|
0
|
1
|
|
my $e = __PACKAGE__->new;
|
59
|
0
|
|
|
|
|
|
$e->command( 'Division', @_ );
|
60
|
0
|
|
|
|
|
|
return $e;
|
61
|
|
|
|
|
|
|
}
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 ADD
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 SUB
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 MUL
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 DIV
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub ADD { &addition }
|
72
|
|
|
|
|
|
|
sub SUB { &subtraction }
|
73
|
|
|
|
|
|
|
sub MUL { &multiplication }
|
74
|
|
|
|
|
|
|
sub DIV { &division }
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 SEE ALSO
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
L
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 AUTHOR
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Sascha Kiefer, C
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 LICENSE
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under
|
87
|
|
|
|
|
|
|
the same terms as Perl itself.
|
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=cut
|
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
1;
|