File Coverage

blib/lib/Syntax/Highlight/Engine/Kate/IDL.pm
Criterion Covered Total %
statement 22 93 23.6
branch 0 52 0.0
condition 1 3 33.3
subroutine 4 14 28.5
pod 0 11 0.0
total 27 173 15.6


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 'idl.xml' file of the syntax highlight
6             # engine of the kate text editor (http://www.kate-editor.org
7              
8             #kate xml version 1.07
9             #kate version 2.4
10             #generated: Sun Feb 3 22:02:05 2008, localtime
11              
12             package Syntax::Highlight::Engine::Kate::IDL;
13              
14             our $VERSION = '0.14';
15              
16 1     1   682 use strict;
  1         2  
  1         31  
17 1     1   5 use warnings;
  1         2  
  1         30  
18 1     1   5 use base('Syntax::Highlight::Engine::Kate::Template');
  1         2  
  1         1076  
19              
20             sub new {
21 1     1 0 597 my $proto = shift;
22 1   33     6 my $class = ref($proto) || $proto;
23 1         11 my $self = $class->SUPER::new(@_);
24 1         14 $self->attributes({
25             'Alert' => 'Alert',
26             'Char' => 'Char',
27             'Comment' => 'Comment',
28             'Data Type' => 'DataType',
29             'Decimal' => 'DecVal',
30             'Float' => 'Float',
31             'Hex' => 'BaseN',
32             'Keyword' => 'Keyword',
33             'Normal Text' => 'Normal',
34             'Octal' => 'BaseN',
35             'Prep. Lib' => 'Others',
36             'Preprocessor' => 'Others',
37             'String' => 'String',
38             'String Char' => 'Char',
39             'Symbol' => 'Normal',
40             });
41 1         7 $self->listAdd('keywords',
42             'FALSE',
43             'Object',
44             'TRUE',
45             'any',
46             'attribute',
47             'case',
48             'const',
49             'context',
50             'default',
51             'enum',
52             'exception',
53             'fixed',
54             'in',
55             'inout',
56             'interface',
57             'module',
58             'oneway',
59             'out',
60             'public',
61             'raises',
62             'readonly',
63             'sequence',
64             'struct',
65             'switch',
66             'typedef',
67             'union',
68             'unsigned',
69             );
70 1         4 $self->listAdd('types',
71             'boolean',
72             'char',
73             'double',
74             'float',
75             'long',
76             'octet',
77             'short',
78             'string',
79             'void',
80             'wchar',
81             'wstring',
82             );
83 1         24 $self->contextdata({
84             'Commentar 1' => {
85             callback => \&parseCommentar1,
86             attribute => 'Comment',
87             lineending => '#pop',
88             },
89             'Commentar 2' => {
90             callback => \&parseCommentar2,
91             attribute => 'Comment',
92             },
93             'Commentar/Preprocessor' => {
94             callback => \&parseCommentarPreprocessor,
95             attribute => 'Comment',
96             },
97             'Normal' => {
98             callback => \&parseNormal,
99             attribute => 'Normal Text',
100             },
101             'Preprocessor' => {
102             callback => \&parsePreprocessor,
103             attribute => 'Preprocessor',
104             lineending => '#pop',
105             },
106             'Some Context' => {
107             callback => \&parseSomeContext,
108             attribute => 'Normal Text',
109             lineending => '#pop',
110             },
111             'Some Context2' => {
112             callback => \&parseSomeContext2,
113             attribute => 'Normal Text',
114             lineending => '#pop',
115             },
116             'Some Context3' => {
117             callback => \&parseSomeContext3,
118             attribute => 'Normal Text',
119             },
120             'String' => {
121             callback => \&parseString,
122             attribute => 'String',
123             },
124             });
125 1         5 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
126 1         4 $self->basecontext('Normal');
127 1         5 $self->keywordscase(0);
128 1         4 $self->initialize;
129 1         2 bless ($self, $class);
130 1         3 return $self;
131             }
132              
133             sub language {
134 0     0 0   return 'IDL';
135             }
136              
137             sub parseCommentar1 {
138 0     0 0   my ($self, $text) = @_;
139             # String => '(FIXME|TODO)'
140             # attribute => 'Alert'
141             # context => '#stay'
142             # type => 'RegExpr'
143 0 0         if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
144 0           return 1
145             }
146 0           return 0;
147             };
148              
149             sub parseCommentar2 {
150 0     0 0   my ($self, $text) = @_;
151             # String => '(FIXME|TODO)'
152             # attribute => 'Alert'
153             # context => '#stay'
154             # type => 'RegExpr'
155 0 0         if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
156 0           return 1
157             }
158             # attribute => 'Comment'
159             # char => '*'
160             # char1 => '/'
161             # context => '#pop'
162             # type => 'Detect2Chars'
163 0 0         if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
164 0           return 1
165             }
166 0           return 0;
167             };
168              
169             sub parseCommentarPreprocessor {
170 0     0 0   my ($self, $text) = @_;
171             # attribute => 'Comment'
172             # char => '*'
173             # char1 => '/'
174             # context => '#pop'
175             # type => 'Detect2Chars'
176 0 0         if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
177 0           return 1
178             }
179 0           return 0;
180             };
181              
182             sub parseNormal {
183 0     0 0   my ($self, $text) = @_;
184             # String => 'keywords'
185             # attribute => 'Keyword'
186             # context => '#stay'
187             # type => 'keyword'
188 0 0         if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
189 0           return 1
190             }
191             # String => 'types'
192             # attribute => 'Data Type'
193             # context => '#stay'
194             # type => 'keyword'
195 0 0         if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
196 0           return 1
197             }
198             # attribute => 'Octal'
199             # context => '#stay'
200             # type => 'HlCOct'
201 0 0         if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
202 0           return 1
203             }
204             # attribute => 'Hex'
205             # context => '#stay'
206             # type => 'HlCHex'
207 0 0         if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
208 0           return 1
209             }
210             # attribute => 'Char'
211             # context => '#stay'
212             # type => 'HlCChar'
213 0 0         if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
214 0           return 1
215             }
216             # attribute => 'String'
217             # char => '"'
218             # context => 'String'
219             # type => 'DetectChar'
220 0 0         if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
221 0           return 1
222             }
223             # context => '##Doxygen'
224             # type => 'IncludeRules'
225 0 0         if ($self->includePlugin('Doxygen', $text)) {
226 0           return 1
227             }
228             # attribute => 'Comment'
229             # char => '/'
230             # char1 => '/'
231             # context => 'Commentar 1'
232             # type => 'Detect2Chars'
233 0 0         if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
234 0           return 1
235             }
236             # attribute => 'Comment'
237             # char => '/'
238             # char1 => '*'
239             # context => 'Commentar 2'
240             # type => 'Detect2Chars'
241 0 0         if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
242 0           return 1
243             }
244             # String => '!%&()+,-<=>?[]^{|}~'
245             # attribute => 'Symbol'
246             # context => '#stay'
247             # type => 'AnyChar'
248 0 0         if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
249 0           return 1
250             }
251             # String => '#if 0'
252             # attribute => 'Comment'
253             # context => 'Some Context3'
254             # insensitive => 'FALSE'
255             # type => 'StringDetect'
256 0 0         if ($self->testStringDetect($text, '#if 0', 0, 0, 0, undef, 0, 'Some Context3', 'Comment')) {
257 0           return 1
258             }
259             # attribute => 'Preprocessor'
260             # char => '#'
261             # column => '0'
262             # context => 'Preprocessor'
263             # type => 'DetectChar'
264 0 0         if ($self->testDetectChar($text, '#', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) {
265 0           return 1
266             }
267 0           return 0;
268             };
269              
270             sub parsePreprocessor {
271 0     0 0   my ($self, $text) = @_;
272             # attribute => 'Preprocessor'
273             # context => 'Some Context2'
274             # type => 'LineContinue'
275 0 0         if ($self->testLineContinue($text, 0, undef, 0, 'Some Context2', 'Preprocessor')) {
276 0           return 1
277             }
278             # attribute => 'Prep. Lib'
279             # char => '"'
280             # char1 => '"'
281             # context => '#stay'
282             # type => 'RangeDetect'
283 0 0         if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
284 0           return 1
285             }
286             # attribute => 'Prep. Lib'
287             # char => '<'
288             # char1 => '>'
289             # context => '#stay'
290             # type => 'RangeDetect'
291 0 0         if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
292 0           return 1
293             }
294             # attribute => 'Comment'
295             # char => '/'
296             # char1 => '/'
297             # context => 'Commentar 1'
298             # type => 'Detect2Chars'
299 0 0         if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
300 0           return 1
301             }
302             # attribute => 'Comment'
303             # char => '/'
304             # char1 => '*'
305             # context => 'Commentar/Preprocessor'
306             # type => 'Detect2Chars'
307 0 0         if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar/Preprocessor', 'Comment')) {
308 0           return 1
309             }
310 0           return 0;
311             };
312              
313             sub parseSomeContext {
314 0     0 0   my ($self, $text) = @_;
315 0           return 0;
316             };
317              
318             sub parseSomeContext2 {
319 0     0 0   my ($self, $text) = @_;
320 0           return 0;
321             };
322              
323             sub parseSomeContext3 {
324 0     0 0   my ($self, $text) = @_;
325             # String => '(FIXME|TODO)'
326             # attribute => 'Alert'
327             # context => '#stay'
328             # type => 'RegExpr'
329 0 0         if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
330 0           return 1
331             }
332             # String => '#endif'
333             # attribute => 'Comment'
334             # column => '0'
335             # context => '#pop'
336             # type => 'StringDetect'
337 0 0         if ($self->testStringDetect($text, '#endif', 0, 0, 0, 0, 0, '#pop', 'Comment')) {
338 0           return 1
339             }
340 0           return 0;
341             };
342              
343             sub parseString {
344 0     0 0   my ($self, $text) = @_;
345             # attribute => 'String'
346             # context => 'Some Context'
347             # type => 'LineContinue'
348 0 0         if ($self->testLineContinue($text, 0, undef, 0, 'Some Context', 'String')) {
349 0           return 1
350             }
351             # attribute => 'String Char'
352             # context => '#stay'
353             # type => 'HlCStringChar'
354 0 0         if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
355 0           return 1
356             }
357             # attribute => 'String'
358             # char => '"'
359             # context => '#pop'
360             # type => 'DetectChar'
361 0 0         if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
362 0           return 1
363             }
364 0           return 0;
365             };
366              
367              
368             1;
369              
370             __END__