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 'bibtex.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Jeroen Wijnhout (Jeroen.Wijnhout@kdemail.net)
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::BibTeX;
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(@_);
27 'Command' => 'Function',
29 'Field' => 'DataType',
30 'Normal Text' => 'Normal',
31 'Ref Key' => 'Others',
34 $self->listAdd('kw_command',
39 $self->listAdd('kw_entry',
59 callback => \&parseEntry,
60 attribute => 'Ref Key',
63 callback => \&parseNormal,
64 attribute => 'Normal Text',
67 callback => \&parseString,
68 attribute => 'String',
71 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
72 $self->basecontext('Normal');
73 $self->keywordscase(0);
75 bless ($self, $class);
84 my ($self, $text) = @_;
85 # attribute => 'Normal Text'
88 # type => 'DetectChar'
89 if ($self->testDetectChar($text, ',', 0, 0, 0, undef, 0, '#pop', 'Normal Text')) {
92 # attribute => 'Normal Text'
93 # beginRegion => 'block'
96 # type => 'DetectChar'
97 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
100 # attribute => 'Normal Text'
103 # endRegion => 'block'
104 # type => 'DetectChar'
105 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
108 # String => '\\([a-zA-Z]+|.)'
109 # attribute => 'Char'
112 if ($self->testRegExpr($text, '\\\\([a-zA-Z]+|.)', 0, 0, 0, undef, 0, '#stay', 'Char')) {
115 # attribute => 'String'
118 # type => 'DetectChar'
119 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
126 my ($self, $text) = @_;
127 # String => '([a-zA-Z]+)\s*='
128 # attribute => 'Field'
130 # firstNonSpace => 'true'
132 if ($self->testRegExpr($text, '([a-zA-Z]+)\\s*=', 0, 0, 0, undef, 1, '#stay', 'Field')) {
135 # String => 'kw_entry'
136 # attribute => 'Entry'
139 if ($self->testKeyword($text, 'kw_entry', 0, undef, 0, 'Entry', 'Entry')) {
142 # String => 'kw_command'
143 # attribute => 'Command'
146 if ($self->testKeyword($text, 'kw_command', 0, undef, 0, '#stay', 'Command')) {
149 # attribute => 'Normal Text'
150 # beginRegion => 'block'
153 # type => 'DetectChar'
154 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
157 # attribute => 'Normal Text'
160 # endRegion => 'block'
161 # type => 'DetectChar'
162 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
165 # String => '\\([a-zA-Z]+|.)'
166 # attribute => 'Char'
169 if ($self->testRegExpr($text, '\\\\([a-zA-Z]+|.)', 0, 0, 0, undef, 0, '#stay', 'Char')) {
172 # attribute => 'String'
174 # context => 'String'
175 # type => 'DetectChar'
176 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'String', 'String')) {
183 my ($self, $text) = @_;
184 # String => '\\([a-zA-Z]+|.)'
185 # attribute => 'Char'
188 if ($self->testRegExpr($text, '\\\\([a-zA-Z]+|.)', 0, 0, 0, undef, 0, '#stay', 'Char')) {
191 # attribute => 'String'
194 # type => 'DetectChar'
195 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
208 Syntax::Highlight::Engine::Kate::BibTeX - a Plugin for BibTeX syntax highlighting
212 require Syntax::Highlight::Engine::Kate::BibTeX;
213 my $sh = new Syntax::Highlight::Engine::Kate::BibTeX([
218 Syntax::Highlight::Engine::Kate::BibTeX is a plugin module that provides syntax highlighting
219 for BibTeX to the Syntax::Haghlight::Engine::Kate highlighting engine.
221 This code is generated from the syntax definition files used
223 It works quite fine, but can use refinement and optimization.
225 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
231 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
237 Unknown. If you find any, please contact the author