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.
5 # This file was generated from the 'abc.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Andrea Primiani (primiani@dag.it)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::ABC;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
27 'Comment' => 'Comment',
28 'Decoration' => 'Float',
30 'Lyrics' => 'DataType',
31 'Normal Text' => 'Normal',
33 'Preprocessor' => 'String',
37 'Tuplet' => 'DataType',
41 callback => \&parseBar,
46 callback => \&parseComment,
47 attribute => 'Comment',
51 callback => \&parseHeader,
52 attribute => 'Header',
55 callback => \&parseHeader2,
56 attribute => 'Header',
60 callback => \&parseLyrics,
61 attribute => 'Lyrics',
65 callback => \&parseNormal,
66 attribute => 'Normal Text',
69 callback => \&parsePart,
70 attribute => 'Header',
74 callback => \&parsePreprocessor,
75 attribute => 'Preprocessor',
79 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
80 $self->basecontext('Normal');
81 $self->keywordscase(0);
83 bless ($self, $class);
92 my ($self, $text) = @_;
93 # attribute => 'Normal Text'
96 # type => 'DetectChar'
97 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
100 # String => '[A-Ga-gZz]'
101 # attribute => 'Normal Text'
104 if ($self->testRegExpr($text, '[A-Ga-gZz]', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
107 # attribute => 'Normal Text'
110 # type => 'DetectChar'
111 if ($self->testDetectChar($text, ' ', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
114 # attribute => 'Decoration'
118 # type => 'RangeDetect'
119 if ($self->testRangeDetect($text, '!', '!', 0, 0, undef, 0, '#stay', 'Decoration')) {
123 # attribute => 'Slur'
126 if ($self->testAnyChar($text, '()', 0, 0, undef, 0, '#stay', 'Slur')) {
129 # String => ':*\|*[1-9]|/*\|'
133 if ($self->testRegExpr($text, ':*\\|*[1-9]|/*\\|', 0, 0, 0, undef, 0, '#pop', 'Bar')) {
140 my ($self, $text) = @_;
145 my ($self, $text) = @_;
147 # attribute => 'Header'
150 # endRegion => 'header'
152 if ($self->testRegExpr($text, 'K:.+', 0, 0, 0, 0, 0, '#pop', 'Header')) {
155 # attribute => 'Header'
158 # type => 'DetectChar'
159 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#pop', 'Header')) {
166 my ($self, $text) = @_;
171 my ($self, $text) = @_;
176 my ($self, $text) = @_;
177 # String => '\([23456789]:?[23456789]?:?[23456789]?'
178 # attribute => 'Tuplet'
181 if ($self->testRegExpr($text, '\\([23456789]:?[23456789]?:?[23456789]?', 0, 0, 0, undef, 0, '#stay', 'Tuplet')) {
184 # attribute => 'String'
188 # type => 'RangeDetect'
189 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'String')) {
192 # attribute => 'Decoration'
196 # type => 'RangeDetect'
197 if ($self->testRangeDetect($text, '!', '!', 0, 0, undef, 0, '#stay', 'Decoration')) {
200 # String => '\[[ABCGHILMNOQRSTUVZ]:'
201 # attribute => 'Header'
202 # context => 'Header'
204 if ($self->testRegExpr($text, '\\[[ABCGHILMNOQRSTUVZ]:', 0, 0, 0, undef, 0, 'Header', 'Header')) {
207 # String => '[ABCGHILMNOPQRSTUVZ]:'
208 # attribute => 'Header'
209 # context => 'Header2'
211 if ($self->testRegExpr($text, '[ABCGHILMNOPQRSTUVZ]:', 0, 0, 0, undef, 0, 'Header2', 'Header')) {
214 # attribute => 'Header'
215 # beginRegion => 'header'
219 # context => 'Header'
220 # type => 'Detect2Chars'
221 if ($self->testDetect2Chars($text, 'X', ':', 0, 0, 0, 0, 0, 'Header', 'Header')) {
228 if ($self->testAnyChar($text, '|:[', 0, 0, undef, 0, 'Bar', 'Bar')) {
234 # type => 'DetectChar'
235 if ($self->testDetectChar($text, ']', 0, 0, 0, undef, 0, '#stay', 'Bar')) {
239 # attribute => 'Slur'
242 if ($self->testAnyChar($text, '()', 0, 0, undef, 0, '#stay', 'Slur')) {
246 # attribute => 'Slur'
249 if ($self->testAnyChar($text, '{}', 0, 0, undef, 0, '#stay', 'Slur')) {
252 # attribute => 'Lyrics'
255 # context => 'Lyrics'
256 # type => 'Detect2Chars'
257 if ($self->testDetect2Chars($text, 'W', ':', 0, 0, 0, undef, 0, 'Lyrics', 'Lyrics')) {
260 # attribute => 'Lyrics'
263 # context => 'Lyrics'
264 # type => 'Detect2Chars'
265 if ($self->testDetect2Chars($text, 'w', ':', 0, 0, 0, undef, 0, 'Lyrics', 'Lyrics')) {
268 # attribute => 'Preprocessor'
271 # context => 'Preprocessor'
272 # type => 'Detect2Chars'
273 if ($self->testDetect2Chars($text, '%', '%', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
276 # attribute => 'Comment'
278 # context => 'Comment'
279 # type => 'DetectChar'
280 if ($self->testDetectChar($text, '%', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
283 # String => '[_|\^]?[_|=|\^][A-Ga-g]'
284 # attribute => 'Sharp'
287 if ($self->testRegExpr($text, '[_|\\^]?[_|=|\\^][A-Ga-g]', 0, 0, 0, undef, 0, '#stay', 'Sharp')) {
294 my ($self, $text) = @_;
298 sub parsePreprocessor {
299 my ($self, $text) = @_;
310 Syntax::Highlight::Engine::Kate::ABC - a Plugin for ABC syntax highlighting
314 require Syntax::Highlight::Engine::Kate::ABC;
315 my $sh = new Syntax::Highlight::Engine::Kate::ABC([
320 Syntax::Highlight::Engine::Kate::ABC is a plugin module that provides syntax highlighting
321 for ABC to the Syntax::Haghlight::Engine::Kate highlighting engine.
323 This code is generated from the syntax definition files used
325 It works quite fine, but can use refinement and optimization.
327 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
333 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
339 Unknown. If you find any, please contact the author