blib/lib/Net/SPOCP/SExpr/Parser.pm

filter: Statementstmt 91.6% 11 / 12 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 84.2% 16 / 19 CC 2 SCAR 3.5
CC
2
Cov
86%
new
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« blib/lib/Net/SPOCP.pm ↑ Summary
1 ####################################################################
2 #
3 # This file was generated using Parse::Yapp version 1.21.
4 #
5 # Don't edit this file, use source file instead.
6 #
7 # ANY CHANGE MADE HERE WILL BE LOST !
8 #
9 ####################################################################
10 package Net::SPOCP::SExpr::Parser;
11 1 ▶use vars qw ( @ISA );
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 0 @ISA= qw ( Parse::Yapp::Driver );
15 1 ▶use Parse::Yapp::Driver;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17  
18  
19 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod undocumented
20 1 my($class)=shift;
21 1 ▶ ref($class)
Branch: 1 branch
BranchTrueFalseTotal
ref $class and $class = ref $class 0 1 1
22 and $class=ref($class);
23  
24 my($self)=$class->SUPER::new( yyversion => '1.21',
25 yystates =>
26 [
27 {#State 0
28 ACTIONS => {
29 "(" => 2
30 },
31 GOTOS => {
32 'sexp' => 1
33 }
34 },
35 {#State 1
36 ACTIONS => {
37 '' => 3
38 }
39 },
40 {#State 2
41 DEFAULT => -3,
42 GOTOS => {
43 'list' => 4
44 }
45 },
46 {#State 3
47 DEFAULT => 0
48 },
49 {#State 4
50 ACTIONS => {
51 ")" => 7,
52 "(" => 2,
53 'ATOM' => 5
54 },
55 GOTOS => {
56 'element' => 6,
57 'sexp' => 8
58 }
59 },
60 {#State 5
61 DEFAULT => -4
62 },
63 {#State 6
64 DEFAULT => -2
65 },
66 {#State 7
67 DEFAULT => -1
68 },
69 {#State 8
70 DEFAULT => -5
71 }
72 ],
73 yyrules =>
74 [
75 [#Rule 0
76 '$start', 2, undef
77 ],
78 [#Rule 1
79 'sexp', 3,
80 sub
81 #line 5 "SPOCP/SExpr/Parser.y"
82 { $_[2]; }
83 ],
84 [#Rule 2
85 'list', 2,
86 sub
87 #line 8 "SPOCP/SExpr/Parser.y"
88 { push(@{$_[1]}, $_[2]); $_[1] }
89 ],
90 [#Rule 3
91 'list', 0,
92 sub
93 #line 9 "SPOCP/SExpr/Parser.y"
94 { []; }
95 ],
96 [#Rule 4
97 'element', 1,
98 sub
99 #line 12 "SPOCP/SExpr/Parser.y"
100 { $_[1]; }
101 ],
102 [#Rule 5
103 'element', 1,
104 sub
105 #line 13 "SPOCP/SExpr/Parser.y"
106 { $_[1]; }
107 ]
108 ],
109 @_);
110 bless($self,$class);
111 }
112  
113 #line 16 "SPOCP/SExpr/Parser.y"
114  
115  
116 sub yylex
117 {
118 my $parser = shift;
119  
120 $parser->YYData->{INPUT} or return('', undef);
121  
122 $parser->YYData->{INPUT} =~ s/^\s+//;
123 $parser->YYData->{INPUT} =~ s/^#.*$//;
124  
125 for ($parser->YYData->{INPUT})
126 {
127 s/^([\(\)])// and return($1, undef);
128 s/^([^\s\(\)]+)// and return('ATOM',$1);
129 s/^(.)//s and return($1, $1);
130 }
131 return('', undef)
132 }
133  
134 sub yyerror
135 {
136 my ($msg, $s) = @_;
137 die "$msg\n";
138 }
139  
140 1;
« blib/lib/Net/SPOCP.pm ↑ Summary