File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/E_Language.pm
Criterion Covered Total %
statement 30 74 40.5
branch 1 38 2.6
condition 1 3 33.3
subroutine 5 9 55.5
pod 0 6 0.0
total 37 130 28.4


line stmt bran cond sub pod time code
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 'e.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 0.21
9             #kate version 2.3
10             #generated: Sun Feb 3 22:02:04 2008, localtime
11              
12             package Syntax::Highlight::Engine::Kate::E_Language;
13              
14             our $VERSION = '0.14';
15              
16 1     1   588 use strict;
  1         2  
  1         28  
17 1     1   5 use warnings;
  1         2  
  1         32  
18 1     1   4 use base('Syntax::Highlight::Engine::Kate::Template');
  1         2  
  1         753  
19              
20             sub new {
21 2     2 0 534 my $proto = shift;
22 2   33     10 my $class = ref($proto) || $proto;
23 2         12 my $self = $class->SUPER::new(@_);
24 2         19 $self->attributes({
25             'Action' => 'Reserved',
26             'Bit' => 'DecVal',
27             'Comment' => 'Comment',
28             'Data Type' => 'DataType',
29             'Function' => 'Function',
30             'Integer' => 'DecVal',
31             'Keyword' => 'Keyword',
32             'Normal Text' => 'Normal',
33             'Operators' => 'Normal',
34             'OutSide E code' => 'Comment',
35             'Statement' => 'Others',
36             'Vector' => 'String',
37             });
38 2         11 $self->listAdd('Action',
39             'C',
40             'add',
41             'also',
42             'and',
43             'as',
44             'as_a',
45             'break',
46             'code',
47             'compute',
48             'computed',
49             'delayed',
50             'do',
51             'each',
52             'else',
53             'emit',
54             'empty',
55             'end',
56             'exit',
57             'finish',
58             'for',
59             'from',
60             'if',
61             'in',
62             'is',
63             'like',
64             'log',
65             'new',
66             'no',
67             'not',
68             'only',
69             'or',
70             'out',
71             'read',
72             'repeat',
73             'return',
74             'reverse',
75             'routine',
76             'step',
77             'then',
78             'to',
79             'traceable',
80             'untraceable',
81             'var',
82             'when',
83             'while',
84             'with',
85             'write',
86             'xor',
87             );
88 2         7 $self->listAdd('Cover',
89             'address',
90             'cover',
91             'error',
92             'event',
93             'events',
94             'illegal',
95             'item',
96             'kind',
97             'length',
98             'range',
99             'ranges',
100             'sample',
101             'text',
102             'transition',
103             'value',
104             );
105 2         7 $self->listAdd('Function',
106             'append',
107             'clear',
108             'crc_32',
109             'deep_compare',
110             'deep_compare_physical',
111             'delete',
112             'dut_error',
113             'hex',
114             'init',
115             'is_empty',
116             'pack',
117             'pop0',
118             'post_generate',
119             'pre_generate',
120             'pre_generate',
121             'run',
122             'set_config',
123             'setup',
124             'size',
125             'stop_run',
126             'unpack',
127             );
128 2         6 $self->listAdd('Generation',
129             'before',
130             'by',
131             'choose',
132             'gen',
133             'keep',
134             'keeping',
135             'matches',
136             'next',
137             'select',
138             'sequence',
139             'soft',
140             'using',
141             );
142 2         7 $self->listAdd('Simulator',
143             'all',
144             'always',
145             'basic',
146             'call',
147             'change',
148             'check',
149             'clock',
150             'cycle',
151             'cycles',
152             'expect',
153             'fall',
154             'first',
155             'forever',
156             'idle',
157             'initial',
158             'negedge',
159             'on',
160             'others',
161             'posedge',
162             'rise',
163             'start',
164             'task',
165             'that',
166             'time',
167             'until',
168             'verilog',
169             'vhdl',
170             'wait',
171             'within',
172             );
173 2         7 $self->listAdd('Statement',
174             'DOECHO',
175             'ECHO',
176             'chars',
177             'define',
178             'event',
179             'extend',
180             'import',
181             'initialize',
182             'non_terminal',
183             'script',
184             'struct',
185             'testgroup',
186             'type',
187             'unit',
188             );
189 2         7 $self->listAdd('Type',
190             'FALSE',
191             'MAX_INT',
192             'MIN_INT',
193             'NULL',
194             'TRUE',
195             'UNDEF',
196             'bit',
197             'bits',
198             'body',
199             'bool',
200             'byte',
201             'byte_array',
202             'continue',
203             'copy',
204             'default',
205             'external_pointer',
206             'file',
207             'files',
208             'form',
209             'global',
210             'index',
211             'init',
212             'int',
213             'it',
214             'list',
215             'load',
216             'long',
217             'me',
218             'method',
219             'module',
220             'ntv',
221             'of',
222             'pat',
223             'print',
224             'result',
225             'source_ref',
226             'string',
227             'symtab',
228             'sys',
229             'test',
230             'uint',
231             'untyped',
232             'vec',
233             );
234 2         19 $self->contextdata({
235             'comment' => {
236             callback => \&parsecomment,
237             attribute => 'Comment',
238             lineending => '#pop',
239             },
240             'normal' => {
241             callback => \&parsenormal,
242             attribute => 'Normal Text',
243             },
244             'out_comment' => {
245             callback => \&parseout_comment,
246             attribute => 'OutSide E code',
247             },
248             'string' => {
249             callback => \&parsestring,
250             attribute => 'Vector',
251             },
252             });
253 2         20 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
254 2         8 $self->basecontext('out_comment');
255 2         8 $self->keywordscase(0);
256 2         4 $self->initialize;
257 2         4 bless ($self, $class);
258 2         10 return $self;
259             }
260              
261             sub language {
262 0     0 0 0 return 'E Language';
263             }
264              
265             sub parsecomment {
266 0     0 0 0 my ($self, $text) = @_;
267 0         0 return 0;
268             };
269              
270             sub parsenormal {
271 0     0 0 0 my ($self, $text) = @_;
272             # attribute => 'Operators'
273             # beginRegion => 'Region1'
274             # char => '{'
275             # context => '#stay'
276             # type => 'DetectChar'
277 0 0       0 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Operators')) {
278 0         0 return 1
279             }
280             # attribute => 'Operators'
281             # char => '}'
282             # context => '#stay'
283             # endRegion => 'Region1'
284             # type => 'DetectChar'
285 0 0       0 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Operators')) {
286 0         0 return 1
287             }
288             # attribute => 'Integer'
289             # context => '#stay'
290             # type => 'HlCHex'
291 0 0       0 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Integer')) {
292 0         0 return 1
293             }
294             # attribute => 'Integer'
295             # context => '#stay'
296             # type => 'HlCOct'
297 0 0       0 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Integer')) {
298 0         0 return 1
299             }
300             # attribute => 'Integer'
301             # context => '#stay'
302             # type => 'Int'
303 0 0       0 if ($self->testInt($text, 0, undef, 0, '#stay', 'Integer')) {
304 0         0 return 1
305             }
306             # attribute => 'OutSide E code'
307             # char => '''
308             # char1 => '>'
309             # context => 'out_comment'
310             # type => 'Detect2Chars'
311 0 0       0 if ($self->testDetect2Chars($text, '\'', '>', 0, 0, 0, undef, 0, 'out_comment', 'OutSide E code')) {
312 0         0 return 1
313             }
314             # attribute => 'Comment'
315             # char => '-'
316             # char1 => '-'
317             # context => 'comment'
318             # type => 'Detect2Chars'
319 0 0       0 if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
320 0         0 return 1
321             }
322             # attribute => 'Comment'
323             # char => '/'
324             # char1 => '/'
325             # context => 'comment'
326             # type => 'Detect2Chars'
327 0 0       0 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
328 0         0 return 1
329             }
330             # attribute => 'Vector'
331             # char => '"'
332             # context => 'string'
333             # type => 'DetectChar'
334 0 0       0 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'Vector')) {
335 0         0 return 1
336             }
337             # String => ''[&><=:+\-*\|].,;'
338             # attribute => 'Operators'
339             # context => '#stay'
340             # type => 'AnyChar'
341 0 0       0 if ($self->testAnyChar($text, '\'[&><=:+\\-*\\|].,;', 0, 0, undef, 0, '#stay', 'Operators')) {
342 0         0 return 1
343             }
344             # String => 'Type'
345             # attribute => 'Data Type'
346             # context => '#stay'
347             # type => 'keyword'
348 0 0       0 if ($self->testKeyword($text, 'Type', 0, undef, 0, '#stay', 'Data Type')) {
349 0         0 return 1
350             }
351             # String => 'Function'
352             # attribute => 'Function'
353             # context => '#stay'
354             # type => 'keyword'
355 0 0       0 if ($self->testKeyword($text, 'Function', 0, undef, 0, '#stay', 'Function')) {
356 0         0 return 1
357             }
358             # String => 'Statement'
359             # attribute => 'Statement'
360             # context => '#stay'
361             # type => 'keyword'
362 0 0       0 if ($self->testKeyword($text, 'Statement', 0, undef, 0, '#stay', 'Statement')) {
363 0         0 return 1
364             }
365             # String => 'Action'
366             # attribute => 'Action'
367             # context => '#stay'
368             # type => 'keyword'
369 0 0       0 if ($self->testKeyword($text, 'Action', 0, undef, 0, '#stay', 'Action')) {
370 0         0 return 1
371             }
372             # String => 'Generation'
373             # attribute => 'Keyword'
374             # context => '#stay'
375             # type => 'keyword'
376 0 0       0 if ($self->testKeyword($text, 'Generation', 0, undef, 0, '#stay', 'Keyword')) {
377 0         0 return 1
378             }
379             # String => 'Cover'
380             # attribute => 'Keyword'
381             # context => '#stay'
382             # type => 'keyword'
383 0 0       0 if ($self->testKeyword($text, 'Cover', 0, undef, 0, '#stay', 'Keyword')) {
384 0         0 return 1
385             }
386             # String => 'Simulator'
387             # attribute => 'Keyword'
388             # context => '#stay'
389             # type => 'keyword'
390 0 0       0 if ($self->testKeyword($text, 'Simulator', 0, undef, 0, '#stay', 'Keyword')) {
391 0         0 return 1
392             }
393 0         0 return 0;
394             };
395              
396             sub parseout_comment {
397 2     2 0 3 my ($self, $text) = @_;
398             # attribute => 'OutSide E code'
399             # char => '<'
400             # char1 => '''
401             # context => '#pop'
402             # type => 'Detect2Chars'
403 2 50       8 if ($self->testDetect2Chars($text, '<', '\'', 0, 0, 0, undef, 0, '#pop', 'OutSide E code')) {
404 2         5 return 1
405             }
406 0           return 0;
407             };
408              
409             sub parsestring {
410 0     0 0   my ($self, $text) = @_;
411             # attribute => 'Vector'
412             # char => '"'
413             # context => '#pop'
414             # type => 'DetectChar'
415 0 0         if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Vector')) {
416 0           return 1
417             }
418 0           return 0;
419             };
420              
421              
422             1;
423              
424             __END__