File Coverage

blib/lib/RPerl/Operation/Expression/Operator.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;
3 5     5   1913 use strict;
  5         15  
  5         125  
4 5     5   25 use warnings;
  5         12  
  5         106  
5 5     5   23 use RPerl::AfterSubclass;
  5         12  
  5         607  
6             our $VERSION = 0.002_000;
7              
8             # [[[ OO INHERITANCE ]]]
9 5     5   33 use parent qw(RPerl::Operation::Expression);
  5         12  
  5         30  
10 5     5   933 use RPerl::Operation::Expression;
  5         12  
  5         1309  
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->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 'Expression_129' ) {
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             }
32             else {
33             die RPerl::Parser::rperl_rule__replace(
34             'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule '
35             . $self_class
36             . ' found where Expression_129 expected, dying' )
37             . "\n";
38             }
39              
40             return $rperl_source_group;
41             };
42              
43             our string_hashref::method $ast_to_cpp__generate__CPPOPS_PERLTYPES = sub {
44             ( my object $self, my string_hashref $modes) = @_;
45             my string_hashref $cpp_source_group
46             = {
47             CPP => q{// <<< RP::O::E::O __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>}
48             . "\n"
49             };
50              
51             #...
52             return $cpp_source_group;
53             };
54              
55             our string_hashref::method $ast_to_cpp__generate__CPPOPS_CPPTYPES = sub {
56             ( my object $self, my string_hashref $modes) = @_;
57             my string_hashref $cpp_source_group = { CPP => q{} };
58              
59             # RPerl::diag( 'in Operator->ast_to_cpp__generate__CPPOPS_CPPTYPES(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" );
60              
61             my string $self_class = ref $self;
62             if ( $self_class eq 'Expression_129' ) {
63             my string_hashref $cpp_source_subgroup = $self->{children}->[0]->ast_to_cpp__generate__CPPOPS_CPPTYPES($modes);
64             # RPerl::diag( 'in Operator->ast_to_cpp__generate__CPPOPS_CPPTYPES(), have $cpp_source_subgroup = ' . "\n" . RPerl::Parser::rperl_ast__dump($cpp_source_subgroup) . "\n" );
65             RPerl::Generator::source_group_append( $cpp_source_group, $cpp_source_subgroup );
66             }
67             else {
68             die RPerl::Parser::rperl_rule__replace(
69             'ERROR ECOGEASCP00, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule '
70             . $self_class
71             . ' found where Expression_129 expected, dying' )
72             . "\n";
73             }
74              
75             return $cpp_source_group;
76             };
77              
78             1; # end of class