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 'makefile.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Per Wigren (wigren@home.se)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Makefile;
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(@_);
26 'Commands' => 'BaseN',
27 'Comment' => 'Comment',
28 'Keyword' => 'Keyword',
29 'Normal Text' => 'Normal',
31 'Section' => 'Others',
35 'Variable' => 'DataType',
37 $self->listAdd('keywords',
50 callback => \&parseCommands,
51 attribute => 'Normal Text',
55 callback => \&parseNormal,
56 attribute => 'Normal Text',
59 callback => \&parseString,
60 attribute => 'String',
64 callback => \&parseValue,
65 attribute => 'String',
68 callback => \&parseVarFromNormal,
69 attribute => 'Variable',
72 callback => \&parseVarFromValue,
73 attribute => 'Variable',
76 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
77 $self->basecontext('Normal');
78 $self->keywordscase(0);
80 bless ($self, $class);
89 my ($self, $text) = @_;
90 # String => '[$][\({]'
91 # attribute => 'Operator'
92 # context => 'VarFromNormal'
94 if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromNormal', 'Operator')) {
97 # String => '[_\w-]*\b'
98 # attribute => 'Commands'
101 if ($self->testRegExpr($text, '[_\\w-]*\\b', 0, 0, 0, undef, 0, '#pop', 'Commands')) {
108 my ($self, $text) = @_;
109 # String => 'keywords'
110 # attribute => 'Keyword'
113 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
116 # String => '[_\w\d]*\s*(?=:=|=)'
117 # attribute => 'Variable'
120 if ($self->testRegExpr($text, '[_\\w\\d]*\\s*(?=:=|=)', 0, 0, 0, undef, 0, 'Value', 'Variable')) {
123 # String => '[_\w\d-]*\s*:'
124 # attribute => 'Target'
126 # firstNonSpace => 'true'
128 if ($self->testRegExpr($text, '[_\\w\\d-]*\\s*:', 0, 0, 0, undef, 1, '#stay', 'Target')) {
131 # String => '^[.].*:'
132 # attribute => 'Section'
135 if ($self->testRegExpr($text, '^[.].*:', 0, 0, 0, undef, 0, '#stay', 'Section')) {
138 # attribute => 'String'
140 # context => 'String'
141 # type => 'DetectChar'
142 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
145 # String => '[$][\({]'
146 # attribute => 'Operator'
147 # context => 'VarFromNormal'
149 if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromNormal', 'Operator')) {
152 # String => '+*=%$():\\;'
153 # attribute => 'Operator'
156 if ($self->testAnyChar($text, '+*=%$():\\\\;', 0, 0, undef, 0, '#stay', 'Operator')) {
160 # attribute => 'Operator'
161 # context => 'Commands'
162 # firstNonSpace => 'true'
164 if ($self->testRegExpr($text, '[@-]', 0, 0, 0, undef, 1, 'Commands', 'Operator')) {
167 # String => '(:^|[^\\])#.*$'
168 # attribute => 'Comment'
171 if ($self->testRegExpr($text, '(:^|[^\\\\])#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
178 my ($self, $text) = @_;
179 # attribute => 'String'
181 # type => 'LineContinue'
182 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
185 # attribute => 'String'
188 # type => 'DetectChar'
189 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
196 my ($self, $text) = @_;
198 # attribute => 'Operator'
201 if ($self->testRegExpr($text, '\\\\$', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
204 # String => '[^\\]?$'
205 # attribute => 'String'
208 if ($self->testRegExpr($text, '[^\\\\]?$', 0, 0, 0, undef, 0, '#pop', 'String')) {
211 # String => '[$][\({]'
212 # attribute => 'Operator'
213 # context => 'VarFromValue'
215 if ($self->testRegExpr($text, '[$][\\({]', 0, 0, 0, undef, 0, 'VarFromValue', 'Operator')) {
218 # String => '@[-_\d\w]*@'
219 # attribute => 'Special'
222 if ($self->testRegExpr($text, '@[-_\\d\\w]*@', 0, 0, 0, undef, 0, '#pop', 'Special')) {
225 # attribute => 'Operator'
228 # type => 'DetectChar'
229 if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
235 sub parseVarFromNormal {
236 my ($self, $text) = @_;
238 # attribute => 'Operator'
241 if ($self->testRegExpr($text, '[\\)}]', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
247 sub parseVarFromValue {
248 my ($self, $text) = @_;
249 # String => '[\)}](?=/)'
250 # attribute => 'Operator'
253 if ($self->testRegExpr($text, '[\\)}](?=/)', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
256 # String => '[\)}][^$]'
257 # attribute => 'Operator'
260 if ($self->testRegExpr($text, '[\\)}][^$]', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
264 # attribute => 'Operator'
265 # context => '#pop#pop'
267 if ($self->testRegExpr($text, '[\\)}]$', 0, 0, 0, undef, 0, '#pop#pop', 'Operator')) {
280 Syntax::Highlight::Engine::Kate::Makefile - a Plugin for Makefile syntax highlighting
284 require Syntax::Highlight::Engine::Kate::Makefile;
285 my $sh = new Syntax::Highlight::Engine::Kate::Makefile([
290 Syntax::Highlight::Engine::Kate::Makefile is a plugin module that provides syntax highlighting
291 for Makefile to the Syntax::Haghlight::Engine::Kate highlighting engine.
293 This code is generated from the syntax definition files used
295 It works quite fine, but can use refinement and optimization.
297 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
303 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
309 Unknown. If you find any, please contact the author