File Coverage

blib/lib/RPerl/Operation/Expression/Operator/Bitwise/Negation.pm
Criterion Covered Total %
statement 26 44 59.0
branch 1 4 25.0
condition n/a
subroutine 6 8 75.0
pod n/a
total 33 56 58.9


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