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 'glsl.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Oliver Richers (o.richers@tu-bs.de)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::GLSL;
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',
31 'Function' => 'Function',
33 'Keyword' => 'Keyword',
34 'Normal Text' => 'Normal',
36 'Preprocessor' => 'Others',
37 'StdFunction' => 'Function',
38 'StdVariable' => 'Function',
40 'Type Qualifier' => 'DataType',
42 $self->listAdd('attention',
47 $self->listAdd('keywords',
61 $self->listAdd('stdlib',
138 $self->listAdd('stdvar',
140 'gl_BackLightModelProduct',
141 'gl_BackLightProduct',
143 'gl_BackSecondaryColor',
149 'gl_DepthRangeParameters',
164 'gl_FrontLightModelProduct',
165 'gl_FrontLightProduct',
167 'gl_FrontSecondaryColor',
169 'gl_LightModelParameters',
170 'gl_LightModelProducts',
173 'gl_LightSourceParameters',
174 'gl_MaterialParameters',
176 'gl_MaxCombinedTextureImageUnits',
178 'gl_MaxFragmentUniformComponents',
180 'gl_MaxTextureCoords',
181 'gl_MaxTextureImageUnits',
182 'gl_MaxTextureUnits',
183 'gl_MaxVaryingFloats',
184 'gl_MaxVertexAttributes',
185 'gl_MaxVertexTextureImageUnits',
186 'gl_MaxVertexUniformComponents',
187 'gl_ModelViewMatrix',
188 'gl_ModelViewMatrixInverse',
189 'gl_ModelViewMatrixInverseTranspose',
190 'gl_ModelViewMatrixTranspose',
191 'gl_ModelViewProjectionMatrix',
192 'gl_ModelViewProjectionMatrixInverse',
193 'gl_ModelViewProjectionMatrixInverseTranspose',
194 'gl_ModelViewProjectionMatrixTranspose',
212 'gl_PointParameters',
215 'gl_ProjectionMatrix',
216 'gl_ProjectionMatrixInverse',
217 'gl_ProjectionMatrixInverseTranspose',
218 'gl_ProjectionMatrixTranspose',
222 'gl_TextureEnvColor',
224 'gl_TextureMatrixInverse',
225 'gl_TextureMatrixInverseTranspose',
226 'gl_TextureMatrixTranspose',
229 $self->listAdd('typequal',
238 $self->listAdd('types',
264 callback => \&parseCommentar1,
265 attribute => 'Comment',
266 lineending => '#pop',
269 callback => \&parseCommentar2,
270 attribute => 'Comment',
273 callback => \&parseMember,
274 attribute => 'Normal Text',
275 lineending => '#pop',
276 fallthrough => '#pop',
279 callback => \&parseNormal,
280 attribute => 'Normal Text',
283 callback => \&parsePreprocessor,
284 attribute => 'Preprocessor',
285 lineending => '#pop',
288 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
289 $self->basecontext('Normal');
290 $self->keywordscase(0);
292 bless ($self, $class);
300 sub parseCommentar1 {
301 my ($self, $text) = @_;
302 # String => 'attention'
303 # attribute => 'Alert'
306 if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
312 sub parseCommentar2 {
313 my ($self, $text) = @_;
314 # attribute => 'Comment'
318 # endRegion => 'Comment'
319 # type => 'Detect2Chars'
320 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
323 # String => 'attention'
324 # attribute => 'Alert'
327 if ($self->testKeyword($text, 'attention', 0, undef, 0, '#stay', 'Alert')) {
334 my ($self, $text) = @_;
335 # String => '\b[_\w][_\w\d]*(?=[\s]*)'
336 # attribute => 'Function'
339 if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*)', 0, 0, 0, undef, 0, '#pop', 'Function')) {
346 my ($self, $text) = @_;
347 # String => 'keywords'
348 # attribute => 'Keyword'
351 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
355 # attribute => 'Data Type'
358 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
361 # String => 'typequal'
362 # attribute => 'Type Qualifier'
365 if ($self->testKeyword($text, 'typequal', 0, undef, 0, '#stay', 'Type Qualifier')) {
369 # attribute => 'StdFunction'
372 if ($self->testKeyword($text, 'stdlib', 0, undef, 0, '#stay', 'StdFunction')) {
376 # attribute => 'StdVariable'
379 if ($self->testKeyword($text, 'stdvar', 0, undef, 0, '#stay', 'StdVariable')) {
382 # attribute => 'Float'
385 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
388 # attribute => 'Octal'
391 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
397 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
400 # attribute => 'Decimal'
403 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
406 # attribute => 'Comment'
409 # context => 'Commentar 1'
410 # type => 'Detect2Chars'
411 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
414 # attribute => 'Comment'
415 # beginRegion => 'Comment'
418 # context => 'Commentar 2'
419 # type => 'Detect2Chars'
420 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
423 # attribute => 'Symbol'
424 # beginRegion => 'Brace1'
427 # type => 'DetectChar'
428 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
431 # attribute => 'Symbol'
434 # endRegion => 'Brace1'
435 # type => 'DetectChar'
436 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
439 # attribute => 'Preprocessor'
441 # context => 'Preprocessor'
442 # firstNonSpace => 'true'
443 # type => 'DetectChar'
444 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 1, 'Preprocessor', 'Preprocessor')) {
447 # String => '\b[_\w][_\w\d]*(?=[\s]*[(])'
448 # attribute => 'Function'
451 if ($self->testRegExpr($text, '\\b[_\\w][_\\w\\d]*(?=[\\s]*[(])', 0, 0, 0, undef, 0, '#stay', 'Function')) {
454 # String => '[.]{1,1}'
455 # attribute => 'Symbol'
456 # context => 'Member'
458 if ($self->testRegExpr($text, '[.]{1,1}', 0, 0, 0, undef, 0, 'Member', 'Symbol')) {
461 # String => '.+-/*%<>[]()^|&~=!:;,?;'
462 # attribute => 'Symbol'
465 if ($self->testAnyChar($text, '.+-/*%<>[]()^|&~=!:;,?;', 0, 0, undef, 0, '#stay', 'Symbol')) {
471 sub parsePreprocessor {
472 my ($self, $text) = @_;
483 Syntax::Highlight::Engine::Kate::GLSL - a Plugin for GLSL syntax highlighting
487 require Syntax::Highlight::Engine::Kate::GLSL;
488 my $sh = new Syntax::Highlight::Engine::Kate::GLSL([
493 Syntax::Highlight::Engine::Kate::GLSL is a plugin module that provides syntax highlighting
494 for GLSL to the Syntax::Haghlight::Engine::Kate highlighting engine.
496 This code is generated from the syntax definition files used
498 It works quite fine, but can use refinement and optimization.
500 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
506 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
512 Unknown. If you find any, please contact the author