File Coverage

blib/lib/RPerl/Operation/Expression/Operator/Named/Pop.pm
Criterion Covered Total %
statement 34 48 70.8
branch 2 8 25.0
condition n/a
subroutine 9 11 81.8
pod n/a
total 45 67 67.1


line stmt bran cond sub pod time code
1             # [[[ DOCUMENTATION ]]]
2             # http://perldoc.perl.org/functions/pop.html
3             # SUPPORTED: pop ARRAY
4             # NOT SUPPORTED: pop
5              
6             # [[[ HEADER ]]]
7             package RPerl::Operation::Expression::Operator::Named::Pop;
8 4     4   28 use strict;
  4         10  
  4         109  
9 4     4   19 use warnings;
  4         18  
  4         84  
10 4     4   19 use RPerl::AfterSubclass;
  4         8  
  4         504  
11             our $VERSION = 0.002_100;
12              
13             # [[[ OO INHERITANCE ]]]
14 4     4   26 use parent qw(RPerl::Operation::Expression::Operator::Named);
  4         8  
  4         23  
15 4     4   223 use RPerl::Operation::Expression::Operator::Named;
  4         8  
  4         116  
16              
17             # [[[ CRITICS ]]]
18             ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator
19             ## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils
20             ## no critic qw(ProhibitConstantPragma ProhibitMagicNumbers) # USER DEFAULT 3: allow constants
21              
22             # [[[ CONSTANTS ]]]
23 4     4   20 use constant NAME => my string $TYPED_NAME = 'pop';
  4         7  
  4         207  
24 4     4   27 use constant ARGUMENTS_MIN => my integer $TYPED_ARGUMENTS_MIN = 1;
  4         10  
  4         177  
25 4     4   20 use constant ARGUMENTS_MAX => my integer $TYPED_ARGUMENTS_MAX = 1;
  4         10  
  4         1335  
26              
27             # [[[ OO PROPERTIES ]]]
28             our hashref $properties = {};
29              
30             # [[[ SUBROUTINES & OO METHODS ]]]
31              
32             sub ast_to_rperl__generate {
33 4     4   11 { my string_hashref::method $RETURN_TYPE };
  4         13  
34 4         19 ( my object $self, my object $operator_named, my string_hashref $modes)
35             = @ARG;
36 4         17 my string_hashref $rperl_source_group = { PMC => q{} };
37              
38             # RPerl::diag( 'in Operator::Named::Pop->ast_to_rperl__generate(), received $self = ' . "\n" . RPerl::Parser::rperl_ast__dump($self) . "\n" );
39             # RPerl::diag( 'in Operator::Named::Pop->ast_to_rperl__generate(), received $operator_named = ' . "\n" . RPerl::Parser::rperl_ast__dump($operator_named) . "\n" );
40              
41 4         14 my string $operator_named_class = ref $operator_named;
42 4 50       27 if ( $operator_named_class eq 'Operation_90' ) { # Operation -> OP01_NAMED_SCOLON
    50          
    0          
    0          
43             die RPerl::Parser::rperl_rule__replace(
44             'ERROR ECOGEASRP16, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Named operator '
45 0         0 . $operator_named->{children}->[0]
46             . ' requires exactly one argument, dying' )
47             . "\n";
48             }
49             elsif ( $operator_named_class eq 'Operator_94' ) { # Operator -> OP01_NAMED SubExpression
50 4         19 $rperl_source_group->{PMC} .= $operator_named->{children}->[0] . q{ };
51             my string_hashref $rperl_source_subgroup
52 4         103 = $operator_named->{children}->[1]
53             ->ast_to_rperl__generate( $modes, $self );
54 4         105 RPerl::Generator::source_group_append( $rperl_source_group,
55             $rperl_source_subgroup );
56             }
57             elsif ( $operator_named_class eq 'Operator_95' ) { # Operator -> LPAREN OP01_NAMED ListElement OP21_LIST_COMMA ListElements ')'
58             die RPerl::Parser::rperl_rule__replace(
59             'ERROR ECOGEASRP14, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Named operator '
60 0         0 . $operator_named->{children}->[1]
61             . ' does not accept multiple arguments, dying' )
62             . "\n";
63             }
64             elsif ( $operator_named_class eq 'OperatorVoid_134' ) { # OperatorVoid -> OP01_NAMED ListElement OP21_LIST_COMMA ListElements ';'
65             die RPerl::Parser::rperl_rule__replace(
66             'ERROR ECOGEASRP14, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Named operator '
67 0         0 . $operator_named->{children}->[0]
68             . ' does not accept multiple arguments, dying' )
69             . "\n";
70             }
71             else {
72 0         0 die RPerl::Parser::rperl_rule__replace(
73             'ERROR ECOGEASRP00, CODE GENERATOR, ABSTRACT SYNTAX TO RPERL: Grammar rule '
74             . ($operator_named_class)
75             . ' found where Operation_90, Operator_94, Operator_95, or OperatorVoid_134 expected, dying'
76             ) . "\n";
77             }
78 4         19 return $rperl_source_group;
79             }
80              
81             sub ast_to_cpp__generate__CPPOPS_PERLTYPES {
82 0     0     { my string_hashref::method $RETURN_TYPE };
  0            
83 0           ( my object $self, my string_hashref $modes) = @ARG;
84 0           my string_hashref $cpp_source_group
85             = { CPP =>
86             q{// <<< RP::O::E::O::N::Po __DUMMY_SOURCE_CODE CPPOPS_PERLTYPES >>>}
87             . "\n" };
88              
89             #...
90 0           return $cpp_source_group;
91             }
92              
93             sub ast_to_cpp__generate__CPPOPS_CPPTYPES {
94 0     0     { my string_hashref::method $RETURN_TYPE };
  0            
95 0           ( my object $self, my string_hashref $modes) = @ARG;
96 0           my string_hashref $cpp_source_group
97             = { CPP =>
98             q{// <<< RP::O::E::O::N::Po __DUMMY_SOURCE_CODE CPPOPS_CPPTYPES >>>}
99             . "\n" };
100              
101             #...
102 0           return $cpp_source_group;
103             }
104              
105             1; # end of class