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 'asm-avr.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Roland Nagy
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::AVR_Assembler;
15 our $VERSION = '0.06';
19 use base('Syntax::Highlight::Engine::Kate::Template');
23 my $class = ref($proto) || $proto;
24 my $self = $class->SUPER::new(@_);
28 'Comment' => 'Comment',
29 'Decimal' => 'DecVal',
32 'Keyword' => 'Keyword',
33 'Label' => 'Function',
34 'Normal Text' => 'Normal',
36 'Preprocessor' => 'Others',
38 'String Char' => 'Char',
41 $self->listAdd('keywords',
155 callback => \&parseCommentar1,
156 attribute => 'Comment',
159 callback => \&parseCommentar2,
160 attribute => 'Comment',
161 lineending => '#pop',
164 callback => \&parseNormal,
165 attribute => 'Normal Text',
168 callback => \&parsePreprocessor,
169 attribute => 'Preprocessor',
170 lineending => '#pop',
173 callback => \&parseSomeContext,
174 attribute => 'Normal Text',
175 lineending => '#pop',
178 callback => \&parseString,
179 attribute => 'String',
180 lineending => '#pop',
183 $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|_|\\.|\\$');
184 $self->basecontext('Normal');
185 $self->keywordscase(0);
187 bless ($self, $class);
192 return 'AVR Assembler';
195 sub parseCommentar1 {
196 my ($self, $text) = @_;
197 # attribute => 'Comment'
201 # type => 'Detect2Chars'
202 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
208 sub parseCommentar2 {
209 my ($self, $text) = @_;
214 my ($self, $text) = @_;
215 # String => '[A-Za-z0-9_.$]+:'
216 # attribute => 'Label'
218 # firstNonSpace => 'true'
220 if ($self->testRegExpr($text, '[A-Za-z0-9_.$]+:', 0, 0, 0, undef, 1, '#stay', 'Label')) {
223 # String => 'keywords'
224 # attribute => 'Keyword'
227 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
230 # attribute => 'Octal'
233 if ($self->testHlCOct($text, 0, undef, 0, '#stay', 'Octal')) {
239 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Hex')) {
242 # String => '0[bB][01]+'
243 # attribute => 'Binary'
246 if ($self->testRegExpr($text, '0[bB][01]+', 0, 0, 0, undef, 0, '#stay', 'Binary')) {
249 # attribute => 'Decimal'
252 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
255 # String => '0[fFeEdD][-+]?[0-9]*\.?[0-9]*[eE]?[-+]?[0-9]+'
256 # attribute => 'Float'
259 if ($self->testRegExpr($text, '0[fFeEdD][-+]?[0-9]*\\.?[0-9]*[eE]?[-+]?[0-9]+', 0, 0, 0, undef, 0, '#stay', 'Float')) {
262 # String => '[A-Za-z_.$][A-Za-z0-9_.$]*'
263 # attribute => 'Normal Text'
266 if ($self->testRegExpr($text, '[A-Za-z_.$][A-Za-z0-9_.$]*', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
269 # String => ''(\\x[0-9a-fA-F][0-9a-fA-F]?|\\[0-7]?[0-7]?[0-7]?|\\.|.)'
270 # attribute => 'Char'
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')) {
276 # attribute => 'String'
278 # context => 'String'
279 # type => 'DetectChar'
280 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
283 # attribute => 'Comment'
286 # context => 'Commentar 1'
287 # type => 'Detect2Chars'
288 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Commentar 1', 'Comment')) {
291 # attribute => 'Comment'
293 # context => 'Commentar 2'
294 # type => 'DetectChar'
295 if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
298 # attribute => 'Comment'
300 # context => 'Commentar 2'
301 # type => 'DetectChar'
302 if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'Commentar 2', 'Comment')) {
305 # String => '!#%&*()+,-<=>?/:[]^{|}~'
306 # attribute => 'Symbol'
309 if ($self->testAnyChar($text, '!#%&*()+,-<=>?/:[]^{|}~', 0, 0, undef, 0, '#stay', 'Symbol')) {
313 # attribute => 'Preprocessor'
314 # context => 'Preprocessor'
316 if ($self->testRegExpr($text, '^#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
322 sub parsePreprocessor {
323 my ($self, $text) = @_;
327 sub parseSomeContext {
328 my ($self, $text) = @_;
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')) {
340 # attribute => 'String Char'
342 # type => 'HlCStringChar'
343 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
346 # attribute => 'String'
349 # type => 'DetectChar'
350 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
363 Syntax::Highlight::Engine::Kate::AVR_Assembler - a Plugin for AVR Assembler syntax highlighting
367 require Syntax::Highlight::Engine::Kate::AVR_Assembler;
368 my $sh = new Syntax::Highlight::Engine::Kate::AVR_Assembler([
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.
376 This code is generated from the syntax definition files used
378 It works quite fine, but can use refinement and optimization.
380 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
386 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
392 Unknown. If you find any, please contact the author