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 'cisco.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Raphaƫl GRAPINET
11 #generated: Sun Feb 3 22:02:04 2008, localtime
13 package Syntax::Highlight::Engine::Kate::Cisco;
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' => 'Normal',
28 'Comment' => 'Comment',
29 'Decimal' => 'DecVal',
31 'Keyword' => 'Keyword',
32 'Normal Text' => 'Normal',
33 'Operator' => 'Others',
34 'Parameter' => 'Others',
36 'Substitution' => 'Others',
38 $self->listAdd('commands',
65 'downward-compatible-config',
125 $self->listAdd('options',
128 'accounting-threshold',
129 'accounting-transits',
175 'password-encryption',
202 $self->listAdd('parameters',
205 'accounting-threshold',
206 'accounting-transits',
252 'password-encryption',
281 callback => \&parseBase,
282 attribute => 'Normal Text',
285 callback => \&parseParameter,
286 attribute => 'Parameter',
289 callback => \&parseSingleQuote,
290 attribute => 'String',
293 callback => \&parseString,
294 attribute => 'String',
297 callback => \&parseSubstitution,
298 attribute => 'Substitution',
301 $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
302 $self->basecontext('Base');
303 $self->keywordscase(0);
305 bless ($self, $class);
314 my ($self, $text) = @_;
315 # String => '\bdone\b'
316 # attribute => 'Keyword'
318 # endRegion => 'dodone1'
319 # insensitive => 'TRUE'
321 if ($self->testRegExpr($text, '\\bdone\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
325 # attribute => 'Keyword'
326 # beginRegion => 'dodone1'
328 # insensitive => 'TRUE'
330 if ($self->testRegExpr($text, '\\bdo\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
333 # String => '\belif\b'
334 # attribute => 'Keyword'
335 # beginRegion => 'iffi1'
337 # endRegion => 'iffi1'
338 # insensitive => 'TRUE'
340 if ($self->testRegExpr($text, '\\belif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
344 # attribute => 'Keyword'
345 # beginRegion => 'iffi1'
347 # insensitive => 'TRUE'
349 if ($self->testRegExpr($text, '\\bif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
353 # attribute => 'Keyword'
355 # endRegion => 'iffi1'
356 # insensitive => 'TRUE'
358 if ($self->testRegExpr($text, '\\bfi\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
361 # String => '\bcase\b'
362 # attribute => 'Keyword'
363 # beginRegion => 'case1'
365 # insensitive => 'TRUE'
367 if ($self->testRegExpr($text, '\\bcase\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
370 # String => '\besac\b'
371 # attribute => 'Keyword'
373 # endRegion => 'case1'
374 # insensitive => 'TRUE'
376 if ($self->testRegExpr($text, '\\besac\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
379 # String => '[^()]+\)'
380 # attribute => 'Keyword'
381 # beginRegion => 'subcase1'
384 # insensitive => 'TRUE'
386 if ($self->testRegExpr($text, '[^()]+\\)', 1, 0, 0, 0, 0, '#stay', 'Keyword')) {
389 # attribute => 'Keyword'
393 # endRegion => 'subcase1'
394 # type => 'Detect2Chars'
395 if ($self->testDetect2Chars($text, ';', ';', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
398 # attribute => 'Keyword'
399 # beginRegion => 'func1'
402 # type => 'DetectChar'
403 if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
406 # attribute => 'Keyword'
409 # endRegion => 'func1'
410 # type => 'DetectChar'
411 if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
414 # String => 'commands'
415 # attribute => 'Command'
418 if ($self->testKeyword($text, 'commands', 0, undef, 0, '#stay', 'Command')) {
421 # String => 'parameters'
422 # attribute => 'Parameter'
425 if ($self->testKeyword($text, 'parameters', 0, undef, 0, '#stay', 'Parameter')) {
428 # String => 'options'
429 # attribute => 'Keyword'
432 if ($self->testKeyword($text, 'options', 0, undef, 0, '#stay', 'Keyword')) {
435 # attribute => 'Decimal'
438 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
441 # String => '\$[A-Za-z0-9_?{}!]+'
442 # attribute => 'Parameter'
445 if ($self->testRegExpr($text, '\\$[A-Za-z0-9_?{}!]+', 0, 0, 0, undef, 0, '#stay', 'Parameter')) {
448 # attribute => 'String'
452 # type => 'RangeDetect'
453 if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'String')) {
457 # attribute => 'Operator'
460 if ($self->testAnyChar($text, '|<>=;', 0, 0, undef, 0, '#stay', 'Operator')) {
463 # attribute => 'String'
465 # context => 'Single Quote'
466 # type => 'DetectChar'
467 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Single Quote', 'String')) {
470 # attribute => 'Substitution'
472 # context => 'Substitution'
473 # type => 'DetectChar'
474 if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Substitution', 'Substitution')) {
477 # attribute => 'Normal Text'
481 # type => 'Detect2Chars'
482 if ($self->testDetect2Chars($text, '\\', '#', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
486 # attribute => 'Comment'
489 if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
496 my ($self, $text) = @_;
497 # String => '\$[A-Za-z0-9_?]+'
498 # attribute => 'Parameter'
501 if ($self->testRegExpr($text, '\\$[A-Za-z0-9_?]+', 0, 0, 0, undef, 0, '#pop', 'Parameter')) {
507 sub parseSingleQuote {
508 my ($self, $text) = @_;
509 # attribute => 'String'
513 # type => 'Detect2Chars'
514 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String')) {
517 # attribute => 'String'
521 # type => 'Detect2Chars'
522 if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'String')) {
525 # attribute => 'String'
528 # type => 'DetectChar'
529 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
536 my ($self, $text) = @_;
537 # attribute => 'String'
541 # type => 'Detect2Chars'
542 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String')) {
545 # attribute => 'String'
549 # type => 'Detect2Chars'
550 if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'String')) {
553 # attribute => 'String'
556 # type => 'DetectChar'
557 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
563 sub parseSubstitution {
564 my ($self, $text) = @_;
565 # attribute => 'String'
569 # type => 'Detect2Chars'
570 if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String')) {
573 # attribute => 'String'
577 # type => 'Detect2Chars'
578 if ($self->testDetect2Chars($text, '\\', '`', 0, 0, 0, undef, 0, '#stay', 'String')) {
581 # attribute => 'Substitution'
584 # type => 'DetectChar'
585 if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Substitution')) {
598 Syntax::Highlight::Engine::Kate::Cisco - a Plugin for Cisco syntax highlighting
602 require Syntax::Highlight::Engine::Kate::Cisco;
603 my $sh = new Syntax::Highlight::Engine::Kate::Cisco([
608 Syntax::Highlight::Engine::Kate::Cisco is a plugin module that provides syntax highlighting
609 for Cisco to the Syntax::Haghlight::Engine::Kate highlighting engine.
611 This code is generated from the syntax definition files used
613 It works quite fine, but can use refinement and optimization.
615 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
621 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
627 Unknown. If you find any, please contact the author