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 'javadoc.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Alfredo Luiz Foltran Fialho (alfoltran@ig.com.br)
11 #generated: Sun Feb 3 22:02:05 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Javadoc;
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 'BlockTag' => 'Keyword',
27 'InlineTag' => 'Keyword',
28 'Javadoc' => 'Comment',
29 'JavadocFS' => 'Comment',
30 'JavadocParam' => 'Keyword',
31 'Normal Text' => 'Normal',
32 'SeeTag' => 'Keyword',
36 callback => \&parseFindJavadoc,
37 attribute => 'Normal Text',
40 callback => \&parseInlineTagar,
41 attribute => 'InlineTag',
45 callback => \&parseJavadocFSar,
46 attribute => 'JavadocFS',
49 callback => \&parseJavadocParam,
50 attribute => 'Javadoc',
54 callback => \&parseJavadocar,
55 attribute => 'Javadoc',
58 callback => \&parseLiteralTagar,
59 attribute => 'InlineTag',
63 callback => \&parseSeeTag,
64 attribute => 'SeeTag',
68 callback => \&parseStart,
69 attribute => 'Normal Text',
72 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
73 $self->basecontext('Start');
74 $self->keywordscase(0);
76 bless ($self, $class);
84 sub parseFindJavadoc {
85 my ($self, $text) = @_;
87 # attribute => 'JavadocFS'
88 # beginRegion => 'Javadoc'
89 # context => 'JavadocFSar'
90 # type => 'StringDetect'
91 if ($self->testStringDetect($text, '/**', 0, 0, 0, undef, 0, 'JavadocFSar', 'JavadocFS')) {
97 sub parseInlineTagar {
98 my ($self, $text) = @_;
99 # attribute => 'InlineTag'
102 # type => 'DetectChar'
103 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'InlineTag')) {
106 # attribute => 'JavadocFS'
109 # context => '#pop#pop#pop'
110 # type => 'Detect2Chars'
111 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop#pop', 'JavadocFS')) {
114 # context => '##HTML'
115 # type => 'IncludeRules'
116 if ($self->includePlugin('HTML', $text)) {
122 sub parseJavadocFSar {
123 my ($self, $text) = @_;
124 # attribute => 'JavadocFS'
128 # endRegion => 'Javadoc'
129 # type => 'Detect2Chars'
130 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'JavadocFS')) {
134 # attribute => 'JavadocFS'
135 # context => 'Javadocar'
137 if ($self->testRegExpr($text, '(!|\\?)', 0, 0, 0, undef, 0, 'Javadocar', 'JavadocFS')) {
140 # String => '(\.\s*$)'
141 # attribute => 'JavadocFS'
142 # context => 'Javadocar'
144 if ($self->testRegExpr($text, '(\\.\\s*$)', 0, 0, 0, undef, 0, 'Javadocar', 'JavadocFS')) {
147 # String => '(\.\s)(?![\da-z])'
148 # attribute => 'JavadocFS'
149 # context => 'Javadocar'
151 if ($self->testRegExpr($text, '(\\.\\s)(?![\\da-z])', 0, 0, 0, undef, 0, 'Javadocar', 'JavadocFS')) {
154 # String => '\**\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\s|$))'
155 # attribute => 'JavadocFS'
156 # context => 'Javadocar'
157 # firstNonSpace => 'true'
159 if ($self->testRegExpr($text, '\\**\\s*(?=@(author|deprecated|exception|param|return|see|serial|serialData|serialField|since|throws|version)(\\s|$))', 0, 0, 0, undef, 1, 'Javadocar', 'JavadocFS')) {
162 # String => '{@code '
163 # attribute => 'InlineTag'
164 # context => 'LiteralTagar'
165 # type => 'StringDetect'
166 if ($self->testStringDetect($text, '{@code ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) {
169 # String => '{@code '
170 # attribute => 'InlineTag'
171 # context => 'LiteralTagar'
172 # type => 'StringDetect'
173 if ($self->testStringDetect($text, '{@code ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) {
176 # String => '{@docRoot}'
177 # attribute => 'InlineTag'
179 # type => 'StringDetect'
180 if ($self->testStringDetect($text, '{@docRoot}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) {
183 # String => '{@inheritDoc}'
184 # attribute => 'InlineTag'
186 # type => 'StringDetect'
187 if ($self->testStringDetect($text, '{@inheritDoc}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) {
190 # String => '{@link '
191 # attribute => 'InlineTag'
192 # context => 'InlineTagar'
193 # type => 'StringDetect'
194 if ($self->testStringDetect($text, '{@link ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
197 # String => '{@link '
198 # attribute => 'InlineTag'
199 # context => 'InlineTagar'
200 # type => 'StringDetect'
201 if ($self->testStringDetect($text, '{@link ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
204 # String => '{@linkplain '
205 # attribute => 'InlineTag'
206 # context => 'InlineTagar'
207 # type => 'StringDetect'
208 if ($self->testStringDetect($text, '{@linkplain ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
211 # String => '{@linkplain '
212 # attribute => 'InlineTag'
213 # context => 'InlineTagar'
214 # type => 'StringDetect'
215 if ($self->testStringDetect($text, '{@linkplain ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
218 # String => '{@literal '
219 # attribute => 'InlineTag'
220 # context => 'LiteralTagar'
221 # type => 'StringDetect'
222 if ($self->testStringDetect($text, '{@literal ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) {
225 # String => '{@literal '
226 # attribute => 'InlineTag'
227 # context => 'LiteralTagar'
228 # type => 'StringDetect'
229 if ($self->testStringDetect($text, '{@literal ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) {
232 # String => '{@value}'
233 # attribute => 'InlineTag'
235 # type => 'StringDetect'
236 if ($self->testStringDetect($text, '{@value}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) {
239 # String => '{@value '
240 # attribute => 'InlineTag'
241 # context => 'InlineTagar'
242 # type => 'StringDetect'
243 if ($self->testStringDetect($text, '{@value ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
246 # String => '{@value '
247 # attribute => 'InlineTag'
248 # context => 'InlineTagar'
249 # type => 'StringDetect'
250 if ($self->testStringDetect($text, '{@value ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
253 # context => '##HTML'
254 # type => 'IncludeRules'
255 if ($self->includePlugin('HTML', $text)) {
261 sub parseJavadocParam {
262 my ($self, $text) = @_;
263 # type => 'DetectSpaces'
264 if ($self->testDetectSpaces($text, 0, undef, 0, '#stay', undef)) {
267 # String => '\S*(?=\*/)'
268 # attribute => 'JavadocParam'
269 # context => '#pop#pop'
271 if ($self->testRegExpr($text, '\\S*(?=\\*/)', 0, 0, 0, undef, 0, '#pop#pop', 'JavadocParam')) {
274 # String => '\S*(\s|$)'
275 # attribute => 'JavadocParam'
278 if ($self->testRegExpr($text, '\\S*(\\s|$)', 0, 0, 0, undef, 0, '#pop', 'JavadocParam')) {
285 my ($self, $text) = @_;
286 # attribute => 'JavadocFS'
289 # context => '#pop#pop'
290 # endRegion => 'Javadoc'
291 # type => 'Detect2Chars'
292 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop', 'JavadocFS')) {
295 # String => '\*+(?!/)'
296 # attribute => 'JavadocFS'
298 # firstNonSpace => 'true'
300 if ($self->testRegExpr($text, '\\*+(?!/)', 0, 0, 0, undef, 1, '#stay', 'JavadocFS')) {
303 # String => '@author '
304 # attribute => 'BlockTag'
306 # type => 'StringDetect'
307 if ($self->testStringDetect($text, '@author ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
310 # String => '@deprecated '
311 # attribute => 'BlockTag'
313 # type => 'StringDetect'
314 if ($self->testStringDetect($text, '@deprecated ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
317 # String => '@exception '
318 # attribute => 'BlockTag'
319 # context => 'JavadocParam'
320 # type => 'StringDetect'
321 if ($self->testStringDetect($text, '@exception ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) {
324 # String => '@param '
325 # attribute => 'BlockTag'
326 # context => 'JavadocParam'
327 # type => 'StringDetect'
328 if ($self->testStringDetect($text, '@param ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) {
331 # String => '@return '
332 # attribute => 'BlockTag'
334 # type => 'StringDetect'
335 if ($self->testStringDetect($text, '@return ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
339 # attribute => 'BlockTag'
340 # context => 'SeeTag'
341 # type => 'StringDetect'
342 if ($self->testStringDetect($text, '@see ', 0, 0, 0, undef, 0, 'SeeTag', 'BlockTag')) {
345 # String => '@serial '
346 # attribute => 'BlockTag'
348 # type => 'StringDetect'
349 if ($self->testStringDetect($text, '@serial ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
352 # String => '@serialData '
353 # attribute => 'BlockTag'
355 # type => 'StringDetect'
356 if ($self->testStringDetect($text, '@serialData ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
359 # String => '@serialField '
360 # attribute => 'BlockTag'
362 # type => 'StringDetect'
363 if ($self->testStringDetect($text, '@serialField ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
366 # String => '@since '
367 # attribute => 'BlockTag'
369 # type => 'StringDetect'
370 if ($self->testStringDetect($text, '@since ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
373 # String => '@throws '
374 # attribute => 'BlockTag'
375 # context => 'JavadocParam'
376 # type => 'StringDetect'
377 if ($self->testStringDetect($text, '@throws ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) {
380 # String => '@version '
381 # attribute => 'BlockTag'
383 # type => 'StringDetect'
384 if ($self->testStringDetect($text, '@version ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
387 # String => '@author '
388 # attribute => 'BlockTag'
390 # type => 'StringDetect'
391 if ($self->testStringDetect($text, '@author ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
394 # String => '@deprecated '
395 # attribute => 'BlockTag'
397 # type => 'StringDetect'
398 if ($self->testStringDetect($text, '@deprecated ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
401 # String => '@exception '
402 # attribute => 'BlockTag'
403 # context => 'JavadocParam'
404 # type => 'StringDetect'
405 if ($self->testStringDetect($text, '@exception ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) {
408 # String => '@param '
409 # attribute => 'BlockTag'
410 # context => 'JavadocParam'
411 # type => 'StringDetect'
412 if ($self->testStringDetect($text, '@param ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) {
415 # String => '@return '
416 # attribute => 'BlockTag'
418 # type => 'StringDetect'
419 if ($self->testStringDetect($text, '@return ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
423 # attribute => 'BlockTag'
424 # context => 'SeeTag'
425 # type => 'StringDetect'
426 if ($self->testStringDetect($text, '@see ', 0, 0, 0, undef, 0, 'SeeTag', 'BlockTag')) {
429 # String => '@serial '
430 # attribute => 'BlockTag'
432 # type => 'StringDetect'
433 if ($self->testStringDetect($text, '@serial ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
436 # String => '@serialData '
437 # attribute => 'BlockTag'
439 # type => 'StringDetect'
440 if ($self->testStringDetect($text, '@serialData ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
443 # String => '@serialField '
444 # attribute => 'BlockTag'
446 # type => 'StringDetect'
447 if ($self->testStringDetect($text, '@serialField ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
450 # String => '@since '
451 # attribute => 'BlockTag'
453 # type => 'StringDetect'
454 if ($self->testStringDetect($text, '@since ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
457 # String => '@throws '
458 # attribute => 'BlockTag'
459 # context => 'JavadocParam'
460 # type => 'StringDetect'
461 if ($self->testStringDetect($text, '@throws ', 0, 0, 0, undef, 0, 'JavadocParam', 'BlockTag')) {
464 # String => '@version '
465 # attribute => 'BlockTag'
467 # type => 'StringDetect'
468 if ($self->testStringDetect($text, '@version ', 0, 0, 0, undef, 0, '#stay', 'BlockTag')) {
471 # String => '{@code '
472 # attribute => 'InlineTag'
473 # context => 'LiteralTagar'
474 # type => 'StringDetect'
475 if ($self->testStringDetect($text, '{@code ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) {
478 # String => '{@code '
479 # attribute => 'InlineTag'
480 # context => 'LiteralTagar'
481 # type => 'StringDetect'
482 if ($self->testStringDetect($text, '{@code ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) {
485 # String => '{@docRoot}'
486 # attribute => 'InlineTag'
488 # type => 'StringDetect'
489 if ($self->testStringDetect($text, '{@docRoot}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) {
492 # String => '{@inheritDoc}'
493 # attribute => 'InlineTag'
495 # type => 'StringDetect'
496 if ($self->testStringDetect($text, '{@inheritDoc}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) {
499 # String => '{@link '
500 # attribute => 'InlineTag'
501 # context => 'InlineTagar'
502 # type => 'StringDetect'
503 if ($self->testStringDetect($text, '{@link ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
506 # String => '{@link '
507 # attribute => 'InlineTag'
508 # context => 'InlineTagar'
509 # type => 'StringDetect'
510 if ($self->testStringDetect($text, '{@link ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
513 # String => '{@linkplain '
514 # attribute => 'InlineTag'
515 # context => 'InlineTagar'
516 # type => 'StringDetect'
517 if ($self->testStringDetect($text, '{@linkplain ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
520 # String => '{@linkplain '
521 # attribute => 'InlineTag'
522 # context => 'InlineTagar'
523 # type => 'StringDetect'
524 if ($self->testStringDetect($text, '{@linkplain ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
527 # String => '{@literal '
528 # attribute => 'InlineTag'
529 # context => 'LiteralTagar'
530 # type => 'StringDetect'
531 if ($self->testStringDetect($text, '{@literal ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) {
534 # String => '{@literal '
535 # attribute => 'InlineTag'
536 # context => 'LiteralTagar'
537 # type => 'StringDetect'
538 if ($self->testStringDetect($text, '{@literal ', 0, 0, 0, undef, 0, 'LiteralTagar', 'InlineTag')) {
541 # String => '{@value}'
542 # attribute => 'InlineTag'
544 # type => 'StringDetect'
545 if ($self->testStringDetect($text, '{@value}', 0, 0, 0, undef, 0, '#stay', 'InlineTag')) {
548 # String => '{@value '
549 # attribute => 'InlineTag'
550 # context => 'InlineTagar'
551 # type => 'StringDetect'
552 if ($self->testStringDetect($text, '{@value ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
555 # String => '{@value '
556 # attribute => 'InlineTag'
557 # context => 'InlineTagar'
558 # type => 'StringDetect'
559 if ($self->testStringDetect($text, '{@value ', 0, 0, 0, undef, 0, 'InlineTagar', 'InlineTag')) {
562 # context => '##HTML'
563 # type => 'IncludeRules'
564 if ($self->includePlugin('HTML', $text)) {
570 sub parseLiteralTagar {
571 my ($self, $text) = @_;
572 # attribute => 'InlineTag'
575 # type => 'DetectChar'
576 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#pop', 'InlineTag')) {
579 # attribute => 'JavadocFS'
582 # context => '#pop#pop#pop'
583 # type => 'Detect2Chars'
584 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop#pop', 'JavadocFS')) {
591 my ($self, $text) = @_;
592 # attribute => 'JavadocFS'
595 # context => '#pop#pop#pop'
596 # type => 'Detect2Chars'
597 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop#pop#pop', 'JavadocFS')) {
600 # context => '##HTML'
601 # type => 'IncludeRules'
602 if ($self->includePlugin('HTML', $text)) {
609 my ($self, $text) = @_;
610 # context => 'FindJavadoc'
611 # type => 'IncludeRules'
612 if ($self->includeRules('FindJavadoc', $text)) {
625 Syntax::Highlight::Engine::Kate::Javadoc - a Plugin for Javadoc syntax highlighting
629 require Syntax::Highlight::Engine::Kate::Javadoc;
630 my $sh = new Syntax::Highlight::Engine::Kate::Javadoc([
635 Syntax::Highlight::Engine::Kate::Javadoc is a plugin module that provides syntax highlighting
636 for Javadoc to the Syntax::Haghlight::Engine::Kate highlighting engine.
638 This code is generated from the syntax definition files used
640 It works quite fine, but can use refinement and optimization.
642 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
648 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
654 Unknown. If you find any, please contact the author