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 'component-pascal.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Werner Braun (wb@o3-software.de)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::ComponentminusPascal;
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(@_);
26 'Attribute' => 'Others',
27 'Builtin' => 'Normal',
29 'CommentMaior' => 'Comment',
30 'CommentMinor' => 'Comment',
32 'ExportFull' => 'Others',
33 'ExportReadOnly' => 'Others',
36 'Keyword' => 'Keyword',
37 'MemAlloc' => 'Keyword',
38 'Normal Text' => 'Normal',
39 'Operator' => 'Normal',
40 'Relation' => 'Normal',
41 'SpecialValues' => 'DecVal',
45 $self->listAdd('attributes',
51 $self->listAdd('builtins',
71 $self->listAdd('exits',
77 $self->listAdd('keywords',
105 $self->listAdd('specials',
111 $self->listAdd('types',
130 callback => \&parseComment1,
131 attribute => 'CommentMaior',
134 callback => \&parseComment2,
135 attribute => 'CommentMinor',
138 callback => \&parseCommentN,
139 attribute => 'CommentMinor',
142 callback => \&parseCommentN2,
143 attribute => 'CommentMinor',
146 callback => \&parseNormal,
147 attribute => 'Normal Text',
150 callback => \&parseString1,
151 attribute => 'String',
154 callback => \&parseString2,
155 attribute => 'String',
158 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
159 $self->basecontext('Normal');
160 $self->keywordscase(0);
162 bless ($self, $class);
167 return 'Component-Pascal';
171 my ($self, $text) = @_;
172 # attribute => 'CommentMaior'
176 # endRegion => 'Comment'
177 # type => 'Detect2Chars'
178 if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMaior')) {
181 # attribute => 'CommentMinor'
184 # context => 'CommentN'
185 # type => 'Detect2Chars'
186 if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN', 'CommentMinor')) {
193 my ($self, $text) = @_;
194 # attribute => 'CommentMinor'
198 # endRegion => 'Comment'
199 # type => 'Detect2Chars'
200 if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) {
203 # attribute => 'CommentMinor'
206 # context => 'CommentN'
207 # type => 'Detect2Chars'
208 if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN', 'CommentMinor')) {
215 my ($self, $text) = @_;
216 # attribute => 'CommentMinor'
220 # type => 'Detect2Chars'
221 if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) {
224 # attribute => 'CommentMinor'
227 # context => 'CommentN2'
228 # type => 'Detect2Chars'
229 if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN2', 'CommentMinor')) {
236 my ($self, $text) = @_;
237 # attribute => 'CommentMinor'
241 # type => 'Detect2Chars'
242 if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) {
249 my ($self, $text) = @_;
251 # attribute => 'CommentMaior'
252 # beginRegion => 'Comment'
253 # context => 'Comment1'
254 # type => 'StringDetect'
255 if ($self->testStringDetect($text, '(**', 0, 0, 0, undef, 0, 'Comment1', 'CommentMaior')) {
258 # attribute => 'CommentMinor'
259 # beginRegion => 'Comment'
262 # context => 'Comment2'
263 # type => 'Detect2Chars'
264 if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'CommentMinor')) {
267 # attribute => 'String'
269 # context => 'String1'
270 # type => 'DetectChar'
271 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String1', 'String')) {
274 # attribute => 'String'
276 # context => 'String2'
277 # type => 'DetectChar'
278 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String2', 'String')) {
281 # String => 'PROCEDURE\s'
282 # attribute => 'Keyword'
283 # beginRegion => 'Proc'
286 if ($self->testRegExpr($text, 'PROCEDURE\\s', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
289 # String => 'ABSTRACT;|EMPTY;|END\s*[A-Za-z][A-Za-z0-9_]*\;'
290 # attribute => 'Normal Text'
292 # endRegion => 'Proc'
294 if ($self->testRegExpr($text, 'ABSTRACT;|EMPTY;|END\\s*[A-Za-z][A-Za-z0-9_]*\\;', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
298 # attribute => 'Type'
299 # beginRegion => 'Rec'
302 if ($self->testRegExpr($text, 'RECORD', 0, 0, 0, undef, 0, '#stay', 'Type')) {
306 # attribute => 'Keyword'
310 if ($self->testRegExpr($text, 'END', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
314 # attribute => 'MemAlloc'
316 # type => 'StringDetect'
317 if ($self->testStringDetect($text, 'NEW', 0, 0, 0, undef, 0, '#stay', 'MemAlloc')) {
320 # String => 'keywords'
321 # attribute => 'Keyword'
324 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
328 # attribute => 'Exit'
331 if ($self->testKeyword($text, 'exits', 0, undef, 0, '#stay', 'Exit')) {
335 # attribute => 'Type'
338 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) {
341 # String => 'attributes'
342 # attribute => 'Attribute'
345 if ($self->testKeyword($text, 'attributes', 0, undef, 0, '#stay', 'Attribute')) {
348 # String => 'builtins'
349 # attribute => 'Builtin'
352 if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin')) {
355 # String => 'specials'
356 # attribute => 'SpecialValues'
359 if ($self->testKeyword($text, 'specials', 0, undef, 0, '#stay', 'SpecialValues')) {
362 # String => '\s[\+|\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))'
363 # attribute => 'Integer'
366 if ($self->testRegExpr($text, '\\s[\\+|\\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))', 0, 0, 0, undef, 0, '#stay', 'Integer')) {
369 # attribute => 'Float'
372 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
375 # String => '\s[0-9][0-9A-F]*X'
376 # attribute => 'Char'
379 if ($self->testRegExpr($text, '\\s[0-9][0-9A-F]*X', 0, 0, 0, undef, 0, '#stay', 'Char')) {
382 # String => '[A-Za-z][A-Za-z0-9_]*\*'
383 # attribute => 'ExportFull'
386 if ($self->testRegExpr($text, '[A-Za-z][A-Za-z0-9_]*\\*', 0, 0, 0, undef, 0, '#stay', 'ExportFull')) {
389 # String => '[A-Za-z][A-Za-z0-9_]*\-'
390 # attribute => 'ExportReadOnly'
393 if ($self->testRegExpr($text, '[A-Za-z][A-Za-z0-9_]*\\-', 0, 0, 0, undef, 0, '#stay', 'ExportReadOnly')) {
396 # String => '\s(=|#|<|<=|>|>=|IN\s|IS)'
397 # attribute => 'Relation'
400 if ($self->testRegExpr($text, '\\s(=|#|<|<=|>|>=|IN\\s|IS)', 0, 0, 0, undef, 0, '#stay', 'Relation')) {
403 # String => '\s(\+|\-|OR|\*|/|DIV|MOD|\&)'
404 # attribute => 'Operator'
407 if ($self->testRegExpr($text, '\\s(\\+|\\-|OR|\\*|/|DIV|MOD|\\&)', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
414 my ($self, $text) = @_;
415 # attribute => 'String'
418 # type => 'DetectChar'
419 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
426 my ($self, $text) = @_;
427 # attribute => 'String'
430 # type => 'DetectChar'
431 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
444 Syntax::Highlight::Engine::Kate::ComponentminusPascal - a Plugin for Component-Pascal syntax highlighting
448 require Syntax::Highlight::Engine::Kate::ComponentminusPascal;
449 my $sh = new Syntax::Highlight::Engine::Kate::ComponentminusPascal([
454 Syntax::Highlight::Engine::Kate::ComponentminusPascal is a plugin module that provides syntax highlighting
455 for Component-Pascal to the Syntax::Haghlight::Engine::Kate highlighting engine.
457 This code is generated from the syntax definition files used
459 It works quite fine, but can use refinement and optimization.
461 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
467 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
473 Unknown. If you find any, please contact the author