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.
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
10 #generated: Sun Feb 3 22:02:04 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Ferite;
14 our $VERSION = '0.06';
18 use base('Syntax::Highlight::Engine::Kate::Template');
22 my $class = ref($proto) || $proto;
23 my $self = $class->SUPER::new(@_);
27 'Comment' => 'Comment',
28 'Data Type' => 'DataType',
29 'Decimal' => 'DecVal',
32 'Keyword' => 'Keyword',
33 'Normal Text' => 'Normal',
35 'Prep. Lib' => 'Others',
36 'Preprocessor' => 'Others',
38 'String Char' => 'Char',
41 $self->listAdd('keywords',
63 $self->listAdd('types',
74 callback => \&parseComment,
75 attribute => 'Comment',
79 callback => \&parseDefault,
80 attribute => 'Normal Text',
82 'Multiline Comment' => {
83 callback => \&parseMultilineComment,
84 attribute => 'Comment',
86 'Multiline Comment 2' => {
87 callback => \&parseMultilineComment2,
88 attribute => 'Comment',
91 callback => \&parsePreprocessor,
92 attribute => 'Preprocessor',
96 callback => \&parseString,
97 attribute => 'String',
101 callback => \&parseUndeffed,
102 attribute => 'Comment',
105 callback => \&parseunknown,
106 attribute => 'Normal Text',
107 lineending => '#pop',
110 callback => \&parseunknown2,
111 attribute => 'Normal Text',
112 lineending => '#pop',
115 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
116 $self->basecontext('Default');
117 $self->keywordscase(0);
119 bless ($self, $class);
128 my ($self, $text) = @_;
129 # String => '(FIXME|TODO)'
130 # attribute => 'Alert'
133 if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
140 my ($self, $text) = @_;
141 # String => 'keywords'
142 # attribute => 'Keyword'
145 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
149 # attribute => 'Data Type'
152 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
155 # attribute => 'Float'
157 # items => 'ARRAY(0xfd97c0)'
159 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
161 # attribute => 'Float'
164 if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
168 # attribute => 'Octal'
171 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
177 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
180 # attribute => 'Decimal'
182 # items => 'ARRAY(0x11bdd60)'
184 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
186 # attribute => 'Decimal'
188 # insensitive => 'TRUE'
189 # type => 'StringDetect'
190 if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
194 # attribute => 'Decimal'
196 # insensitive => 'TRUE'
197 # type => 'StringDetect'
198 if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
202 # attribute => 'Decimal'
204 # insensitive => 'TRUE'
205 # type => 'StringDetect'
206 if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
210 # attribute => 'Decimal'
212 # insensitive => 'TRUE'
213 # type => 'StringDetect'
214 if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
218 # attribute => 'Decimal'
220 # insensitive => 'TRUE'
221 # type => 'StringDetect'
222 if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
226 # attribute => 'Decimal'
228 # insensitive => 'TRUE'
229 # type => 'StringDetect'
230 if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
234 # attribute => 'Decimal'
236 # insensitive => 'TRUE'
237 # type => 'StringDetect'
238 if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
242 # attribute => 'Decimal'
244 # insensitive => 'TRUE'
245 # type => 'StringDetect'
246 if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
250 # attribute => 'Char'
253 if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
256 # attribute => 'String'
258 # context => 'String'
259 # type => 'DetectChar'
260 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
263 # attribute => 'Comment'
266 # context => 'Comment'
267 # type => 'Detect2Chars'
268 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
271 # attribute => 'Comment'
274 # context => 'Multiline Comment'
275 # type => 'Detect2Chars'
276 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multiline Comment', 'Comment')) {
279 # String => '!%&()+,-<=>?[]^{|}~'
280 # attribute => 'Symbol'
283 if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
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')) {
294 # attribute => 'Preprocessor'
297 # context => 'Preprocessor'
298 # type => 'DetectChar'
299 if ($self->testDetectChar($text, '#', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) {
305 sub parseMultilineComment {
306 my ($self, $text) = @_;
307 # attribute => 'Comment'
311 # type => 'Detect2Chars'
312 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
315 # String => '(FIXME|TODO)'
316 # attribute => 'Alert'
319 if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
325 sub parseMultilineComment2 {
326 my ($self, $text) = @_;
327 # attribute => 'Comment'
331 # type => 'Detect2Chars'
332 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
338 sub parsePreprocessor {
339 my ($self, $text) = @_;
340 # attribute => 'Preprocessor'
342 # type => 'LineContinue'
343 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) {
346 # attribute => 'Prep. Lib'
350 # type => 'RangeDetect'
351 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
354 # attribute => 'Prep. Lib'
358 # type => 'RangeDetect'
359 if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
362 # attribute => 'Comment'
365 # context => 'Comment'
366 # type => 'Detect2Chars'
367 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
370 # attribute => 'Comment'
373 # context => 'Multiline Comment 2'
374 # type => 'Detect2Chars'
375 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multiline Comment 2', 'Comment')) {
382 my ($self, $text) = @_;
383 # attribute => 'String'
385 # type => 'LineContinue'
386 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
389 # attribute => 'String Char'
391 # type => 'HlCStringChar'
392 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
395 # attribute => 'String'
398 # type => 'DetectChar'
399 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
406 my ($self, $text) = @_;
407 # String => '(FIXME|TODO)'
408 # attribute => 'Alert'
411 if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
415 # attribute => 'Comment'
418 # type => 'StringDetect'
419 if ($self->testStringDetect($text, '#endif', 0, 0, 0, 0, 0, '#pop', 'Comment')) {
426 my ($self, $text) = @_;
431 my ($self, $text) = @_;
442 Syntax::Highlight::Engine::Kate::Ferite - a Plugin for ferite syntax highlighting
446 require Syntax::Highlight::Engine::Kate::Ferite;
447 my $sh = new Syntax::Highlight::Engine::Kate::Ferite([
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.
455 This code is generated from the syntax definition files used
457 It works quite fine, but can use refinement and optimization.
459 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
465 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
471 Unknown. If you find any, please contact the author