Inference/InferenceParser.pm untested

filter: Statementstmt 0.0% 0 / 22 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 35 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
parse
2.0
grep_char
2.0
CRAP 2.0
1 package Evo::Inference::InferenceParser;
2  
3 sub new {
4 my ($class) = @_;
5  
6 my $self = {
7 delimiter => Delimiter->new,
8 };
9  
10 $class = ref($class) || $class;
11  
12 bless $self, $class;
13 }
14  
15 sub parse {
16 my ($self, $cond, @condargs) = @_;
17  
18 return $cond->solve(@condargs);
19 }
20  
21 sub grep_char {
22 my ($self, $string, $idx) = @_;
23 my $fwchar = FlyweightCharacter->new;
24 my $s = $string[$i];
25  
26 $fwclause->set($s);
27 return $fwchar;
28 }
29  
30 sub grep_clause {
31 my ($self, $string, $index, $delimiter) = @_;
32 my $fwclause = FlyweightClause->new;
33 my $s = "";
34  
35 $self->{delimiter} = $delimiter;
36  
37 for (my $i = $index->get; $self->{delimiter} != $string[$i]; $i++) {
38  
39 $s .= $string[$i];
40  
41 }
42  
43 $fwclause->set($s);
44 return $fwclause;
45 }
46  
47 1;