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 'cmake.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::CMake;
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(@_);
25 'Commands' => 'Keyword',
26 'Comment' => 'Comment',
27 'Macros' => 'Keyword',
28 'Normal Text' => 'Normal',
29 'Region Marker' => 'RegionMarker',
30 'Special Args' => 'Others',
31 'Variable' => 'DecVal',
33 $self->listAdd('commands',
42 'AUX_SOURCE_DIRECTORY',
45 'CMAKE_MINIMUM_REQUIRED',
47 'CREATE_TEST_SOURCELIST',
54 'EXPORT_LIBRARY_DEPENDENCIES',
64 'GET_DIRECTORY_PROPERTY',
65 'GET_FILENAME_COMPONENT',
66 'GET_SOURCE_FILE_PROPERTY',
67 'GET_TARGET_PROPERTY',
70 'INCLUDE_DIRECTORIES',
71 'INCLUDE_EXTERNAL_MSPROJECT',
72 'INCLUDE_REGULAR_EXPRESSION',
86 'OUTPUT_REQUIRED_FILES',
94 'SET_DIRECTORY_PROPERTIES',
95 'SET_SOURCE_FILES_PROPERTIES',
96 'SET_TARGET_PROPERTIES',
99 'SOURCE_FILES_REMOVE',
104 'TARGET_LINK_LIBRARIES',
110 'VTK_MAKE_INSTANTIATOR',
114 'WRAP_EXCLUDE_FILES',
117 $self->listAdd('special_args',
120 'ADDITIONAL_MAKE_CLEAN_FILES',
163 'INCLUDE_DIRECTORIES',
165 'INCLUDE_REGULAR_EXPRESSION',
191 'POST_INSTALL_SCRIPT',
195 'PRE_INSTALL_SCRIPT',
204 'REGULAR_EXPRESSION',
230 callback => \&parseFunctionArgs,
231 attribute => 'Normal Text',
234 callback => \&parseNormalText,
235 attribute => 'Normal Text',
238 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
239 $self->basecontext('Normal Text');
240 $self->keywordscase(0);
242 bless ($self, $class);
250 sub parseFunctionArgs {
251 my ($self, $text) = @_;
252 # attribute => 'Normal Text'
255 # type => 'DetectChar'
256 if ($self->testDetectChar($text, ')', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
259 # String => 'special_args'
260 # attribute => 'Special Args'
263 if ($self->testKeyword($text, 'special_args', 0, undef, 0, '#stay', 'Special Args')) {
267 # attribute => 'Comment'
270 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
273 # String => '\$\{\s*\w+\s*\}'
274 # attribute => 'Variable'
277 if ($self->testRegExpr($text, '\\$\\{\\s*\\w+\\s*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
283 sub parseNormalText {
284 my ($self, $text) = @_;
285 # String => 'commands'
286 # attribute => 'Commands'
287 # context => 'Function Args'
289 if ($self->testKeyword($text, 'commands', 0, undef, 0, 'Function Args', 'Commands')) {
292 # String => '#\s*BEGIN.*$'
293 # attribute => 'Region Marker'
294 # beginRegion => 'block'
296 # firstNonSpace => 'true'
298 if ($self->testRegExpr($text, '#\\s*BEGIN.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
301 # String => '#\s*END.*$'
302 # attribute => 'Region Marker'
304 # endRegion => 'block'
305 # firstNonSpace => 'true'
307 if ($self->testRegExpr($text, '#\\s*END.*$', 0, 0, 0, undef, 1, '#stay', 'Region Marker')) {
311 # attribute => 'Comment'
314 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
317 # String => '\$\{\s*\w+\s*\}'
318 # attribute => 'Variable'
321 if ($self->testRegExpr($text, '\\$\\{\\s*\\w+\\s*\\}', 0, 0, 0, undef, 0, '#stay', 'Variable')) {
324 # String => '\s*\w+\s*(?=\(.*\))'
325 # attribute => 'Macros'
328 if ($self->testRegExpr($text, '\\s*\\w+\\s*(?=\\(.*\\))', 0, 0, 0, undef, 0, '#stay', 'Macros')) {
341 Syntax::Highlight::Engine::Kate::CMake - a Plugin for CMake syntax highlighting
345 require Syntax::Highlight::Engine::Kate::CMake;
346 my $sh = new Syntax::Highlight::Engine::Kate::CMake([
351 Syntax::Highlight::Engine::Kate::CMake is a plugin module that provides syntax highlighting
352 for CMake to the Syntax::Haghlight::Engine::Kate highlighting engine.
354 This code is generated from the syntax definition files used
356 It works quite fine, but can use refinement and optimization.
358 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
364 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
370 Unknown. If you find any, please contact the author