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 'ansic89.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Dominik Haumann (dhdev@gmx.de)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::ANSI_C89;
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 'Data Type' => 'DataType',
29 'Decimal' => 'DecVal',
32 'Keyword' => 'Keyword',
33 'Normal Text' => 'Normal',
35 'Prep. Lib' => 'Others',
36 'Preprocessor' => 'Others',
38 'String Char' => 'Char',
41 $self->listAdd('keywords',
61 $self->listAdd('types',
79 callback => \&parseDefine,
80 attribute => 'Preprocessor',
84 callback => \&parseNormal,
85 attribute => 'Normal Text',
88 callback => \&parseOutscoped,
89 attribute => 'Comment',
91 'Outscoped intern' => {
92 callback => \&parseOutscopedintern,
93 attribute => 'Comment',
96 callback => \&parsePreprocessor,
97 attribute => 'Preprocessor',
101 callback => \&parseString,
102 attribute => 'String',
103 lineending => '#pop',
106 callback => \&parsecomment,
107 attribute => 'Comment',
110 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
111 $self->basecontext('Normal');
112 $self->keywordscase(0);
114 bless ($self, $class);
123 my ($self, $text) = @_;
124 # attribute => 'Preprocessor'
126 # type => 'LineContinue'
127 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) {
134 my ($self, $text) = @_;
135 # type => 'DetectSpaces'
136 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
139 # String => '#\s*if\s+0'
140 # attribute => 'Preprocessor'
141 # beginRegion => 'Outscoped'
142 # context => 'Outscoped'
143 # firstNonSpace => 'true'
145 if ($self->testRegExpr($text, '#\\s*if\\s+0', 0, 0, 0, undef, 1, 'Outscoped', 'Preprocessor')) {
148 # attribute => 'Preprocessor'
150 # context => 'Preprocessor'
151 # firstNonSpace => 'true'
152 # type => 'DetectChar'
153 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) {
156 # String => 'keywords'
157 # attribute => 'Keyword'
160 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
164 # attribute => 'Data Type'
167 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
170 # type => 'DetectIdentifier'
171 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
174 # attribute => 'Symbol'
175 # beginRegion => 'Brace1'
178 # type => 'DetectChar'
179 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
182 # attribute => 'Symbol'
185 # endRegion => 'Brace1'
186 # type => 'DetectChar'
187 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
190 # attribute => 'Float'
192 # items => 'ARRAY(0xec1180)'
194 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
196 # attribute => 'Float'
199 if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
203 # attribute => 'Octal'
206 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
212 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
215 # attribute => 'Decimal'
217 # items => 'ARRAY(0xef8f50)'
219 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
221 # attribute => 'Decimal'
223 # insensitive => 'TRUE'
224 # type => 'StringDetect'
225 if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
229 # attribute => 'Decimal'
231 # insensitive => 'TRUE'
232 # type => 'StringDetect'
233 if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
237 # attribute => 'Decimal'
239 # insensitive => 'TRUE'
240 # type => 'StringDetect'
241 if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
245 # attribute => 'Decimal'
247 # insensitive => 'TRUE'
248 # type => 'StringDetect'
249 if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
253 # attribute => 'Decimal'
255 # insensitive => 'TRUE'
256 # type => 'StringDetect'
257 if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
261 # attribute => 'Decimal'
263 # insensitive => 'TRUE'
264 # type => 'StringDetect'
265 if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
269 # attribute => 'Decimal'
271 # insensitive => 'TRUE'
272 # type => 'StringDetect'
273 if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
277 # attribute => 'Decimal'
279 # insensitive => 'TRUE'
280 # type => 'StringDetect'
281 if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
285 # attribute => 'Char'
288 if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
291 # attribute => 'String'
293 # context => 'String'
294 # type => 'DetectChar'
295 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
298 # attribute => 'Comment'
299 # beginRegion => 'blockcomment'
302 # context => 'comment'
303 # type => 'Detect2Chars'
304 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
307 # String => ':!%&()+,-/.*<=>?[]|~^;'
308 # attribute => 'Symbol'
311 if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) {
318 my ($self, $text) = @_;
319 # attribute => 'Comment'
320 # beginRegion => 'Comment'
323 # context => 'comment'
324 # type => 'Detect2Chars'
325 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
328 # context => '##Alerts'
329 # type => 'IncludeRules'
330 if ($self->includePlugin('Alerts', $text)) {
334 # attribute => 'Comment'
335 # beginRegion => 'Outscoped'
336 # context => 'Outscoped intern'
337 # firstNonSpace => 'true'
339 if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) {
342 # String => '#\s*(endif|else|elif)'
343 # attribute => 'Preprocessor'
345 # endRegion => 'Outscoped'
346 # firstNonSpace => 'true'
348 if ($self->testRegExpr($text, '#\\s*(endif|else|elif)', 0, 0, 0, undef, 1, '#pop', 'Preprocessor')) {
354 sub parseOutscopedintern {
355 my ($self, $text) = @_;
356 # attribute => 'Comment'
357 # beginRegion => 'Comment'
360 # context => 'comment'
361 # type => 'Detect2Chars'
362 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
366 # attribute => 'Comment'
367 # beginRegion => 'Outscoped'
368 # context => 'Outscoped intern'
369 # firstNonSpace => 'true'
371 if ($self->testRegExpr($text, '#\\s*if', 0, 0, 0, undef, 1, 'Outscoped intern', 'Comment')) {
374 # String => '#\s*endif'
375 # attribute => 'Comment'
377 # endRegion => 'Outscoped'
378 # firstNonSpace => 'true'
380 if ($self->testRegExpr($text, '#\\s*endif', 0, 0, 0, undef, 1, '#pop', 'Comment')) {
386 sub parsePreprocessor {
387 my ($self, $text) = @_;
388 # attribute => 'Preprocessor'
390 # type => 'LineContinue'
391 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) {
394 # String => 'define.*((?=\\))'
395 # attribute => 'Preprocessor'
396 # context => 'Define'
398 if ($self->testRegExpr($text, 'define.*((?=\\\\))', 0, 0, 0, undef, 0, 'Define', 'Preprocessor')) {
401 # String => 'define.*'
402 # attribute => 'Preprocessor'
405 if ($self->testRegExpr($text, 'define.*', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) {
408 # attribute => 'Prep. Lib'
412 # type => 'RangeDetect'
413 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
416 # attribute => 'Prep. Lib'
420 # type => 'RangeDetect'
421 if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
424 # attribute => 'Comment'
425 # beginRegion => 'blockcomment'
428 # context => 'comment'
429 # type => 'Detect2Chars'
430 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
437 my ($self, $text) = @_;
438 # attribute => 'String'
440 # type => 'LineContinue'
441 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
444 # attribute => 'String Char'
446 # type => 'HlCStringChar'
447 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
450 # attribute => 'String'
453 # type => 'DetectChar'
454 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
461 my ($self, $text) = @_;
462 # attribute => 'Comment'
466 # endRegion => 'blockcomment'
467 # type => 'Detect2Chars'
468 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
471 # context => '##Alerts'
472 # type => 'IncludeRules'
473 if ($self->includePlugin('Alerts', $text)) {
486 Syntax::Highlight::Engine::Kate::ANSI_C89 - a Plugin for ANSI C89 syntax highlighting
490 require Syntax::Highlight::Engine::Kate::ANSI_C89;
491 my $sh = new Syntax::Highlight::Engine::Kate::ANSI_C89([
496 Syntax::Highlight::Engine::Kate::ANSI_C89 is a plugin module that provides syntax highlighting
497 for ANSI C89 to the Syntax::Haghlight::Engine::Kate highlighting engine.
499 This code is generated from the syntax definition files used
501 It works quite fine, but can use refinement and optimization.
503 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
509 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
515 Unknown. If you find any, please contact the author