Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / AVR_Assembler.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 'asm-avr.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.4
10 #kate author Roland Nagy
11 #generated: Sun Feb  3 22:02:04 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::AVR_Assembler;
14
15 our $VERSION = '0.06';
16
17 use strict;
18 use warnings;
19 use base('Syntax::Highlight::Engine::Kate::Template');
20
21 sub new {
22    my $proto = shift;
23    my $class = ref($proto) || $proto;
24    my $self = $class->SUPER::new(@_);
25    $self->attributes({
26       'Binary' => 'BaseN',
27       'Char' => 'Char',
28       'Comment' => 'Comment',
29       'Decimal' => 'DecVal',
30       'Float' => 'Float',
31       'Hex' => 'BaseN',
32       'Keyword' => 'Keyword',
33       'Label' => 'Function',
34       'Normal Text' => 'Normal',
35       'Octal' => 'BaseN',
36       'Preprocessor' => 'Others',
37       'String' => 'String',
38       'String Char' => 'Char',
39       'Symbol' => 'Normal',
40    });
41    $self->listAdd('keywords',
42       'adc',
43       'add',
44       'adiw',
45       'and',
46       'andi',
47       'asr',
48       'bclr',
49       'bld',
50       'brbc',
51       'brbs',
52       'break',
53       'breq',
54       'brge',
55       'brhc',
56       'brhs',
57       'brid',
58       'brie',
59       'brlo',
60       'brlt',
61       'brmi',
62       'brne',
63       'brpl',
64       'brsh',
65       'brtc',
66       'brts',
67       'brvc',
68       'brvs',
69       'bset',
70       'bst',
71       'call',
72       'cbi',
73       'cbr',
74       'clc',
75       'clh',
76       'cli',
77       'cln',
78       'clr',
79       'cls',
80       'clt',
81       'clv',
82       'clz',
83       'com',
84       'cp',
85       'cpc',
86       'cpi',
87       'cpse',
88       'dec',
89       'eicall',
90       'eijmp',
91       'elpm',
92       'eor',
93       'fmul',
94       'fmuls',
95       'fmulsu',
96       'icall',
97       'ijmp',
98       'in',
99       'inc',
100       'jmp',
101       'ld',
102       'ldi',
103       'lds',
104       'lpm',
105       'lsl',
106       'lsr',
107       'mov',
108       'movw',
109       'mul',
110       'muls',
111       'mulsu',
112       'neg',
113       'nop',
114       'or',
115       'ori',
116       'out',
117       'pop',
118       'push',
119       'rcall',
120       'ret',
121       'reti',
122       'rjmp',
123       'rol',
124       'ror',
125       'sbc',
126       'sbci',
127       'sbi',
128       'sbic',
129       'sbis',
130       'sbiw',
131       'sbr',
132       'sbrc',
133       'sbrs',
134       'sec',
135       'seh',
136       'sei',
137       'sen',
138       'ser',
139       'ses',
140       'set',
141       'sev',
142       'sez',
143       'sleep',
144       'spm',
145       'st',
146       'sts',
147       'sub',
148       'subi',
149       'swap',
150       'tst',
151       'wdr',
152    );
153    $self->contextdata({
154       'Commentar 1' => {
155          callback => \&parseCommentar1,
156          attribute => 'Comment',
157       },
158       'Commentar 2' => {
159          callback => \&parseCommentar2,
160          attribute => 'Comment',
161          lineending => '#pop',
162       },
163       'Normal' => {
164          callback => \&parseNormal,
165          attribute => 'Normal Text',
166       },
167       'Preprocessor' => {
168          callback => \&parsePreprocessor,
169          attribute => 'Preprocessor',
170          lineending => '#pop',
171       },
172       'Some Context' => {
173          callback => \&parseSomeContext,
174          attribute => 'Normal Text',
175          lineending => '#pop',
176       },
177       'String' => {
178          callback => \&parseString,
179          attribute => 'String',
180          lineending => '#pop',
181       },
182    });
183    $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|_|\\.|\\$');
184    $self->basecontext('Normal');
185    $self->keywordscase(0);
186    $self->initialize;
187    bless ($self, $class);
188    return $self;
189 }
190
191 sub language {
192    return 'AVR Assembler';
193 }
194
195 sub parseCommentar1 {
196    my ($self, $text) = @_;
197    # attribute => 'Comment'
198    # char => '*'
199    # char1 => '/'
200    # context => '#pop'
201    # type => 'Detect2Chars'
202    if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
203       return 1
204    }
205    return 0;
206 };
207
208 sub parseCommentar2 {
209    my ($self, $text) = @_;
210    return 0;
211 };
212
213 sub parseNormal {
214    my ($self, $text) = @_;
215    # String => '[A-Za-z0-9_.$]+:'
216    # attribute => 'Label'
217    # context => '#stay'
218    # firstNonSpace => 'true'
219    # type => 'RegExpr'
220    if ($self->testRegExpr($text, '[A-Za-z0-9_.$]+:', 0, 0, 0, undef, 1, '#stay', 'Label')) {
221       return 1
222    }
223    # String => 'keywords'
224    # attribute => 'Keyword'
225    # context => '#stay'
226    # type => 'keyword'
227    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
228       return 1
229    }
230    # attribute => 'Octal'
231    # context => '#stay'
232    # type => 'HlCOct'
233    if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
234       return 1
235    }
236    # attribute => 'Hex'
237    # context => '#stay'
238    # type => 'HlCHex'
239    if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
240       return 1
241    }
242    # String => '0[bB][01]+'
243    # attribute => 'Binary'
244    # context => '#stay'
245    # type => 'RegExpr'
246    if ($self->testRegExpr($text, '0[bB][01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) {
247       return 1
248    }
249    # attribute => 'Decimal'
250    # context => '#stay'
251    # type => 'Int'
252    if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
253       return 1
254    }
255    # String => '0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+'
256    # attribute => 'Float'
257    # context => '#stay'
258    # type => 'RegExpr'
259    if ($self->testRegExpr($text, '0[fFeEdD][-+]?[0-9]*\\.?[0-9]*[eE]?[-+]?[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Float')) {
260       return 1
261    }
262    # String => '[A-Za-z_.$][A-Za-z0-9_.$]*'
263    # attribute => 'Normal Text'
264    # context => '#stay'
265    # type => 'RegExpr'
266    if ($self->testRegExpr($text, '[A-Za-z_.$][A-Za-z0-9_.$]*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
267       return 1
268    }
269    # String => ''(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)'
270    # attribute => 'Char'
271    # context => '#stay'
272    # type => 'RegExpr'
273    if ($self->testRegExpr($text, '\'(\\\\x[0-9a-fA-F][0-9a-fA-F]?|\\\\[0-7]?[0-7]?[0-7]?|\\\\.|.)', 0, 0, 0, undef, 0, '#stay', 'Char')) {
274       return 1
275    }
276    # attribute => 'String'
277    # char => '"'
278    # context => 'String'
279    # type => 'DetectChar'
280    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
281       return 1
282    }
283    # attribute => 'Comment'
284    # char => '/'
285    # char1 => '*'
286    # context => 'Commentar 1'
287    # type => 'Detect2Chars'
288    if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
289       return 1
290    }
291    # attribute => 'Comment'
292    # char => '@'
293    # context => 'Commentar 2'
294    # type => 'DetectChar'
295    if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
296       return 1
297    }
298    # attribute => 'Comment'
299    # char => ';'
300    # context => 'Commentar 2'
301    # type => 'DetectChar'
302    if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
303       return 1
304    }
305    # String => '!#%&*()+,-<=>?/:[]^{|}~'
306    # attribute => 'Symbol'
307    # context => '#stay'
308    # type => 'AnyChar'
309    if ($self->testAnyChar($text, '!#%&*()+,-<=>?/:[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
310       return 1
311    }
312    # String => '^#'
313    # attribute => 'Preprocessor'
314    # context => 'Preprocessor'
315    # type => 'RegExpr'
316    if ($self->testRegExpr($text, '^#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
317       return 1
318    }
319    return 0;
320 };
321
322 sub parsePreprocessor {
323    my ($self, $text) = @_;
324    return 0;
325 };
326
327 sub parseSomeContext {
328    my ($self, $text) = @_;
329    return 0;
330 };
331
332 sub parseString {
333    my ($self, $text) = @_;
334    # attribute => 'String'
335    # context => 'Some Context'
336    # type => 'LineContinue'
337    if ($self->testLineContinue($text, 0, undef, 0, 'Some Context', 'String')) {
338       return 1
339    }
340    # attribute => 'String Char'
341    # context => '#stay'
342    # type => 'HlCStringChar'
343    if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
344       return 1
345    }
346    # attribute => 'String'
347    # char => '"'
348    # context => '#pop'
349    # type => 'DetectChar'
350    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
351       return 1
352    }
353    return 0;
354 };
355
356
357 1;
358
359 __END__
360
361 =head1 NAME
362
363 Syntax::Highlight::Engine::Kate::AVR_Assembler - a Plugin for AVR Assembler syntax highlighting
364
365 =head1 SYNOPSIS
366
367  require Syntax::Highlight::Engine::Kate::AVR_Assembler;
368  my $sh = new Syntax::Highlight::Engine::Kate::AVR_Assembler([
369  ]);
370
371 =head1 DESCRIPTION
372
373 Syntax::Highlight::Engine::Kate::AVR_Assembler is a  plugin module that provides syntax highlighting
374 for AVR Assembler to the Syntax::Haghlight::Engine::Kate highlighting engine.
375
376 This code is generated from the syntax definition files used
377 by the Kate project.
378 It works quite fine, but can use refinement and optimization.
379
380 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
381
382 =cut
383
384 =head1 AUTHOR
385
386 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
387
388 =cut
389
390 =head1 BUGS
391
392 Unknown. If you find any, please contact the author
393
394 =cut
395