File Coverage

blib/lib/RPerl/Operation/Expression/SubroutineCall/MethodCall/ConstructorCall.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::SubroutineCall::MethodCall::ConstructorCall;
3 5     5   36 use strict;
  5         12  
  5         144  
4 5     5   30 use warnings;
  5         13  
  5         119  
5 5     5   31 use RPerl::AfterSubclass;
  5         14  
  5         743  
6             our $VERSION = 0.002_000;
7              
8             # [[[ OO INHERITANCE ]]]
9 5     5   40 use parent qw(RPerl::Operation::Expression::SubroutineCall::MethodCall);
  5         14  
  5         39  
10 5     5   414 use RPerl::Operation::Expression::SubroutineCall::MethodCall;
  5         18  
  5         1741  
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 ConstructorCall->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" );
26              
27             if ( ( ref $self ) ne 'Expression_134' ) {
28             die RPerl::Parser::rperl_rule__replace(
29             'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule '
30             . ( ref $self )
31             . ' found where Expression_134 expected, dying' )
32             . "\n";
33             }
34              
35             # Expression -> WordScoped OP02_METHOD_THINARROW_NEW ')'
36             my object $type = $self->{children}->[0];
37             my string $thin_arrow_new_left_paren = $self->{children}->[1];
38             my string $right_paren = $self->{children}->[2];
39              
40             $rperl_source_group->{PMC}
41             .= $type->{children}->[0] . $thin_arrow_new_left_paren . $right_paren;
42             return $rperl_source_group;
43             };
44              
45             our string_hashref::method $ast_to_cpp__generate__CPPOPS_PERLTYPES = sub {
46             ( my object $self, my string_hashref $modes) = @_;
47             my string_hashref $cpp_source_group
48             = { CPP =>
49             q{// <<< RP::O::E::SC::MC::CC __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>}
50             . "\n" };
51              
52             #...
53             return $cpp_source_group;
54             };
55              
56             our string_hashref::method $ast_to_cpp__generate__CPPOPS_CPPTYPES = sub {
57             ( my object $self, my string_hashref $modes) = @_;
58             # RPerl::diag( 'in ConstructorCall->ast_to_cpp__generate__CPPOPS_CPPTYPES(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" );
59            
60             my string_hashref $cpp_source_group = { CPP => q{} };
61              
62             if ( ( ref $self ) ne 'Expression_134' ) {
63             die RPerl::Parser::rperl_rule__replace(
64             'ERROR ECOGEASCP00, CODE GENERATOR, ABSTRACT SYNTAX TO C++: Grammar rule '
65             . ( ref $self )
66             . ' found where Expression_134 expected, dying' )
67             . "\n";
68             }
69              
70             # Expression -> WordScoped OP02_METHOD_THINARROW_NEW ')'
71             my object $type = $self->{children}->[0]->{children}->[0];
72             $type = RPerl::Generator::type_convert_perl_to_cpp($type, 0); # $pointerify_classes = 0
73              
74             $cpp_source_group->{CPP} .= 'new ' . $type;
75             return $cpp_source_group;
76             };
77              
78             1; # end of class