Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / ObjectiveminusC.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 'objectivec.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.3
10 #generated: Sun Feb  3 22:02:05 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::ObjectiveminusC;
13
14 our $VERSION = '0.06';
15
16 use strict;
17 use warnings;
18 use base('Syntax::Highlight::Engine::Kate::Template');
19
20 sub new {
21    my $proto = shift;
22    my $class = ref($proto) || $proto;
23    my $self = $class->SUPER::new(@_);
24    $self->attributes({
25       'Char' => 'Char',
26       'Comment' => 'Comment',
27       'Data Type' => 'DataType',
28       'Decimal' => 'DecVal',
29       'Float' => 'Float',
30       'Hex' => 'BaseN',
31       'Keyword' => 'Keyword',
32       'Normal Text' => 'Normal',
33       'Octal' => 'BaseN',
34       'Prep. Lib' => 'Others',
35       'Preprocessor' => 'Others',
36       'String' => 'String',
37       'String Char' => 'Char',
38       'Symbol' => 'Normal',
39    });
40    $self->listAdd('keywords',
41       '@class',
42       '@defs',
43       '@encode',
44       '@end',
45       '@implementation',
46       '@interface',
47       '@private',
48       '@protected',
49       '@protocol',
50       '@public',
51       '@selector',
52       'break',
53       'case',
54       'continue',
55       'default',
56       'do',
57       'else',
58       'enum',
59       'extern',
60       'for',
61       'goto',
62       'if',
63       'return',
64       'self',
65       'sizeof',
66       'struct',
67       'super',
68       'switch',
69       'typedef',
70       'union',
71       'while',
72    );
73    $self->listAdd('types',
74       'auto',
75       'char',
76       'const',
77       'double',
78       'float',
79       'int',
80       'long',
81       'register',
82       'short',
83       'signed',
84       'static',
85       'unsigned',
86       'void',
87       'volatile',
88    );
89    $self->contextdata({
90       'Default' => {
91          callback => \&parseDefault,
92          attribute => 'Normal Text',
93       },
94       'MultiLineComment' => {
95          callback => \&parseMultiLineComment,
96          attribute => 'Comment',
97       },
98       'MultiLineCommentPrep' => {
99          callback => \&parseMultiLineCommentPrep,
100          attribute => 'Comment',
101       },
102       'Preprocessor' => {
103          callback => \&parsePreprocessor,
104          attribute => 'Preprocessor',
105          lineending => 'Default',
106       },
107       'SingleLineComment' => {
108          callback => \&parseSingleLineComment,
109          attribute => 'Comment',
110          lineending => '#pop',
111       },
112       'String' => {
113          callback => \&parseString,
114          attribute => 'String',
115          lineending => '#pop',
116       },
117    });
118    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
119    $self->basecontext('Default');
120    $self->keywordscase(0);
121    $self->initialize;
122    bless ($self, $class);
123    return $self;
124 }
125
126 sub language {
127    return 'Objective-C';
128 }
129
130 sub parseDefault {
131    my ($self, $text) = @_;
132    # String => 'keywords'
133    # attribute => 'Keyword'
134    # context => '#stay'
135    # type => 'keyword'
136    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
137       return 1
138    }
139    # String => 'types'
140    # attribute => 'Data Type'
141    # context => '#stay'
142    # type => 'keyword'
143    if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
144       return 1
145    }
146    # attribute => 'Symbol'
147    # beginRegion => 'Brace1'
148    # char => '{'
149    # context => '#stay'
150    # type => 'DetectChar'
151    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
152       return 1
153    }
154    # attribute => 'Symbol'
155    # char => '}'
156    # context => '#stay'
157    # endRegion => 'Brace1'
158    # type => 'DetectChar'
159    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
160       return 1
161    }
162    # attribute => 'Float'
163    # context => '#stay'
164    # items => 'ARRAY(0x197ace0)'
165    # type => 'Float'
166    if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
167       # String => 'fF'
168       # attribute => 'Float'
169       # context => '#stay'
170       # type => 'AnyChar'
171       if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
172          return 1
173       }
174    }
175    # attribute => 'Octal'
176    # context => '#stay'
177    # type => 'HlCOct'
178    if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
179       return 1
180    }
181    # attribute => 'Hex'
182    # context => '#stay'
183    # type => 'HlCHex'
184    if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
185       return 1
186    }
187    # attribute => 'Decimal'
188    # context => '#stay'
189    # items => 'ARRAY(0x1835840)'
190    # type => 'Int'
191    if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
192       # String => 'ULL'
193       # attribute => 'Decimal'
194       # context => '#stay'
195       # insensitive => 'TRUE'
196       # type => 'StringDetect'
197       if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
198          return 1
199       }
200       # String => 'LUL'
201       # attribute => 'Decimal'
202       # context => '#stay'
203       # insensitive => 'TRUE'
204       # type => 'StringDetect'
205       if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
206          return 1
207       }
208       # String => 'LLU'
209       # attribute => 'Decimal'
210       # context => '#stay'
211       # insensitive => 'TRUE'
212       # type => 'StringDetect'
213       if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
214          return 1
215       }
216       # String => 'UL'
217       # attribute => 'Decimal'
218       # context => '#stay'
219       # insensitive => 'TRUE'
220       # type => 'StringDetect'
221       if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
222          return 1
223       }
224       # String => 'LU'
225       # attribute => 'Decimal'
226       # context => '#stay'
227       # insensitive => 'TRUE'
228       # type => 'StringDetect'
229       if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
230          return 1
231       }
232       # String => 'LL'
233       # attribute => 'Decimal'
234       # context => '#stay'
235       # insensitive => 'TRUE'
236       # type => 'StringDetect'
237       if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
238          return 1
239       }
240       # String => 'U'
241       # attribute => 'Decimal'
242       # context => '#stay'
243       # insensitive => 'TRUE'
244       # type => 'StringDetect'
245       if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
246          return 1
247       }
248       # String => 'L'
249       # attribute => 'Decimal'
250       # context => '#stay'
251       # insensitive => 'TRUE'
252       # type => 'StringDetect'
253       if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
254          return 1
255       }
256    }
257    # attribute => 'Char'
258    # context => '#stay'
259    # type => 'HlCChar'
260    if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
261       return 1
262    }
263    # attribute => 'String'
264    # char => '"'
265    # context => 'String'
266    # type => 'DetectChar'
267    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
268       return 1
269    }
270    # attribute => 'Comment'
271    # char => '/'
272    # char1 => '/'
273    # context => 'SingleLineComment'
274    # type => 'Detect2Chars'
275    if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) {
276       return 1
277    }
278    # attribute => 'Comment'
279    # char => '/'
280    # char1 => '*'
281    # context => 'MultiLineComment'
282    # type => 'Detect2Chars'
283    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineComment', 'Comment')) {
284       return 1
285    }
286    # String => ':!%&()+,-/.*<=>?[]|~^;'
287    # attribute => 'Symbol'
288    # context => '#stay'
289    # type => 'AnyChar'
290    if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) {
291       return 1
292    }
293    # String => '^#'
294    # attribute => 'Preprocessor'
295    # context => 'Preprocessor'
296    # type => 'RegExpr'
297    if ($self->testRegExpr($text, '^#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
298       return 1
299    }
300    # attribute => 'String'
301    # char => '@'
302    # char1 => '"'
303    # context => 'String'
304    # type => 'Detect2Chars'
305    if ($self->testDetect2Chars($text, '@', '"', 0, 0, 0, undef, 0, 'String', 'String')) {
306       return 1
307    }
308    return 0;
309 };
310
311 sub parseMultiLineComment {
312    my ($self, $text) = @_;
313    # attribute => 'Comment'
314    # char => '*'
315    # char1 => '/'
316    # context => '#pop'
317    # type => 'Detect2Chars'
318    if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
319       return 1
320    }
321    return 0;
322 };
323
324 sub parseMultiLineCommentPrep {
325    my ($self, $text) = @_;
326    # attribute => 'Comment'
327    # char => '*'
328    # char1 => '/'
329    # context => '#pop#pop'
330    # type => 'Detect2Chars'
331    if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop', 'Comment')) {
332       return 1
333    }
334    return 0;
335 };
336
337 sub parsePreprocessor {
338    my ($self, $text) = @_;
339    # attribute => 'Preprocessor'
340    # context => '#stay'
341    # type => 'LineContinue'
342    if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) {
343       return 1
344    }
345    # attribute => 'Prep. Lib'
346    # char => '"'
347    # char1 => '"'
348    # context => '#stay'
349    # type => 'RangeDetect'
350    if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
351       return 1
352    }
353    # attribute => 'Prep. Lib'
354    # char => '<'
355    # char1 => '>'
356    # context => '#stay'
357    # type => 'RangeDetect'
358    if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
359       return 1
360    }
361    # context => '##Doxygen'
362    # type => 'IncludeRules'
363    if ($self->includePlugin('Doxygen', $text)) {
364       return 1
365    }
366    # attribute => 'Comment'
367    # char => '/'
368    # char1 => '/'
369    # context => 'SingleLineComment'
370    # type => 'Detect2Chars'
371    if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) {
372       return 1
373    }
374    # attribute => 'Comment'
375    # char => '/'
376    # char1 => '*'
377    # context => 'MultiLineCommentPrep'
378    # type => 'Detect2Chars'
379    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineCommentPrep', 'Comment')) {
380       return 1
381    }
382    return 0;
383 };
384
385 sub parseSingleLineComment {
386    my ($self, $text) = @_;
387    return 0;
388 };
389
390 sub parseString {
391    my ($self, $text) = @_;
392    # attribute => 'String'
393    # context => '#stay'
394    # type => 'LineContinue'
395    if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
396       return 1
397    }
398    # attribute => 'String Char'
399    # context => '#stay'
400    # type => 'HlCStringChar'
401    if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
402       return 1
403    }
404    # attribute => 'String'
405    # char => '"'
406    # context => '#pop'
407    # type => 'DetectChar'
408    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
409       return 1
410    }
411    return 0;
412 };
413
414
415 1;
416
417 __END__
418
419 =head1 NAME
420
421 Syntax::Highlight::Engine::Kate::ObjectiveminusC - a Plugin for Objective-C syntax highlighting
422
423 =head1 SYNOPSIS
424
425  require Syntax::Highlight::Engine::Kate::ObjectiveminusC;
426  my $sh = new Syntax::Highlight::Engine::Kate::ObjectiveminusC([
427  ]);
428
429 =head1 DESCRIPTION
430
431 Syntax::Highlight::Engine::Kate::ObjectiveminusC is a  plugin module that provides syntax highlighting
432 for Objective-C to the Syntax::Haghlight::Engine::Kate highlighting engine.
433
434 This code is generated from the syntax definition files used
435 by the Kate project.
436 It works quite fine, but can use refinement and optimization.
437
438 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
439
440 =cut
441
442 =head1 AUTHOR
443
444 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
445
446 =cut
447
448 =head1 BUGS
449
450 Unknown. If you find any, please contact the author
451
452 =cut
453