File Coverage

blib/lib/Parse/YALALR/Kernel.pm
Criterion Covered Total %
statement 12 20 60.0
branch n/a
condition n/a
subroutine 4 5 80.0
pod 0 1 0.0
total 16 26 61.5


line stmt bran cond sub pod time code
1             # -*- cperl -*-
2              
3             package Parse::YALALR::Kernel;
4 1     1   601 use Parse::YALALR::Parser;
  1         2  
  1         42  
5              
6 1         7 use fields (id => #
7             items => #
8             shifts => #
9             reduces => #
10             actions => #
11             REDUCE_WHY => #
12             SHIFT_WHY => #
13 1     1   8 );
  1         1  
14              
15 1     1   84 use strict;
  1         1  
  1         60  
16              
17             sub new {
18 0     0 0   my $class = shift;
19 0           my Parse::YALALR::Parser $parser = shift;
20 0           my ($items) = @_;
21              
22 1     1   5 no strict 'refs';
  1         2  
  1         108  
23 0           my Parse::YALALR::Kernel $self = bless [ \%{"${class}::FIELDS"} ], $class;
  0            
24 0           $self->{id} = $parser->{nstates}++;
25 0           $self->{items} = $items;
26 0           return $self;
27             }
28              
29             1;