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 'cgis.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:04 2008, localtime
12 package Syntax::Highlight::Engine::Kate::CGiS;
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(@_);
27 'Comment' => 'Comment',
28 'Data Type' => 'DataType',
29 'Decimal' => 'DecVal',
33 'Keyword' => 'Keyword',
34 'Normal Text' => 'Normal',
36 'Region Marker' => 'RegionMarker',
38 'String Char' => 'Char',
41 $self->listAdd('keywords',
64 $self->listAdd('types',
84 callback => \&parseCode,
85 attribute => 'Normal Text',
88 callback => \&parseCommentar1,
89 attribute => 'Comment',
93 callback => \&parseCommentar2,
94 attribute => 'Comment',
97 callback => \&parseCommon,
98 attribute => 'Normal Text',
101 callback => \&parseControl,
102 attribute => 'Normal Text',
105 callback => \&parseHint,
109 callback => \&parseInterface,
110 attribute => 'Normal Text',
113 callback => \&parseNormal,
114 attribute => 'Normal Text',
117 callback => \&parseRegionMarker,
118 attribute => 'Region Marker',
119 lineending => '#pop',
122 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
123 $self->basecontext('Normal');
124 $self->keywordscase(0);
126 bless ($self, $class);
135 my ($self, $text) = @_;
136 # type => 'DetectSpaces'
137 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
140 # String => 'CONTROL'
141 # attribute => 'Keyword'
142 # context => 'Control'
143 # type => 'StringDetect'
144 if ($self->testStringDetect($text, 'CONTROL', 0, 0, 0, undef, 0, 'Control', 'Keyword')) {
148 # attribute => 'Hint'
150 # type => 'StringDetect'
151 if ($self->testStringDetect($text, '#HINT', 0, 0, 0, undef, 0, 'Hint', 'Hint')) {
154 # context => 'Common'
155 # type => 'IncludeRules'
156 if ($self->includeRules('Common', $text)) {
162 sub parseCommentar1 {
163 my ($self, $text) = @_;
164 # context => '##Alerts'
165 # type => 'IncludeRules'
166 if ($self->includePlugin('Alerts', $text)) {
172 sub parseCommentar2 {
173 my ($self, $text) = @_;
174 # attribute => 'Comment'
178 # endRegion => 'Comment'
179 # type => 'Detect2Chars'
180 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
183 # context => '##Alerts'
184 # type => 'IncludeRules'
185 if ($self->includePlugin('Alerts', $text)) {
192 my ($self, $text) = @_;
193 # String => '//BEGIN'
194 # attribute => 'Region Marker'
195 # beginRegion => 'Region1'
196 # context => 'Region Marker'
197 # firstNonSpace => 'true'
198 # type => 'StringDetect'
199 if ($self->testStringDetect($text, '//BEGIN', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) {
203 # attribute => 'Region Marker'
204 # context => 'Region Marker'
205 # endRegion => 'Region1'
206 # firstNonSpace => 'true'
207 # type => 'StringDetect'
208 if ($self->testStringDetect($text, '//END', 0, 0, 0, undef, 1, 'Region Marker', 'Region Marker')) {
211 # String => 'keywords'
212 # attribute => 'Keyword'
215 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
219 # attribute => 'Data Type'
222 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
225 # type => 'DetectIdentifier'
226 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
229 # attribute => 'Symbol'
230 # beginRegion => 'Brace1'
233 # type => 'DetectChar'
234 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
237 # attribute => 'Symbol'
240 # endRegion => 'Brace1'
241 # type => 'DetectChar'
242 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
245 # attribute => 'Float'
247 # items => 'ARRAY(0x11a5b70)'
249 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
251 # attribute => 'Float'
254 if ($self->testAnyChar($text, 'fF', 0, 0, undef, 0, '#stay', 'Float')) {
258 # attribute => 'Octal'
261 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
267 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
270 # attribute => 'Decimal'
273 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
276 # context => '##Doxygen'
277 # type => 'IncludeRules'
278 if ($self->includePlugin('Doxygen', $text)) {
281 # attribute => 'Comment'
284 # context => 'Commentar 1'
285 # type => 'Detect2Chars'
286 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
289 # attribute => 'Comment'
290 # beginRegion => 'Comment'
293 # context => 'Commentar 2'
294 # type => 'Detect2Chars'
295 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
302 my ($self, $text) = @_;
303 # type => 'DetectSpaces'
304 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
308 # attribute => 'Keyword'
310 # type => 'StringDetect'
311 if ($self->testStringDetect($text, 'CODE', 0, 0, 0, undef, 0, 'Code', 'Keyword')) {
314 # context => 'Common'
315 # type => 'IncludeRules'
316 if ($self->includeRules('Common', $text)) {
323 my ($self, $text) = @_;
324 # type => 'DetectSpaces'
325 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
328 # attribute => 'Hint'
331 # type => 'DetectChar'
332 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Hint')) {
335 # type => 'DetectIdentifier'
336 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
343 my ($self, $text) = @_;
344 # type => 'DetectSpaces'
345 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
348 # String => 'CONTROL'
349 # attribute => 'Keyword'
350 # context => 'Control'
351 # type => 'StringDetect'
352 if ($self->testStringDetect($text, 'CONTROL', 0, 0, 0, undef, 0, 'Control', 'Keyword')) {
356 # attribute => 'Keyword'
358 # type => 'StringDetect'
359 if ($self->testStringDetect($text, 'CODE', 0, 0, 0, undef, 0, 'Code', 'Keyword')) {
362 # context => 'Common'
363 # type => 'IncludeRules'
364 if ($self->includeRules('Common', $text)) {
371 my ($self, $text) = @_;
372 # type => 'DetectSpaces'
373 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
376 # String => 'PROGRAM'
377 # attribute => 'Keyword'
379 # type => 'StringDetect'
380 if ($self->testStringDetect($text, 'PROGRAM', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
383 # String => 'INTERFACE'
384 # attribute => 'Keyword'
385 # context => 'Interface'
386 # type => 'StringDetect'
387 if ($self->testStringDetect($text, 'INTERFACE', 0, 0, 0, undef, 0, 'Interface', 'Keyword')) {
393 sub parseRegionMarker {
394 my ($self, $text) = @_;
405 Syntax::Highlight::Engine::Kate::CGiS - a Plugin for CGiS syntax highlighting
409 require Syntax::Highlight::Engine::Kate::CGiS;
410 my $sh = new Syntax::Highlight::Engine::Kate::CGiS([
415 Syntax::Highlight::Engine::Kate::CGiS is a plugin module that provides syntax highlighting
416 for CGiS to the Syntax::Haghlight::Engine::Kate highlighting engine.
418 This code is generated from the syntax definition files used
420 It works quite fine, but can use refinement and optimization.
422 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
428 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
434 Unknown. If you find any, please contact the author