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 'picsrc.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Alain GIBAUD (alain.gibaud@univ-valenciennes.fr)
11 #generated: Sun Feb 3 22:02:06 2008, localtime
13 package Syntax::Highlight::Engine::Kate::PicAsm;
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(@_);
27 'Based Numbers' => 'BaseN',
29 'Comment' => 'Comment',
30 'Directives' => 'Others',
32 'GPASM-macros' => 'BString',
33 'InstructionAttr' => 'Operator',
34 'Instructions' => 'Keyword',
35 'Normal Text' => 'Normal',
36 'Prep. Lib' => 'Others',
37 'Preprocessor' => 'Others',
39 'Symbol' => 'Variable',
40 'Unbased Numbers' => 'DecVal',
42 $self->listAdd('conditional',
54 $self->listAdd('directives',
124 $self->listAdd('gpasm_macro',
152 $self->listAdd('instruction_attr',
159 $self->listAdd('instructions',
307 callback => \&parseASCIIChar,
309 lineending => '#pop',
311 'QuotedNumError' => {
312 callback => \&parseQuotedNumError,
313 attribute => 'Error',
314 lineending => '#pop#pop',
317 callback => \&parsebinaryDigits,
318 attribute => 'Based Numbers',
319 lineending => '#pop',
322 callback => \&parsecomment,
323 attribute => 'Comment',
324 lineending => '#pop',
327 callback => \&parsedecimalDigits,
328 attribute => 'Based Numbers',
329 lineending => '#pop',
332 callback => \&parsehexDigits,
333 attribute => 'Based Numbers',
334 lineending => '#pop',
337 callback => \&parsenormal,
338 attribute => 'Normal Text',
341 callback => \&parseoctDigits,
342 attribute => 'Based Numbers',
343 lineending => '#pop',
346 callback => \&parsestring,
347 attribute => 'String',
348 lineending => '#pop',
351 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
352 $self->basecontext('normal');
353 $self->keywordscase(0);
355 bless ($self, $class);
364 my ($self, $text) = @_;
365 # attribute => 'Char'
368 # type => 'DetectChar'
369 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Char')) {
373 # attribute => 'Error'
374 # context => 'QuotedNumError'
376 if ($self->testRegExpr($text, '.[^\']', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) {
382 sub parseQuotedNumError {
383 my ($self, $text) = @_;
384 # attribute => 'Error'
386 # context => '#pop#pop'
387 # type => 'DetectChar'
388 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop#pop', 'Error')) {
394 sub parsebinaryDigits {
395 my ($self, $text) = @_;
396 # attribute => 'Based Numbers'
399 # type => 'DetectChar'
400 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) {
404 # attribute => 'Error'
405 # context => 'QuotedNumError'
407 if ($self->testRegExpr($text, '[^0-1]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) {
414 my ($self, $text) = @_;
415 # String => '(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)'
416 # attribute => 'Instructions'
419 if ($self->testRegExpr($text, '(INPUT|OUTPUT|PARAMETERS|AUTHOR|EMAIL)', 0, 0, 0, undef, 0, '#stay', 'Instructions')) {
422 # String => '(FIXME|TODO)'
423 # attribute => 'Alert'
426 if ($self->testRegExpr($text, '(FIXME|TODO)', 0, 0, 0, undef, 0, '#stay', 'Alert')) {
432 sub parsedecimalDigits {
433 my ($self, $text) = @_;
434 # attribute => 'Based Numbers'
437 # type => 'DetectChar'
438 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) {
442 # attribute => 'Error'
443 # context => 'QuotedNumError'
445 if ($self->testRegExpr($text, '\\D', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) {
452 my ($self, $text) = @_;
453 # attribute => 'Based Numbers'
456 # type => 'DetectChar'
457 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) {
460 # String => '[^0-9A-Fa-f]'
461 # attribute => 'Error'
462 # context => 'QuotedNumError'
464 if ($self->testRegExpr($text, '[^0-9A-Fa-f]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) {
471 my ($self, $text) = @_;
472 # String => 'directives'
473 # attribute => 'Directives'
476 if ($self->testKeyword($text, 'directives', 0, undef, 0, '#stay', 'Directives')) {
479 # String => 'instructions'
480 # attribute => 'Instructions'
483 if ($self->testKeyword($text, 'instructions', 0, undef, 0, '#stay', 'Instructions')) {
486 # String => 'instruction_attr'
487 # attribute => 'InstructionAttr'
490 if ($self->testKeyword($text, 'instruction_attr', 0, undef, 0, '#stay', 'InstructionAttr')) {
493 # String => 'conditional'
494 # attribute => 'Preprocessor'
497 if ($self->testKeyword($text, 'conditional', 0, undef, 0, '#stay', 'Preprocessor')) {
500 # String => 'gpasm_macro'
501 # attribute => 'GPASM-macros'
504 if ($self->testKeyword($text, 'gpasm_macro', 0, undef, 0, '#stay', 'GPASM-macros')) {
507 # attribute => 'Based Numbers'
510 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'Based Numbers')) {
513 # String => '([ \t,][0-9A-F]+H[ \t,])'
514 # attribute => 'Based Numbers'
516 # insensitive => 'TRUE'
518 if ($self->testRegExpr($text, '([ \\t,][0-9A-F]+H[ \\t,])', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) {
521 # String => '([ \t,][0-9A-F]+H)$'
522 # attribute => 'Based Numbers'
524 # insensitive => 'TRUE'
526 if ($self->testRegExpr($text, '([ \\t,][0-9A-F]+H)$', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) {
529 # String => '([ \t,][0-9]+D)'
530 # attribute => 'Based Numbers'
532 # insensitive => 'TRUE'
534 if ($self->testRegExpr($text, '([ \\t,][0-9]+D)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) {
537 # String => '([ \t,][0-7]+O)'
538 # attribute => 'Based Numbers'
540 # insensitive => 'TRUE'
542 if ($self->testRegExpr($text, '([ \\t,][0-7]+O)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) {
545 # String => '([ \t,][0-1]+B)'
546 # attribute => 'Based Numbers'
548 # insensitive => 'TRUE'
550 if ($self->testRegExpr($text, '([ \\t,][0-1]+B)', 1, 0, 0, undef, 0, '#stay', 'Based Numbers')) {
553 # attribute => 'Unbased Numbers'
556 if ($self->testInt($text, 0, undef, 0, '#stay', 'Unbased Numbers')) {
559 # attribute => 'Char'
562 if ($self->testHlCChar($text, 0, undef, 0, '#stay', 'Char')) {
565 # attribute => 'Char'
568 # context => 'ASCIIChar'
569 # type => 'Detect2Chars'
570 if ($self->testDetect2Chars($text, 'A', '\'', 0, 0, 0, undef, 0, 'ASCIIChar', 'Char')) {
573 # attribute => 'Char'
576 # context => 'ASCIIChar'
577 # type => 'Detect2Chars'
578 if ($self->testDetect2Chars($text, 'a', '\'', 0, 0, 0, undef, 0, 'ASCIIChar', 'Char')) {
581 # attribute => 'Based Numbers'
584 # context => 'binaryDigits'
585 # type => 'Detect2Chars'
586 if ($self->testDetect2Chars($text, 'B', '\'', 0, 0, 0, undef, 0, 'binaryDigits', 'Based Numbers')) {
589 # attribute => 'Based Numbers'
592 # context => 'binaryDigits'
593 # type => 'Detect2Chars'
594 if ($self->testDetect2Chars($text, 'b', '\'', 0, 0, 0, undef, 0, 'binaryDigits', 'Based Numbers')) {
597 # attribute => 'Based Numbers'
600 # context => 'hexDigits'
601 # type => 'Detect2Chars'
602 if ($self->testDetect2Chars($text, 'H', '\'', 0, 0, 0, undef, 0, 'hexDigits', 'Based Numbers')) {
605 # attribute => 'Based Numbers'
608 # context => 'hexDigits'
609 # type => 'Detect2Chars'
610 if ($self->testDetect2Chars($text, 'h', '\'', 0, 0, 0, undef, 0, 'hexDigits', 'Based Numbers')) {
613 # attribute => 'Based Numbers'
616 # context => 'octDigits'
617 # type => 'Detect2Chars'
618 if ($self->testDetect2Chars($text, 'O', '\'', 0, 0, 0, undef, 0, 'octDigits', 'Based Numbers')) {
621 # attribute => 'Based Numbers'
624 # context => 'octDigits'
625 # type => 'Detect2Chars'
626 if ($self->testDetect2Chars($text, 'o', '\'', 0, 0, 0, undef, 0, 'octDigits', 'Based Numbers')) {
629 # attribute => 'Based Numbers'
632 # context => 'decimalDigits'
633 # type => 'Detect2Chars'
634 if ($self->testDetect2Chars($text, 'D', '\'', 0, 0, 0, undef, 0, 'decimalDigits', 'Based Numbers')) {
637 # attribute => 'Based Numbers'
640 # context => 'decimalDigits'
641 # type => 'Detect2Chars'
642 if ($self->testDetect2Chars($text, 'd', '\'', 0, 0, 0, undef, 0, 'decimalDigits', 'Based Numbers')) {
645 # attribute => 'String'
647 # context => 'string'
648 # type => 'DetectChar'
649 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) {
652 # attribute => 'Comment'
654 # context => 'comment'
655 # type => 'DetectChar'
656 if ($self->testDetectChar($text, ';', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
659 # String => '-/*%+=><&|^!~'
660 # attribute => 'Symbol'
663 if ($self->testAnyChar($text, '-/*%+=><&|^!~', 0, 0, undef, 0, '#stay', 'Symbol')) {
666 # String => '#define'
667 # attribute => 'Preprocessor'
669 # type => 'StringDetect'
670 if ($self->testStringDetect($text, '#define', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) {
673 # String => '#undefine'
674 # attribute => 'Preprocessor'
676 # type => 'StringDetect'
677 if ($self->testStringDetect($text, '#undefine', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) {
681 # attribute => 'Preprocessor'
683 # type => 'StringDetect'
684 if ($self->testStringDetect($text, '#v', 0, 0, 0, undef, 0, '#stay', 'Preprocessor')) {
691 my ($self, $text) = @_;
692 # attribute => 'Based Numbers'
695 # type => 'DetectChar'
696 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'Based Numbers')) {
700 # attribute => 'Error'
701 # context => 'QuotedNumError'
703 if ($self->testRegExpr($text, '[^0-7]', 0, 0, 0, undef, 0, 'QuotedNumError', 'Error')) {
710 my ($self, $text) = @_;
711 # attribute => 'String'
713 # type => 'LineContinue'
714 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
717 # attribute => 'Char'
719 # type => 'HlCStringChar'
720 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'Char')) {
723 # attribute => 'String'
726 # type => 'DetectChar'
727 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
740 Syntax::Highlight::Engine::Kate::PicAsm - a Plugin for PicAsm syntax highlighting
744 require Syntax::Highlight::Engine::Kate::PicAsm;
745 my $sh = new Syntax::Highlight::Engine::Kate::PicAsm([
750 Syntax::Highlight::Engine::Kate::PicAsm is a plugin module that provides syntax highlighting
751 for PicAsm to the Syntax::Haghlight::Engine::Kate highlighting engine.
753 This code is generated from the syntax definition files used
755 It works quite fine, but can use refinement and optimization.
757 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
763 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
769 Unknown. If you find any, please contact the author