File Coverage

blib/lib/RPerl/Operation/Expression/Operator/Bitwise/Shift.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::Bitwise::Shift;
3 5     5   44 use strict;
  5         12  
  5         126  
4 5     5   27 use warnings;
  5         12  
  5         100  
5 5     5   39 use RPerl::AfterSubclass;
  5         12  
  5         643  
6             our $VERSION = 0.001_000;
7              
8             # [[[ OO INHERITANCE ]]]
9 5     5   35 use parent qw(RPerl::Operation::Expression::Operator::Bitwise);
  5         9  
  5         32  
10 5     5   292 use RPerl::Operation::Expression::Operator::Bitwise;
  5         12  
  5         1382  
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::Shift->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_98' ) { # Operator -> SubExpression OP09_BITWISE_SHIFT SubExpression
29             my string_hashref $rperl_source_subgroup
30             = $self->{children}->[0]->ast_to_rperl__generate($modes);
31             RPerl::Generator::source_group_append( $rperl_source_group,
32             $rperl_source_subgroup );
33             $rperl_source_group->{PMC} .= q{ } . $self->{children}->[1] . q{ };
34             $rperl_source_subgroup
35             = $self->{children}->[2]->ast_to_rperl__generate($modes);
36             RPerl::Generator::source_group_append( $rperl_source_group,
37             $rperl_source_subgroup );
38             }
39             else {
40             die RPerl::Parser::rperl_rule__replace(
41             'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule '
42             . $self_class
43             . ' found where Operator_98 expected, dying' )
44             . "\n";
45             }
46              
47             return $rperl_source_group;
48             };
49              
50             our string_hashref::method $ast_to_cpp__generate__CPPOPS_PERLTYPES = sub {
51             ( my object $self, my string_hashref $modes) = @_;
52             my string_hashref $cpp_source_group
53             = { CPP =>
54             q{// <<< RP::O::E::O::B::S __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>}
55             . "\n" };
56              
57             #...
58             return $cpp_source_group;
59             };
60              
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
64             = { CPP =>
65             q{// <<< RP::O::E::O::B::S __DUMMY_SOURCE_CODE CPPOPS_CPPTYPES >>>}
66             . "\n" };
67              
68             #...
69             return $cpp_source_group;
70             };
71              
72             1; # end of class