Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Yacas.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 'yacas.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.02
9 #kate version 2.3
10 #generated: Sun Feb  3 22:02:06 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::Yacas;
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       'Decimal' => 'DecVal',
28       'Float' => 'Float',
29       'Highlight' => 'Alert',
30       'Keyword' => 'Keyword',
31       'Normal Text' => 'Normal',
32       'Parens' => 'Normal',
33       'String' => 'String',
34       'Symbol' => 'Others',
35    });
36    $self->listAdd('keywords',
37       '=',
38       'And',
39       'ApplyPure',
40       'ArrayCreate',
41       'ArrayGet',
42       'ArraySet',
43       'ArraySize',
44       'Atom',
45       'Berlekamp',
46       'BitAnd',
47       'BitOr',
48       'BitXor',
49       'Bodied',
50       'CTokenizer',
51       'Check',
52       'Clear',
53       'CommonLispTokenizer',
54       'Concat',
55       'ConcatStrings',
56       'CurrentFile',
57       'CurrentLine',
58       'CustomEval',
59       'CustomEval\\\'Expression',
60       'CustomEval\\\'Locals',
61       'CustomEval\\\'Result',
62       'CustomEval\\\'Stop',
63       'DefLoad',
64       'DefLoadFunction',
65       'DefMacroRuleBase',
66       'DefMacroRuleBaseListed',
67       'DefaultDirectory',
68       'DefaultTokenizer',
69       'Delete',
70       'DestructiveDelete',
71       'DestructiveInsert',
72       'DestructiveReplace',
73       'DestructiveReverse',
74       'DllEnumerate',
75       'DllLoad',
76       'DllUnload',
77       'Equals',
78       'Eval',
79       'FastArcCos',
80       'FastArcSin',
81       'FastArcTan',
82       'FastAssoc',
83       'FastCos',
84       'FastExp',
85       'FastIsPrime',
86       'FastLog',
87       'FastPower',
88       'FastSin',
89       'FastTan',
90       'FindFile',
91       'FindFunction',
92       'FlatCopy',
93       'FromBase',
94       'FromFile',
95       'FromString',
96       'FullForm',
97       'GarbageCollect',
98       'GenericTypeName',
99       'GetExtraInfo',
100       'GetPrecision',
101       'GreaterThan',
102       'Head',
103       'Hold',
104       'HoldArg',
105       'If',
106       'Infix',
107       'Insert',
108       'IsAtom',
109       'IsBodied',
110       'IsBound',
111       'IsFunction',
112       'IsGeneric',
113       'IsInfix',
114       'IsInteger',
115       'IsList',
116       'IsNumber',
117       'IsPostfix',
118       'IsPrefix',
119       'IsString',
120       'LazyGlobal',
121       'LeftPrecedence',
122       'Length',
123       'LessThan',
124       'LispRead',
125       'LispReadListed',
126       'List',
127       'Listify',
128       'Load',
129       'Local',
130       'LocalSymbols',
131       'MacroClear',
132       'MacroLocal',
133       'MacroRule',
134       'MacroRuleBase',
135       'MacroRuleBaseListed',
136       'MacroRulePattern',
137       'MacroSet',
138       'MathAbs',
139       'MathAdd',
140       'MathAnd',
141       'MathArcCos',
142       'MathArcSin',
143       'MathArcTan',
144       'MathCeil',
145       'MathCos',
146       'MathDiv',
147       'MathDivide',
148       'MathExp',
149       'MathFac',
150       'MathFloor',
151       'MathGcd',
152       'MathGetExactBits',
153       'MathLibrary',
154       'MathLog',
155       'MathMod',
156       'MathMultiply',
157       'MathNot',
158       'MathNth',
159       'MathOr',
160       'MathPi',
161       'MathPower',
162       'MathSetExactBits',
163       'MathSin',
164       'MathSqrt',
165       'MathSubtract',
166       'MathTan',
167       'MaxEvalDepth',
168       'Not',
169       'OpLeftPrecedence',
170       'OpPrecedence',
171       'OpRightPrecedence',
172       'Or',
173       'PatchLoad',
174       'PatchString',
175       'PatternCreate',
176       'PatternMatches',
177       'Postfix',
178       'Precision',
179       'Prefix',
180       'PrettyPrinter',
181       'Prog',
182       'Read',
183       'ReadToken',
184       'Replace',
185       'Retract',
186       'RightAssociative',
187       'RightPrecedence',
188       'Rule',
189       'RuleBase',
190       'RuleBaseArgList',
191       'RuleBaseDefined',
192       'RuleBaseListed',
193       'RulePattern',
194       'Secure',
195       'Set',
196       'SetExtraInfo',
197       'SetStringMid',
198       'ShiftLeft',
199       'ShiftRight',
200       'String',
201       'StringMid',
202       'Subst',
203       'SystemCall',
204       'Tail',
205       'ToBase',
206       'ToFile',
207       'ToString',
208       'TraceRule',
209       'TraceStack',
210       'Type',
211       'UnFence',
212       'UnList',
213       'Use',
214       'Version',
215       'While',
216       'Write',
217       'WriteString',
218       'XmlExplodeTag',
219       'XmlTokenizer',
220       '`',
221    );
222    $self->contextdata({
223       'default' => {
224          callback => \&parsedefault,
225          attribute => 'Normal Text',
226       },
227       'linecomment' => {
228          callback => \&parselinecomment,
229          attribute => 'Comment',
230          lineending => '#pop',
231       },
232       'multilinecomment' => {
233          callback => \&parsemultilinecomment,
234          attribute => 'Comment',
235       },
236       'string' => {
237          callback => \&parsestring,
238          attribute => 'String',
239          lineending => '#pop',
240       },
241    });
242    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|=|`');
243    $self->basecontext('default');
244    $self->keywordscase(0);
245    $self->initialize;
246    bless ($self, $class);
247    return $self;
248 }
249
250 sub language {
251    return 'yacas';
252 }
253
254 sub parsedefault {
255    my ($self, $text) = @_;
256    # attribute => 'String'
257    # char => '"'
258    # context => 'string'
259    # type => 'DetectChar'
260    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) {
261       return 1
262    }
263    # attribute => 'Comment'
264    # char => '/'
265    # char1 => '/'
266    # context => 'linecomment'
267    # type => 'Detect2Chars'
268    if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'linecomment', 'Comment')) {
269       return 1
270    }
271    # attribute => 'Comment'
272    # char => '/'
273    # char1 => '*'
274    # context => 'multilinecomment'
275    # type => 'Detect2Chars'
276    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'multilinecomment', 'Comment')) {
277       return 1
278    }
279    # String => 'keywords'
280    # attribute => 'Keyword'
281    # context => '#stay'
282    # type => 'keyword'
283    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
284       return 1
285    }
286    # String => '{[('
287    # attribute => 'Parens'
288    # beginRegion => 'brace'
289    # context => '#stay'
290    # type => 'AnyChar'
291    if ($self->testAnyChar($text, '{[(', 0, 0, undef, 0, '#stay', 'Parens')) {
292       return 1
293    }
294    # String => '}])'
295    # attribute => 'Parens'
296    # context => '#stay'
297    # endRegion => 'brace'
298    # type => 'AnyChar'
299    if ($self->testAnyChar($text, '}])', 0, 0, undef, 0, '#stay', 'Parens')) {
300       return 1
301    }
302    # String => '+-*/=`~:!@#$^&*_|<>'
303    # attribute => 'Symbol'
304    # context => '#stay'
305    # type => 'AnyChar'
306    if ($self->testAnyChar($text, '+-*/=`~:!@#$^&*_|<>', 0, 0, undef, 0, '#stay', 'Symbol')) {
307       return 1
308    }
309    # attribute => 'Float'
310    # context => '#stay'
311    # type => 'Float'
312    if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
313       return 1
314    }
315    # attribute => 'Decimal'
316    # context => '#stay'
317    # type => 'Int'
318    if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
319       return 1
320    }
321    return 0;
322 };
323
324 sub parselinecomment {
325    my ($self, $text) = @_;
326    # String => '(FIXME|TODO)'
327    # attribute => 'Highlight'
328    # context => '#stay'
329    # type => 'RegExpr'
330    if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Highlight')) {
331       return 1
332    }
333    return 0;
334 };
335
336 sub parsemultilinecomment {
337    my ($self, $text) = @_;
338    # attribute => 'Comment'
339    # char => '*'
340    # char1 => '/'
341    # context => '#pop'
342    # type => 'Detect2Chars'
343    if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
344       return 1
345    }
346    # String => '(FIXME|TODO)'
347    # attribute => 'Highlight'
348    # context => '#stay'
349    # type => 'RegExpr'
350    if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Highlight')) {
351       return 1
352    }
353    return 0;
354 };
355
356 sub parsestring {
357    my ($self, $text) = @_;
358    # attribute => 'String'
359    # context => '#stay'
360    # type => 'LineContinue'
361    if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
362       return 1
363    }
364    # attribute => 'String'
365    # char => '"'
366    # context => '#pop'
367    # type => 'DetectChar'
368    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
369       return 1
370    }
371    return 0;
372 };
373
374
375 1;
376
377 __END__
378
379 =head1 NAME
380
381 Syntax::Highlight::Engine::Kate::Yacas - a Plugin for yacas syntax highlighting
382
383 =head1 SYNOPSIS
384
385  require Syntax::Highlight::Engine::Kate::Yacas;
386  my $sh = new Syntax::Highlight::Engine::Kate::Yacas([
387  ]);
388
389 =head1 DESCRIPTION
390
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.
393
394 This code is generated from the syntax definition files used
395 by the Kate project.
396 It works quite fine, but can use refinement and optimization.
397
398 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
399
400 =cut
401
402 =head1 AUTHOR
403
404 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
405
406 =cut
407
408 =head1 BUGS
409
410 Unknown. If you find any, please contact the author
411
412 =cut
413