Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Sather.pm
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.
4
5 # This file was generated from the 'sather.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.03
9 #kate version 2.1
10 #generated: Sun Feb  3 22:02:06 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::Sather;
13
14 our $VERSION = '0.06';
15
16 use strict;
17 use warnings;
18 use base('Syntax::Highlight::Engine::Kate::Template');
19
20 sub new {
21    my $proto = shift;
22    my $class = ref($proto) || $proto;
23    my $self = $class->SUPER::new(@_);
24    $self->attributes({
25       'Char' => 'Char',
26       'Comment' => 'Comment',
27       'Data Type' => 'DataType',
28       'Decimal' => 'DecVal',
29       'Features' => 'Others',
30       'Float' => 'Float',
31       'Keyword' => 'Keyword',
32       'Normal Text' => 'Normal',
33       'String' => 'String',
34    });
35    $self->listAdd('features',
36       'aget',
37       'aset',
38       'create',
39       'div',
40       'invariant',
41       'is_eq',
42       'is_geq',
43       'is_gt',
44       'is_leq',
45       'is_lt',
46       'is_neq',
47       'main',
48       'minus',
49       'mod',
50       'negate',
51       'not',
52       'plus',
53       'pow',
54       'times',
55    );
56    $self->listAdd('keywords',
57       'ITER',
58       'ROUT',
59       'SAME',
60       'abstract',
61       'and',
62       'any',
63       'assert',
64       'attr',
65       'bind',
66       'break!',
67       'case',
68       'class',
69       'const',
70       'else',
71       'elsif',
72       'end',
73       'exception',
74       'external',
75       'false',
76       'fork',
77       'guard',
78       'if',
79       'immutable',
80       'in',
81       'include',
82       'initial',
83       'inout',
84       'is',
85       'lock',
86       'loop',
87       'new',
88       'once',
89       'or',
90       'out',
91       'par',
92       'parloop',
93       'partial',
94       'post',
95       'pre',
96       'private',
97       'protect',
98       'quit',
99       'raise',
100       'readonly',
101       'result',
102       'return',
103       'self',
104       'shared',
105       'spread',
106       'stub',
107       'then',
108       'true',
109       'type',
110       'typecase',
111       'until!',
112       'value',
113       'void',
114       'when',
115       'while!',
116       'yield',
117    );
118    $self->listAdd('types',
119       '$OB',
120       '$REHASH',
121       'AREF',
122       'ARRAY',
123       'AVAL',
124       'BOOL',
125       'CHAR',
126       'EXT_OB',
127       'FLT',
128       'FLTD',
129       'FLTDX',
130       'FLTI',
131       'FLTX',
132       'INT',
133       'INTI',
134       'STR',
135       'SYS',
136    );
137    $self->contextdata({
138       'Comment' => {
139          callback => \&parseComment,
140          attribute => 'Comment',
141          lineending => '#pop',
142       },
143       'Normal' => {
144          callback => \&parseNormal,
145          attribute => 'Normal Text',
146       },
147       'String' => {
148          callback => \&parseString,
149          attribute => 'String',
150       },
151    });
152    $self->deliminators('\\s||\\.|\\(|\\)|:|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\$|\\!');
153    $self->basecontext('Normal');
154    $self->keywordscase(0);
155    $self->initialize;
156    bless ($self, $class);
157    return $self;
158 }
159
160 sub language {
161    return 'Sather';
162 }
163
164 sub parseComment {
165    my ($self, $text) = @_;
166    return 0;
167 };
168
169 sub parseNormal {
170    my ($self, $text) = @_;
171    # String => 'keywords'
172    # attribute => 'Keyword'
173    # context => '#stay'
174    # type => 'keyword'
175    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
176       return 1
177    }
178    # String => 'types'
179    # attribute => 'Data Type'
180    # context => '#stay'
181    # type => 'keyword'
182    if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
183       return 1
184    }
185    # String => 'features'
186    # attribute => 'Features'
187    # context => '#stay'
188    # type => 'keyword'
189    if ($self->testKeyword($text, 'features', 0, undef, 0, '#stay', 'Features')) {
190       return 1
191    }
192    # attribute => 'Float'
193    # context => '#stay'
194    # type => 'Float'
195    if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
196       return 1
197    }
198    # attribute => 'Decimal'
199    # context => '#stay'
200    # type => 'Int'
201    if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
202       return 1
203    }
204    # String => ''.''
205    # attribute => 'Char'
206    # context => '#stay'
207    # type => 'RegExpr'
208    if ($self->testRegExpr($text, '\'.\'', 0, 0, 0, undef, 0, '#stay', 'Char')) {
209       return 1
210    }
211    # attribute => 'String'
212    # char => '"'
213    # context => 'String'
214    # type => 'DetectChar'
215    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
216       return 1
217    }
218    # attribute => 'Comment'
219    # char => '-'
220    # char1 => '-'
221    # context => 'Comment'
222    # type => 'Detect2Chars'
223    if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
224       return 1
225    }
226    return 0;
227 };
228
229 sub parseString {
230    my ($self, $text) = @_;
231    # attribute => 'String'
232    # char => '"'
233    # context => '#pop'
234    # type => 'DetectChar'
235    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
236       return 1
237    }
238    return 0;
239 };
240
241
242 1;
243
244 __END__
245
246 =head1 NAME
247
248 Syntax::Highlight::Engine::Kate::Sather - a Plugin for Sather syntax highlighting
249
250 =head1 SYNOPSIS
251
252  require Syntax::Highlight::Engine::Kate::Sather;
253  my $sh = new Syntax::Highlight::Engine::Kate::Sather([
254  ]);
255
256 =head1 DESCRIPTION
257
258 Syntax::Highlight::Engine::Kate::Sather is a  plugin module that provides syntax highlighting
259 for Sather to the Syntax::Haghlight::Engine::Kate highlighting engine.
260
261 This code is generated from the syntax definition files used
262 by the Kate project.
263 It works quite fine, but can use refinement and optimization.
264
265 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
266
267 =cut
268
269 =head1 AUTHOR
270
271 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
272
273 =cut
274
275 =head1 BUGS
276
277 Unknown. If you find any, please contact the author
278
279 =cut
280