line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
2
|
|
|
|
|
|
|
package RPerl::Operation::Expression::Operator::Arithmetic::MultiplyDivideModulo; |
3
|
4
|
|
|
4
|
|
27
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
110
|
|
4
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
94
|
|
5
|
4
|
|
|
4
|
|
23
|
use RPerl::AfterSubclass; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
546
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.002_000; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# [[[ OO INHERITANCE ]]] |
9
|
4
|
|
|
4
|
|
27
|
use parent qw(RPerl::Operation::Expression::Operator::Arithmetic); |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
24
|
|
10
|
4
|
|
|
4
|
|
223
|
use RPerl::Operation::Expression::Operator::Arithmetic; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
1263
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# [[[ CRITICS ]]] |
13
|
|
|
|
|
|
|
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator |
14
|
|
|
|
|
|
|
## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# [[[ OO PROPERTIES ]]] |
17
|
|
|
|
|
|
|
our hashref $properties = {}; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# [[[ SUBROUTINES & OO METHODS ]]] |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub ast_to_rperl__generate { |
22
|
134
|
|
|
134
|
|
357
|
{ my string_hashref::method $RETURN_TYPE }; |
|
134
|
|
|
|
|
342
|
|
23
|
134
|
|
|
|
|
456
|
( my object $self, my string_hashref $modes) = @ARG; |
24
|
134
|
|
|
|
|
539
|
my string_hashref $rperl_source_group = { PMC => q{} }; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# RPerl::diag( 'in Operator::Arithmetic::MultiplyDivideModulo->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
27
|
|
|
|
|
|
|
|
28
|
134
|
|
|
|
|
368
|
my string $self_class = ref $self; |
29
|
134
|
50
|
|
|
|
599
|
if ( $self_class eq 'Operator_106' ) { # Operator -> SubExpression OP07_MATH_MULT_DIV_MOD SubExpression |
30
|
134
|
|
|
|
|
2872
|
my string_hashref $rperl_source_subgroup = $self->{children}->[0]->ast_to_rperl__generate($modes); |
31
|
134
|
|
|
|
|
2815
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
32
|
134
|
|
|
|
|
519
|
$rperl_source_group->{PMC} .= q{ } . $self->{children}->[1] . q{ }; |
33
|
134
|
|
|
|
|
3059
|
$rperl_source_subgroup = $self->{children}->[2]->ast_to_rperl__generate($modes); |
34
|
134
|
|
|
|
|
3093
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
else { |
37
|
0
|
|
|
|
|
0
|
die RPerl::Parser::rperl_rule__replace( |
38
|
|
|
|
|
|
|
'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
39
|
|
|
|
|
|
|
. $self_class |
40
|
|
|
|
|
|
|
. ' found where Operator_106 expected, dying' ) |
41
|
|
|
|
|
|
|
. "\n"; |
42
|
|
|
|
|
|
|
} |
43
|
134
|
|
|
|
|
820
|
return $rperl_source_group; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub ast_to_cpp__generate__CPPOPS_PERLTYPES { |
47
|
0
|
|
|
0
|
|
0
|
{ my string_hashref::method $RETURN_TYPE }; |
|
0
|
|
|
|
|
0
|
|
48
|
0
|
|
|
|
|
0
|
( my object $self, my string_hashref $modes) = @ARG; |
49
|
0
|
|
|
|
|
0
|
my string_hashref $cpp_source_group |
50
|
|
|
|
|
|
|
= { |
51
|
|
|
|
|
|
|
CPP => q{// <<< RP::O::E::O::M::MDM __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>} |
52
|
|
|
|
|
|
|
. "\n" |
53
|
|
|
|
|
|
|
}; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
#... |
56
|
0
|
|
|
|
|
0
|
return $cpp_source_group; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# DEV NOTE: PERLOPS_PERLTYPES & CPPOPS_CPPTYPES code generation are exactly equivalent |
60
|
|
|
|
|
|
|
sub ast_to_cpp__generate__CPPOPS_CPPTYPES { |
61
|
8
|
|
|
8
|
|
17
|
{ my string_hashref::method $RETURN_TYPE }; |
|
8
|
|
|
|
|
17
|
|
62
|
8
|
|
|
|
|
19
|
( my object $self, my string_hashref $modes) = @ARG; |
63
|
8
|
|
|
|
|
24
|
my string_hashref $cpp_source_group = { CPP => q{} }; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# RPerl::diag( 'in Operator::Arithmetic::MultiplyDivideModulo->ast_to_cpp__generate__CPPOPS_CPPTYPES(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
66
|
|
|
|
|
|
|
|
67
|
8
|
|
|
|
|
19
|
my string $self_class = ref $self; |
68
|
8
|
50
|
|
|
|
19
|
if ( $self_class eq 'Operator_106' ) { # Operator -> SubExpression OP07_MATH_MULT_DIV_MOD SubExpression |
69
|
8
|
|
|
|
|
454
|
my string_hashref $cpp_source_subgroup = $self->{children}->[0]->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
70
|
8
|
|
|
|
|
156
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
71
|
8
|
|
|
|
|
33
|
$cpp_source_group->{CPP} .= q{ } . $self->{children}->[1] . q{ }; |
72
|
8
|
|
|
|
|
162
|
$cpp_source_subgroup = $self->{children}->[2]->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
73
|
8
|
|
|
|
|
164
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
else { |
76
|
0
|
|
|
|
|
0
|
die RPerl::Parser::rperl_rule__replace( |
77
|
|
|
|
|
|
|
'ERROR ECOGEASCP00, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule ' |
78
|
|
|
|
|
|
|
. $self_class |
79
|
|
|
|
|
|
|
. ' found where Operator_106 expected, dying' ) |
80
|
|
|
|
|
|
|
. "\n"; |
81
|
|
|
|
|
|
|
} |
82
|
8
|
|
|
|
|
35
|
return $cpp_source_group; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; # end of class |