Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / ComponentminusPascal.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 'component-pascal.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.05
9 #kate version 2.1
10 #kate author Werner Braun (wb@o3-software.de)
11 #generated: Sun Feb  3 22:02:04 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::ComponentminusPascal;
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       'Builtin' => 'Normal',
28       'Char' => 'Char',
29       'CommentMaior' => 'Comment',
30       'CommentMinor' => 'Comment',
31       'Exit' => 'Keyword',
32       'ExportFull' => 'Others',
33       'ExportReadOnly' => 'Others',
34       'Float' => 'Float',
35       'Integer' => 'BaseN',
36       'Keyword' => 'Keyword',
37       'MemAlloc' => 'Keyword',
38       'Normal Text' => 'Normal',
39       'Operator' => 'Normal',
40       'Relation' => 'Normal',
41       'SpecialValues' => 'DecVal',
42       'String' => 'String',
43       'Type' => 'DataType',
44    });
45    $self->listAdd('attributes',
46       'ABSTRACT',
47       'EMPTY',
48       'EXTENSIBLE',
49       'LIMITED',
50    );
51    $self->listAdd('builtins',
52       'ABS',
53       'ASH',
54       'BITS',
55       'CAP',
56       'CHR',
57       'DEC',
58       'ENTIER',
59       'EXCL',
60       'INC',
61       'INCL',
62       'LEN',
63       'LONG',
64       'MAX',
65       'MIN',
66       'ODD',
67       'ORD',
68       'SHORT',
69       'SIZE',
70    );
71    $self->listAdd('exits',
72       'ASSERT',
73       'EXIT',
74       'HALT',
75       'RETURN',
76    );
77    $self->listAdd('keywords',
78       'BEGIN',
79       'BY',
80       'CASE',
81       'CLOSE',
82       'CONST',
83       'DO',
84       'ELSE',
85       'ELSIF',
86       'END',
87       'FOR',
88       'IF',
89       'IMPORT',
90       'LOOP',
91       'MODULE',
92       'NEW',
93       'OF',
94       'OUT',
95       'PROCEDURE',
96       'REPEAT',
97       'THEN',
98       'TO',
99       'TYPE',
100       'UNTIL',
101       'VAR',
102       'WHILE',
103       'WITH',
104    );
105    $self->listAdd('specials',
106       'FALSE',
107       'INF',
108       'NIL',
109       'TRUE',
110    );
111    $self->listAdd('types',
112       'ANYPTR',
113       'ANYREC',
114       'ARRAY',
115       'BOOLEAN',
116       'BYTE',
117       'CHAR',
118       'INTEGER',
119       'LONGINT',
120       'POINTER',
121       'REAL',
122       'RECORD',
123       'SET',
124       'SHORTCHAR',
125       'SHORTINT',
126       'SHORTREAL',
127    );
128    $self->contextdata({
129       'Comment1' => {
130          callback => \&parseComment1,
131          attribute => 'CommentMaior',
132       },
133       'Comment2' => {
134          callback => \&parseComment2,
135          attribute => 'CommentMinor',
136       },
137       'CommentN' => {
138          callback => \&parseCommentN,
139          attribute => 'CommentMinor',
140       },
141       'CommentN2' => {
142          callback => \&parseCommentN2,
143          attribute => 'CommentMinor',
144       },
145       'Normal' => {
146          callback => \&parseNormal,
147          attribute => 'Normal Text',
148       },
149       'String1' => {
150          callback => \&parseString1,
151          attribute => 'String',
152       },
153       'String2' => {
154          callback => \&parseString2,
155          attribute => 'String',
156       },
157    });
158    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
159    $self->basecontext('Normal');
160    $self->keywordscase(0);
161    $self->initialize;
162    bless ($self, $class);
163    return $self;
164 }
165
166 sub language {
167    return 'Component-Pascal';
168 }
169
170 sub parseComment1 {
171    my ($self, $text) = @_;
172    # attribute => 'CommentMaior'
173    # char => '*'
174    # char1 => ')'
175    # context => '#pop'
176    # endRegion => 'Comment'
177    # type => 'Detect2Chars'
178    if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMaior')) {
179       return 1
180    }
181    # attribute => 'CommentMinor'
182    # char => '('
183    # char1 => '*'
184    # context => 'CommentN'
185    # type => 'Detect2Chars'
186    if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN', 'CommentMinor')) {
187       return 1
188    }
189    return 0;
190 };
191
192 sub parseComment2 {
193    my ($self, $text) = @_;
194    # attribute => 'CommentMinor'
195    # char => '*'
196    # char1 => ')'
197    # context => '#pop'
198    # endRegion => 'Comment'
199    # type => 'Detect2Chars'
200    if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) {
201       return 1
202    }
203    # attribute => 'CommentMinor'
204    # char => '('
205    # char1 => '*'
206    # context => 'CommentN'
207    # type => 'Detect2Chars'
208    if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN', 'CommentMinor')) {
209       return 1
210    }
211    return 0;
212 };
213
214 sub parseCommentN {
215    my ($self, $text) = @_;
216    # attribute => 'CommentMinor'
217    # char => '*'
218    # char1 => ')'
219    # context => '#pop'
220    # type => 'Detect2Chars'
221    if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) {
222       return 1
223    }
224    # attribute => 'CommentMinor'
225    # char => '('
226    # char1 => '*'
227    # context => 'CommentN2'
228    # type => 'Detect2Chars'
229    if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'CommentN2', 'CommentMinor')) {
230       return 1
231    }
232    return 0;
233 };
234
235 sub parseCommentN2 {
236    my ($self, $text) = @_;
237    # attribute => 'CommentMinor'
238    # char => '*'
239    # char1 => ')'
240    # context => '#pop'
241    # type => 'Detect2Chars'
242    if ($self->testDetect2Chars($text, '*', ')', 0, 0, 0, undef, 0, '#pop', 'CommentMinor')) {
243       return 1
244    }
245    return 0;
246 };
247
248 sub parseNormal {
249    my ($self, $text) = @_;
250    # String => '(**'
251    # attribute => 'CommentMaior'
252    # beginRegion => 'Comment'
253    # context => 'Comment1'
254    # type => 'StringDetect'
255    if ($self->testStringDetect($text, '(**', 0, 0, 0, undef, 0, 'Comment1', 'CommentMaior')) {
256       return 1
257    }
258    # attribute => 'CommentMinor'
259    # beginRegion => 'Comment'
260    # char => '('
261    # char1 => '*'
262    # context => 'Comment2'
263    # type => 'Detect2Chars'
264    if ($self->testDetect2Chars($text, '(', '*', 0, 0, 0, undef, 0, 'Comment2', 'CommentMinor')) {
265       return 1
266    }
267    # attribute => 'String'
268    # char => '"'
269    # context => 'String1'
270    # type => 'DetectChar'
271    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String1', 'String')) {
272       return 1
273    }
274    # attribute => 'String'
275    # char => '''
276    # context => 'String2'
277    # type => 'DetectChar'
278    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String2', 'String')) {
279       return 1
280    }
281    # String => 'PROCEDURE\s'
282    # attribute => 'Keyword'
283    # beginRegion => 'Proc'
284    # context => '#stay'
285    # type => 'RegExpr'
286    if ($self->testRegExpr($text, 'PROCEDURE\\s', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
287       return 1
288    }
289    # String => 'ABSTRACT;|EMPTY;|END\s*[A-Za-z][A-Za-z0-9_]*\;'
290    # attribute => 'Normal Text'
291    # context => '#stay'
292    # endRegion => 'Proc'
293    # type => 'RegExpr'
294    if ($self->testRegExpr($text, 'ABSTRACT;|EMPTY;|END\\s*[A-Za-z][A-Za-z0-9_]*\\;', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
295       return 1
296    }
297    # String => 'RECORD'
298    # attribute => 'Type'
299    # beginRegion => 'Rec'
300    # context => '#stay'
301    # type => 'RegExpr'
302    if ($self->testRegExpr($text, 'RECORD', 0, 0, 0, undef, 0, '#stay', 'Type')) {
303       return 1
304    }
305    # String => 'END'
306    # attribute => 'Keyword'
307    # context => '#stay'
308    # endRegion => 'Rec'
309    # type => 'RegExpr'
310    if ($self->testRegExpr($text, 'END', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
311       return 1
312    }
313    # String => 'NEW'
314    # attribute => 'MemAlloc'
315    # context => '#stay'
316    # type => 'StringDetect'
317    if ($self->testStringDetect($text, 'NEW', 0, 0, 0, undef, 0, '#stay', 'MemAlloc')) {
318       return 1
319    }
320    # String => 'keywords'
321    # attribute => 'Keyword'
322    # context => '#stay'
323    # type => 'keyword'
324    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
325       return 1
326    }
327    # String => 'exits'
328    # attribute => 'Exit'
329    # context => '#stay'
330    # type => 'keyword'
331    if ($self->testKeyword($text, 'exits', 0, undef, 0, '#stay', 'Exit')) {
332       return 1
333    }
334    # String => 'types'
335    # attribute => 'Type'
336    # context => '#stay'
337    # type => 'keyword'
338    if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Type')) {
339       return 1
340    }
341    # String => 'attributes'
342    # attribute => 'Attribute'
343    # context => '#stay'
344    # type => 'keyword'
345    if ($self->testKeyword($text, 'attributes', 0, undef, 0, '#stay', 'Attribute')) {
346       return 1
347    }
348    # String => 'builtins'
349    # attribute => 'Builtin'
350    # context => '#stay'
351    # type => 'keyword'
352    if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin')) {
353       return 1
354    }
355    # String => 'specials'
356    # attribute => 'SpecialValues'
357    # context => '#stay'
358    # type => 'keyword'
359    if ($self->testKeyword($text, 'specials', 0, undef, 0, '#stay', 'SpecialValues')) {
360       return 1
361    }
362    # String => '\s[\+|\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))'
363    # attribute => 'Integer'
364    # context => '#stay'
365    # type => 'RegExpr'
366    if ($self->testRegExpr($text, '\\s[\\+|\\-]{0,1}[0-9]([0-9]*|[0-9A-F]*(H|L))', 0, 0, 0, undef, 0, '#stay', 'Integer')) {
367       return 1
368    }
369    # attribute => 'Float'
370    # context => '#stay'
371    # type => 'Float'
372    if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
373       return 1
374    }
375    # String => '\s[0-9][0-9A-F]*X'
376    # attribute => 'Char'
377    # context => '#stay'
378    # type => 'RegExpr'
379    if ($self->testRegExpr($text, '\\s[0-9][0-9A-F]*X', 0, 0, 0, undef, 0, '#stay', 'Char')) {
380       return 1
381    }
382    # String => '[A-Za-z][A-Za-z0-9_]*\*'
383    # attribute => 'ExportFull'
384    # context => '#stay'
385    # type => 'RegExpr'
386    if ($self->testRegExpr($text, '[A-Za-z][A-Za-z0-9_]*\\*', 0, 0, 0, undef, 0, '#stay', 'ExportFull')) {
387       return 1
388    }
389    # String => '[A-Za-z][A-Za-z0-9_]*\-'
390    # attribute => 'ExportReadOnly'
391    # context => '#stay'
392    # type => 'RegExpr'
393    if ($self->testRegExpr($text, '[A-Za-z][A-Za-z0-9_]*\\-', 0, 0, 0, undef, 0, '#stay', 'ExportReadOnly')) {
394       return 1
395    }
396    # String => '\s(=|#|<|<=|>|>=|IN\s|IS)'
397    # attribute => 'Relation'
398    # context => '#stay'
399    # type => 'RegExpr'
400    if ($self->testRegExpr($text, '\\s(=|#|<|<=|>|>=|IN\\s|IS)', 0, 0, 0, undef, 0, '#stay', 'Relation')) {
401       return 1
402    }
403    # String => '\s(\+|\-|OR|\*|/|DIV|MOD|\&)'
404    # attribute => 'Operator'
405    # context => '#stay'
406    # type => 'RegExpr'
407    if ($self->testRegExpr($text, '\\s(\\+|\\-|OR|\\*|/|DIV|MOD|\\&)', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
408       return 1
409    }
410    return 0;
411 };
412
413 sub parseString1 {
414    my ($self, $text) = @_;
415    # attribute => 'String'
416    # char => '"'
417    # context => '#pop'
418    # type => 'DetectChar'
419    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
420       return 1
421    }
422    return 0;
423 };
424
425 sub parseString2 {
426    my ($self, $text) = @_;
427    # attribute => 'String'
428    # char => '''
429    # context => '#pop'
430    # type => 'DetectChar'
431    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
432       return 1
433    }
434    return 0;
435 };
436
437
438 1;
439
440 __END__
441
442 =head1 NAME
443
444 Syntax::Highlight::Engine::Kate::ComponentminusPascal - a Plugin for Component-Pascal syntax highlighting
445
446 =head1 SYNOPSIS
447
448  require Syntax::Highlight::Engine::Kate::ComponentminusPascal;
449  my $sh = new Syntax::Highlight::Engine::Kate::ComponentminusPascal([
450  ]);
451
452 =head1 DESCRIPTION
453
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.
456
457 This code is generated from the syntax definition files used
458 by the Kate project.
459 It works quite fine, but can use refinement and optimization.
460
461 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
462
463 =cut
464
465 =head1 AUTHOR
466
467 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
468
469 =cut
470
471 =head1 BUGS
472
473 Unknown. If you find any, please contact the author
474
475 =cut
476