Kate/AVR_Assembler.pm

filter: Statementstmt 74.3% 55 / 74 Branchbran 68.4% 26 / 38 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 63.6% 7 / 11 Podpod 0.0% 0 / 8 totaltotal 65.4% 89 / 136 SCAR 34.5
CC
21
Cov
71%
parseNormal
20.4
parseCommentar1
6.0
parseString
4.4
CRAP 31.4
« Kate/MABminusDB.pm ↑ Summary Kate/KBasic.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 'asm-avr.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.03
9 #kate version 2.4
10 #kate author Roland Nagy
11 #generated: Sun Feb 3 22:02:04 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::AVR_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 2 ▶ my $proto = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
23 2 ▶ my $class = ref($proto) || $proto;
Condition33%1/3
ref $proto || $proto
l!l&&r!l&&!r
020
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 2 my $self = $class->SUPER::new(@_);
25 2 $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' => 'Function',
34 'Normal Text' => 'Normal',
35 'Octal' => 'BaseN',
36 'Preprocessor' => 'Others',
37 'String' => 'String',
38 'String Char' => 'Char',
39 'Symbol' => 'Normal',
40 });
41 2 $self->listAdd('keywords',
42 'adc',
43 'add',
44 'adiw',
45 'and',
46 'andi',
47 'asr',
48 'bclr',
49 'bld',
50 'brbc',
51 'brbs',
52 'break',
53 'breq',
54 'brge',
55 'brhc',
56 'brhs',
57 'brid',
58 'brie',
59 'brlo',
60 'brlt',
61 'brmi',
62 'brne',
63 'brpl',
64 'brsh',
65 'brtc',
66 'brts',
67 'brvc',
68 'brvs',
69 'bset',
70 'bst',
71 'call',
72 'cbi',
73 'cbr',
74 'clc',
75 'clh',
76 'cli',
77 'cln',
78 'clr',
79 'cls',
80 'clt',
81 'clv',
82 'clz',
83 'com',
84 'cp',
85 'cpc',
86 'cpi',
87 'cpse',
88 'dec',
89 'eicall',
90 'eijmp',
91 'elpm',
92 'eor',
93 'fmul',
94 'fmuls',
95 'fmulsu',
96 'icall',
97 'ijmp',
98 'in',
99 'inc',
100 'jmp',
101 'ld',
102 'ldi',
103 'lds',
104 'lpm',
105 'lsl',
106 'lsr',
107 'mov',
108 'movw',
109 'mul',
110 'muls',
111 'mulsu',
112 'neg',
113 'nop',
114 'or',
115 'ori',
116 'out',
117 'pop',
118 'push',
119 'rcall',
120 'ret',
121 'reti',
122 'rjmp',
123 'rol',
124 'ror',
125 'sbc',
126 'sbci',
127 'sbi',
128 'sbic',
129 'sbis',
130 'sbiw',
131 'sbr',
132 'sbrc',
133 'sbrs',
134 'sec',
135 'seh',
136 'sei',
137 'sen',
138 'ser',
139 'ses',
140 'set',
141 'sev',
142 'sez',
143 'sleep',
144 'spm',
145 'st',
146 'sts',
147 'sub',
148 'subi',
149 'swap',
150 'tst',
151 'wdr',
152 );
153 2 $self->contextdata({
154 'Commentar 1' => {
155 callback => \&parseCommentar1,
156 attribute => 'Comment',
157 },
158 'Commentar 2' => {
159 callback => \&parseCommentar2,
160 attribute => 'Comment',
161 lineending => '#pop',
162 },
163 'Normal' => {
164 callback => \&parseNormal,
165 attribute => 'Normal Text',
166 },
167 'Preprocessor' => {
168 callback => \&parsePreprocessor,
169 attribute => 'Preprocessor',
170 lineending => '#pop',
171 },
172 'Some Context' => {
173 callback => \&parseSomeContext,
174 attribute => 'Normal Text',
175 lineending => '#pop',
176 },
177 'String' => {
178 callback => \&parseString,
179 attribute => 'String',
180 lineending => '#pop',
181 },
182 });
183 2 $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|_|\\.|\\$');
184 2 $self->basecontext('Normal');
185 2 $self->keywordscase(0);
186 2 $self->initialize;
187 2 bless ($self, $class);
188 2 return $self;
189 }
190  
191 sub language {
192 0 ▶ return 'AVR Assembler';
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
193 }
194  
195 sub parseCommentar1 {
196 0 ▶ my ($self, $text) = @_;
Subroutine parseCommentar1: not called CC=2 SCAR=17.9
Pod undocumented
197 # attribute => 'Comment'
198 # char => '*'
199 # char1 => '/'
200 # context => '#pop'
201 # type => 'Detect2Chars'
202 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
203 0 return 1
204 }
205 0 return 0;
206 };
207  
208 sub parseCommentar2 {
209 2262 ▶ my ($self, $text) = @_;
Subroutine parseCommentar2: called CC=1 SCAR=0.0
Pod undocumented
210 2262 return 0;
211 };
212  
213 sub parseNormal {
214 712 ▶ my ($self, $text) = @_;
Subroutine parseNormal: called CC=16 SCAR=30.2
Pod undocumented
215 # String => '[A-Za-z0-9_.$]+:'
216 # attribute => 'Label'
217 # context => '#stay'
218 # firstNonSpace => 'true'
219 # type => 'RegExpr'
220 712 ▶ 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")) 8 704 712
221 8 return 1
222 }
223 # String => 'keywords'
224 # attribute => 'Keyword'
225 # context => '#stay'
226 # type => 'keyword'
227 704 ▶ if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "keywords", 0, undef, 0, "#stay", "Keyword")) 36 668 704
228 36 return 1
229 }
230 # attribute => 'Octal'
231 # context => '#stay'
232 # type => 'HlCOct'
233 668 ▶ if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCOct($text, 0, undef, 0, "#stay", "Octal")) 0 668 668
234 0 return 1
235 }
236 # attribute => 'Hex'
237 # context => '#stay'
238 # type => 'HlCHex'
239 668 ▶ if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCHex($text, 0, undef, 0, "#stay", "Hex")) 0 668 668
240 0 return 1
241 }
242 # String => '0[bB][01]+'
243 # attribute => 'Binary'
244 # context => '#stay'
245 # type => 'RegExpr'
246 668 ▶ 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 668 668
247 0 return 1
248 }
249 # attribute => 'Decimal'
250 # context => '#stay'
251 # type => 'Int'
252 668 ▶ if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testInt($text, 0, undef, 0, "#stay", "Decimal")) 4 664 668
253 4 return 1
254 }
255 # String => '0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+'
256 # attribute => 'Float'
257 # context => '#stay'
258 # type => 'RegExpr'
259 664 ▶ 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 664 664
260 0 return 1
261 }
262 # String => '[A-Za-z_.$][A-Za-z0-9_.$]*'
263 # attribute => 'Normal Text'
264 # context => '#stay'
265 # type => 'RegExpr'
266 664 ▶ 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")) 72 592 664
267 72 return 1
268 }
269 # String => ''(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)'
270 # attribute => 'Char'
271 # context => '#stay'
272 # type => 'RegExpr'
273 592 ▶ 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 592 592
274 0 return 1
275 }
276 # attribute => 'String'
277 # char => '"'
278 # context => 'String'
279 # type => 'DetectChar'
280 592 ▶ 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")) 2 590 592
281 2 return 1
282 }
283 # attribute => 'Comment'
284 # char => '/'
285 # char1 => '*'
286 # context => 'Commentar 1'
287 # type => 'Detect2Chars'
288 590 ▶ 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 590 590
289 0 return 1
290 }
291 # attribute => 'Comment'
292 # char => '@'
293 # context => 'Commentar 2'
294 # type => 'DetectChar'
295 590 ▶ if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "\@", 0, 0, 0, undef, 0, "Commentar 2", "Comment")) 0 590 590
296 0 return 1
297 }
298 # attribute => 'Comment'
299 # char => ';'
300 # context => 'Commentar 2'
301 # type => 'DetectChar'
302 590 ▶ if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ";", 0, 0, 0, undef, 0, "Commentar 2", "Comment")) 80 510 590
303 80 return 1
304 }
305 # String => '!#%&*()+,-<=>?/:[]^{|}~'
306 # attribute => 'Symbol'
307 # context => '#stay'
308 # type => 'AnyChar'
309 510 ▶ if ($self->testAnyChar($text, '!#%&*()+,-<=>?/:[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testAnyChar($text, "!#%&*()+,-<=>?/:[]^{|}~", 0, 0, undef, 0, "#stay", "Symbol")) 20 490 510
310 20 return 1
311 }
312 # String => '^#'
313 # attribute => 'Preprocessor'
314 # context => 'Preprocessor'
315 # type => 'RegExpr'
316 490 ▶ 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 490 490
317 0 return 1
318 }
319 490 return 0;
320 };
321  
322 sub parsePreprocessor {
323 0 ▶ my ($self, $text) = @_;
Subroutine parsePreprocessor: not called CC=1 SCAR=6.9
Pod undocumented
324 0 return 0;
325 };
326  
327 sub parseSomeContext {
328 0 ▶ my ($self, $text) = @_;
Subroutine parseSomeContext: not called CC=1 SCAR=6.9
Pod undocumented
329 0 return 0;
330 };
331  
332 sub parseString {
333 24 ▶ my ($self, $text) = @_;
Subroutine parseString: called CC=4 SCAR=14.8
Pod undocumented
334 # attribute => 'String'
335 # context => 'Some Context'
336 # type => 'LineContinue'
337 24 ▶ 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 24 24
338 0 return 1
339 }
340 # attribute => 'String Char'
341 # context => '#stay'
342 # type => 'HlCStringChar'
343 24 ▶ 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 24 24
344 0 return 1
345 }
346 # attribute => 'String'
347 # char => '"'
348 # context => '#pop'
349 # type => 'DetectChar'
350 24 ▶ 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")) 2 22 24
351 2 return 1
352 }
353 22 return 0;
354 };
355  
356  
357 1 1;
358  
359 __END__
« Kate/MABminusDB.pm ↑ Summary Kate/KBasic.pm »