File Coverage

blib/lib/RPerl/Operation/Expression/Operator/Logical/Negation.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


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