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 'xharbour.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Giancarlo Niccolai (giancarlo@niccolai.ws)
11 #generated: Sun Feb 3 22:02:06 2008, localtime
13 package Syntax::Highlight::Engine::Kate::XHarbour;
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 'Comment' => 'Comment',
27 'Function' => 'Function',
28 'Keyword' => 'Keyword',
29 'Normal Text' => 'Normal',
31 'Operator' => 'BaseN',
32 'Preprocessor' => 'Others',
35 $self->listAdd('class_keywords',
44 $self->listAdd('context_beginners',
55 $self->listAdd('context_terminators',
62 $self->listAdd('functions',
341 $self->listAdd('keywords',
389 $self->listAdd('pragma',
398 $self->listAdd('set_commands',
458 callback => \&parseClassContext,
459 attribute => 'Normal Text',
462 callback => \&parseTopLevel,
463 attribute => 'Normal Text',
466 callback => \&parsecomment,
467 attribute => 'Comment',
468 lineending => '#pop',
471 callback => \&parselogic,
472 attribute => 'Operator',
473 lineending => '#pop',
476 callback => \&parseml_comment,
477 attribute => 'Comment',
480 callback => \&parsestring,
481 attribute => 'String',
482 lineending => '#pop',
485 callback => \&parsestringc,
486 attribute => 'String',
487 lineending => '#pop',
490 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
491 $self->basecontext('TopLevel');
492 $self->keywordscase(0);
494 bless ($self, $class);
502 sub parseClassContext {
503 my ($self, $text) = @_;
504 # attribute => 'Comment'
505 # beginRegion => 'comment_region'
508 # context => 'ml_comment'
509 # type => 'Detect2Chars'
510 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'ml_comment', 'Comment')) {
513 # attribute => 'Comment'
515 # context => 'comment'
516 # firstNonSpace => 'true'
517 # type => 'DetectChar'
518 if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 1, 'comment', 'Comment')) {
521 # attribute => 'Comment'
524 # context => 'comment'
525 # type => 'Detect2Chars'
526 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
529 # String => 'class_keywords'
530 # attribute => 'Keyword'
533 if ($self->testKeyword($text, 'class_keywords', 0, undef, 0, '#stay', 'Keyword')) {
536 # String => 'END(CLASS)? *$'
537 # attribute => 'Keyword'
539 # endRegion => 'ClassDeclRegion'
540 # firstNonSpace => 'true'
541 # insensitive => 'TRUE'
543 if ($self->testRegExpr($text, 'END(CLASS)? *$', 1, 0, 0, undef, 1, '#pop', 'Keyword')) {
550 my ($self, $text) = @_;
551 # attribute => 'Comment'
552 # beginRegion => 'comment_region'
555 # context => 'ml_comment'
556 # type => 'Detect2Chars'
557 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'ml_comment', 'Comment')) {
560 # attribute => 'Comment'
562 # context => 'comment'
563 # firstNonSpace => 'true'
564 # type => 'DetectChar'
565 if ($self->testDetectChar($text, '*', 0, 0, 0, undef, 1, 'comment', 'Comment')) {
568 # attribute => 'Comment'
571 # context => 'comment'
572 # type => 'Detect2Chars'
573 if ($self->testDetect2Chars($text, '/', '/', 0, 0, 0, undef, 0, 'comment', 'Comment')) {
576 # attribute => 'String'
578 # context => 'string'
579 # type => 'DetectChar'
580 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'string', 'String')) {
583 # attribute => 'String'
585 # context => 'stringc'
586 # type => 'DetectChar'
587 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'stringc', 'String')) {
591 # attribute => 'Operator'
593 # insensitive => 'TRUE'
594 # type => 'StringDetect'
595 if ($self->testStringDetect($text, '.and.', 1, 0, 0, undef, 0, '#stay', 'Operator')) {
599 # attribute => 'Operator'
601 # insensitive => 'TRUE'
602 # type => 'StringDetect'
603 if ($self->testStringDetect($text, '.or.', 1, 0, 0, undef, 0, '#stay', 'Operator')) {
607 # attribute => 'Operator'
609 # insensitive => 'TRUE'
610 # type => 'StringDetect'
611 if ($self->testStringDetect($text, '.not.', 1, 0, 0, undef, 0, '#stay', 'Operator')) {
615 # attribute => 'Operator'
617 # insensitive => 'TRUE'
618 # type => 'StringDetect'
619 if ($self->testStringDetect($text, '.f.', 1, 0, 0, undef, 0, '#stay', 'Operator')) {
623 # attribute => 'Operator'
625 # insensitive => 'TRUE'
626 # type => 'StringDetect'
627 if ($self->testStringDetect($text, '.t.', 1, 0, 0, undef, 0, '#stay', 'Operator')) {
631 # attribute => 'Operator'
634 if ($self->testAnyChar($text, ':=!', 0, 0, undef, 0, '#stay', 'Operator')) {
637 # attribute => 'Keyword'
640 # type => 'DetectChar'
641 if ($self->testDetectChar($text, '@', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
644 # String => 'CLASS[\t ]+'
645 # attribute => 'Keyword'
646 # beginRegion => 'ClassDeclRegion'
647 # context => 'ClassContext'
648 # firstNonSpace => 'true'
649 # insensitive => 'TRUE'
651 if ($self->testRegExpr($text, 'CLASS[\\t ]+', 1, 0, 0, undef, 1, 'ClassContext', 'Keyword')) {
654 # String => 'DO[\t ]+CASE[\t ]*$'
655 # attribute => 'Keyword'
656 # beginRegion => 'IndentRegion'
658 # firstNonSpace => 'true'
659 # insensitive => 'TRUE'
661 if ($self->testRegExpr($text, 'DO[\\t ]+CASE[\\t ]*$', 1, 0, 0, undef, 1, '#stay', 'Keyword')) {
664 # String => 'context_beginners'
665 # attribute => 'Keyword'
666 # beginRegion => 'IndentRegion'
669 if ($self->testKeyword($text, 'context_beginners', 0, undef, 0, '#stay', 'Keyword')) {
672 # String => 'context_terminators'
673 # attribute => 'Keyword'
675 # endRegion => 'IndentRegion'
677 if ($self->testKeyword($text, 'context_terminators', 0, undef, 0, '#stay', 'Keyword')) {
680 # String => 'return ?'
681 # attribute => 'Keyword'
684 # endRegion => 'IndentRegion'
685 # insensitive => 'TRUE'
687 if ($self->testRegExpr($text, 'return ?', 1, 0, 0, 0, 0, '#stay', 'Keyword')) {
690 # String => 'keywords'
691 # attribute => 'Keyword'
694 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
697 # String => 'set_commands'
698 # attribute => 'Keyword'
701 if ($self->testKeyword($text, 'set_commands', 0, undef, 0, '#stay', 'Keyword')) {
704 # String => 'functions'
705 # attribute => 'Function'
708 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
712 # attribute => 'Preprocessor'
715 if ($self->testKeyword($text, 'pragma', 0, undef, 0, '#stay', 'Preprocessor')) {
718 # attribute => 'Operator'
722 # type => 'Detect2Chars'
723 if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Operator')) {
727 # attribute => 'Number'
730 if ($self->testRegExpr($text, '\\d+', 0, 0, 0, undef, 0, '#stay', 'Number')) {
737 my ($self, $text) = @_;
742 my ($self, $text) = @_;
743 # attribute => 'Operator'
746 # type => 'DetectChar'
747 if ($self->testDetectChar($text, '.', 0, 0, 0, undef, 0, '#pop', 'Operator')) {
753 sub parseml_comment {
754 my ($self, $text) = @_;
755 # attribute => 'Comment'
759 # endRegion => 'comment_region'
760 # type => 'Detect2Chars'
761 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
768 my ($self, $text) = @_;
769 # attribute => 'String'
772 # type => 'DetectChar'
773 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
780 my ($self, $text) = @_;
781 # attribute => 'String'
784 # type => 'DetectChar'
785 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
798 Syntax::Highlight::Engine::Kate::XHarbour - a Plugin for xHarbour syntax highlighting
802 require Syntax::Highlight::Engine::Kate::XHarbour;
803 my $sh = new Syntax::Highlight::Engine::Kate::XHarbour([
808 Syntax::Highlight::Engine::Kate::XHarbour is a plugin module that provides syntax highlighting
809 for xHarbour to the Syntax::Haghlight::Engine::Kate highlighting engine.
811 This code is generated from the syntax definition files used
813 It works quite fine, but can use refinement and optimization.
815 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
821 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
827 Unknown. If you find any, please contact the author