XSP.yp

filter: Statementstmt 89.5% 198 / 221 Branchbran 72.2% 13 / 18 Conditioncond 57.1% 4 / 7 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 86.9% 113 / 130 Podpod n/a totaltotal 86.5% 329 / 380 CC 13 SCAR 3.0
CC
13
Cov
87%
__ANON__
4.0
__ANON__
3.0
__ANON__
2.1
CRAP 1.3
« blib/lib/ExtUtils/XSpp/Node/Constructor.pm ↑ Summary blib/lib/ExtUtils/XSpp/Exception/unknown.pm »
1 #############################################################################
2 ## Name: XSP.yp
3 ## Purpose: Grammar file for xsubppp.pl
4 ## Author: Mattia Barbon
5 ## Modified by:
6 ## Created: 01/03/2003
7 ## RCS-ID: $Id: XSP.yp,v 1.5 2007/03/10 20:38:57 mbarbon Exp $
8 ## Copyright: (c) 2003, 2007, 2009 Mattia Barbon
9 ## Licence: This program is free software; you can redistribute it and/or
10 ## modify it under the same terms as Perl itself
11 #############################################################################
12  
13 %token OPCURLY CLCURLY OPPAR CLPAR OPANG CLANG SEMICOLON TILDE DCOLON
14 %token STAR AMP COMMA EQUAL OPSPECIAL CLSPECIAL
15 %token INTEGER RAW_CODE COMMENT ID COLON
16 %expect 2
17  
18 %%
19  
20 top_list:
21 top
22 229 ▶ | top_list top { push @{$_[1]}, @{$_[2]}; $_[1] }
Subroutine __ANON__: called CC=1 SCAR=0.0
23 | p__type OPCURLY type CLCURLY
24 0 ▶ { $_[3] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
25 ;
26  
27 315 ▶top: _top { !$_[1] ? [] :
Subroutine __ANON__: called CC=3 SCAR=11.0
Branch: 2 branches
BranchTrueFalseTotal
!$_[1] ? : 51 264 315
ref $_[1] eq 'ARRAY' ? : 46 218 264
28 ref $_[1] eq 'ARRAY' ? $_[1] :
29 [ $_[1] ] };
30  
31 _top: raw | class | directive | enum
32 44 ▶ | function { process_function( $_[0], $_[1] ) };
Subroutine __ANON__: called CC=1 SCAR=0.0
33  
34 directive: perc_module SEMICOLON
35 82 ▶ { ExtUtils::XSpp::Node::Module->new( module => $_[1] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
36 | perc_package SEMICOLON
37 30 ▶ { ExtUtils::XSpp::Node::Package->new( perl_name => $_[1] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
38 | perc_file SEMICOLON
39 8 ▶ { ExtUtils::XSpp::Node::File->new( file => $_[1] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
40 | perc_loadplugin SEMICOLON
41 9 ▶ { $_[0]->YYData->{PARSER}->load_plugin( $_[1] ); undef }
Subroutine __ANON__: called CC=1 SCAR=0.0
42 | perc_include SEMICOLON
43 2 ▶ { $_[0]->YYData->{PARSER}->include_file( $_[1] ); undef }
Subroutine __ANON__: called CC=1 SCAR=0.0
44 | perc_any SEMICOLON
45 2 ▶ { add_top_level_directive( $_[0], %{$_[1][1]} ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
46 26 ▶ | typemap { }
Subroutine __ANON__: called CC=1 SCAR=0.0
47 14 ▶ | exceptionmap { }
Subroutine __ANON__: called CC=1 SCAR=0.0
48 ;
49  
50 typemap: p_typemap OPCURLY type CLCURLY OPCURLY ID CLCURLY
51 special_blocks SEMICOLON
52 15 ▶ { my $c = 0;
Subroutine __ANON__: called CC=2 SCAR=7.6
53 0 my %args = map { "arg" . ++$c => $_ }
54 0 map { join( '', @$_ ) }
55 15 ▶ @{$_[8] || []};
Condition50%1/2
$_[8] || []
l!l
015
MC/DC0%0/1
$_[8] || []
$_[8]
Truth table50%1/2
A
A= $_[8]
Aresult
11
00
56 15 add_typemap( $_[6], $_[3], %args );
57 15 undef }
58 | p_typemap OPCURLY type CLCURLY OPCURLY ID CLCURLY
59 OPCURLY perc_any_args CLCURLY SEMICOLON
60 9 ▶ { # this assumes that there will be at most one named
Subroutine __ANON__: called CC=4 SCAR=13.9
61 # block for each directive inside the typemap
62 9 ▶ for( my $i = 1; $i <= $#{$_[9]}; $i += 2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i <= $#{$_[9];}) 12 9 21
63 12 ▶ $_[9][$i] = join "\n", @{$_[9][$i][0]}
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[9][$i] eq "ARRAY" and ref $_[9][$i][0] eq "ARRAY" 11 1 12
Condition66%2/3
ref $_[9][$i] eq "ARRAY" and ref $_[9][$i][0] eq "ARRAY"
!ll&&!rl&&r
1011
MC/DC50%1/2
ref $_[9][$i] eq "ARRAY" and ref $_[9][$i][0] eq "ARRAY"
ref $_[9][$i] eq "ARRAY" ref $_[9][$i][0] eq "ARRAY"
Truth table66%2/3
A and B
A= ref $_[9][$i] eq "ARRAY"B= ref $_[9][$i][0] eq "ARRAY"
ABresult
0X0
100
111
64 if ref( $_[9][$i] ) eq 'ARRAY'
65 && ref( $_[9][$i][0] ) eq 'ARRAY';
66 }
67 9 add_typemap( $_[6], $_[3], @{$_[9]} );
68 9 undef }
69 | p_typemap OPCURLY type CLCURLY SEMICOLON
70 2 ▶ { add_typemap( 'simple', $_[3] );
Subroutine __ANON__: called CC=1 SCAR=0.0
71 2 add_typemap( 'reference', make_ref($_[3]->clone) );
72 2 undef }
73 ;
74  
75 exceptionmap: p_exceptionmap OPCURLY ID CLCURLY OPCURLY type_name CLCURLY
76 OPCURLY ID CLCURLY
77 mixed_blocks SEMICOLON
78 14 ▶ { my $package = "ExtUtils::XSpp::Exception::" . $_[9];
Subroutine __ANON__: called CC=2 SCAR=6.9
79 14 my $type = make_type($_[6]); my $c = 0;
80 3 my %args = map { "arg" . ++$c => $_ }
81 3 map { join( "\n", @$_ ) }
82 14 ▶ @{$_[11] || []};
Condition50%1/2
$_[11] || []
l!l
140
MC/DC0%0/1
$_[11] || []
$_[11]
Truth table50%1/2
A
A= $_[11]
Aresult
11
00
83 14 my $e = $package->new( name => $_[3], type => $type, %args );
84 14 ExtUtils::XSpp::Exception->add_exception( $e );
85 14 undef };
86  
87 mixed_blocks: mixed_blocks special_block
88 10 ▶ { [ @{$_[1]}, $_[2] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
89 | mixed_blocks simple_block
90 16 ▶ { [ @{$_[1]}, [ $_[2] ] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
91 44 ▶ | { [] };
Subroutine __ANON__: called CC=1 SCAR=0.0
92  
93 simple_block: OPCURLY ID CLCURLY
94 16 ▶ { $_[2] };
Subroutine __ANON__: called CC=1 SCAR=0.0
95  
96 18 ▶raw: RAW_CODE { add_data_raw( $_[0], [ $_[1] ] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
97 5 ▶ | COMMENT { add_data_comment( $_[0], $_[1] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
98 22 ▶ | PREPROCESSOR { ExtUtils::XSpp::Node::Preprocessor->new
Subroutine __ANON__: called CC=1 SCAR=0.0
99 ( rows => [ $_[1][0] ],
100 symbol => $_[1][1],
101 ) }
102 6 ▶ | special_block { add_data_raw( $_[0], [ @{$_[1]} ] ) };
Subroutine __ANON__: called CC=1 SCAR=0.0
103  
104 enum:
105 'enum' OPCURLY enum_element_list CLCURLY SEMICOLON
106 1 ▶ { ExtUtils::XSpp::Node::Enum->new
Subroutine __ANON__: called CC=1 SCAR=0.0
107 ( elements => $_[3],
108 condition => $_[0]->get_conditional,
109 ) }
110 | 'enum' ID OPCURLY enum_element_list CLCURLY SEMICOLON
111 2 ▶ { ExtUtils::XSpp::Node::Enum->new
Subroutine __ANON__: called CC=1 SCAR=0.0
112 ( name => $_[2],
113 elements => $_[4],
114 condition => $_[0]->get_conditional,
115 ) }
116 ;
117  
118 enum_element_list:
119 3 ▶ { [] }
Subroutine __ANON__: called CC=1 SCAR=0.0
120 | enum_element_list enum_element
121 3 ▶ { push @{$_[1]}, $_[2] if $_[2]; $_[1] }
Subroutine __ANON__: called CC=2 SCAR=7.1
Branch: 1 branch
BranchTrueFalseTotal
if $_[2] 3 0 3
122 | enum_element_list enum_element COMMA
123 7 ▶ { push @{$_[1]}, $_[2] if $_[2]; $_[1] }
Subroutine __ANON__: called CC=2 SCAR=7.1
Branch: 1 branch
BranchTrueFalseTotal
if $_[2] 7 0 7
124 ;
125  
126 enum_element:
127 ID
128 5 ▶ { ExtUtils::XSpp::Node::EnumValue->new
Subroutine __ANON__: called CC=1 SCAR=0.0
129 ( name => $_[1],
130 condition => $_[0]->get_conditional,
131 ) }
132 | ID EQUAL expression
133 3 ▶ { ExtUtils::XSpp::Node::EnumValue->new
Subroutine __ANON__: called CC=1 SCAR=0.0
134 ( name => $_[1],
135 value => $_[3],
136 condition => $_[0]->get_conditional,
137 ) }
138 | raw
139 ;
140  
141 class: class_decl SEMICOLON | decorate_class SEMICOLON;
142 function: function_decl SEMICOLON;
143 method: method_decl SEMICOLON;
144 member: member_decl SEMICOLON;
145  
146 decorate_class:
147 2 ▶ perc_name class_decl { $_[2]->set_perl_name( $_[1] ); $_[2] };
Subroutine __ANON__: called CC=1 SCAR=0.0
148  
149 class_decl: 'class' class_name base_classes class_metadata OPCURLY class_body_list CLCURLY
150 51 ▶ { create_class( $_[0], $_[2], $_[3], $_[4], $_[6],
Subroutine __ANON__: called CC=1 SCAR=0.0
151 $_[0]->get_conditional ) };
152  
153 base_classes:
154 2 ▶ COLON base_class { [ $_[2] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
155 1 ▶ | base_classes COMMA base_class { push @{$_[1]}, $_[3] if $_[3]; $_[1] }
Subroutine __ANON__: called CC=2 SCAR=7.1
Branch: 1 branch
BranchTrueFalseTotal
if $_[3] 1 0 1
156 | ;
157  
158 base_class:
159 3 ▶ 'public' class_name_rename { $_[2] }
Subroutine __ANON__: called CC=1 SCAR=0.0
160 0 ▶ | 'protected' class_name_rename { $_[2] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
161 0 ▶ | 'private' class_name_rename { $_[2] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
162 ;
163  
164 class_name_rename:
165 2 ▶ class_name { create_class( $_[0], $_[1], [], [] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
166 1 ▶ | perc_name class_name { my $klass = create_class( $_[0], $_[2], [], [] );
Subroutine __ANON__: called CC=1 SCAR=0.0
167 1 $klass->set_perl_name( $_[1] );
168 1 $klass
169 }
170 ;
171  
172 3 ▶class_metadata: class_metadata perc_catch { [ @{$_[1]}, @{$_[2]} ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
173 0 ▶ | class_metadata perc_any { [ @{$_[1]}, @{$_[2]} ] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
174 51 ▶ | { [] }
Subroutine __ANON__: called CC=1 SCAR=0.0
175 ;
176  
177 class_body_list:
178 51 ▶ { [] }
Subroutine __ANON__: called CC=1 SCAR=0.0
179 | class_body_list class_body_element
180 76 ▶ { push @{$_[1]}, $_[2] if $_[2]; $_[1] }
Subroutine __ANON__: called CC=2 SCAR=7.1
Branch: 1 branch
BranchTrueFalseTotal
if $_[2] 76 0 76
181 ;
182  
183 class_body_element:
184 method | raw | typemap | exceptionmap | access_specifier | member
185 | perc_any SEMICOLON
186 8 ▶ { ExtUtils::XSpp::Node::PercAny->new( %{$_[1][1]} ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
187 ;
188  
189 access_specifier:
190 0 ▶ 'public' COLON { ExtUtils::XSpp::Node::Access->new( access => $_[1] ) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
191 0 ▶ | 'protected' COLON { ExtUtils::XSpp::Node::Access->new( access => $_[1] ) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
192 0 ▶ | 'private' COLON { ExtUtils::XSpp::Node::Access->new( access => $_[1] ) }
Subroutine __ANON__: not called CC=1 SCAR=6.9
193 ;
194  
195 18 ▶member_metadata: member_metadata _member_metadata { [ @{$_[1]}, @{$_[2]} ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
196 12 ▶ | { [] }
Subroutine __ANON__: called CC=1 SCAR=0.0
197 ;
198  
199 _member_metadata: perc_any;
200  
201 member_decl:
202 | looks_like_member
203 | perc_name looks_like_member
204 7 ▶ { $_[2]->set_perl_name( $_[1] ); $_[2] };
Subroutine __ANON__: called CC=1 SCAR=0.0
205  
206 looks_like_member:
207 type ID member_metadata
208 12 ▶ { create_member( $_[0],
Subroutine __ANON__: called CC=1 SCAR=0.0
209 name => $_[2],
210 type => $_[1],
211 condition => $_[0]->get_conditional,
212 12 @{$_[3]} ) };
213  
214 method_decl: nmethod | vmethod | ctor | dtor;
215  
216 2 ▶const: 'const' { 1 }
Subroutine __ANON__: called CC=1 SCAR=0.0
217 86 ▶ | { 0 };
Subroutine __ANON__: called CC=1 SCAR=0.0
218  
219 virtual: 'virtual';
220  
221 static: 'package_static'
222 | 'class_static'
223 0 ▶ | 'static' { 'package_static' }
Subroutine __ANON__: not called CC=1 SCAR=6.9
224 ;
225  
226 looks_like_function:
227 type ID OPPAR arg_list CLPAR const
228 88 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
229 88 return { ret_type => $_[1],
230 name => $_[2],
231 arguments => $_[4],
232 const => $_[6],
233 };
234 };
235  
236 looks_like_renamed_function:
237 looks_like_function
238 | perc_name looks_like_function
239 12 ▶ { $_[2]->{perl_name} = $_[1]; $_[2] };
Subroutine __ANON__: called CC=1 SCAR=0.0
240  
241 function_decl: looks_like_renamed_function function_metadata
242 44 ▶ { add_data_function( $_[0],
Subroutine __ANON__: called CC=1 SCAR=0.0
243 name => $_[1]->{name},
244 perl_name => $_[1]->{perl_name},
245 ret_type => $_[1]->{ret_type},
246 arguments => $_[1]->{arguments},
247 condition => $_[0]->get_conditional,
248 44 @{$_[2]} ) };
249  
250 ctor: ID OPPAR arg_list CLPAR function_metadata
251 4 ▶ { add_data_ctor( $_[0], name => $_[1],
Subroutine __ANON__: called CC=1 SCAR=0.0
252 arguments => $_[3],
253 condition => $_[0]->get_conditional,
254 4 @{ $_[5] } ) }
255 2 ▶ | perc_name ctor { $_[2]->set_perl_name( $_[1] ); $_[2] };
Subroutine __ANON__: called CC=1 SCAR=0.0
256  
257 dtor: TILDE ID OPPAR CLPAR function_metadata
258 3 ▶ { add_data_dtor( $_[0], name => $_[2],
Subroutine __ANON__: called CC=1 SCAR=0.0
259 condition => $_[0]->get_conditional,
260 3 @{ $_[5] },
261 ) }
262 1 ▶ | perc_name dtor { $_[2]->set_perl_name( $_[1] ); $_[2] }
Subroutine __ANON__: called CC=1 SCAR=0.0
263 1 ▶ | virtual dtor { $_[2]->set_virtual( 1 ); $_[2] };
Subroutine __ANON__: called CC=1 SCAR=0.0
264  
265 43 ▶function_metadata: function_metadata _function_metadata { [ @{$_[1]}, @{$_[2]} ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
266 95 ▶ | { [] }
Subroutine __ANON__: called CC=1 SCAR=0.0
267 ;
268  
269 nmethod:
270 looks_like_renamed_function function_metadata
271 40 ▶ { my $m = add_data_method
Subroutine __ANON__: called CC=1 SCAR=0.0
272 ( $_[0],
273 name => $_[1]->{name},
274 perl_name => $_[1]->{perl_name},
275 ret_type => $_[1]->{ret_type},
276 arguments => $_[1]->{arguments},
277 const => $_[1]->{const},
278 condition => $_[0]->get_conditional,
279 40 @{$_[2]},
280 );
281 40 $m
282 }
283 | static nmethod
284 1 ▶ { $_[2]->set_static( $_[1] ); $_[2] };
Subroutine __ANON__: called CC=1 SCAR=0.0
285  
286 vmethod:
287 _vmethod
288 | perc_name vmethod
289 2 ▶ { $_[2]->set_perl_name( $_[1] ); $_[2] }
Subroutine __ANON__: called CC=1 SCAR=0.0
290 ;
291  
292 _vmethod:
293 virtual looks_like_function function_metadata
294 2 ▶ { my $m = add_data_method
Subroutine __ANON__: called CC=1 SCAR=0.0
295 ( $_[0],
296 name => $_[2]->{name},
297 perl_name => $_[2]->{perl_name},
298 ret_type => $_[2]->{ret_type},
299 arguments => $_[2]->{arguments},
300 const => $_[2]->{const},
301 condition => $_[0]->get_conditional,
302 2 @{$_[3]},
303 );
304 2 $m->set_virtual( 1 );
305 2 $m
306 }
307 | virtual looks_like_function EQUAL INTEGER function_metadata
308 2 ▶ { my $m = add_data_method
Subroutine __ANON__: called CC=2 SCAR=7.0
309 ( $_[0],
310 name => $_[2]->{name},
311 perl_name => $_[2]->{perl_name},
312 ret_type => $_[2]->{ret_type},
313 arguments => $_[2]->{arguments},
314 const => $_[2]->{const},
315 condition => $_[0]->get_conditional,
316 2 @{$_[5]},
317 );
318 2 ▶ die "Invalid pure virtual method" unless $_[4] eq '0';
Branch: 1 branch
BranchTrueFalseTotal
unless $_[4] eq 0 0 2 2
319 2 $m->set_virtual( 2 );
320 2 $m
321 }
322 ;
323  
324 _function_metadata: perc_code
325 | perc_cleanup
326 | perc_postcall
327 | perc_catch
328 | perc_alias
329 | perc_any
330 ;
331  
332 28 ▶perc_name: p_name OPCURLY class_name CLCURLY { $_[3] };
Subroutine __ANON__: called CC=1 SCAR=0.0
333 5 ▶perc_alias: p_alias OPCURLY ID EQUAL INTEGER CLCURLY { [ alias => [$_[3], $_[5]] ] };
Subroutine __ANON__: called CC=1 SCAR=0.0
334 30 ▶perc_package: p_package OPCURLY class_name CLCURLY { $_[3] };
Subroutine __ANON__: called CC=1 SCAR=0.0
335 82 ▶perc_module: p_module OPCURLY class_name CLCURLY { $_[3] };
Subroutine __ANON__: called CC=1 SCAR=0.0
336 8 ▶perc_file: p_file OPCURLY file_name CLCURLY { $_[3] };
Subroutine __ANON__: called CC=1 SCAR=0.0
337 9 ▶perc_loadplugin: p_loadplugin OPCURLY class_name CLCURLY { $_[3] };
Subroutine __ANON__: called CC=1 SCAR=0.0
338 2 ▶perc_include: p_include OPCURLY file_name CLCURLY { $_[3] };
Subroutine __ANON__: called CC=1 SCAR=0.0
339 11 ▶perc_code: p_code special_block { [ code => $_[2] ] };
Subroutine __ANON__: called CC=1 SCAR=0.0
340 3 ▶perc_cleanup: p_cleanup special_block { [ cleanup => $_[2] ] };
Subroutine __ANON__: called CC=1 SCAR=0.0
341 3 ▶perc_postcall: p_postcall special_block { [ postcall => $_[2] ] };
Subroutine __ANON__: called CC=1 SCAR=0.0
342 17 ▶perc_catch: p_catch OPCURLY class_name_list CLCURLY { [ map {(catch => $_)} @{$_[3]} ] };
Subroutine __ANON__: called CC=1 SCAR=0.0
343  
344 # this expands mixed_blocks to avoid ambiguity in the OPCURLY case
345 perc_any:
346 p_any OPCURLY perc_any_args CLCURLY
347 6 ▶ { [ tag => { any => $_[1], named => $_[3] } ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
348 | p_any OPCURLY ID CLCURLY mixed_blocks
349 7 ▶ { [ tag => { any => $_[1], positional => [ $_[3], @{$_[5]} ] } ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
350 | p_any special_block mixed_blocks
351 0 ▶ { [ tag => { any => $_[1], positional => [ $_[2], @{$_[3]} ] } ] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
352 | p_any
353 23 ▶ { [ tag => { any => $_[1] } ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
354 ;
355  
356 perc_any_args:
357 15 ▶ perc_any_arg { $_[1] }
Subroutine __ANON__: called CC=1 SCAR=0.0
358 9 ▶ | perc_any_args perc_any_arg { [ @{$_[1]}, @{$_[2]} ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
359 ;
360  
361 perc_any_arg:
362 23 ▶ p_any mixed_blocks SEMICOLON { [ $_[1] => $_[2] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
363 87 ▶ | perc_name SEMICOLON { [ name => $_[1] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
364 ;
365  
366 type:
367 102 ▶ 'const' nconsttype { make_const( $_[2] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
368 | nconsttype
369 ;
370  
371 nconsttype:
372 9 ▶ nconsttype STAR { make_ptr( $_[1] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
373 11 ▶ | nconsttype AMP { make_ref( $_[1] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
374 242 ▶ | type_name { make_type( $_[1] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
375 | template
376 ;
377  
378 type_name:
379 class_name
380 | basic_type
381 | 'void'
382 1 ▶ | 'unsigned' { 'unsigned int' }
Subroutine __ANON__: called CC=1 SCAR=0.0
383 10 ▶ | 'unsigned' basic_type { 'unsigned' . ' ' . $_[2] }
Subroutine __ANON__: called CC=1 SCAR=0.0
384 ;
385  
386 basic_type: 'char' | 'int' | 'long' | 'short' | 'long' 'int' | 'short' 'int';
387  
388 template:
389 9 ▶ class_name OPANG type_list CLANG { make_template( $_[1], $_[3] ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
390 ;
391  
392 type_list:
393 9 ▶ type { [ $_[1] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
394 2 ▶ | type_list COMMA type { push @{$_[1]}, $_[3]; $_[1] }
Subroutine __ANON__: called CC=1 SCAR=0.0
395 ;
396  
397 class_name: ID
398 33 ▶ | ID class_suffix { $_[1] . '::' . $_[2] };
Subroutine __ANON__: called CC=1 SCAR=0.0
399  
400 class_name_list:
401 17 ▶ class_name { [ $_[1] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
402 4 ▶ | class_name_list COMMA class_name { push @{$_[1]}, $_[3]; $_[1] }
Subroutine __ANON__: called CC=1 SCAR=0.0
403 ;
404  
405 33 ▶class_suffix: DCOLON ID { $_[2] }
Subroutine __ANON__: called CC=1 SCAR=0.0
406 7 ▶ | class_suffix DCOLON ID { $_[1] . '::' . $_[3] };
Subroutine __ANON__: called CC=1 SCAR=0.0
407  
408 4 ▶file_name: DASH { '-' }
Subroutine __ANON__: called CC=1 SCAR=0.0
409 6 ▶ | ID DOT ID { $_[1] . '.' . $_[3] }
Subroutine __ANON__: called CC=1 SCAR=0.0
410 6 ▶ | ID SLASH file_name { $_[1] . '/' . $_[3] };
Subroutine __ANON__: called CC=1 SCAR=0.0
411  
412 arg_list: nonvoid_arg_list
413 1 ▶ | 'void' { undef };
Subroutine __ANON__: called CC=1 SCAR=0.0
414  
415 nonvoid_arg_list:
416 76 ▶ argument { [ $_[1] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
417 38 ▶ | nonvoid_arg_list COMMA argument { push @{$_[1]}, $_[3]; $_[1] }
Subroutine __ANON__: called CC=1 SCAR=0.0
418 | ;
419  
420 1 ▶argument_metadata: argument_metadata _argument_metadata { [ @{$_[1]}, @{$_[2]} ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
421 111 ▶ | { [] }
Subroutine __ANON__: called CC=1 SCAR=0.0
422 ;
423  
424 _argument_metadata: perc_any;
425  
426 argument: type p_length OPCURLY ID CLCURLY
427 3 ▶ { make_argument( @_[0, 1], "length($_[4])" ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
428 | type ID argument_metadata EQUAL expression
429 4 ▶ { make_argument( @_[0, 1, 2, 5], @{$_[3]} ) }
Subroutine __ANON__: called CC=1 SCAR=0.0
430 | type ID argument_metadata
431 107 ▶ { make_argument( @_[0, 1, 2], undef, @{$_[3]} ) };
Subroutine __ANON__: called CC=1 SCAR=0.0
432  
433 value: INTEGER
434 0 ▶ | DASH INTEGER { '-' . $_[2] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
435 | FLOAT
436 | QUOTED_STRING
437 | class_name
438 0 ▶ | class_name OPPAR value_list CLPAR { "$_[1]($_[3])" }
Subroutine __ANON__: not called CC=1 SCAR=6.9
439 ;
440  
441 value_list:
442 value
443 0 ▶ | value_list COMMA value { "$_[1], $_[2]" }
Subroutine __ANON__: not called CC=1 SCAR=6.9
444 0 ▶ | { "" }
Subroutine __ANON__: not called CC=1 SCAR=6.9
445 ;
446  
447 expression:
448 value
449 | value AMP value
450 0 ▶ { "$_[1] & $_[3]" }
Subroutine __ANON__: not called CC=1 SCAR=6.9
451 | value PIPE value
452 1 ▶ { "$_[1] | $_[3]" }
Subroutine __ANON__: called CC=1 SCAR=0.0
453 ;
454  
455 special_blocks: special_block
456 0 ▶ { [ $_[1] ] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
457 | special_blocks special_block
458 0 ▶ { [ @{$_[1]}, $_[2] ] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
459 | ;
460  
461 special_block: special_block_start lines special_block_end
462 33 ▶ { $_[2] }
Subroutine __ANON__: called CC=1 SCAR=0.0
463 | special_block_start special_block_end
464 0 ▶ { [] }
Subroutine __ANON__: not called CC=1 SCAR=6.9
465 ;
466  
467 33 ▶special_block_start: OPSPECIAL { push_lex_mode( $_[0], 'special' ) };
Subroutine __ANON__: called CC=1 SCAR=0.0
468  
469 33 ▶special_block_end: CLSPECIAL { pop_lex_mode( $_[0], 'special' ) };
Subroutine __ANON__: called CC=1 SCAR=0.0
470  
471 33 ▶lines: line { [ $_[1] ] }
Subroutine __ANON__: called CC=1 SCAR=0.0
472 15 ▶ | lines line { push @{$_[1]}, $_[2]; $_[1] };
Subroutine __ANON__: called CC=1 SCAR=0.0
473  
474 %%
475  
476 21 ▶use ExtUtils::XSpp::Lexer;
Subroutine BEGIN: called CC=1 SCAR=0.0
« blib/lib/ExtUtils/XSpp/Node/Constructor.pm ↑ Summary blib/lib/ExtUtils/XSpp/Exception/unknown.pm »