line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
2
|
|
|
|
|
|
|
package RPerl::Operation::Expression::Operator::Arithmetic::MultiplyDivideModulo; |
3
|
5
|
|
|
5
|
|
36
|
use strict; |
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
139
|
|
4
|
5
|
|
|
5
|
|
33
|
use warnings; |
|
5
|
|
|
|
|
13
|
|
|
5
|
|
|
|
|
137
|
|
5
|
5
|
|
|
5
|
|
33
|
use RPerl::AfterSubclass; |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
737
|
|
6
|
|
|
|
|
|
|
our $VERSION = 0.002_000; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# [[[ OO INHERITANCE ]]] |
9
|
5
|
|
|
5
|
|
41
|
use parent qw(RPerl::Operation::Expression::Operator::Arithmetic); |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
30
|
|
10
|
5
|
|
|
5
|
|
333
|
use RPerl::Operation::Expression::Operator::Arithmetic; |
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
1972
|
|
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
|
|
|
|
|
|
|
our string_hashref::method $ast_to_rperl__generate = sub { |
22
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
23
|
|
|
|
|
|
|
my string_hashref $rperl_source_group = { PMC => q{} }; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# RPerl::diag( 'in Operator::Arithmetic::MultiplyDivideModulo->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my string $self_class = ref $self; |
28
|
|
|
|
|
|
|
if ( $self_class eq 'Operator_95' ) { # Operator -> SubExpression OP07_MATH_MULT_DIV_MOD SubExpression |
29
|
|
|
|
|
|
|
my string_hashref $rperl_source_subgroup = $self->{children}->[0]->ast_to_rperl__generate($modes); |
30
|
|
|
|
|
|
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
31
|
|
|
|
|
|
|
$rperl_source_group->{PMC} .= q{ } . $self->{children}->[1] . q{ }; |
32
|
|
|
|
|
|
|
$rperl_source_subgroup = $self->{children}->[2]->ast_to_rperl__generate($modes); |
33
|
|
|
|
|
|
|
RPerl::Generator::source_group_append( $rperl_source_group, $rperl_source_subgroup ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
else { |
36
|
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
37
|
|
|
|
|
|
|
'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule ' |
38
|
|
|
|
|
|
|
. $self_class |
39
|
|
|
|
|
|
|
. ' found where Operator_95 expected, dying' ) |
40
|
|
|
|
|
|
|
. "\n"; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
return $rperl_source_group; |
44
|
|
|
|
|
|
|
}; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
our string_hashref::method $ast_to_cpp__generate__CPPOPS_PERLTYPES = sub { |
47
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
48
|
|
|
|
|
|
|
my string_hashref $cpp_source_group |
49
|
|
|
|
|
|
|
= { |
50
|
|
|
|
|
|
|
CPP => q{// <<< RP::O::E::O::M::MDM __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>} |
51
|
|
|
|
|
|
|
. "\n" |
52
|
|
|
|
|
|
|
}; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
#... |
55
|
|
|
|
|
|
|
return $cpp_source_group; |
56
|
|
|
|
|
|
|
}; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# DEV NOTE: PERLOPS_PERLTYPES & CPPOPS_CPPTYPES code generation are exactly equivalent |
59
|
|
|
|
|
|
|
our string_hashref::method $ast_to_cpp__generate__CPPOPS_CPPTYPES = sub { |
60
|
|
|
|
|
|
|
( my object $self, my string_hashref $modes) = @_; |
61
|
|
|
|
|
|
|
my string_hashref $cpp_source_group = { CPP => q{} }; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# RPerl::diag( 'in Operator::Arithmetic::MultiplyDivideModulo->ast_to_cpp__generate__CPPOPS_CPPTYPES(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" ); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
my string $self_class = ref $self; |
66
|
|
|
|
|
|
|
if ( $self_class eq 'Operator_95' ) { # Operator -> SubExpression OP07_MATH_MULT_DIV_MOD SubExpression |
67
|
|
|
|
|
|
|
my string_hashref $cpp_source_subgroup = $self->{children}->[0]->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
68
|
|
|
|
|
|
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
69
|
|
|
|
|
|
|
$cpp_source_group->{CPP} .= q{ } . $self->{children}->[1] . q{ }; |
70
|
|
|
|
|
|
|
$cpp_source_subgroup = $self->{children}->[2]->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes); |
71
|
|
|
|
|
|
|
RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup ); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
else { |
74
|
|
|
|
|
|
|
die RPerl::Parser::rperl_rule__replace( |
75
|
|
|
|
|
|
|
'ERROR ECOGEASCP00, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule ' |
76
|
|
|
|
|
|
|
. $self_class |
77
|
|
|
|
|
|
|
. ' found where Operator_95 expected, dying' ) |
78
|
|
|
|
|
|
|
. "\n"; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
return $cpp_source_group; |
82
|
|
|
|
|
|
|
}; |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; # end of class |