File Coverage

blib/lib/Parse/Yapp/KeyValue/Parser.pm
Criterion Covered Total %
statement 11 11 100.0
branch 1 2 50.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 16 18 88.8


line stmt bran cond sub pod time code
1             ####################################################################
2             #
3             # This file was generated using Parse::Yapp version 1.05.
4             #
5             # Don't edit this file, use source file instead.
6             #
7             # ANY CHANGE MADE HERE WILL BE LOST !
8             #
9             ####################################################################
10             package Parse::Yapp::KeyValue::Parser;
11 1     1   6 use vars qw ( @ISA );
  1         2  
  1         56  
12 1     1   4 use strict;
  1         2  
  1         44  
13              
14             @ISA= qw ( Parse::Yapp::Driver );
15 1     1   980 use Parse::Yapp::Driver;
  1         2817  
  1         728  
16              
17              
18              
19             sub new {
20 1     1 0 4 my($class)=shift;
21 1 50       8 ref($class)
22             and $class=ref($class);
23              
24             my($self)=$class->SUPER::new( yyversion => '1.05',
25             yystates =>
26             [
27             {#State 0
28             ACTIONS => {
29             'KEY' => 5,
30             'TEXT_NONQUOTED' => 1,
31             'TEXT_Q_DOUBLE' => 3,
32             'TEXT_Q_SINGLE' => 8,
33             'OP_ASSIGNMENT' => 7
34             },
35             GOTOS => {
36             'string' => 4,
37             'pair' => 6,
38             'pairs' => 2
39             }
40             },
41             {#State 1
42             DEFAULT => -9
43             },
44             {#State 2
45             ACTIONS => {
46             'OP_ASSIGNMENT' => 7,
47             'TEXT_Q_SINGLE' => 8,
48             'EOI' => 10,
49             '' => 11,
50             'TEXT_NONQUOTED' => 1,
51             'TEXT_Q_DOUBLE' => 3,
52             'KEY' => 5
53             },
54             GOTOS => {
55             'string' => 4,
56             'pair' => 9
57             }
58             },
59             {#State 3
60             DEFAULT => -8
61             },
62             {#State 4
63             DEFAULT => -6
64             },
65             {#State 5
66             ACTIONS => {
67             'OP_ASSIGNMENT' => 12
68             },
69             DEFAULT => -10
70             },
71             {#State 6
72             DEFAULT => -1
73             },
74             {#State 7
75             ACTIONS => {
76             'KEY' => 14,
77             'TEXT_Q_DOUBLE' => 3,
78             'TEXT_NONQUOTED' => 1,
79             'TEXT_Q_SINGLE' => 8
80             },
81             GOTOS => {
82             'string' => 13
83             }
84             },
85             {#State 8
86             DEFAULT => -7
87             },
88             {#State 9
89             DEFAULT => -2
90             },
91             {#State 10
92             DEFAULT => -3
93             },
94             {#State 11
95             DEFAULT => 0
96             },
97             {#State 12
98             ACTIONS => {
99             'KEY' => 14,
100             'TEXT_NONQUOTED' => 1,
101             'TEXT_Q_DOUBLE' => 3,
102             'TEXT_Q_SINGLE' => 8
103             },
104             GOTOS => {
105             'string' => 15
106             }
107             },
108             {#State 13
109             DEFAULT => -5
110             },
111             {#State 14
112             DEFAULT => -10
113             },
114             {#State 15
115             DEFAULT => -4
116             }
117             ],
118             yyrules =>
119             [
120             [#Rule 0
121             '$start', 2, undef
122             ],
123             [#Rule 1
124             'pairs', 1, undef
125             ],
126             [#Rule 2
127             'pairs', 2, undef
128             ],
129             [#Rule 3
130             'pairs', 2, undef
131             ],
132             [#Rule 4
133             'pair', 3,
134             sub
135             #line 15 "grammar.yp"
136             {
137             my $data = $_[0]->YYData->{DATA};
138              
139             if (exists $data->{$_[1]}) {
140             my $val = $data->{$_[1]};
141              
142             if (ref $val eq 'ARRAY') {
143             push @{ $val }, $_[3];
144             } else {
145             $data->{$_[1]} = [ $val, $_[3] ];
146             }
147             } else {
148             $data->{$_[1]} = $_[3];
149             }
150             }
151             ],
152             [#Rule 5
153             'pair', 2,
154             sub
155             #line 31 "grammar.yp"
156             {
157             my $data = $_[0]->YYData->{DATA};
158              
159             if (exists $data->{''}) {
160             my $val = $data->{''};
161              
162             if (ref $val eq 'ARRAY') {
163             push @{ $val }, $_[2];
164             } else {
165             $data->{''} = [ $val, $_[2] ];
166             }
167             } else {
168             $data->{''} = $_[2];
169             }
170             }
171             ],
172             [#Rule 6
173             'pair', 1,
174             sub
175             #line 47 "grammar.yp"
176             {
177             my $data = $_[0]->YYData->{DATA};
178              
179             if (exists $data->{''}) {
180             my $val = $data->{''};
181              
182             if (ref $val eq 'ARRAY') {
183             push @{ $val }, $_[1];
184             } else {
185             $data->{''} = [ $val, $_[1] ];
186             }
187             } else {
188             $data->{''} = $_[1];
189             }
190             }
191             ],
192             [#Rule 7
193             'string', 1,
194             sub
195             #line 65 "grammar.yp"
196             { chop $_[1]; substr $_[1], 1; }
197             ],
198             [#Rule 8
199             'string', 1,
200             sub
201             #line 67 "grammar.yp"
202             { chop $_[1]; substr $_[1], 1; }
203             ],
204             [#Rule 9
205             'string', 1,
206             sub
207             #line 69 "grammar.yp"
208             { $_[1] }
209             ],
210             [#Rule 10
211             'string', 1,
212             sub
213             #line 71 "grammar.yp"
214             { $_[1] }
215             ]
216             ],
217             @_);
218             bless($self,$class);
219             }
220              
221             #line 74 "grammar.yp"
222              
223             # vim:ts=4:et:sw=4
224              
225             1;