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