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 'xorg.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
9 #kate author Jan Janssen (medhefgo@web.de)
10 #generated: Sun Feb 3 22:02:06 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Xorg_Configuration;
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',
29 'Keyword' => 'Keyword',
30 'Normal Text' => 'Normal',
31 'Section' => 'Function',
32 'Section Name' => 'String',
33 'Value' => 'DataType',
38 callback => \&parseComment,
39 attribute => 'Comment',
43 callback => \&parseKeyword,
44 attribute => 'Keyword',
48 callback => \&parseSection,
49 attribute => 'Normal Text',
51 'Section Content' => {
52 callback => \&parseSectionContent,
53 attribute => 'Normal Text',
56 callback => \&parsexorg,
57 attribute => 'Normal Text',
60 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
61 $self->basecontext('xorg');
62 $self->keywordscase(1);
64 bless ($self, $class);
69 return 'x.org Configuration';
73 my ($self, $text) = @_;
74 # type => 'DetectSpaces'
75 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
78 # context => '##Alerts'
79 # type => 'IncludeRules'
80 if ($self->includePlugin('Alerts', $text)) {
83 # type => 'DetectIdentifier'
84 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', undef)) {
91 my ($self, $text) = @_;
92 # attribute => 'Value'
95 # type => 'RangeDetect'
96 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Value')) {
99 # attribute => 'Value'
102 # type => 'RangeDetect'
103 if ($self->testRangeDetect($text, '\'', '\'', 0, 0, undef, 0, '#stay', 'Value')) {
106 # attribute => 'Float'
108 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
113 if ($self->testInt($text, 0, undef, 0, '#stay', 'Int')) {
116 # String => '[\w\d]+'
117 # attribute => 'Value2'
119 if ($self->testRegExpr($text, '[\\w\\d]+', 0, 0, 0, undef, 0, '#stay', 'Value2')) {
123 # context => 'Comment'
124 # type => 'DetectChar'
125 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) {
132 my ($self, $text) = @_;
133 # attribute => 'Section Name'
136 # context => 'Section Content'
137 # type => 'RangeDetect'
138 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, 'Section Content', 'Section Name')) {
141 # attribute => 'Section Name'
144 # context => 'Section Content'
145 # type => 'RangeDetect'
146 if ($self->testRangeDetect($text, '\'', '\'', 0, 0, undef, 0, 'Section Content', 'Section Name')) {
149 # attribute => 'Alert'
150 # type => 'DetectIdentifier'
151 if ($self->testDetectIdentifier($text, 0, undef, 0, '#stay', 'Alert')) {
155 # context => 'Comment'
156 # type => 'DetectChar'
157 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) {
163 sub parseSectionContent {
164 my ($self, $text) = @_;
165 # String => 'EndSection'
166 # attribute => 'Section'
167 # context => '#pop#pop'
168 # endRegion => 'Section'
169 # insensitive => 'true'
170 # type => 'StringDetect'
171 if ($self->testStringDetect($text, 'EndSection', 1, 0, 0, undef, 0, '#pop#pop', 'Section')) {
174 # String => 'EndSubSection'
175 # attribute => 'Section'
176 # context => '#pop#pop'
177 # endRegion => 'SubSection'
178 # insensitive => 'true'
179 # type => 'StringDetect'
180 if ($self->testStringDetect($text, 'EndSubSection', 1, 0, 0, undef, 0, '#pop#pop', 'Section')) {
183 # String => 'SubSection'
184 # attribute => 'Section'
185 # beginRegion => 'SubSection'
186 # context => 'Section'
187 # insensitive => 'true'
188 # type => 'StringDetect'
189 if ($self->testStringDetect($text, 'SubSection', 1, 0, 0, undef, 0, 'Section', 'Section')) {
192 # String => '\b\w+\b'
193 # context => 'Keyword'
195 if ($self->testRegExpr($text, '\\b\\w+\\b', 0, 0, 0, undef, 0, 'Keyword', undef)) {
199 # context => 'Comment'
200 # type => 'DetectChar'
201 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) {
208 my ($self, $text) = @_;
209 # String => 'Section'
210 # attribute => 'Section'
211 # beginRegion => 'Section'
212 # context => 'Section'
213 # insensitive => 'true'
214 # type => 'StringDetect'
215 if ($self->testStringDetect($text, 'Section', 1, 0, 0, undef, 0, 'Section', 'Section')) {
219 # context => 'Comment'
220 # type => 'DetectChar'
221 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'Comment', undef)) {
234 Syntax::Highlight::Engine::Kate::Xorg_Configuration - a Plugin for x.org Configuration syntax highlighting
238 require Syntax::Highlight::Engine::Kate::Xorg_Configuration;
239 my $sh = new Syntax::Highlight::Engine::Kate::Xorg_Configuration([
244 Syntax::Highlight::Engine::Kate::Xorg_Configuration is a plugin module that provides syntax highlighting
245 for x.org Configuration to the Syntax::Haghlight::Engine::Kate highlighting engine.
247 This code is generated from the syntax definition files used
249 It works quite fine, but can use refinement and optimization.
251 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
257 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
263 Unknown. If you find any, please contact the author