# Copyright (c) 2005 - 2006 Hans Jeuken. All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # This file was generated from the 'katexml/xml.xml' file of the syntax highlight # engine of the kate text editor (http://kate.kde.org #kate xml version 1.96 #kate version 2.4 #kate author Wilbert Berendsen (wilbert@kde.nl) #generated: Wed Nov 1 21:17:54 2006, localtime package Syntax::Highlight::Engine::Kate::XML; use vars qw($VERSION); $VERSION = '0.02'; use strict; use warnings; use base('Syntax::Highlight::Engine::Kate::Template'); sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = $class->SUPER::new(@_); $self->attributes({ 'Attribute' => 'Others', 'CDATA' => 'BaseN', 'Comment' => 'Comment', 'Doctype' => 'DataType', 'Element' => 'Keyword', 'EntityRef' => 'DecVal', 'Error' => 'Error', 'Normal Text' => 'Normal', 'PEntityRef' => 'DecVal', 'Processing Instruction' => 'Keyword', 'Value' => 'String', }); $self->contextdata({ 'Attribute' => { callback => \&parseAttribute, attribute => 'Normal Text', }, 'CDATA' => { callback => \&parseCDATA, attribute => 'Normal Text', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', }, 'Doctype' => { callback => \&parseDoctype, attribute => 'Normal Text', }, 'Doctype Internal Subset' => { callback => \&parseDoctypeInternalSubset, attribute => 'Normal Text', }, 'Doctype Markupdecl' => { callback => \&parseDoctypeMarkupdecl, attribute => 'Normal Text', }, 'Doctype Markupdecl DQ' => { callback => \&parseDoctypeMarkupdeclDQ, attribute => 'Value', }, 'Doctype Markupdecl SQ' => { callback => \&parseDoctypeMarkupdeclSQ, attribute => 'Value', }, 'El Content' => { callback => \&parseElContent, attribute => 'Normal Text', }, 'El End' => { callback => \&parseElEnd, attribute => 'Normal Text', }, 'Element' => { callback => \&parseElement, attribute => 'Normal Text', }, 'FindEntityRefs' => { callback => \&parseFindEntityRefs, attribute => 'Normal Text', }, 'FindPEntityRefs' => { callback => \&parseFindPEntityRefs, attribute => 'Normal Text', }, 'FindXML' => { callback => \&parseFindXML, attribute => 'Normal Text', }, 'PI' => { callback => \&parsePI, attribute => 'Normal Text', }, 'Start' => { callback => \&parseStart, attribute => 'Normal Text', }, 'Value' => { callback => \&parseValue, attribute => 'Normal Text', }, 'Value DQ' => { callback => \&parseValueDQ, attribute => 'Value', }, 'Value SQ' => { callback => \&parseValueSQ, attribute => 'Value', }, }); $self->deliminators('.():!+,-<=>%&*/;?[]^{|}~\\'); $self->basecontext('Start'); $self->keywordscase(1); $self->initialize; bless ($self, $class); return $self; } sub language { return 'XML'; } sub parseAttribute { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '=', 0, 0, 0, undef, 0, 'Value', 'Attribute')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '\\S', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } return 0; }; sub parseCDATA { my ($self, $text) = @_; # type => DetectSpaces if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => DetectIdentifier if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => StringDetect if ($self->testStringDetect($text, ']]>', 0, 0, 0, undef, 0, '#pop', 'CDATA')) { return 1 } # type => StringDetect if ($self->testStringDetect($text, ']]>', 0, 0, 0, undef, 0, '#stay', 'EntityRef')) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # type => DetectSpaces if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) { return 1 } # type => StringDetect if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, '-(-(?!->))+', 0, 0, 0, undef, 0, '#stay', 'Error')) { return 1 } # type => IncludeRules if ($self->includePlugin('Alerts', $text)) { return 1 } # type => DetectIdentifier if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) { return 1 } return 0; }; sub parseDoctype { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Doctype')) { return 1 } # type => DetectChar if ($self->testDetectChar($text, '[', 0, 0, 0, undef, 0, 'Doctype Internal Subset', 'Doctype')) { return 1 } return 0; }; sub parseDoctypeInternalSubset { my ($self, $text) = @_; # type => DetectChar if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Doctype')) { return 1 } # type => RegExpr if ($self->testRegExpr($text, ' StringDetect if ($self->testStringDetect($text, '