# 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 'sgml.xml' file of the syntax highlight # engine of the kate text editor (http://www.kate-editor.org #kate xml version 1.02 #kate version 2.1 #generated: Sun Feb 3 22:02:06 2008, localtime package Syntax::Highlight::Engine::Kate::SGML; our $VERSION = '0.07'; 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 Name' => 'Others', 'Attribute Value' => 'DataType', 'Comment' => 'Comment', 'Normal Text' => 'Normal', 'Tag' => 'Keyword', }); $self->contextdata({ 'Attribute' => { callback => \&parseAttribute, attribute => 'Attribute Name', }, 'Comment' => { callback => \&parseComment, attribute => 'Comment', }, 'Normal Text' => { callback => \&parseNormalText, attribute => 'Normal Text', }, 'Value' => { callback => \&parseValue, attribute => 'Attribute Value', }, 'Value 2' => { callback => \&parseValue2, attribute => 'Attribute Value', }, }); $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\'); $self->basecontext('Normal Text'); $self->keywordscase(0); $self->initialize; bless ($self, $class); return $self; } sub language { return 'SGML'; } sub parseAttribute { my ($self, $text) = @_; # attribute => 'Tag' # char => '/' # char1 => '>' # context => '#pop' # type => 'Detect2Chars' if ($self->testDetect2Chars($text, '/', '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) { return 1 } # attribute => 'Tag' # char => '>' # context => '#pop' # type => 'DetectChar' if ($self->testDetectChar($text, '>', 0, 0, 0, undef, 0, '#pop', 'Tag')) { return 1 } # String => '\s*=\s*' # attribute => 'Normal Text' # context => 'Value' # type => 'RegExpr' if ($self->testRegExpr($text, '\\s*=\\s*', 0, 0, 0, undef, 0, 'Value', 'Normal Text')) { return 1 } return 0; }; sub parseComment { my ($self, $text) = @_; # String => '-->' # attribute => 'Comment' # context => '#pop' # type => 'StringDetect' if ($self->testStringDetect($text, '-->', 0, 0, 0, undef, 0, '#pop', 'Comment')) { return 1 } return 0; }; sub parseNormalText { my ($self, $text) = @_; # String => '