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 'pike.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Paul Pogonyshev
11 #generated: Sun Feb 3 22:02:06 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Pike;
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 'Builtin Function' => 'Function',
29 'Comment' => 'Comment',
30 'Data Type' => 'DataType',
31 'Decimal' => 'DecVal',
34 'Keyword' => 'Keyword',
35 'Normal Text' => 'Normal',
38 'Preprocessor' => 'Others',
39 'Preprocessor Lib' => 'String',
41 'String Char' => 'Char',
43 $self->listAdd('builtins',
49 $self->listAdd('keywords',
64 $self->listAdd('types',
80 callback => \&parseBlockComment,
81 attribute => 'Comment',
84 callback => \&parseLineComment,
85 attribute => 'Comment',
89 callback => \&parseNormal,
90 attribute => 'Normal Text',
93 callback => \&parseOutscoped,
94 attribute => 'Comment',
96 'Outscoped intern' => {
97 callback => \&parseOutscopedintern,
98 attribute => 'Comment',
101 callback => \&parsePreprocessor,
102 attribute => 'Preprocessor',
103 lineending => '#pop',
106 callback => \&parseString,
107 attribute => 'String',
108 lineending => '#pop',
111 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
112 $self->basecontext('Normal');
113 $self->keywordscase(0);
115 bless ($self, $class);
123 sub parseBlockComment {
124 my ($self, $text) = @_;
125 # attribute => 'Comment'
129 # endRegion => 'Comment'
130 # type => 'Detect2Chars'
131 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
134 # String => '(FIXME|TODO|NOT(IC)?E):?'
135 # attribute => 'Note'
138 if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) {
144 sub parseLineComment {
145 my ($self, $text) = @_;
146 # String => '(FIXME|TODO|NOT(IC)?E):?'
147 # attribute => 'Note'
150 if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) {
157 my ($self, $text) = @_;
158 # String => 'keywords'
159 # attribute => 'Keyword'
162 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
166 # attribute => 'Data Type'
169 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
172 # String => 'builtins'
173 # attribute => 'Builtin Function'
176 if ($self->testKeyword($text, 'builtins', 0, undef, 0, '#stay', 'Builtin Function')) {
179 # String => '`([\+\-\*/%~&\|^]|[!=<>]=|<<?|>>?|(\[\]|->)=?)'
180 # attribute => 'Builtin Function'
183 if ($self->testRegExpr($text, '`([\\+\\-\\*/%~&\\|^]|[!=<>]=|<<?|>>?|(\\[\\]|->)=?)', 0, 0, 0, undef, 0, '#stay', 'Builtin Function')) {
186 # attribute => 'Float'
189 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
192 # String => '0[bB][01]+'
193 # attribute => 'Binary'
196 if ($self->testRegExpr($text, '0[bB][01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) {
199 # attribute => 'Octal'
202 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
208 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
211 # attribute => 'Decimal'
214 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
217 # attribute => 'Char'
220 if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
223 # attribute => 'Normal Text'
224 # beginRegion => 'Brace'
227 # type => 'DetectChar'
228 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
231 # attribute => 'Normal Text'
234 # endRegion => 'Brace'
235 # type => 'DetectChar'
236 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
239 # attribute => 'String'
241 # context => 'String'
242 # type => 'DetectChar'
243 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
246 # attribute => 'Comment'
249 # context => 'Line Comment'
250 # type => 'Detect2Chars'
251 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) {
254 # attribute => 'Comment'
257 # context => 'Line Comment'
258 # type => 'Detect2Chars'
259 if ($self->testDetect2Chars($text, '#', '!', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) {
262 # attribute => 'Comment'
263 # beginRegion => 'Comment'
266 # context => 'Block Comment'
267 # type => 'Detect2Chars'
268 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) {
271 # String => '#\s*if\s+0'
272 # attribute => 'Preprocessor'
273 # beginRegion => 'Outscoped'
274 # context => 'Outscoped'
275 # firstNonSpace => 'true'
277 if ($self->testRegExpr($text, '#\\s*if\\s+0', 0, 0, 0, undef, 1, 'Outscoped', 'Preprocessor')) {
280 # attribute => 'Preprocessor'
282 # context => 'Preprocessor'
283 # firstNonSpace => 'true'
284 # type => 'DetectChar'
285 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) {
292 my ($self, $text) = @_;
293 # String => '(FIXME|TODO|NOT(IC)?E):?'
294 # attribute => 'Note'
297 if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E):?', 0, 0, 0, undef, 0, '#stay', 'Note')) {
300 # attribute => 'Comment'
301 # beginRegion => 'Comment'
304 # context => 'Block Comment'
305 # type => 'Detect2Chars'
306 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) {
310 # attribute => 'Comment'
311 # beginRegion => 'Outscoped'
312 # context => 'Outscoped intern'
313 # firstNonSpace => 'true'
315 if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) {
318 # String => '#\s*(endif|elif|else)'
319 # attribute => 'Preprocessor'
321 # endRegion => 'Outscoped'
322 # firstNonSpace => 'true'
324 if ($self->testRegExpr($text, '#\\s*(endif|elif|else)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) {
330 sub parseOutscopedintern {
331 my ($self, $text) = @_;
332 # attribute => 'Comment'
333 # beginRegion => 'Comment'
336 # context => 'Block Comment'
337 # type => 'Detect2Chars'
338 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) {
342 # attribute => 'Comment'
343 # beginRegion => 'Outscoped'
344 # context => 'Outscoped intern'
345 # firstNonSpace => 'true'
347 if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) {
350 # String => '#\s*endif'
351 # attribute => 'Comment'
353 # endRegion => 'Outscoped'
354 # firstNonSpace => 'true'
356 if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) {
362 sub parsePreprocessor {
363 my ($self, $text) = @_;
364 # attribute => 'Preprocessor Lib'
368 # type => 'RangeDetect'
369 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Preprocessor Lib')) {
372 # attribute => 'Preprocessor Lib'
376 # type => 'RangeDetect'
377 if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Preprocessor Lib')) {
380 # attribute => 'Comment'
383 # context => 'Line Comment'
384 # type => 'Detect2Chars'
385 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Line Comment', 'Comment')) {
388 # attribute => 'Comment'
391 # context => 'Block Comment'
392 # type => 'Detect2Chars'
393 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Block Comment', 'Comment')) {
396 # attribute => 'Preprocessor'
398 # type => 'LineContinue'
399 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) {
406 my ($self, $text) = @_;
407 # String => '\\d[0-9]+'
408 # attribute => 'String Char'
411 if ($self->testRegExpr($text, '\\\\d[0-9]+', 0, 0, 0, undef, 0, '#stay', 'String Char')) {
414 # attribute => 'String Char'
416 # type => 'HlCStringChar'
417 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
420 # attribute => 'String'
423 # type => 'DetectChar'
424 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
427 # attribute => 'String'
429 # type => 'LineContinue'
430 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
443 Syntax::Highlight::Engine::Kate::Pike - a Plugin for Pike syntax highlighting
447 require Syntax::Highlight::Engine::Kate::Pike;
448 my $sh = new Syntax::Highlight::Engine::Kate::Pike([
453 Syntax::Highlight::Engine::Kate::Pike is a plugin module that provides syntax highlighting
454 for Pike to the Syntax::Haghlight::Engine::Kate highlighting engine.
456 This code is generated from the syntax definition files used
458 It works quite fine, but can use refinement and optimization.
460 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
466 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
472 Unknown. If you find any, please contact the author