Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / TI_Basic.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 'tibasic.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.01
9 #kate version 2.3
10 #generated: Sun Feb  3 22:02:06 2008, localtime
11
12 package Syntax::Highlight::Engine::Kate::TI_Basic;
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       'Assignment' => 'Others',
26       'Keyword' => 'Keyword',
27       'Matrix' => 'Normal',
28       'Normal Text' => 'Normal',
29       'Special operators' => 'Normal',
30       'String' => 'String',
31    });
32    $self->listAdd('keywords',
33       'ClrHome',
34       'ClrTable',
35       'DS<',
36       'DelVar',
37       'Disp',
38       'DispGraph',
39       'DispTable',
40       'Else',
41       'End',
42       'For',
43       'Get',
44       'GetCalc',
45       'Goto',
46       'GraphStyle',
47       'IS>',
48       'If',
49       'Input',
50       'Lbl',
51       'Menu',
52       'Output',
53       'Pause',
54       'Prompt',
55       'Repeat',
56       'Return',
57       'Send',
58       'Then',
59       'While',
60       'getKey',
61       'prgm',
62       'prgm',
63    );
64    $self->listAdd('special_sym',
65       '%THETA',
66       'eogt',
67       'eolt',
68       'net',
69       'sqrt',
70    );
71    $self->contextdata({
72       'Normal' => {
73          callback => \&parseNormal,
74          attribute => 'Normal Text',
75       },
76       'String' => {
77          callback => \&parseString,
78          attribute => 'String',
79       },
80    });
81    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|=|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\|\\%|<|>');
82    $self->basecontext('Normal');
83    $self->keywordscase(0);
84    $self->initialize;
85    bless ($self, $class);
86    return $self;
87 }
88
89 sub language {
90    return 'TI Basic';
91 }
92
93 sub parseNormal {
94    my ($self, $text) = @_;
95    # String => 'keywords'
96    # attribute => 'Keyword'
97    # context => '#stay'
98    # type => 'keyword'
99    if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
100       return 1
101    }
102    # String => 'special_sym'
103    # attribute => 'Special operators'
104    # context => '#stay'
105    # type => 'keyword'
106    if ($self->testKeyword($text, 'special_sym', 0, undef, 0, '#stay', 'Special operators')) {
107       return 1
108    }
109    # attribute => 'Assignment'
110    # char => '-'
111    # char1 => '>'
112    # context => '#stay'
113    # type => 'Detect2Chars'
114    if ($self->testDetect2Chars($text, '-', '>', 0, 0, 0, undef, 0, '#stay', 'Assignment')) {
115       return 1
116    }
117    # attribute => 'Assignment'
118    # char => 's'
119    # char1 => 't'
120    # context => '#stay'
121    # type => 'Detect2Chars'
122    if ($self->testDetect2Chars($text, 's', 't', 0, 0, 0, undef, 0, '#stay', 'Assignment')) {
123       return 1
124    }
125    # String => '\[\w\]'
126    # attribute => 'Matrix'
127    # context => '#stay'
128    # type => 'RegExpr'
129    if ($self->testRegExpr($text, '\\[\\w\\]', 0, 0, 0, undef, 0, '#stay', 'Matrix')) {
130       return 1
131    }
132    # attribute => 'String'
133    # char => '"'
134    # context => 'String'
135    # type => 'DetectChar'
136    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
137       return 1
138    }
139    return 0;
140 };
141
142 sub parseString {
143    my ($self, $text) = @_;
144    # attribute => 'String'
145    # char => '"'
146    # context => '#pop'
147    # type => 'DetectChar'
148    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
149       return 1
150    }
151    return 0;
152 };
153
154
155 1;
156
157 __END__
158
159 =head1 NAME
160
161 Syntax::Highlight::Engine::Kate::TI_Basic - a Plugin for TI Basic syntax highlighting
162
163 =head1 SYNOPSIS
164
165  require Syntax::Highlight::Engine::Kate::TI_Basic;
166  my $sh = new Syntax::Highlight::Engine::Kate::TI_Basic([
167  ]);
168
169 =head1 DESCRIPTION
170
171 Syntax::Highlight::Engine::Kate::TI_Basic is a  plugin module that provides syntax highlighting
172 for TI Basic to the Syntax::Haghlight::Engine::Kate highlighting engine.
173
174 This code is generated from the syntax definition files used
175 by the Kate project.
176 It works quite fine, but can use refinement and optimization.
177
178 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
179
180 =cut
181
182 =head1 AUTHOR
183
184 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
185
186 =cut
187
188 =head1 BUGS
189
190 Unknown. If you find any, please contact the author
191
192 =cut
193