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 'clipper.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Andrey Cherepanov (sibskull@mail.ru)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Clipper;
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(@_);
26 'Command' => 'DataType',
27 'Comment' => 'Comment',
28 'Decimal' => 'DecVal',
29 'Eval Block' => 'Others',
30 'Function' => 'Function',
32 'Keyword' => 'Keyword',
33 'Normal Text' => 'Normal',
34 'Prep. Lib' => 'Others',
35 'Preprocessor' => 'Others',
36 'Region Marker' => 'RegionMarker',
38 'String Char' => 'Char',
41 $self->listAdd('commands',
156 $self->listAdd('functions',
391 $self->listAdd('keywords',
440 callback => \&parseBlockComment,
441 attribute => 'Comment',
444 callback => \&parseEvalBlock,
445 attribute => 'Eval Block',
448 callback => \&parseLineComment,
449 attribute => 'Comment',
450 lineending => '#pop',
453 callback => \&parseNormal,
454 attribute => 'Normal Text',
457 callback => \&parsePreprocessor,
458 attribute => 'Preprocessor',
459 lineending => '#pop',
462 callback => \&parseString,
463 attribute => 'String',
464 lineending => '#pop',
467 callback => \&parseString2,
468 attribute => 'String',
469 lineending => '#pop',
472 $self->deliminators('\\s||\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\?|\\.');
473 $self->basecontext('Normal');
474 $self->keywordscase(0);
476 bless ($self, $class);
484 sub parseBlockComment {
485 my ($self, $text) = @_;
486 # attribute => 'Comment'
490 # endRegion => 'Comment2'
491 # type => 'Detect2Chars'
492 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
495 # String => '(FIXME|TODO|NOT(IC)?E)'
496 # attribute => 'Command'
499 if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E)', 0, 0, 0, undef, 0, '#stay', 'Command')) {
506 my ($self, $text) = @_;
507 # attribute => 'Eval Block'
509 # type => 'LineContinue'
510 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Eval Block')) {
513 # attribute => 'Eval Block'
516 # type => 'DetectChar'
517 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'Eval Block')) {
523 sub parseLineComment {
524 my ($self, $text) = @_;
525 # String => '(FIXME|TODO|NOT(IC)?E)'
526 # attribute => 'Command'
529 if ($self->testRegExpr($text, '(FIXME|TODO|NOT(IC)?E)', 0, 0, 0, undef, 0, '#stay', 'Command')) {
536 my ($self, $text) = @_;
537 # String => '\bfunction\b'
538 # attribute => 'Keyword'
539 # beginRegion => 'regFunction'
541 # insensitive => 'TRUE'
543 if ($self->testRegExpr($text, '\\bfunction\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
546 # String => '^return\b'
547 # attribute => 'Keyword'
549 # endRegion => 'regFunction'
550 # insensitive => 'TRUE'
552 if ($self->testRegExpr($text, '^return\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
555 # String => '\bbegin\s+sequence\b'
556 # attribute => 'Keyword'
557 # beginRegion => 'regSequence'
559 # insensitive => 'TRUE'
561 if ($self->testRegExpr($text, '\\bbegin\\s+sequence\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
564 # String => '\bend\s+sequence\b'
565 # attribute => 'Keyword'
567 # endRegion => 'regSequence'
568 # insensitive => 'TRUE'
570 if ($self->testRegExpr($text, '\\bend\\s+sequence\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
573 # String => '\bdo\s+case\b'
574 # attribute => 'Keyword'
575 # beginRegion => 'regDoCase'
577 # insensitive => 'TRUE'
579 if ($self->testRegExpr($text, '\\bdo\\s+case\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
582 # String => '\bendcase\b'
583 # attribute => 'Keyword'
585 # endRegion => 'regDoCase'
586 # insensitive => 'TRUE'
588 if ($self->testRegExpr($text, '\\bendcase\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
591 # String => '\bdo\s+while\b'
592 # attribute => 'Keyword'
593 # beginRegion => 'regDoWhile'
595 # insensitive => 'TRUE'
597 if ($self->testRegExpr($text, '\\bdo\\s+while\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
600 # String => '\benddo\b'
601 # attribute => 'Keyword'
603 # endRegion => 'regDoWhile'
604 # insensitive => 'TRUE'
606 if ($self->testRegExpr($text, '\\benddo\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
609 # String => '\bfor\b'
610 # attribute => 'Keyword'
611 # beginRegion => 'regFor'
613 # insensitive => 'TRUE'
615 if ($self->testRegExpr($text, '\\bfor\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
618 # String => '\bnext\b'
619 # attribute => 'Keyword'
621 # endRegion => 'regFor'
622 # insensitive => 'TRUE'
624 if ($self->testRegExpr($text, '\\bnext\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
628 # attribute => 'Keyword'
629 # beginRegion => 'regIf'
631 # insensitive => 'TRUE'
633 if ($self->testRegExpr($text, '\\bif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
636 # String => '\belseif\b'
637 # attribute => 'Keyword'
638 # beginRegion => 'regIf'
640 # endRegion => 'regIf'
641 # insensitive => 'TRUE'
643 if ($self->testRegExpr($text, '\\belseif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
646 # String => '\belse\b'
647 # attribute => 'Keyword'
648 # beginRegion => 'regIf'
650 # endRegion => 'regIf'
651 # insensitive => 'TRUE'
653 if ($self->testRegExpr($text, '\\belse\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
656 # String => '\bendif\b'
657 # attribute => 'Keyword'
659 # endRegion => 'regIf'
660 # insensitive => 'TRUE'
662 if ($self->testRegExpr($text, '\\bendif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
665 # String => '\bswitch\b'
666 # attribute => 'Keyword'
667 # beginRegion => 'regSwitch'
669 # insensitive => 'TRUE'
671 if ($self->testRegExpr($text, '\\bswitch\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
674 # String => '\bendswitch\b'
675 # attribute => 'Keyword'
677 # endRegion => 'regSwitch'
678 # insensitive => 'TRUE'
680 if ($self->testRegExpr($text, '\\bendswitch\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
683 # String => 'keywords'
684 # attribute => 'Keyword'
687 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
690 # String => 'commands'
691 # attribute => 'Command'
694 if ($self->testKeyword($text, 'commands', 0, undef, 0, '#stay', 'Command')) {
697 # String => 'functions'
698 # attribute => 'Function'
701 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
704 # attribute => 'String Char'
707 if ($self->testHlCHex($text, 0, undef, 0, '#stay', 'String Char')) {
710 # attribute => 'String'
712 # context => 'String'
713 # type => 'DetectChar'
714 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
717 # String => '//\s*BEGIN.*$'
718 # attribute => 'Region Marker'
719 # beginRegion => 'regMarker'
722 if ($self->testRegExpr($text, '//\\s*BEGIN.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
725 # String => '//\s*END.*$'
726 # attribute => 'Region Marker'
728 # endRegion => 'regMarker'
730 if ($self->testRegExpr($text, '//\\s*END.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
733 # attribute => 'Comment'
736 # context => 'LineComment'
737 # type => 'Detect2Chars'
738 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'LineComment', 'Comment')) {
741 # String => '^\s*\*.*$'
742 # attribute => 'Comment'
743 # context => 'LineComment'
745 if ($self->testRegExpr($text, '^\\s*\\*.*$', 0, 0, 0, undef, 0, 'LineComment', 'Comment')) {
748 # attribute => 'Comment'
749 # beginRegion => 'Comment2'
752 # context => 'BlockComment'
753 # type => 'Detect2Chars'
754 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'BlockComment', 'Comment')) {
757 # String => '!%&()+,-<:=>[]^~'
758 # attribute => 'Symbol'
761 if ($self->testAnyChar($text, '!%&()+,-<:=>[]^~', 0, 0, undef, 0, '#stay', 'Symbol')) {
765 # attribute => 'Preprocessor'
766 # context => 'Preprocessor'
768 if ($self->testRegExpr($text, '#', 0, 0, 0, undef, 0, 'Preprocessor', 'Preprocessor')) {
771 # attribute => 'Eval Block'
774 # context => 'EvalBlock'
775 # type => 'Detect2Chars'
776 if ($self->testDetect2Chars($text, '{', '|', 0, 0, 0, undef, 0, 'EvalBlock', 'Eval Block')) {
779 # attribute => 'String'
781 # context => 'String2'
782 # type => 'DetectChar'
783 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String2', 'String')) {
789 sub parsePreprocessor {
790 my ($self, $text) = @_;
791 # attribute => 'Preprocessor'
793 # type => 'LineContinue'
794 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'Preprocessor')) {
797 # attribute => 'Prep. Lib'
801 # type => 'RangeDetect'
802 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
805 # attribute => 'Prep. Lib'
809 # type => 'RangeDetect'
810 if ($self->testRangeDetect($text, '<', '>', 0, 0, undef, 0, '#stay', 'Prep. Lib')) {
813 # String => '//\s*BEGIN.*$'
814 # attribute => 'Region Marker'
815 # beginRegion => 'regMarker'
818 if ($self->testRegExpr($text, '//\\s*BEGIN.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
821 # String => '//\s*END.*$'
822 # attribute => 'Region Marker'
824 # endRegion => 'regMarker'
826 if ($self->testRegExpr($text, '//\\s*END.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
829 # attribute => 'Comment'
832 # context => 'LineComment'
833 # type => 'Detect2Chars'
834 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'LineComment', 'Comment')) {
837 # attribute => 'Comment'
838 # beginRegion => 'Comment2'
841 # context => 'BlockComment'
842 # type => 'Detect2Chars'
843 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'BlockComment', 'Comment')) {
850 my ($self, $text) = @_;
851 # attribute => 'String'
853 # type => 'LineContinue'
854 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
857 # attribute => 'String Char'
859 # type => 'HlCStringChar'
860 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
863 # attribute => 'String'
866 # type => 'DetectChar'
867 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
874 my ($self, $text) = @_;
875 # attribute => 'String'
877 # type => 'LineContinue'
878 if ($self->testLineContinue($text, 0, undef, 0, '#stay', 'String')) {
881 # attribute => 'String Char'
883 # type => 'HlCStringChar'
884 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
887 # attribute => 'String'
890 # type => 'DetectChar'
891 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
904 Syntax::Highlight::Engine::Kate::Clipper - a Plugin for Clipper syntax highlighting
908 require Syntax::Highlight::Engine::Kate::Clipper;
909 my $sh = new Syntax::Highlight::Engine::Kate::Clipper([
914 Syntax::Highlight::Engine::Kate::Clipper is a plugin module that provides syntax highlighting
915 for Clipper to the Syntax::Haghlight::Engine::Kate highlighting engine.
917 This code is generated from the syntax definition files used
919 It works quite fine, but can use refinement and optimization.
921 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
927 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
933 Unknown. If you find any, please contact the author