Kate/GNU_Assembler.pm

filter: Statementstmt 31.9% 23 / 72 Branchbran 0.0% 0 / 36 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 36.3% 4 / 11 Podpod 0.0% 0 / 8 totaltotal 21.2% 28 / 132 SCAR 53.6
CC
20
Cov
22%
parseNormal
240.0
parseString
20.0
parseCommentar1
6.0
CRAP 212.6
« Kate/Lex_Flex.pm ↑ Summary Kate/Sieve.pm »
1 # Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved.
2 # This program is free software; you can redistribute it and/or
3 # modify it under the same terms as Perl itself.
4  
5 # This file was generated from the 'gnuassembler.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.05
9 #kate version 2.4
10 #kate author John Zaitseff (J.Zaitseff@zap.org.au), Roland Pabel (roland@pabel.name)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::GNU_Assembler;
14  
15 1 our $VERSION = '0.14';
16  
17 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use base('Syntax::Highlight::Engine::Kate::Template');
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 sub new {
22 1 ▶ my $proto = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
23 1 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
24 1 my $self = $class->SUPER::new(@_);
25 1 $self->attributes({
26 'Binary' => 'BaseN',
27 'Char' => 'Char',
28 'Comment' => 'Comment',
29 'Decimal' => 'DecVal',
30 'Float' => 'Float',
31 'Hex' => 'BaseN',
32 'Keyword' => 'Keyword',
33 'Label' => 'Normal',
34 'Normal Text' => 'Normal',
35 'Octal' => 'BaseN',
36 'Preprocessor' => 'Others',
37 'String' => 'String',
38 'String Char' => 'Char',
39 'Symbol' => 'Normal',
40 });
41 1 $self->listAdd('keywords',
42 '.abort',
43 '.align',
44 '.appfile',
45 '.appline',
46 '.arm',
47 '.ascii',
48 '.asciz',
49 '.balign',
50 '.balignl',
51 '.balignw',
52 '.bss',
53 '.byte',
54 '.code',
55 '.comm',
56 '.common',
57 '.common.s',
58 '.data',
59 '.dc',
60 '.dc.b',
61 '.dc.d',
62 '.dc.l',
63 '.dc.s',
64 '.dc.w',
65 '.dc.x',
66 '.dcb',
67 '.dcb.b',
68 '.dcb.d',
69 '.dcb.l',
70 '.dcb.s',
71 '.dcb.w',
72 '.dcb.x',
73 '.debug',
74 '.def',
75 '.desc',
76 '.dim',
77 '.double',
78 '.ds',
79 '.ds.b',
80 '.ds.d',
81 '.ds.l',
82 '.ds.p',
83 '.ds.s',
84 '.ds.w',
85 '.ds.x',
86 '.dsect',
87 '.eject',
88 '.else',
89 '.elsec',
90 '.elseif',
91 '.end',
92 '.endc',
93 '.endef',
94 '.endfunc',
95 '.endif',
96 '.endm',
97 '.endr',
98 '.equ',
99 '.equiv',
100 '.err',
101 '.even',
102 '.exitm',
103 '.extend',
104 '.extern',
105 '.fail',
106 '.file',
107 '.fill',
108 '.float',
109 '.force_thumb',
110 '.format',
111 '.func',
112 '.global',
113 '.globl',
114 '.hidden',
115 '.hword',
116 '.ident',
117 '.if',
118 '.ifc',
119 '.ifdef',
120 '.ifeq',
121 '.ifeqs',
122 '.ifge',
123 '.ifgt',
124 '.ifle',
125 '.iflt',
126 '.ifnc',
127 '.ifndef',
128 '.ifne',
129 '.ifnes',
130 '.ifnotdef',
131 '.include',
132 '.int',
133 '.internal',
134 '.irep',
135 '.irepc',
136 '.irp',
137 '.irpc',
138 '.lcomm',
139 '.ldouble',
140 '.lflags',
141 '.line',
142 '.linkonce',
143 '.list',
144 '.llen',
145 '.ln',
146 '.loc',
147 '.long',
148 '.lsym',
149 '.ltorg',
150 '.macro',
151 '.mexit',
152 '.name',
153 '.noformat',
154 '.nolist',
155 '.nopage',
156 '.octa',
157 '.offset',
158 '.org',
159 '.p2align',
160 '.p2alignl',
161 '.p2alignw',
162 '.packed',
163 '.page',
164 '.plen',
165 '.pool',
166 '.popsection',
167 '.previous',
168 '.print',
169 '.protected',
170 '.psize',
171 '.purgem',
172 '.pushsection',
173 '.quad',
174 '.rep',
175 '.rept',
176 '.req',
177 '.rva',
178 '.sbttl',
179 '.scl',
180 '.sect',
181 '.sect.s',
182 '.section',
183 '.section.s',
184 '.set',
185 '.short',
186 '.single',
187 '.size',
188 '.skip',
189 '.sleb128',
190 '.space',
191 '.spc',
192 '.stabd',
193 '.stabn',
194 '.stabs',
195 '.string',
196 '.struct',
197 '.subsection',
198 '.symver',
199 '.tag',
200 '.text',
201 '.thumb',
202 '.thumb_func',
203 '.thumb_set',
204 '.title',
205 '.ttl',
206 '.type',
207 '.uleb128',
208 '.use',
209 '.val',
210 '.version',
211 '.vtable_entry',
212 '.vtable_inherit',
213 '.weak',
214 '.word',
215 '.xcom',
216 '.xdef',
217 '.xref',
218 '.xstabs',
219 '.zero',
220 );
221 1 $self->contextdata({
222 'Commentar 1' => {
223 callback => \&parseCommentar1,
224 attribute => 'Comment',
225 },
226 'Commentar 2' => {
227 callback => \&parseCommentar2,
228 attribute => 'Comment',
229 lineending => '#pop',
230 },
231 'Normal' => {
232 callback => \&parseNormal,
233 attribute => 'Normal Text',
234 },
235 'Preprocessor' => {
236 callback => \&parsePreprocessor,
237 attribute => 'Preprocessor',
238 lineending => '#pop',
239 },
240 'Some Context' => {
241 callback => \&parseSomeContext,
242 attribute => 'Normal Text',
243 lineending => '#pop',
244 },
245 'String' => {
246 callback => \&parseString,
247 attribute => 'String',
248 lineending => '#pop',
249 },
250 });
251 1 $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|_|\\.|\\$');
252 1 $self->basecontext('Normal');
253 1 $self->keywordscase(0);
254 1 $self->initialize;
255 1 bless ($self, $class);
256 1 return $self;
257 }
258  
259 sub language {
260 0 ▶ return 'GNU Assembler';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
261 }
262  
263 sub parseCommentar1 {
264 0 ▶ my ($self, $text) = @_;
Subroutine parseCommentar1: not called CC=2 SCAR=17.9
Pod undocumented
265 # attribute => 'Comment'
266 # char => '*'
267 # char1 => '/'
268 # context => '#pop'
269 # type => 'Detect2Chars'
270 0 ▶ if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "*", "/", 0, 0, 0, undef, 0, "#pop", "Comment")) 0 0 0
271 0 return 1
272 }
273 0 return 0;
274 };
275  
276 sub parseCommentar2 {
277 0 ▶ my ($self, $text) = @_;
Subroutine parseCommentar2: not called CC=1 SCAR=6.9
Pod undocumented
278 0 return 0;
279 };
280  
281 sub parseNormal {
282 0 ▶ my ($self, $text) = @_;
Subroutine parseNormal: not called CC=15 SCAR=54.8
Pod undocumented
283 # String => '[A-Za-z0-9_.$]+:'
284 # attribute => 'Label'
285 # context => '#stay'
286 # firstNonSpace => 'true'
287 # type => 'RegExpr'
288 0 ▶ if ($self->testRegExpr($text, '[A-Za-z0-9_.$]+:', 0, 0, 0, undef, 1, '#stay', 'Label')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[A-Za-z0-9_.\$]+:", 0, 0, 0, undef, 1, "#stay", "Label")) 0 0 0
289 0 return 1
290 }
291 # String => 'keywords'
292 # attribute => 'Keyword'
293 # context => '#stay'
294 # type => 'keyword'
295 0 ▶ if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywords", 0, undef, 0, "#stay", "Keyword")) 0 0 0
296 0 return 1
297 }
298 # attribute => 'Octal'
299 # context => '#stay'
300 # type => 'HlCOct'
301 0 ▶ if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCOct($text, 0, undef, 0, "#stay", "Octal")) 0 0 0
302 0 return 1
303 }
304 # attribute => 'Hex'
305 # context => '#stay'
306 # type => 'HlCHex'
307 0 ▶ if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCHex($text, 0, undef, 0, "#stay", "Hex")) 0 0 0
308 0 return 1
309 }
310 # String => '0[bB][01]+'
311 # attribute => 'Binary'
312 # context => '#stay'
313 # type => 'RegExpr'
314 0 ▶ if ($self->testRegExpr($text, '0[bB][01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "0[bB][01]+", 0, 0, 0, undef, 0, "#stay", "Binary")) 0 0 0
315 0 return 1
316 }
317 # attribute => 'Decimal'
318 # context => '#stay'
319 # type => 'Int'
320 0 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Decimal")) 0 0 0
321 0 return 1
322 }
323 # String => '0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+'
324 # attribute => 'Float'
325 # context => '#stay'
326 # type => 'RegExpr'
327 0 ▶ if ($self->testRegExpr($text, '0[fFeEdD][-+]?[0-9]*\\.?[0-9]*[eE]?[-+]?[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Float')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "0[fFeEdD][-+]?[0-9]*\\.?[0-9]*[eE]?[-+]?[0-9]+", 0, 0, 0, undef, 0, "#stay", "Float")) 0 0 0
328 0 return 1
329 }
330 # String => '[A-Za-z_.$][A-Za-z0-9_.$]*'
331 # attribute => 'Normal Text'
332 # context => '#stay'
333 # type => 'RegExpr'
334 0 ▶ if ($self->testRegExpr($text, '[A-Za-z_.$][A-Za-z0-9_.$]*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "[A-Za-z_.\$][A-Za-z0-9_.\$]*", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 0 0 0
335 0 return 1
336 }
337 # String => ''(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)'
338 # attribute => 'Char'
339 # context => '#stay'
340 # type => 'RegExpr'
341 0 ▶ if ($self->testRegExpr($text, '\'(\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7]?[0-7]?[0-7]?|\\\\.|.)', 0, 0, 0, undef, 0, '#stay', 'Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "'(\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7]?[0-7]?[0-7]?|\\\\.|.)", 0, 0, 0, undef, 0, "#stay", "Char")) 0 0 0
342 0 return 1
343 }
344 # attribute => 'String'
345 # char => '"'
346 # context => 'String'
347 # type => 'DetectChar'
348 0 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "String", "String")) 0 0 0
349 0 return 1
350 }
351 # attribute => 'Comment'
352 # char => '/'
353 # char1 => '*'
354 # context => 'Commentar 1'
355 # type => 'Detect2Chars'
356 0 ▶ if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "/", "*", 0, 0, 0, undef, 0, "Commentar 1", "Comment")) 0 0 0
357 0 return 1
358 }
359 # String => '@;'
360 # attribute => 'Comment'
361 # context => 'Commentar 2'
362 # type => 'AnyChar'
363 0 ▶ if ($self->testAnyChar($text, '@;', 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "\@;", 0, 0, undef, 0, "Commentar 2", "Comment")) 0 0 0
364 0 return 1
365 }
366 # String => '!#%&*()+,-<=>?/:[]^{|}~'
367 # attribute => 'Symbol'
368 # context => '#stay'
369 # type => 'AnyChar'
370 0 ▶ if ($self->testAnyChar($text, '!#%&*()+,-<=>?/:[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "!#%&*()+,-<=>?/:[]^{|}~", 0, 0, undef, 0, "#stay", "Symbol")) 0 0 0
371 0 return 1
372 }
373 # String => '^#'
374 # attribute => 'Preprocessor'
375 # context => 'Preprocessor'
376 # type => 'RegExpr'
377 0 ▶ if ($self->testRegExpr($text, '^#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "^#", 0, 0, 0, undef, 0, "Preprocessor", "Preprocessor")) 0 0 0
378 0 return 1
379 }
380 0 return 0;
381 };
382  
383 sub parsePreprocessor {
384 0 ▶ my ($self, $text) = @_;
Subroutine parsePreprocessor: not called CC=1 SCAR=6.9
Pod undocumented
385 0 return 0;
386 };
387  
388 sub parseSomeContext {
389 0 ▶ my ($self, $text) = @_;
Subroutine parseSomeContext: not called CC=1 SCAR=6.9
Pod undocumented
390 0 return 0;
391 };
392  
393 sub parseString {
394 0 ▶ my ($self, $text) = @_;
Subroutine parseString: not called CC=4 SCAR=30.0
Pod undocumented
395 # attribute => 'String'
396 # context => 'Some Context'
397 # type => 'LineContinue'
398 0 ▶ if ($self->testLineContinue($text, 0, undef, 0, 'Some Context', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testLineContinue($text, 0, undef, 0, "Some Context", "String")) 0 0 0
399 0 return 1
400 }
401 # attribute => 'String Char'
402 # context => '#stay'
403 # type => 'HlCStringChar'
404 0 ▶ if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCStringChar($text, 0, undef, 0, "#stay", "String Char")) 0 0 0
405 0 return 1
406 }
407 # attribute => 'String'
408 # char => '"'
409 # context => '#pop'
410 # type => 'DetectChar'
411 0 ▶ if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\"", 0, 0, 0, undef, 0, "#pop", "String")) 0 0 0
412 0 return 1
413 }
414 0 return 0;
415 };
416  
417  
418 1 1;
419  
420 __END__
« Kate/Lex_Flex.pm ↑ Summary Kate/Sieve.pm »