Kate/AHDL.pm

filter: Statementstmt 28.4% 25 / 88 Branchbran 0.0% 0 / 56 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 4 / 8 Podpod 0.0% 0 / 5 totaltotal 18.5% 30 / 162 CC 30 SCAR 62.0
CC
30
Cov
18%
parsenormal
702.0
parsestring
12.0
parsecomment
6.0
CRAP 494.8
« Kate/Cdash.pm ↑ Summary Kate/C.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 'ahdl.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7  
8 #kate xml version 1.04
9 #kate version 2.4
10 #kate author Dominik Haumann (dhdev@gmx.de)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
12  
13 package Syntax::Highlight::Engine::Kate::AHDL;
14  
15 1 our $VERSION = '0.16';
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 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod undocumented
22 1 my $proto = shift;
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 'Bit' => 'DecVal',
27 'Char' => 'Char',
28 'Comment' => 'Comment',
29 'Data Type' => 'DataType',
30 'Decimal' => 'DecVal',
31 'Hex' => 'BaseN',
32 'Keyword' => 'Keyword',
33 'Normal Text' => 'Normal',
34 'Octal' => 'BaseN',
35 'Operator' => 'Others',
36 'Region Marker' => 'RegionMarker',
37 'String' => 'String',
38 });
39 1 $self->listAdd('keywords',
40 'assert',
41 'bidir',
42 'bits',
43 'buried',
44 'case',
45 'clique',
46 'connected_pins',
47 'constant',
48 'defaults',
49 'define',
50 'design',
51 'device',
52 'else',
53 'elsif',
54 'for',
55 'function',
56 'generate',
57 'gnd',
58 'help_id',
59 'in',
60 'include',
61 'input',
62 'is',
63 'machine',
64 'node',
65 'of',
66 'options',
67 'others',
68 'output',
69 'parameters',
70 'returns',
71 'states',
72 'subdesign',
73 'then',
74 'title',
75 'to',
76 'tri_state_node',
77 'variable',
78 'vcc',
79 'when',
80 'with',
81 );
82 1 $self->listAdd('operator',
83 'and',
84 'ceil',
85 'div',
86 'floor',
87 'log2',
88 'mod',
89 'nand',
90 'nor',
91 'not',
92 'or',
93 'used',
94 'xnor',
95 'xor',
96 );
97 1 $self->listAdd('types',
98 'carry',
99 'cascade',
100 'dff',
101 'dffe',
102 'exp',
103 'global',
104 'jkff',
105 'jkffe',
106 'latch',
107 'lcell',
108 'mcell',
109 'memory',
110 'opendrn',
111 'soft',
112 'srff',
113 'srffe',
114 'tff',
115 'tffe',
116 'tri',
117 'wire',
118 'x',
119 );
120 1 $self->contextdata({
121 'comment' => {
122 callback => \&parsecomment,
123 attribute => 'Comment',
124 },
125 'normal' => {
126 callback => \&parsenormal,
127 attribute => 'Normal Text',
128 },
129 'string' => {
130 callback => \&parsestring,
131 attribute => 'String',
132 },
133 });
134 1 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
135 1 $self->basecontext('normal');
136 1 $self->keywordscase(0);
137 1 $self->initialize;
138 1 bless ($self, $class);
139 1 return $self;
140 }
141  
142 0 ▶sub language {
Subroutine language: not called CC=1 SCAR=6.9
Pod undocumented
143 0 return 'AHDL';
144 }
145  
146 0 ▶sub parsecomment {
Subroutine parsecomment: not called CC=2 SCAR=17.9
Pod undocumented
147 0 my ($self, $text) = @_;
148 # attribute => 'Comment'
149 # char => '%'
150 # context => '#pop'
151 # type => 'DetectChar'
152 0 ▶ if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "%", 0, 0, 0, undef, 0, "#pop", "Comment")) 0 0 0
153 0 return 1
154 }
155 0 return 0;
156 };
157  
158 0 ▶sub parsenormal {
Subroutine parsenormal: not called CC=26 SCAR=65.5
Pod undocumented
159 0 my ($self, $text) = @_;
160 # String => '\bdefaults\b'
161 # attribute => 'Keyword'
162 # beginRegion => 'def'
163 # context => '#stay'
164 # insensitive => 'true'
165 # type => 'RegExpr'
166 0 ▶ if ($self->testRegExpr($text, '\\bdefaults\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bdefaults\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
167 0 return 1
168 }
169 # String => '\bend\s+defaults\b'
170 # attribute => 'Keyword'
171 # context => '#stay'
172 # endRegion => 'def'
173 # insensitive => 'true'
174 # type => 'RegExpr'
175 0 ▶ if ($self->testRegExpr($text, '\\bend\\s+defaults\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bend\\s+defaults\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
176 0 return 1
177 }
178 # String => '\bif\b'
179 # attribute => 'Keyword'
180 # beginRegion => 'if'
181 # context => '#stay'
182 # insensitive => 'true'
183 # type => 'RegExpr'
184 0 ▶ if ($self->testRegExpr($text, '\\bif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bif\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
185 0 return 1
186 }
187 # String => '\bend\s+if\b'
188 # attribute => 'Keyword'
189 # context => '#stay'
190 # endRegion => 'if'
191 # insensitive => 'true'
192 # type => 'RegExpr'
193 0 ▶ if ($self->testRegExpr($text, '\\bend\\s+if\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bend\\s+if\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
194 0 return 1
195 }
196 # String => '\btable\b'
197 # attribute => 'Keyword'
198 # beginRegion => 'table'
199 # context => '#stay'
200 # insensitive => 'true'
201 # type => 'RegExpr'
202 0 ▶ if ($self->testRegExpr($text, '\\btable\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\btable\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
203 0 return 1
204 }
205 # String => '\bend\s+table\b'
206 # attribute => 'Keyword'
207 # context => '#stay'
208 # endRegion => 'table'
209 # insensitive => 'true'
210 # type => 'RegExpr'
211 0 ▶ if ($self->testRegExpr($text, '\\bend\\s+table\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bend\\s+table\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
212 0 return 1
213 }
214 # String => '\bcase\b'
215 # attribute => 'Keyword'
216 # beginRegion => 'case'
217 # context => '#stay'
218 # insensitive => 'true'
219 # type => 'RegExpr'
220 0 ▶ if ($self->testRegExpr($text, '\\bcase\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bcase\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
221 0 return 1
222 }
223 # String => '\bend\s+case\b'
224 # attribute => 'Keyword'
225 # context => '#stay'
226 # endRegion => 'case'
227 # insensitive => 'true'
228 # type => 'RegExpr'
229 0 ▶ if ($self->testRegExpr($text, '\\bend\\s+case\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bend\\s+case\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
230 0 return 1
231 }
232 # String => '\bbegin\b'
233 # attribute => 'Keyword'
234 # beginRegion => 'block'
235 # context => '#stay'
236 # insensitive => 'true'
237 # type => 'RegExpr'
238 0 ▶ if ($self->testRegExpr($text, '\\bbegin\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bbegin\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
239 0 return 1
240 }
241 # String => '\bend\b'
242 # attribute => 'Keyword'
243 # context => '#stay'
244 # endRegion => 'block'
245 # insensitive => 'true'
246 # type => 'RegExpr'
247 0 ▶ if ($self->testRegExpr($text, '\\bend\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bend\\b", 1, 0, 0, undef, 0, "#stay", "Keyword")) 0 0 0
248 0 return 1
249 }
250 # attribute => 'Normal Text'
251 # beginRegion => 'bracket'
252 # char => '('
253 # context => '#stay'
254 # type => 'DetectChar'
255 0 ▶ if ($self->testDetectChar($text, '(', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "(", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 0 0 0
256 0 return 1
257 }
258 # attribute => 'Normal Text'
259 # char => ')'
260 # context => '#stay'
261 # endRegion => 'bracket'
262 # type => 'DetectChar'
263 0 ▶ if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, ")", 0, 0, 0, undef, 0, "#stay", "Normal Text")) 0 0 0
264 0 return 1
265 }
266 # String => 'keywords'
267 # attribute => 'Keyword'
268 # context => '#stay'
269 # type => 'keyword'
270 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
271 0 return 1
272 }
273 # String => 'types'
274 # attribute => 'Data Type'
275 # context => '#stay'
276 # type => 'keyword'
277 0 ▶ if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "types", 0, undef, 0, "#stay", "Data Type")) 0 0 0
278 0 return 1
279 }
280 # String => 'operator'
281 # attribute => 'Operator'
282 # context => '#stay'
283 # type => 'keyword'
284 0 ▶ if ($self->testKeyword($text, 'operator', 0, undef, 0, '#stay', 'Operator')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testKeyword($text, "operator", 0, undef, 0, "#stay", "Operator")) 0 0 0
285 0 return 1
286 }
287 # String => '\b(\d+)\b'
288 # attribute => 'Decimal'
289 # context => '#stay'
290 # type => 'RegExpr'
291 0 ▶ if ($self->testRegExpr($text, '\\b(\\d+)\\b', 0, 0, 0, undef, 0, '#stay', 'Decimal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\b(\\d+)\\b", 0, 0, 0, undef, 0, "#stay", "Decimal")) 0 0 0
292 0 return 1
293 }
294 # String => '\bb"(0|1|x)+"'
295 # attribute => 'Bit'
296 # context => '#stay'
297 # insensitive => 'true'
298 # type => 'RegExpr'
299 0 ▶ if ($self->testRegExpr($text, '\\bb"(0|1|x)+"', 1, 0, 0, undef, 0, '#stay', 'Bit')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\bb\"(0|1|x)+\"", 1, 0, 0, undef, 0, "#stay", "Bit")) 0 0 0
300 0 return 1
301 }
302 # String => '\b(o|q)"[0-7*]"'
303 # attribute => 'Octal'
304 # context => '#stay'
305 # insensitive => 'true'
306 # type => 'RegExpr'
307 0 ▶ if ($self->testRegExpr($text, '\\b(o|q)"[0-7*]"', 1, 0, 0, undef, 0, '#stay', 'Octal')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\b(o|q)\"[0-7*]\"", 1, 0, 0, undef, 0, "#stay", "Octal")) 0 0 0
308 0 return 1
309 }
310 # String => '\b(h|x)"[0-9a-f]*"'
311 # attribute => 'Hex'
312 # context => '#stay'
313 # insensitive => 'true'
314 # type => 'RegExpr'
315 0 ▶ if ($self->testRegExpr($text, '\\b(h|x)"[0-9a-f]*"', 1, 0, 0, undef, 0, '#stay', 'Hex')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "\\b(h|x)\"[0-9a-f]*\"", 1, 0, 0, undef, 0, "#stay", "Hex")) 0 0 0
316 0 return 1
317 }
318 # attribute => 'String'
319 # char => '"'
320 # context => 'string'
321 # type => 'DetectChar'
322 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
323 0 return 1
324 }
325 # String => '--\s*BEGIN.*$'
326 # attribute => 'Region Marker'
327 # beginRegion => 'region'
328 # context => '#stay'
329 # firstNonSpace => 'true'
330 # type => 'RegExpr'
331 0 ▶ if ($self->testRegExpr($text, '--\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "--\\s*BEGIN.*\$", 0, 0, 0, undef, 1, "#stay", "Region Marker")) 0 0 0
332 0 return 1
333 }
334 # String => '--\s*END.*$'
335 # attribute => 'Region Marker'
336 # context => '#stay'
337 # endRegion => 'region'
338 # firstNonSpace => 'true'
339 # type => 'RegExpr'
340 0 ▶ if ($self->testRegExpr($text, '--\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "--\\s*END.*\$", 0, 0, 0, undef, 1, "#stay", "Region Marker")) 0 0 0
341 0 return 1
342 }
343 # String => '--.*$'
344 # attribute => 'Comment'
345 # context => '#stay'
346 # type => 'RegExpr'
347 0 ▶ if ($self->testRegExpr($text, '--.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testRegExpr($text, "--.*\$", 0, 0, 0, undef, 0, "#stay", "Comment")) 0 0 0
348 0 return 1
349 }
350 # attribute => 'Comment'
351 # char => '%'
352 # context => 'comment'
353 # type => 'DetectChar'
354 0 ▶ if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetectChar($text, "%", 0, 0, 0, undef, 0, "comment", "Comment")) 0 0 0
355 0 return 1
356 }
357 # attribute => 'Char'
358 # context => '#stay'
359 # type => 'HlCChar'
360 0 ▶ if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testHlCChar($text, 0, undef, 0, "#stay", "Char")) 0 0 0
361 0 return 1
362 }
363 0 return 0;
364 };
365  
366 0 ▶sub parsestring {
Subroutine parsestring: not called CC=3 SCAR=24.8
Pod undocumented
367 0 my ($self, $text) = @_;
368 # attribute => 'Char'
369 # char => '\'
370 # char1 => '"'
371 # context => '#stay'
372 # type => 'Detect2Chars'
373 0 ▶ if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'Char')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->testDetect2Chars($text, "\\", "\"", 0, 0, 0, undef, 0, "#stay", "Char")) 0 0 0
374 0 return 1
375 }
376 # attribute => 'String'
377 # char => '"'
378 # context => '#pop'
379 # type => 'DetectChar'
380 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
381 0 return 1
382 }
383 0 return 0;
384 };
385  
386  
387 1 1;
388  
389 __END__
« Kate/Cdash.pm ↑ Summary Kate/C.pm »