Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / CGiS.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 'cgis.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.02
9 #kate version 2.4
10 #generated: Sun Feb  3 22:02:04 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::CGiS;
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       'Hint' => 'Others',
33       'Keyword' => 'Keyword',
34       'Normal Text' => 'Normal',
35       'Octal' => 'BaseN',
36       'Region Marker' => 'RegionMarker',
37       'String' => 'String',
38       'String Char' => 'Char',
39       'Symbol' => 'Normal',
40    });
41    $self->listAdd('keywords',
42       '1D',
43       '2D',
44       'break',
45       'continue',
46       'do',
47       'else',
48       'extern',
49       'for',
50       'forall',
51       'foreach',
52       'function',
53       'if',
54       'in',
55       'inout',
56       'internal',
57       'out',
58       'reduction',
59       'return',
60       'struct',
61       'typedef',
62       'while',
63    );
64    $self->listAdd('types',
65       'bool',
66       'bool2',
67       'bool3',
68       'bool4',
69       'float',
70       'float2',
71       'float3',
72       'float4',
73       'half',
74       'half2',
75       'half3',
76       'half4',
77       'int',
78       'int2',
79       'int3',
80       'int4',
81    );
82    $self->contextdata({
83       'Code' => {
84          callback => \&parseCode,
85          attribute => 'Normal Text',
86       },
87       'Commentar 1' => {
88          callback => \&parseCommentar1,
89          attribute => 'Comment',
90          lineending => '#pop',
91       },
92       'Commentar 2' => {
93          callback => \&parseCommentar2,
94          attribute => 'Comment',
95       },
96       'Common' => {
97          callback => \&parseCommon,
98          attribute => 'Normal Text',
99       },
100       'Control' => {
101          callback => \&parseControl,
102          attribute => 'Normal Text',
103       },
104       'Hint' => {
105          callback => \&parseHint,
106          attribute => 'Hint',
107       },
108       'Interface' => {
109          callback => \&parseInterface,
110          attribute => 'Normal Text',
111       },
112       'Normal' => {
113          callback => \&parseNormal,
114          attribute => 'Normal Text',
115       },
116       'Region Marker' => {
117          callback => \&parseRegionMarker,
118          attribute => 'Region Marker',
119          lineending => '#pop',
120       },
121    });
122    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
123    $self->basecontext('Normal');
124    $self->keywordscase(0);
125    $self->initialize;
126    bless ($self, $class);
127    return $self;
128 }
129
130 sub language {
131    return 'CGiS';
132 }
133
134 sub parseCode {
135    my ($self, $text) = @_;
136    # type => 'DetectSpaces'
137    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
138       return 1
139    }
140    # String => 'CONTROL'
141    # attribute => 'Keyword'
142    # context => 'Control'
143    # type => 'StringDetect'
144    if ($self->testStringDetect($text, 'CONTROL', 0, 0, 0, undef, 0, 'Control', 'Keyword')) {
145       return 1
146    }
147    # String => '#HINT'
148    # attribute => 'Hint'
149    # context => 'Hint'
150    # type => 'StringDetect'
151    if ($self->testStringDetect($text, '#HINT', 0, 0, 0, undef, 0, 'Hint', 'Hint')) {
152       return 1
153    }
154    # context => 'Common'
155    # type => 'IncludeRules'
156    if ($self->includeRules('Common', $text)) {
157       return 1
158    }
159    return 0;
160 };
161
162 sub parseCommentar1 {
163    my ($self, $text) = @_;
164    # context => '##Alerts'
165    # type => 'IncludeRules'
166    if ($self->includePlugin('Alerts', $text)) {
167       return 1
168    }
169    return 0;
170 };
171
172 sub parseCommentar2 {
173    my ($self, $text) = @_;
174    # attribute => 'Comment'
175    # char => '*'
176    # char1 => '/'
177    # context => '#pop'
178    # endRegion => 'Comment'
179    # type => 'Detect2Chars'
180    if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
181       return 1
182    }
183    # context => '##Alerts'
184    # type => 'IncludeRules'
185    if ($self->includePlugin('Alerts', $text)) {
186       return 1
187    }
188    return 0;
189 };
190
191 sub parseCommon {
192    my ($self, $text) = @_;
193    # String => '//BEGIN'
194    # attribute => 'Region Marker'
195    # beginRegion => 'Region1'
196    # context => 'Region Marker'
197    # firstNonSpace => 'true'
198    # type => 'StringDetect'
199    if ($self->testStringDetect($text, '//BEGIN', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) {
200       return 1
201    }
202    # String => '//END'
203    # attribute => 'Region Marker'
204    # context => 'Region Marker'
205    # endRegion => 'Region1'
206    # firstNonSpace => 'true'
207    # type => 'StringDetect'
208    if ($self->testStringDetect($text, '//END', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) {
209       return 1
210    }
211    # String => 'keywords'
212    # attribute => 'Keyword'
213    # context => '#stay'
214    # type => 'keyword'
215    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
216       return 1
217    }
218    # String => 'types'
219    # attribute => 'Data Type'
220    # context => '#stay'
221    # type => 'keyword'
222    if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
223       return 1
224    }
225    # type => 'DetectIdentifier'
226    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
227       return 1
228    }
229    # attribute => 'Symbol'
230    # beginRegion => 'Brace1'
231    # char => '{'
232    # context => '#stay'
233    # type => 'DetectChar'
234    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
235       return 1
236    }
237    # attribute => 'Symbol'
238    # char => '}'
239    # context => '#stay'
240    # endRegion => 'Brace1'
241    # type => 'DetectChar'
242    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
243       return 1
244    }
245    # attribute => 'Float'
246    # context => '#stay'
247    # items => 'ARRAY(0x11a5b70)'
248    # type => 'Float'
249    if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
250       # String => 'fF'
251       # attribute => 'Float'
252       # context => '#stay'
253       # type => 'AnyChar'
254       if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
255          return 1
256       }
257    }
258    # attribute => 'Octal'
259    # context => '#stay'
260    # type => 'HlCOct'
261    if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
262       return 1
263    }
264    # attribute => 'Hex'
265    # context => '#stay'
266    # type => 'HlCHex'
267    if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
268       return 1
269    }
270    # attribute => 'Decimal'
271    # context => '#stay'
272    # type => 'Int'
273    if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
274       return 1
275    }
276    # context => '##Doxygen'
277    # type => 'IncludeRules'
278    if ($self->includePlugin('Doxygen', $text)) {
279       return 1
280    }
281    # attribute => 'Comment'
282    # char => '/'
283    # char1 => '/'
284    # context => 'Commentar 1'
285    # type => 'Detect2Chars'
286    if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
287       return 1
288    }
289    # attribute => 'Comment'
290    # beginRegion => 'Comment'
291    # char => '/'
292    # char1 => '*'
293    # context => 'Commentar 2'
294    # type => 'Detect2Chars'
295    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
296       return 1
297    }
298    return 0;
299 };
300
301 sub parseControl {
302    my ($self, $text) = @_;
303    # type => 'DetectSpaces'
304    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
305       return 1
306    }
307    # String => 'CODE'
308    # attribute => 'Keyword'
309    # context => 'Code'
310    # type => 'StringDetect'
311    if ($self->testStringDetect($text, 'CODE', 0, 0, 0, undef, 0, 'Code', 'Keyword')) {
312       return 1
313    }
314    # context => 'Common'
315    # type => 'IncludeRules'
316    if ($self->includeRules('Common', $text)) {
317       return 1
318    }
319    return 0;
320 };
321
322 sub parseHint {
323    my ($self, $text) = @_;
324    # type => 'DetectSpaces'
325    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
326       return 1
327    }
328    # attribute => 'Hint'
329    # char => ')'
330    # context => '#pop'
331    # type => 'DetectChar'
332    if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Hint')) {
333       return 1
334    }
335    # type => 'DetectIdentifier'
336    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
337       return 1
338    }
339    return 0;
340 };
341
342 sub parseInterface {
343    my ($self, $text) = @_;
344    # type => 'DetectSpaces'
345    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
346       return 1
347    }
348    # String => 'CONTROL'
349    # attribute => 'Keyword'
350    # context => 'Control'
351    # type => 'StringDetect'
352    if ($self->testStringDetect($text, 'CONTROL', 0, 0, 0, undef, 0, 'Control', 'Keyword')) {
353       return 1
354    }
355    # String => 'CODE'
356    # attribute => 'Keyword'
357    # context => 'Code'
358    # type => 'StringDetect'
359    if ($self->testStringDetect($text, 'CODE', 0, 0, 0, undef, 0, 'Code', 'Keyword')) {
360       return 1
361    }
362    # context => 'Common'
363    # type => 'IncludeRules'
364    if ($self->includeRules('Common', $text)) {
365       return 1
366    }
367    return 0;
368 };
369
370 sub parseNormal {
371    my ($self, $text) = @_;
372    # type => 'DetectSpaces'
373    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
374       return 1
375    }
376    # String => 'PROGRAM'
377    # attribute => 'Keyword'
378    # context => '#stay'
379    # type => 'StringDetect'
380    if ($self->testStringDetect($text, 'PROGRAM', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
381       return 1
382    }
383    # String => 'INTERFACE'
384    # attribute => 'Keyword'
385    # context => 'Interface'
386    # type => 'StringDetect'
387    if ($self->testStringDetect($text, 'INTERFACE', 0, 0, 0, undef, 0, 'Interface', 'Keyword')) {
388       return 1
389    }
390    return 0;
391 };
392
393 sub parseRegionMarker {
394    my ($self, $text) = @_;
395    return 0;
396 };
397
398
399 1;
400
401 __END__
402
403 =head1 NAME
404
405 Syntax::Highlight::Engine::Kate::CGiS - a Plugin for CGiS syntax highlighting
406
407 =head1 SYNOPSIS
408
409  require Syntax::Highlight::Engine::Kate::CGiS;
410  my $sh = new Syntax::Highlight::Engine::Kate::CGiS([
411  ]);
412
413 =head1 DESCRIPTION
414
415 Syntax::Highlight::Engine::Kate::CGiS is a  plugin module that provides syntax highlighting
416 for CGiS to the Syntax::Haghlight::Engine::Kate highlighting engine.
417
418 This code is generated from the syntax definition files used
419 by the Kate project.
420 It works quite fine, but can use refinement and optimization.
421
422 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
423
424 =cut
425
426 =head1 AUTHOR
427
428 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
429
430 =cut
431
432 =head1 BUGS
433
434 Unknown. If you find any, please contact the author
435
436 =cut
437