Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / UnrealScript.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 'uscript.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 0.91
9 #kate version 2.3
10 #generated: Sun Feb  3 22:02:06 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::UnrealScript;
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       'Preprocessor' => 'Others',
35       'Region Marker' => 'RegionMarker',
36       'String' => 'String',
37       'String Char' => 'Char',
38       'Symbol' => 'Normal',
39    });
40    $self->listAdd('keywords',
41       'Cross',
42       'Dot',
43       'Static',
44       'abstract',
45       'array',
46       'auto',
47       'break',
48       'case',
49       'coerce',
50       'config',
51       'const',
52       'continue',
53       'cpptext',
54       'default',
55       'defaultproperties',
56       'do',
57       'editconst',
58       'editinline',
59       'editinlinenew',
60       'editinlineuse',
61       'else',
62       'enum',
63       'event',
64       'exec',
65       'expands',
66       'export',
67       'extends',
68       'false',
69       'final',
70       'final',
71       'for',
72       'foreach',
73       'function',
74       'global',
75       'hidecategories',
76       'if',
77       'ignores',
78       'instanceof',
79       'iterator',
80       'latent',
81       'local',
82       'localized',
83       'native',
84       'nativereplication',
85       'new',
86       'noexport',
87       'none',
88       'null',
89       'operator',
90       'optional',
91       'out',
92       'placeable',
93       'postoperator',
94       'preoperator',
95       'private',
96       'protected',
97       'public',
98       'reliable',
99       'replication',
100       'return',
101       'self',
102       'simulated',
103       'singular',
104       'state',
105       'static',
106       'struct',
107       'super',
108       'switch',
109       'synchronized',
110       'throws',
111       'transient',
112       'true',
113       'unreliable',
114       'var',
115       'virtual',
116       'volatile',
117       'while',
118    );
119    $self->listAdd('types',
120       'ELightType',
121       'Pawn',
122       'actor',
123       'ammo',
124       'bool',
125       'boolean',
126       'byte',
127       'char',
128       'class',
129       'color',
130       'coords',
131       'double',
132       'float',
133       'int',
134       'ipaddr',
135       'long',
136       'material',
137       'name',
138       'object',
139       'package',
140       'plane',
141       'rotator',
142       'short',
143       'sound',
144       'staticmesh',
145       'string',
146       'vector',
147       'void',
148    );
149    $self->contextdata({
150       'Commentar 1' => {
151          callback => \&parseCommentar1,
152          attribute => 'Comment',
153          lineending => '#pop',
154       },
155       'Commentar 2' => {
156          callback => \&parseCommentar2,
157          attribute => 'Comment',
158       },
159       'Normal' => {
160          callback => \&parseNormal,
161          attribute => 'Normal Text',
162       },
163       'Preprocessor' => {
164          callback => \&parsePreprocessor,
165          attribute => 'Preprocessor',
166          lineending => '#pop',
167       },
168       'String' => {
169          callback => \&parseString,
170          attribute => 'String',
171          lineending => '#pop',
172       },
173    });
174    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
175    $self->basecontext('Normal');
176    $self->keywordscase(0);
177    $self->initialize;
178    bless ($self, $class);
179    return $self;
180 }
181
182 sub language {
183    return 'UnrealScript';
184 }
185
186 sub parseCommentar1 {
187    my ($self, $text) = @_;
188    return 0;
189 };
190
191 sub parseCommentar2 {
192    my ($self, $text) = @_;
193    # attribute => 'Comment'
194    # char => '*'
195    # char1 => '/'
196    # context => '#pop'
197    # endRegion => 'Comment'
198    # type => 'Detect2Chars'
199    if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
200       return 1
201    }
202    return 0;
203 };
204
205 sub parseNormal {
206    my ($self, $text) = @_;
207    # String => 'keywords'
208    # attribute => 'Keyword'
209    # context => '#stay'
210    # type => 'keyword'
211    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
212       return 1
213    }
214    # String => 'types'
215    # attribute => 'Data Type'
216    # context => '#stay'
217    # type => 'keyword'
218    if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
219       return 1
220    }
221    # attribute => 'Float'
222    # context => '#stay'
223    # items => 'ARRAY(0x16a9b80)'
224    # type => 'Float'
225    if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
226       # String => 'fF'
227       # attribute => 'Float'
228       # context => '#stay'
229       # type => 'AnyChar'
230       if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
231          return 1
232       }
233    }
234    # attribute => 'Octal'
235    # context => '#stay'
236    # type => 'HlCOct'
237    if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
238       return 1
239    }
240    # attribute => 'Hex'
241    # context => '#stay'
242    # type => 'HlCHex'
243    if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
244       return 1
245    }
246    # attribute => 'Decimal'
247    # context => '#stay'
248    # items => 'ARRAY(0x16fe360)'
249    # type => 'Int'
250    if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
251       # String => 'ULL'
252       # attribute => 'Decimal'
253       # context => '#stay'
254       # insensitive => 'TRUE'
255       # type => 'StringDetect'
256       if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
257          return 1
258       }
259       # String => 'LUL'
260       # attribute => 'Decimal'
261       # context => '#stay'
262       # insensitive => 'TRUE'
263       # type => 'StringDetect'
264       if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
265          return 1
266       }
267       # String => 'LLU'
268       # attribute => 'Decimal'
269       # context => '#stay'
270       # insensitive => 'TRUE'
271       # type => 'StringDetect'
272       if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
273          return 1
274       }
275       # String => 'UL'
276       # attribute => 'Decimal'
277       # context => '#stay'
278       # insensitive => 'TRUE'
279       # type => 'StringDetect'
280       if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
281          return 1
282       }
283       # String => 'LU'
284       # attribute => 'Decimal'
285       # context => '#stay'
286       # insensitive => 'TRUE'
287       # type => 'StringDetect'
288       if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
289          return 1
290       }
291       # String => 'LL'
292       # attribute => 'Decimal'
293       # context => '#stay'
294       # insensitive => 'TRUE'
295       # type => 'StringDetect'
296       if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
297          return 1
298       }
299       # String => 'U'
300       # attribute => 'Decimal'
301       # context => '#stay'
302       # insensitive => 'TRUE'
303       # type => 'StringDetect'
304       if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
305          return 1
306       }
307       # String => 'L'
308       # attribute => 'Decimal'
309       # context => '#stay'
310       # insensitive => 'TRUE'
311       # type => 'StringDetect'
312       if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
313          return 1
314       }
315    }
316    # attribute => 'Char'
317    # context => '#stay'
318    # type => 'HlCChar'
319    if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
320       return 1
321    }
322    # String => '//BEGIN.*$'
323    # attribute => 'Region Marker'
324    # beginRegion => 'Region1'
325    # context => '#stay'
326    # type => 'RegExpr'
327    if ($self->testRegExpr($text, '//BEGIN.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
328       return 1
329    }
330    # String => '//END.*$'
331    # attribute => 'Region Marker'
332    # context => '#stay'
333    # endRegion => 'Region1'
334    # type => 'RegExpr'
335    if ($self->testRegExpr($text, '//END.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
336       return 1
337    }
338    # attribute => 'String'
339    # char => '"'
340    # context => 'String'
341    # type => 'DetectChar'
342    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
343       return 1
344    }
345    # attribute => 'String'
346    # char => '''
347    # context => 'String'
348    # type => 'DetectChar'
349    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) {
350       return 1
351    }
352    # attribute => 'Comment'
353    # char => '/'
354    # char1 => '/'
355    # context => 'Commentar 1'
356    # type => 'Detect2Chars'
357    if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
358       return 1
359    }
360    # attribute => 'Comment'
361    # beginRegion => 'Comment'
362    # char => '/'
363    # char1 => '*'
364    # context => 'Commentar 2'
365    # type => 'Detect2Chars'
366    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
367       return 1
368    }
369    # attribute => 'Normal Text'
370    # beginRegion => 'Brace1'
371    # char => '{'
372    # context => '#stay'
373    # type => 'DetectChar'
374    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
375       return 1
376    }
377    # attribute => 'Normal Text'
378    # char => '}'
379    # context => '#stay'
380    # endRegion => 'Brace1'
381    # type => 'DetectChar'
382    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
383       return 1
384    }
385    # String => '!%&()+,-<=>?[]^{|}~'
386    # attribute => 'Symbol'
387    # context => '#stay'
388    # type => 'AnyChar'
389    if ($self->testAnyChar($text, '!%&()+,-<=>?[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
390       return 1
391    }
392    # String => '#exec'
393    # attribute => 'Preprocessor'
394    # context => 'Preprocessor'
395    # insensitive => 'TRUE'
396    # type => 'RegExpr'
397    if ($self->testRegExpr($text, '#exec', 1, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
398       return 1
399    }
400    return 0;
401 };
402
403 sub parsePreprocessor {
404    my ($self, $text) = @_;
405    # attribute => 'Comment'
406    # char => '/'
407    # char1 => '/'
408    # context => 'Commentar 1'
409    # type => 'Detect2Chars'
410    if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
411       return 1
412    }
413    # attribute => 'Comment'
414    # char => '/'
415    # char1 => '*'
416    # context => 'Commentar 2'
417    # type => 'Detect2Chars'
418    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
419       return 1
420    }
421    return 0;
422 };
423
424 sub parseString {
425    my ($self, $text) = @_;
426    # attribute => 'String'
427    # context => '#stay'
428    # type => 'LineContinue'
429    if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
430       return 1
431    }
432    # attribute => 'String Char'
433    # context => '#stay'
434    # type => 'HlCStringChar'
435    if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
436       return 1
437    }
438    # attribute => 'String'
439    # char => '"'
440    # context => '#pop'
441    # type => 'DetectChar'
442    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
443       return 1
444    }
445    # attribute => 'String'
446    # char => '''
447    # context => '#pop'
448    # type => 'DetectChar'
449    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
450       return 1
451    }
452    return 0;
453 };
454
455
456 1;
457
458 __END__
459
460 =head1 NAME
461
462 Syntax::Highlight::Engine::Kate::UnrealScript - a Plugin for UnrealScript syntax highlighting
463
464 =head1 SYNOPSIS
465
466  require Syntax::Highlight::Engine::Kate::UnrealScript;
467  my $sh = new Syntax::Highlight::Engine::Kate::UnrealScript([
468  ]);
469
470 =head1 DESCRIPTION
471
472 Syntax::Highlight::Engine::Kate::UnrealScript is a  plugin module that provides syntax highlighting
473 for UnrealScript to the Syntax::Haghlight::Engine::Kate highlighting engine.
474
475 This code is generated from the syntax definition files used
476 by the Kate project.
477 It works quite fine, but can use refinement and optimization.
478
479 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
480
481 =cut
482
483 =head1 AUTHOR
484
485 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
486
487 =cut
488
489 =head1 BUGS
490
491 Unknown. If you find any, please contact the author
492
493 =cut
494