Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / KBasic.pm
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.
4
5 # This file was generated from the 'kbasic.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.02
9 #kate version 2.1
10 #generated: Sun Feb  3 22:02:05 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::KBasic;
13
14 our $VERSION = '0.06';
15
16 use strict;
17 use warnings;
18 use base('Syntax::Highlight::Engine::Kate::Template');
19
20 sub new {
21    my $proto = shift;
22    my $class = ref($proto) || $proto;
23    my $self = $class->SUPER::new(@_);
24    $self->attributes({
25       'Comment' => 'Comment',
26       'Identifier' => 'Others',
27       'Keyword' => 'Keyword',
28       'Normal Text' => 'Normal',
29       'String' => 'String',
30       'Types' => 'DataType',
31    });
32    $self->listAdd('keywords',
33       'And',
34       'As',
35       'Close',
36       'Declare',
37       'Dim',
38       'Do',
39       'Else',
40       'End',
41       'Exit',
42       'Explicit',
43       'False',
44       'For',
45       'Function',
46       'Get',
47       'Global',
48       'Goto',
49       'If',
50       'Implements',
51       'In',
52       'Input',
53       'Let',
54       'Load',
55       'Loop',
56       'Next',
57       'Not',
58       'Open',
59       'Option',
60       'Or',
61       'Output',
62       'Print',
63       'Private',
64       'Property',
65       'Public',
66       'Put',
67       'Repeat',
68       'Seek',
69       'Set',
70       'Sub',
71       'Sub',
72       'Then',
73       'To',
74       'True',
75       'Unload',
76       'Until',
77       'Wend',
78       'While',
79       'Xor',
80    );
81    $self->listAdd('types',
82       'Boolean',
83       'Byte',
84       'Control',
85       'Currency',
86       'Double',
87       'Integer',
88       'Long',
89       'Object',
90       'Single',
91       'String',
92       'Variant',
93    );
94    $self->contextdata({
95       'Comment' => {
96          callback => \&parseComment,
97          attribute => 'Comment',
98          lineending => '#pop',
99       },
100       'Normal' => {
101          callback => \&parseNormal,
102          attribute => 'Normal Text',
103       },
104       'String' => {
105          callback => \&parseString,
106          attribute => 'String',
107          lineending => '#pop',
108       },
109    });
110    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
111    $self->basecontext('Normal');
112    $self->keywordscase(0);
113    $self->initialize;
114    bless ($self, $class);
115    return $self;
116 }
117
118 sub language {
119    return 'KBasic';
120 }
121
122 sub parseComment {
123    my ($self, $text) = @_;
124    return 0;
125 };
126
127 sub parseNormal {
128    my ($self, $text) = @_;
129    # String => 'keywords'
130    # attribute => 'Keyword'
131    # context => '#stay'
132    # type => 'keyword'
133    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
134       return 1
135    }
136    # String => 'types'
137    # attribute => 'Identifier'
138    # context => '#stay'
139    # type => 'keyword'
140    if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Identifier')) {
141       return 1
142    }
143    # attribute => 'String'
144    # context => '#stay'
145    # type => 'Float'
146    if ($self->testFloat($text, 0, undef, 0, '#stay', 'String')) {
147       return 1
148    }
149    # attribute => 'Types'
150    # context => '#stay'
151    # type => 'Int'
152    if ($self->testInt($text, 0, undef, 0, '#stay', 'Types')) {
153       return 1
154    }
155    # attribute => 'String'
156    # char => '"'
157    # context => 'String'
158    # type => 'DetectChar'
159    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
160       return 1
161    }
162    # attribute => 'Comment'
163    # char => '''
164    # context => 'Comment'
165    # type => 'DetectChar'
166    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Comment', 'Comment')) {
167       return 1
168    }
169    return 0;
170 };
171
172 sub parseString {
173    my ($self, $text) = @_;
174    # attribute => 'String'
175    # char => '''
176    # context => '#pop'
177    # type => 'DetectChar'
178    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
179       return 1
180    }
181    return 0;
182 };
183
184
185 1;
186
187 __END__
188
189 =head1 NAME
190
191 Syntax::Highlight::Engine::Kate::KBasic - a Plugin for KBasic syntax highlighting
192
193 =head1 SYNOPSIS
194
195  require Syntax::Highlight::Engine::Kate::KBasic;
196  my $sh = new Syntax::Highlight::Engine::Kate::KBasic([
197  ]);
198
199 =head1 DESCRIPTION
200
201 Syntax::Highlight::Engine::Kate::KBasic is a  plugin module that provides syntax highlighting
202 for KBasic to the Syntax::Haghlight::Engine::Kate highlighting engine.
203
204 This code is generated from the syntax definition files used
205 by the Kate project.
206 It works quite fine, but can use refinement and optimization.
207
208 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
209
210 =cut
211
212 =head1 AUTHOR
213
214 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
215
216 =cut
217
218 =head1 BUGS
219
220 Unknown. If you find any, please contact the author
221
222 =cut
223