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 'objectivec.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #generated: Sun Feb 3 22:02:05 2008, localtime
12 package Syntax::Highlight::Engine::Kate::ObjectiveminusC;
14 our $VERSION = '0.06';
18 use base('Syntax::Highlight::Engine::Kate::Template');
22 my $class = ref($proto) || $proto;
23 my $self = $class->SUPER::new(@_);
26 'Comment' => 'Comment',
27 'Data Type' => 'DataType',
28 'Decimal' => 'DecVal',
31 'Keyword' => 'Keyword',
32 'Normal Text' => 'Normal',
34 'Prep. Lib' => 'Others',
35 'Preprocessor' => 'Others',
37 'String Char' => 'Char',
40 $self->listAdd('keywords',
73 $self->listAdd('types',
91 callback => \&parseDefault,
92 attribute => 'Normal Text',
94 'MultiLineComment' => {
95 callback => \&parseMultiLineComment,
96 attribute => 'Comment',
98 'MultiLineCommentPrep' => {
99 callback => \&parseMultiLineCommentPrep,
100 attribute => 'Comment',
103 callback => \&parsePreprocessor,
104 attribute => 'Preprocessor',
105 lineending => 'Default',
107 'SingleLineComment' => {
108 callback => \&parseSingleLineComment,
109 attribute => 'Comment',
110 lineending => '#pop',
113 callback => \&parseString,
114 attribute => 'String',
115 lineending => '#pop',
118 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
119 $self->basecontext('Default');
120 $self->keywordscase(0);
122 bless ($self, $class);
127 return 'Objective-C';
131 my ($self, $text) = @_;
132 # String => 'keywords'
133 # attribute => 'Keyword'
136 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
140 # attribute => 'Data Type'
143 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
146 # attribute => 'Symbol'
147 # beginRegion => 'Brace1'
150 # type => 'DetectChar'
151 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
154 # attribute => 'Symbol'
157 # endRegion => 'Brace1'
158 # type => 'DetectChar'
159 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
162 # attribute => 'Float'
164 # items => 'ARRAY(0x197ace0)'
166 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
168 # attribute => 'Float'
171 if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
175 # attribute => 'Octal'
178 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
184 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
187 # attribute => 'Decimal'
189 # items => 'ARRAY(0x1835840)'
191 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
193 # attribute => 'Decimal'
195 # insensitive => 'TRUE'
196 # type => 'StringDetect'
197 if ($self->testStringDetect($text, 'ULL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
201 # attribute => 'Decimal'
203 # insensitive => 'TRUE'
204 # type => 'StringDetect'
205 if ($self->testStringDetect($text, 'LUL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
209 # attribute => 'Decimal'
211 # insensitive => 'TRUE'
212 # type => 'StringDetect'
213 if ($self->testStringDetect($text, 'LLU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
217 # attribute => 'Decimal'
219 # insensitive => 'TRUE'
220 # type => 'StringDetect'
221 if ($self->testStringDetect($text, 'UL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
225 # attribute => 'Decimal'
227 # insensitive => 'TRUE'
228 # type => 'StringDetect'
229 if ($self->testStringDetect($text, 'LU', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
233 # attribute => 'Decimal'
235 # insensitive => 'TRUE'
236 # type => 'StringDetect'
237 if ($self->testStringDetect($text, 'LL', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
241 # attribute => 'Decimal'
243 # insensitive => 'TRUE'
244 # type => 'StringDetect'
245 if ($self->testStringDetect($text, 'U', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
249 # attribute => 'Decimal'
251 # insensitive => 'TRUE'
252 # type => 'StringDetect'
253 if ($self->testStringDetect($text, 'L', 1, 0, 0, undef, 0, '#stay', 'Decimal')) {
257 # attribute => 'Char'
260 if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
263 # attribute => 'String'
265 # context => 'String'
266 # type => 'DetectChar'
267 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
270 # attribute => 'Comment'
273 # context => 'SingleLineComment'
274 # type => 'Detect2Chars'
275 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) {
278 # attribute => 'Comment'
281 # context => 'MultiLineComment'
282 # type => 'Detect2Chars'
283 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineComment', 'Comment')) {
286 # String => ':!%&()+,-/.*<=>?[]|~^;'
287 # attribute => 'Symbol'
290 if ($self->testAnyChar($text, ':!%&()+,-/.*<=>?[]|~^;', 0, 0, undef, 0, '#stay', 'Symbol')) {
294 # attribute => 'Preprocessor'
295 # context => 'Preprocessor'
297 if ($self->testRegExpr($text, '^#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
300 # attribute => 'String'
303 # context => 'String'
304 # type => 'Detect2Chars'
305 if ($self->testDetect2Chars($text, '@', '"', 0, 0, 0, undef, 0, 'String', 'String')) {
311 sub parseMultiLineComment {
312 my ($self, $text) = @_;
313 # attribute => 'Comment'
317 # type => 'Detect2Chars'
318 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
324 sub parseMultiLineCommentPrep {
325 my ($self, $text) = @_;
326 # attribute => 'Comment'
329 # context => '#pop#pop'
330 # type => 'Detect2Chars'
331 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop', 'Comment')) {
337 sub parsePreprocessor {
338 my ($self, $text) = @_;
339 # attribute => 'Preprocessor'
341 # type => 'LineContinue'
342 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) {
345 # attribute => 'Prep. Lib'
349 # type => 'RangeDetect'
350 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
353 # attribute => 'Prep. Lib'
357 # type => 'RangeDetect'
358 if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
361 # context => '##Doxygen'
362 # type => 'IncludeRules'
363 if ($self->includePlugin('Doxygen', $text)) {
366 # attribute => 'Comment'
369 # context => 'SingleLineComment'
370 # type => 'Detect2Chars'
371 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) {
374 # attribute => 'Comment'
377 # context => 'MultiLineCommentPrep'
378 # type => 'Detect2Chars'
379 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineCommentPrep', 'Comment')) {
385 sub parseSingleLineComment {
386 my ($self, $text) = @_;
391 my ($self, $text) = @_;
392 # attribute => 'String'
394 # type => 'LineContinue'
395 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
398 # attribute => 'String Char'
400 # type => 'HlCStringChar'
401 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
404 # attribute => 'String'
407 # type => 'DetectChar'
408 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
421 Syntax::Highlight::Engine::Kate::ObjectiveminusC - a Plugin for Objective-C syntax highlighting
425 require Syntax::Highlight::Engine::Kate::ObjectiveminusC;
426 my $sh = new Syntax::Highlight::Engine::Kate::ObjectiveminusC([
431 Syntax::Highlight::Engine::Kate::ObjectiveminusC is a plugin module that provides syntax highlighting
432 for Objective-C to the Syntax::Haghlight::Engine::Kate highlighting engine.
434 This code is generated from the syntax definition files used
436 It works quite fine, but can use refinement and optimization.
438 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
444 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
450 Unknown. If you find any, please contact the author