Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / XML.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 'xml.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.96
9 #kate version 2.4
10 #kate author Wilbert Berendsen (wilbert@kde.nl)
11 #generated: Sun Feb  3 22:02:06 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::XML;
14
15 our $VERSION = '0.06';
16
17 use strict;
18 use warnings;
19 use base('Syntax::Highlight::Engine::Kate::Template');
20
21 sub new {
22    my $proto = shift;
23    my $class = ref($proto) || $proto;
24    my $self = $class->SUPER::new(@_);
25    $self->attributes({
26       'Attribute' => 'Others',
27       'CDATA' => 'BaseN',
28       'Comment' => 'Comment',
29       'Doctype' => 'DataType',
30       'Element' => 'Keyword',
31       'EntityRef' => 'DecVal',
32       'Error' => 'Error',
33       'Normal Text' => 'Normal',
34       'PEntityRef' => 'DecVal',
35       'Processing Instruction' => 'Keyword',
36       'Value' => 'String',
37    });
38    $self->contextdata({
39       'Attribute' => {
40          callback => \&parseAttribute,
41          attribute => 'Normal Text',
42       },
43       'CDATA' => {
44          callback => \&parseCDATA,
45          attribute => 'Normal Text',
46       },
47       'Comment' => {
48          callback => \&parseComment,
49          attribute => 'Comment',
50       },
51       'Doctype' => {
52          callback => \&parseDoctype,
53          attribute => 'Normal Text',
54       },
55       'Doctype Internal Subset' => {
56          callback => \&parseDoctypeInternalSubset,
57          attribute => 'Normal Text',
58       },
59       'Doctype Markupdecl' => {
60          callback => \&parseDoctypeMarkupdecl,
61          attribute => 'Normal Text',
62       },
63       'Doctype Markupdecl DQ' => {
64          callback => \&parseDoctypeMarkupdeclDQ,
65          attribute => 'Value',
66       },
67       'Doctype Markupdecl SQ' => {
68          callback => \&parseDoctypeMarkupdeclSQ,
69          attribute => 'Value',
70       },
71       'El Content' => {
72          callback => \&parseElContent,
73          attribute => 'Normal Text',
74       },
75       'El End' => {
76          callback => \&parseElEnd,
77          attribute => 'Normal Text',
78       },
79       'Element' => {
80          callback => \&parseElement,
81          attribute => 'Normal Text',
82       },
83       'FindEntityRefs' => {
84          callback => \&parseFindEntityRefs,
85          attribute => 'Normal Text',
86       },
87       'FindPEntityRefs' => {
88          callback => \&parseFindPEntityRefs,
89          attribute => 'Normal Text',
90       },
91       'FindXML' => {
92          callback => \&parseFindXML,
93          attribute => 'Normal Text',
94       },
95       'PI' => {
96          callback => \&parsePI,
97          attribute => 'Normal Text',
98       },
99       'Start' => {
100          callback => \&parseStart,
101          attribute => 'Normal Text',
102       },
103       'Value' => {
104          callback => \&parseValue,
105          attribute => 'Normal Text',
106       },
107       'Value DQ' => {
108          callback => \&parseValueDQ,
109          attribute => 'Value',
110       },
111       'Value SQ' => {
112          callback => \&parseValueSQ,
113          attribute => 'Value',
114       },
115    });
116    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
117    $self->basecontext('Start');
118    $self->keywordscase(1);
119    $self->initialize;
120    bless ($self, $class);
121    return $self;
122 }
123
124 sub language {
125    return 'XML';
126 }
127
128 sub parseAttribute {
129    my ($self, $text) = @_;
130    # attribute => 'Attribute'
131    # char => '='
132    # context => 'Value'
133    # type => 'DetectChar'
134    if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Attribute')) {
135       return 1
136    }
137    # String => '\S'
138    # attribute => 'Error'
139    # context => '#stay'
140    # type => 'RegExpr'
141    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
142       return 1
143    }
144    return 0;
145 };
146
147 sub parseCDATA {
148    my ($self, $text) = @_;
149    # type => 'DetectSpaces'
150    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
151       return 1
152    }
153    # type => 'DetectIdentifier'
154    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
155       return 1
156    }
157    # String => ']]>'
158    # attribute => 'CDATA'
159    # context => '#pop'
160    # endRegion => 'cdata'
161    # type => 'StringDetect'
162    if ($self->testStringDetect($text, ']]>', 0, 0, 0, undef, 0, '#pop', 'CDATA')) {
163       return 1
164    }
165    # String => ']]&gt;'
166    # attribute => 'EntityRef'
167    # context => '#stay'
168    # type => 'StringDetect'
169    if ($self->testStringDetect($text, ']]&gt;', 0, 0, 0, undef, 0, '#stay', 'EntityRef')) {
170       return 1
171    }
172    return 0;
173 };
174
175 sub parseComment {
176    my ($self, $text) = @_;
177    # type => 'DetectSpaces'
178    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
179       return 1
180    }
181    # String => '-->'
182    # attribute => 'Comment'
183    # context => '#pop'
184    # endRegion => 'comment'
185    # type => 'StringDetect'
186    if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
187       return 1
188    }
189    # String => '-(-(?!->))+'
190    # attribute => 'Error'
191    # context => '#stay'
192    # type => 'RegExpr'
193    if ($self->testRegExpr($text, '-(-(?!->))+', 0, 0, 0, undef, 0, '#stay', 'Error')) {
194       return 1
195    }
196    # context => '##Alerts'
197    # type => 'IncludeRules'
198    if ($self->includePlugin('Alerts', $text)) {
199       return 1
200    }
201    # type => 'DetectIdentifier'
202    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
203       return 1
204    }
205    return 0;
206 };
207
208 sub parseDoctype {
209    my ($self, $text) = @_;
210    # attribute => 'Doctype'
211    # char => '>'
212    # context => '#pop'
213    # endRegion => 'doctype'
214    # type => 'DetectChar'
215    if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Doctype')) {
216       return 1
217    }
218    # attribute => 'Doctype'
219    # beginRegion => 'int_subset'
220    # char => '['
221    # context => 'Doctype Internal Subset'
222    # type => 'DetectChar'
223    if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Doctype Internal Subset', 'Doctype')) {
224       return 1
225    }
226    return 0;
227 };
228
229 sub parseDoctypeInternalSubset {
230    my ($self, $text) = @_;
231    # attribute => 'Doctype'
232    # char => ']'
233    # context => '#pop'
234    # endRegion => 'int_subset'
235    # type => 'DetectChar'
236    if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Doctype')) {
237       return 1
238    }
239    # String => '<!(ELEMENT|ENTITY|ATTLIST|NOTATION)\b'
240    # attribute => 'Doctype'
241    # context => 'Doctype Markupdecl'
242    # type => 'RegExpr'
243    if ($self->testRegExpr($text, '<!(ELEMENT|ENTITY|ATTLIST|NOTATION)\\b', 0, 0, 0, undef, 0, 'Doctype Markupdecl', 'Doctype')) {
244       return 1
245    }
246    # String => '<!--'
247    # attribute => 'Comment'
248    # beginRegion => 'comment'
249    # context => 'Comment'
250    # type => 'StringDetect'
251    if ($self->testStringDetect($text, '<!--', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
252       return 1
253    }
254    # String => '<\?[\w:_-]*'
255    # attribute => 'Processing Instruction'
256    # beginRegion => 'pi'
257    # context => 'PI'
258    # type => 'RegExpr'
259    if ($self->testRegExpr($text, '<\\?[\\w:_-]*', 0, 0, 0, undef, 0, 'PI', 'Processing Instruction')) {
260       return 1
261    }
262    # context => 'FindPEntityRefs'
263    # type => 'IncludeRules'
264    if ($self->includeRules('FindPEntityRefs', $text)) {
265       return 1
266    }
267    return 0;
268 };
269
270 sub parseDoctypeMarkupdecl {
271    my ($self, $text) = @_;
272    # attribute => 'Doctype'
273    # char => '>'
274    # context => '#pop'
275    # type => 'DetectChar'
276    if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Doctype')) {
277       return 1
278    }
279    # attribute => 'Value'
280    # char => '"'
281    # context => 'Doctype Markupdecl DQ'
282    # type => 'DetectChar'
283    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Doctype Markupdecl DQ', 'Value')) {
284       return 1
285    }
286    # attribute => 'Value'
287    # char => '''
288    # context => 'Doctype Markupdecl SQ'
289    # type => 'DetectChar'
290    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Doctype Markupdecl SQ', 'Value')) {
291       return 1
292    }
293    return 0;
294 };
295
296 sub parseDoctypeMarkupdeclDQ {
297    my ($self, $text) = @_;
298    # attribute => 'Value'
299    # char => '"'
300    # context => '#pop'
301    # type => 'DetectChar'
302    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Value')) {
303       return 1
304    }
305    # context => 'FindPEntityRefs'
306    # type => 'IncludeRules'
307    if ($self->includeRules('FindPEntityRefs', $text)) {
308       return 1
309    }
310    return 0;
311 };
312
313 sub parseDoctypeMarkupdeclSQ {
314    my ($self, $text) = @_;
315    # attribute => 'Value'
316    # char => '''
317    # context => '#pop'
318    # type => 'DetectChar'
319    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Value')) {
320       return 1
321    }
322    # context => 'FindPEntityRefs'
323    # type => 'IncludeRules'
324    if ($self->includeRules('FindPEntityRefs', $text)) {
325       return 1
326    }
327    return 0;
328 };
329
330 sub parseElContent {
331    my ($self, $text) = @_;
332    # String => '</[A-Za-z_:][\w.:_-]*'
333    # attribute => 'Element'
334    # context => 'El End'
335    # type => 'RegExpr'
336    if ($self->testRegExpr($text, '</[A-Za-z_:][\\w.:_-]*', 0, 0, 0, undef, 0, 'El End', 'Element')) {
337       return 1
338    }
339    # context => 'FindXML'
340    # type => 'IncludeRules'
341    if ($self->includeRules('FindXML', $text)) {
342       return 1
343    }
344    return 0;
345 };
346
347 sub parseElEnd {
348    my ($self, $text) = @_;
349    # attribute => 'Element'
350    # char => '>'
351    # context => '#pop#pop#pop'
352    # endRegion => 'element'
353    # type => 'DetectChar'
354    if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Element')) {
355       return 1
356    }
357    # String => '\S'
358    # attribute => 'Error'
359    # context => '#stay'
360    # type => 'RegExpr'
361    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
362       return 1
363    }
364    return 0;
365 };
366
367 sub parseElement {
368    my ($self, $text) = @_;
369    # attribute => 'Element'
370    # char => '/'
371    # char1 => '>'
372    # context => '#pop'
373    # endRegion => 'element'
374    # type => 'Detect2Chars'
375    if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'Element')) {
376       return 1
377    }
378    # attribute => 'Element'
379    # char => '>'
380    # context => 'El Content'
381    # type => 'DetectChar'
382    if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, 'El Content', 'Element')) {
383       return 1
384    }
385    # String => '^[A-Za-z_:][\w.:_-]*'
386    # attribute => 'Attribute'
387    # context => 'Attribute'
388    # type => 'RegExpr'
389    if ($self->testRegExpr($text, '^[A-Za-z_:][\\w.:_-]*', 0, 0, 0, undef, 0, 'Attribute', 'Attribute')) {
390       return 1
391    }
392    # String => '\s+[A-Za-z_:][\w.:_-]*'
393    # attribute => 'Attribute'
394    # context => 'Attribute'
395    # type => 'RegExpr'
396    if ($self->testRegExpr($text, '\\s+[A-Za-z_:][\\w.:_-]*', 0, 0, 0, undef, 0, 'Attribute', 'Attribute')) {
397       return 1
398    }
399    # String => '\S'
400    # attribute => 'Error'
401    # context => '#stay'
402    # type => 'RegExpr'
403    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
404       return 1
405    }
406    return 0;
407 };
408
409 sub parseFindEntityRefs {
410    my ($self, $text) = @_;
411    # String => '&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z_:][\w.:_-]*);'
412    # attribute => 'EntityRef'
413    # context => '#stay'
414    # type => 'RegExpr'
415    if ($self->testRegExpr($text, '&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z_:][\\w.:_-]*);', 0, 0, 0, undef, 0, '#stay', 'EntityRef')) {
416       return 1
417    }
418    # String => '&<'
419    # attribute => 'Error'
420    # context => '#stay'
421    # type => 'AnyChar'
422    if ($self->testAnyChar($text, '&<', 0, 0, undef, 0, '#stay', 'Error')) {
423       return 1
424    }
425    return 0;
426 };
427
428 sub parseFindPEntityRefs {
429    my ($self, $text) = @_;
430    # String => '&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z_:][\w.:_-]*);'
431    # attribute => 'EntityRef'
432    # context => '#stay'
433    # type => 'RegExpr'
434    if ($self->testRegExpr($text, '&(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z_:][\\w.:_-]*);', 0, 0, 0, undef, 0, '#stay', 'EntityRef')) {
435       return 1
436    }
437    # String => '%[A-Za-z_:][\w.:_-]*;'
438    # attribute => 'PEntityRef'
439    # context => '#stay'
440    # type => 'RegExpr'
441    if ($self->testRegExpr($text, '%[A-Za-z_:][\\w.:_-]*;', 0, 0, 0, undef, 0, '#stay', 'PEntityRef')) {
442       return 1
443    }
444    # String => '&%'
445    # attribute => 'Error'
446    # context => '#stay'
447    # type => 'AnyChar'
448    if ($self->testAnyChar($text, '&%', 0, 0, undef, 0, '#stay', 'Error')) {
449       return 1
450    }
451    return 0;
452 };
453
454 sub parseFindXML {
455    my ($self, $text) = @_;
456    # type => 'DetectSpaces'
457    if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
458       return 1
459    }
460    # String => '<!--'
461    # attribute => 'Comment'
462    # beginRegion => 'comment'
463    # context => 'Comment'
464    # type => 'StringDetect'
465    if ($self->testStringDetect($text, '<!--', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
466       return 1
467    }
468    # String => '<![CDATA['
469    # attribute => 'CDATA'
470    # beginRegion => 'cdata'
471    # context => 'CDATA'
472    # type => 'StringDetect'
473    if ($self->testStringDetect($text, '<![CDATA[', 0, 0, 0, undef, 0, 'CDATA', 'CDATA')) {
474       return 1
475    }
476    # String => '<!DOCTYPE\s+'
477    # attribute => 'Doctype'
478    # beginRegion => 'doctype'
479    # context => 'Doctype'
480    # type => 'RegExpr'
481    if ($self->testRegExpr($text, '<!DOCTYPE\\s+', 0, 0, 0, undef, 0, 'Doctype', 'Doctype')) {
482       return 1
483    }
484    # String => '<\?[\w:_-]*'
485    # attribute => 'Processing Instruction'
486    # beginRegion => 'pi'
487    # context => 'PI'
488    # type => 'RegExpr'
489    if ($self->testRegExpr($text, '<\\?[\\w:_-]*', 0, 0, 0, undef, 0, 'PI', 'Processing Instruction')) {
490       return 1
491    }
492    # String => '<[A-Za-z_:][\w.:_-]*'
493    # attribute => 'Element'
494    # beginRegion => 'element'
495    # context => 'Element'
496    # type => 'RegExpr'
497    if ($self->testRegExpr($text, '<[A-Za-z_:][\\w.:_-]*', 0, 0, 0, undef, 0, 'Element', 'Element')) {
498       return 1
499    }
500    # context => 'FindEntityRefs'
501    # type => 'IncludeRules'
502    if ($self->includeRules('FindEntityRefs', $text)) {
503       return 1
504    }
505    # type => 'DetectIdentifier'
506    if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
507       return 1
508    }
509    return 0;
510 };
511
512 sub parsePI {
513    my ($self, $text) = @_;
514    # attribute => 'Processing Instruction'
515    # char => '?'
516    # char1 => '>'
517    # context => '#pop'
518    # endRegion => 'pi'
519    # type => 'Detect2Chars'
520    if ($self->testDetect2Chars($text, '?', '>', 0, 0, 0, undef, 0, '#pop', 'Processing Instruction')) {
521       return 1
522    }
523    return 0;
524 };
525
526 sub parseStart {
527    my ($self, $text) = @_;
528    # context => 'FindXML'
529    # type => 'IncludeRules'
530    if ($self->includeRules('FindXML', $text)) {
531       return 1
532    }
533    return 0;
534 };
535
536 sub parseValue {
537    my ($self, $text) = @_;
538    # attribute => 'Value'
539    # char => '"'
540    # context => 'Value DQ'
541    # type => 'DetectChar'
542    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Value DQ', 'Value')) {
543       return 1
544    }
545    # attribute => 'Value'
546    # char => '''
547    # context => 'Value SQ'
548    # type => 'DetectChar'
549    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Value SQ', 'Value')) {
550       return 1
551    }
552    # String => '\S'
553    # attribute => 'Error'
554    # context => '#stay'
555    # type => 'RegExpr'
556    if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) {
557       return 1
558    }
559    return 0;
560 };
561
562 sub parseValueDQ {
563    my ($self, $text) = @_;
564    # attribute => 'Value'
565    # char => '"'
566    # context => '#pop#pop#pop'
567    # type => 'DetectChar'
568    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Value')) {
569       return 1
570    }
571    # context => 'FindEntityRefs'
572    # type => 'IncludeRules'
573    if ($self->includeRules('FindEntityRefs', $text)) {
574       return 1
575    }
576    return 0;
577 };
578
579 sub parseValueSQ {
580    my ($self, $text) = @_;
581    # attribute => 'Value'
582    # char => '''
583    # context => '#pop#pop#pop'
584    # type => 'DetectChar'
585    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop#pop', 'Value')) {
586       return 1
587    }
588    # context => 'FindEntityRefs'
589    # type => 'IncludeRules'
590    if ($self->includeRules('FindEntityRefs', $text)) {
591       return 1
592    }
593    return 0;
594 };
595
596
597 1;
598
599 __END__
600
601 =head1 NAME
602
603 Syntax::Highlight::Engine::Kate::XML - a Plugin for XML syntax highlighting
604
605 =head1 SYNOPSIS
606
607  require Syntax::Highlight::Engine::Kate::XML;
608  my $sh = new Syntax::Highlight::Engine::Kate::XML([
609  ]);
610
611 =head1 DESCRIPTION
612
613 Syntax::Highlight::Engine::Kate::XML is a  plugin module that provides syntax highlighting
614 for XML to the Syntax::Haghlight::Engine::Kate highlighting engine.
615
616 This code is generated from the syntax definition files used
617 by the Kate project.
618 It works quite fine, but can use refinement and optimization.
619
620 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
621
622 =cut
623
624 =head1 AUTHOR
625
626 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
627
628 =cut
629
630 =head1 BUGS
631
632 Unknown. If you find any, please contact the author
633
634 =cut
635