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 'yacas.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:06 2008, localtime
12 package Syntax::Highlight::Engine::Kate::Yacas;
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',
27 'Decimal' => 'DecVal',
29 'Highlight' => 'Alert',
30 'Keyword' => 'Keyword',
31 'Normal Text' => 'Normal',
36 $self->listAdd('keywords',
53 'CommonLispTokenizer',
59 'CustomEval\\\'Expression',
60 'CustomEval\\\'Locals',
61 'CustomEval\\\'Result',
66 'DefMacroRuleBaseListed',
135 'MacroRuleBaseListed',
224 callback => \&parsedefault,
225 attribute => 'Normal Text',
228 callback => \&parselinecomment,
229 attribute => 'Comment',
230 lineending => '#pop',
232 'multilinecomment' => {
233 callback => \&parsemultilinecomment,
234 attribute => 'Comment',
237 callback => \&parsestring,
238 attribute => 'String',
239 lineending => '#pop',
242 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|=|`');
243 $self->basecontext('default');
244 $self->keywordscase(0);
246 bless ($self, $class);
255 my ($self, $text) = @_;
256 # attribute => 'String'
258 # context => 'string'
259 # type => 'DetectChar'
260 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) {
263 # attribute => 'Comment'
266 # context => 'linecomment'
267 # type => 'Detect2Chars'
268 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'linecomment', 'Comment')) {
271 # attribute => 'Comment'
274 # context => 'multilinecomment'
275 # type => 'Detect2Chars'
276 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'multilinecomment', 'Comment')) {
279 # String => 'keywords'
280 # attribute => 'Keyword'
283 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
287 # attribute => 'Parens'
288 # beginRegion => 'brace'
291 if ($self->testAnyChar($text, '{[(', 0, 0, undef, 0, '#stay', 'Parens')) {
295 # attribute => 'Parens'
297 # endRegion => 'brace'
299 if ($self->testAnyChar($text, '}])', 0, 0, undef, 0, '#stay', 'Parens')) {
302 # String => '+-*/=`~:!@#$^&*_|<>'
303 # attribute => 'Symbol'
306 if ($self->testAnyChar($text, '+-*/=`~:!@#$^&*_|<>', 0, 0, undef, 0, '#stay', 'Symbol')) {
309 # attribute => 'Float'
312 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
315 # attribute => 'Decimal'
318 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
324 sub parselinecomment {
325 my ($self, $text) = @_;
326 # String => '(FIXME|TODO)'
327 # attribute => 'Highlight'
330 if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Highlight')) {
336 sub parsemultilinecomment {
337 my ($self, $text) = @_;
338 # attribute => 'Comment'
342 # type => 'Detect2Chars'
343 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
346 # String => '(FIXME|TODO)'
347 # attribute => 'Highlight'
350 if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Highlight')) {
357 my ($self, $text) = @_;
358 # attribute => 'String'
360 # type => 'LineContinue'
361 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
364 # attribute => 'String'
367 # type => 'DetectChar'
368 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
381 Syntax::Highlight::Engine::Kate::Yacas - a Plugin for yacas syntax highlighting
385 require Syntax::Highlight::Engine::Kate::Yacas;
386 my $sh = new Syntax::Highlight::Engine::Kate::Yacas([
391 Syntax::Highlight::Engine::Kate::Yacas is a plugin module that provides syntax highlighting
392 for yacas to the Syntax::Haghlight::Engine::Kate highlighting engine.
394 This code is generated from the syntax definition files used
396 It works quite fine, but can use refinement and optimization.
398 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
404 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
410 Unknown. If you find any, please contact the author