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 'freebasic.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Chris Neugebauer (chrisjrn@gmail.com)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::FreeBASIC;
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 'Constant' => 'BaseN',
28 'Data Types' => 'DataType',
29 'Functions' => 'Function',
30 'Keyword' => 'Keyword',
31 'Normal Text' => 'Normal',
33 'Preprocessor' => 'Operator',
34 'Region Marker ' => 'RegionMarker',
37 $self->listAdd('Assembly Operators',
69 $self->listAdd('Data Types',
80 $self->listAdd('functions',
474 $self->listAdd('keywords',
531 $self->listAdd('preproc',
547 callback => \&parseComment1,
548 attribute => 'Comment',
549 lineending => '#pop',
552 callback => \&parseNormal,
553 attribute => 'Normal Text',
556 callback => \&parseString,
557 attribute => 'String',
558 lineending => '#pop',
561 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
562 $self->basecontext('Normal');
563 $self->keywordscase(0);
565 bless ($self, $class);
574 my ($self, $text) = @_;
575 # context => '##Alerts'
576 # type => 'IncludeRules'
577 if ($self->includePlugin('Alerts', $text)) {
584 my ($self, $text) = @_;
585 # String => '\b(exit (function|sub|for|do|while|type|select))([\s]|$)'
586 # attribute => 'Keyword'
588 # insensitive => 'true'
590 if ($self->testRegExpr($text, '\\b(exit (function|sub|for|do|while|type|select))([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
593 # String => '\b(declare (function|sub))([\s]|$)'
594 # attribute => 'Keyword'
596 # insensitive => 'true'
598 if ($self->testRegExpr($text, '\\b(declare (function|sub))([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
601 # String => '\b(while)([\s]|$)'
602 # attribute => 'Keyword'
603 # beginRegion => 'WhileRegion'
605 # insensitive => 'true'
607 if ($self->testRegExpr($text, '\\b(while)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
610 # String => '\b(wend)([\s]|$)'
611 # attribute => 'Keyword'
613 # endRegion => 'WhileRegion'
614 # insensitive => 'true'
616 if ($self->testRegExpr($text, '\\b(wend)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
619 # String => '\b(do)([\s]|$)'
620 # attribute => 'Keyword'
621 # beginRegion => 'DoRegion'
623 # insensitive => 'true'
625 if ($self->testRegExpr($text, '\\b(do)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
628 # String => '\b(loop)([\s]|$)'
629 # attribute => 'Keyword'
631 # endRegion => 'DoRegion'
632 # insensitive => 'true'
634 if ($self->testRegExpr($text, '\\b(loop)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
637 # String => '\b(select)([\s]|$)'
638 # attribute => 'Keyword'
639 # beginRegion => 'SelectRegion'
641 # insensitive => 'true'
643 if ($self->testRegExpr($text, '\\b(select)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
646 # String => '\b(end select)([\s]|$)'
647 # attribute => 'Keyword'
649 # endRegion => 'SelectRegion'
650 # insensitive => 'true'
652 if ($self->testRegExpr($text, '\\b(end select)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
655 # String => '\b(for (input|output|binary|random))([\s]|$)'
656 # attribute => 'Keyword'
658 # insensitive => 'true'
660 if ($self->testRegExpr($text, '\\b(for (input|output|binary|random))([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
663 # String => '\b(for)([\s]|$)'
664 # attribute => 'Keyword'
665 # beginRegion => 'ForRegion'
667 # insensitive => 'true'
669 if ($self->testRegExpr($text, '\\b(for)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
672 # String => '\b(next)([\s]|$)'
673 # attribute => 'Keyword'
675 # endRegion => 'ForRegion'
676 # insensitive => 'true'
678 if ($self->testRegExpr($text, '\\b(next)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
681 # String => '\b(function)([.\s]|$)'
682 # attribute => 'Keyword'
683 # beginRegion => 'fProcedureRegion'
685 # insensitive => 'true'
687 if ($self->testRegExpr($text, '\\b(function)([.\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
690 # String => '\b(end function)([\s]|$)'
691 # attribute => 'Keyword'
693 # endRegion => 'fProcedureRegion'
694 # insensitive => 'true'
696 if ($self->testRegExpr($text, '\\b(end function)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
699 # String => '\b(sub)([.\s]|$)'
700 # attribute => 'Keyword'
701 # beginRegion => 'sProcedureRegion'
703 # insensitive => 'true'
705 if ($self->testRegExpr($text, '\\b(sub)([.\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
708 # String => '\b(end sub)([\s]|$)'
709 # attribute => 'Keyword'
711 # endRegion => 'sProcedureRegion'
712 # insensitive => 'true'
714 if ($self->testRegExpr($text, '\\b(end sub)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
717 # String => '\b(type)([\s]|$)'
718 # attribute => 'Keyword'
719 # beginRegion => 'StructureRegion'
721 # insensitive => 'true'
723 if ($self->testRegExpr($text, '\\b(type)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
726 # String => '\b(end type)([\s]|$)'
727 # attribute => 'Keyword'
729 # endRegion => 'StructureRegion'
730 # insensitive => 'true'
732 if ($self->testRegExpr($text, '\\b(end type)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
735 # String => '\b(if)([\s]|$)'
736 # attribute => 'Keyword'
737 # beginRegion => 'IfRegion'
739 # insensitive => 'true'
741 if ($self->testRegExpr($text, '\\b(if)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
744 # String => '\b(then )[a-zA-Z_\x7f-\xff].'
745 # attribute => 'Keyword'
747 # endRegion => 'IfRegion'
748 # insensitive => 'true'
750 if ($self->testRegExpr($text, '\\b(then )[a-zA-Z_\\x7f-\\xff].', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
753 # String => '\b(end if)([\s]|$)'
754 # attribute => 'Keyword'
756 # endRegion => 'IfRegion'
757 # insensitive => 'true'
759 if ($self->testRegExpr($text, '\\b(end if)([\\s]|$)', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
762 # String => 'keywords'
763 # attribute => 'Keyword'
766 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
769 # String => 'Data Types'
770 # attribute => 'Data Types'
773 if ($self->testKeyword($text, 'Data Types', 0, undef, 0, '#stay', 'Data Types')) {
776 # String => 'functions'
777 # attribute => 'Functions'
780 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Functions')) {
783 # String => '\#+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
784 # attribute => 'Constant'
787 if ($self->testRegExpr($text, '\\#+[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]*', 0, 0, 0, undef, 0, '#stay', 'Constant')) {
790 # attribute => 'Number'
793 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Number')) {
796 # attribute => 'Number'
799 if ($self->testInt($text, 0, undef, 0, '#stay', 'Number')) {
802 # attribute => 'String'
804 # context => 'String'
805 # type => 'DetectChar'
806 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
809 # String => '^\s*;+\s*BEGIN.*$'
810 # attribute => 'Region Marker'
811 # beginRegion => 'marker'
814 if ($self->testRegExpr($text, '^\\s*;+\\s*BEGIN.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
817 # String => '^\s*;+\s*END.*$'
818 # attribute => 'Region Marker'
820 # endRegion => 'marker'
822 if ($self->testRegExpr($text, '^\\s*;+\\s*END.*$', 0, 0, 0, undef, 0, '#stay', 'Region Marker')) {
825 # attribute => 'Comment'
827 # context => 'Comment1'
828 # type => 'DetectChar'
829 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Comment1', 'Comment')) {
836 my ($self, $text) = @_;
837 # attribute => 'String'
840 # type => 'DetectChar'
841 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
854 Syntax::Highlight::Engine::Kate::FreeBASIC - a Plugin for FreeBASIC syntax highlighting
858 require Syntax::Highlight::Engine::Kate::FreeBASIC;
859 my $sh = new Syntax::Highlight::Engine::Kate::FreeBASIC([
864 Syntax::Highlight::Engine::Kate::FreeBASIC is a plugin module that provides syntax highlighting
865 for FreeBASIC to the Syntax::Haghlight::Engine::Kate highlighting engine.
867 This code is generated from the syntax definition files used
869 It works quite fine, but can use refinement and optimization.
871 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
877 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
883 Unknown. If you find any, please contact the author