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