Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Syntax / Highlight / Engine / Kate / Cisco.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 'cisco.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
7
8 #kate xml version 1.10
9 #kate version 2.4
10 #kate author RaphaĆ«l GRAPINET
11 #generated: Sun Feb  3 22:02:04 2008, localtime
12
13 package Syntax::Highlight::Engine::Kate::Cisco;
14
15 our $VERSION = '0.06';
16
17 use strict;
18 use warnings;
19 use base('Syntax::Highlight::Engine::Kate::Template');
20
21 sub new {
22    my $proto = shift;
23    my $class = ref($proto) || $proto;
24    my $self = $class->SUPER::new(@_);
25    $self->attributes({
26       'Char' => 'Char',
27       'Command' => 'Normal',
28       'Comment' => 'Comment',
29       'Decimal' => 'DecVal',
30       'Float' => 'Float',
31       'Keyword' => 'Keyword',
32       'Normal Text' => 'Normal',
33       'Operator' => 'Others',
34       'Parameter' => 'Others',
35       'String' => 'String',
36       'Substitution' => 'Others',
37    });
38    $self->listAdd('commands',
39       'aaa',
40       'access-list',
41       'address',
42       'alias',
43       'arp',
44       'async-bootp',
45       'banner',
46       'boot',
47       'bridge',
48       'buffers',
49       'busy-message',
50       'call-history-mib',
51       'cdp',
52       'chat-script',
53       'class-map',
54       'clock',
55       'cns',
56       'config-register',
57       'controller',
58       'crypto',
59       'default',
60       'default-value',
61       'dialer',
62       'dialer-list',
63       'dnsix-dmdp',
64       'dnsix-nat',
65       'downward-compatible-config',
66       'enable',
67       'end',
68       'exception',
69       'exit',
70       'file',
71       'frame-relay',
72       'help',
73       'hostname',
74       'interface',
75       'ip',
76       'isdn',
77       'isdn-mib',
78       'kerberos',
79       'key',
80       'line',
81       'logging',
82       'login-string',
83       'map-class',
84       'map-list',
85       'memory-size',
86       'menu',
87       'modemcap',
88       'multilink',
89       'netbios',
90       'no',
91       'ntp',
92       'partition',
93       'policy-map',
94       'priority-list',
95       'privilege',
96       'process-max-time',
97       'prompt',
98       'queue-list',
99       'resume-string',
100       'rlogin',
101       'rmon',
102       'route-map',
103       'router',
104       'rtr',
105       'scheduler',
106       'service',
107       'snmp-server',
108       'sntp',
109       'stackmaker',
110       'state-machine',
111       'subscriber-policy',
112       'tacacs-server',
113       'template',
114       'terminal-queue',
115       'tftp-server',
116       'time-range',
117       'username',
118       'virtual-profile',
119       'virtual-template',
120       'vpdn',
121       'vpdn-group',
122       'x25',
123       'x29',
124    );
125    $self->listAdd('options',
126       'accounting',
127       'accounting-list',
128       'accounting-threshold',
129       'accounting-transits',
130       'address-pool',
131       'as-path',
132       'audit',
133       'auth-proxy',
134       'authentication',
135       'authorization',
136       'bgp-community',
137       'bootp',
138       'cef',
139       'classless',
140       'community-list',
141       'default-gateway',
142       'default-network',
143       'dhcp',
144       'dhcp-server',
145       'domain-list',
146       'domain-lookup',
147       'domain-name',
148       'dvmrp',
149       'exec-callback',
150       'extcommunity-list',
151       'finger',
152       'flow-aggregation',
153       'flow-cache',
154       'flow-export',
155       'forward-protocol',
156       'ftp',
157       'gratuitous-arps',
158       'host',
159       'host-routing',
160       'hp-host',
161       'http',
162       'icmp',
163       'inspect',
164       'local',
165       'mrm',
166       'mroute',
167       'msdp',
168       'multicast',
169       'multicast-routing',
170       'name-server',
171       'nat',
172       'new-model',
173       'ospf',
174       'password',
175       'password-encryption',
176       'pgm',
177       'pim',
178       'port-map',
179       'prefix-list',
180       'radius',
181       'rcmd',
182       'reflexive-list',
183       'route',
184       'routing',
185       'rsvp',
186       'rtcp',
187       'sap',
188       'sdr',
189       'security',
190       'source-route',
191       'subnet-zero',
192       'tacacs',
193       'tcp',
194       'tcp-small-servers',
195       'telnet',
196       'tftp',
197       'timestamps',
198       'udp-small-servers',
199       'vrf',
200       'wccp',
201    );
202    $self->listAdd('parameters',
203       'accounting',
204       'accounting-list',
205       'accounting-threshold',
206       'accounting-transits',
207       'address-pool',
208       'as-path',
209       'audit',
210       'auth-proxy',
211       'authentication',
212       'authorization',
213       'bgp-community',
214       'bootp',
215       'cef',
216       'classless',
217       'community-list',
218       'default-gateway',
219       'default-network',
220       'dhcp',
221       'dhcp-server',
222       'domain-list',
223       'domain-lookup',
224       'domain-name',
225       'dvmrp',
226       'exec-callback',
227       'extcommunity-list',
228       'finger',
229       'flow-aggregation',
230       'flow-cache',
231       'flow-export',
232       'forward-protocol',
233       'ftp',
234       'gratuitous-arps',
235       'host',
236       'host-routing',
237       'hp-host',
238       'http',
239       'icmp',
240       'inspect',
241       'local',
242       'mrm',
243       'mroute',
244       'msdp',
245       'multicast',
246       'multicast-routing',
247       'name-server',
248       'nat',
249       'new-model',
250       'ospf',
251       'password',
252       'password-encryption',
253       'pgm',
254       'pim',
255       'port-map',
256       'prefix-list',
257       'radius',
258       'rcmd',
259       'reflexive-list',
260       'route',
261       'routing',
262       'rsvp',
263       'rtcp',
264       'sap',
265       'sdr',
266       'security',
267       'source-route',
268       'subnet-zero',
269       'tacacs',
270       'tcp',
271       'tcp-small-servers',
272       'telnet',
273       'tftp',
274       'timestamps',
275       'udp-small-servers',
276       'vrf',
277       'wccp',
278    );
279    $self->contextdata({
280       'Base' => {
281          callback => \&parseBase,
282          attribute => 'Normal Text',
283       },
284       'Parameter' => {
285          callback => \&parseParameter,
286          attribute => 'Parameter',
287       },
288       'Single Quote' => {
289          callback => \&parseSingleQuote,
290          attribute => 'String',
291       },
292       'String' => {
293          callback => \&parseString,
294          attribute => 'String',
295       },
296       'Substitution' => {
297          callback => \&parseSubstitution,
298          attribute => 'Substitution',
299       },
300    });
301    $self->deliminators('\\s||\\.|\\(|\\)|:|\\!|\\+|,|-|<|=|>|\\%|\\&|\\*|\\/|;|\\?|\\[|\\]|\\^|\\{|\\||\\}|\\~|\\\\');
302    $self->basecontext('Base');
303    $self->keywordscase(0);
304    $self->initialize;
305    bless ($self, $class);
306    return $self;
307 }
308
309 sub language {
310    return 'Cisco';
311 }
312
313 sub parseBase {
314    my ($self, $text) = @_;
315    # String => '\bdone\b'
316    # attribute => 'Keyword'
317    # context => '#stay'
318    # endRegion => 'dodone1'
319    # insensitive => 'TRUE'
320    # type => 'RegExpr'
321    if ($self->testRegExpr($text, '\\bdone\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
322       return 1
323    }
324    # String => '\bdo\b'
325    # attribute => 'Keyword'
326    # beginRegion => 'dodone1'
327    # context => '#stay'
328    # insensitive => 'TRUE'
329    # type => 'RegExpr'
330    if ($self->testRegExpr($text, '\\bdo\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
331       return 1
332    }
333    # String => '\belif\b'
334    # attribute => 'Keyword'
335    # beginRegion => 'iffi1'
336    # context => '#stay'
337    # endRegion => 'iffi1'
338    # insensitive => 'TRUE'
339    # type => 'RegExpr'
340    if ($self->testRegExpr($text, '\\belif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
341       return 1
342    }
343    # String => '\bif\b'
344    # attribute => 'Keyword'
345    # beginRegion => 'iffi1'
346    # context => '#stay'
347    # insensitive => 'TRUE'
348    # type => 'RegExpr'
349    if ($self->testRegExpr($text, '\\bif\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
350       return 1
351    }
352    # String => '\bfi\b'
353    # attribute => 'Keyword'
354    # context => '#stay'
355    # endRegion => 'iffi1'
356    # insensitive => 'TRUE'
357    # type => 'RegExpr'
358    if ($self->testRegExpr($text, '\\bfi\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
359       return 1
360    }
361    # String => '\bcase\b'
362    # attribute => 'Keyword'
363    # beginRegion => 'case1'
364    # context => '#stay'
365    # insensitive => 'TRUE'
366    # type => 'RegExpr'
367    if ($self->testRegExpr($text, '\\bcase\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
368       return 1
369    }
370    # String => '\besac\b'
371    # attribute => 'Keyword'
372    # context => '#stay'
373    # endRegion => 'case1'
374    # insensitive => 'TRUE'
375    # type => 'RegExpr'
376    if ($self->testRegExpr($text, '\\besac\\b', 1, 0, 0, undef, 0, '#stay', 'Keyword')) {
377       return 1
378    }
379    # String => '[^()]+\)'
380    # attribute => 'Keyword'
381    # beginRegion => 'subcase1'
382    # column => '0'
383    # context => '#stay'
384    # insensitive => 'TRUE'
385    # type => 'RegExpr'
386    if ($self->testRegExpr($text, '[^()]+\\)', 1, 0, 0, 0, 0, '#stay', 'Keyword')) {
387       return 1
388    }
389    # attribute => 'Keyword'
390    # char => ';'
391    # char1 => ';'
392    # context => '#stay'
393    # endRegion => 'subcase1'
394    # type => 'Detect2Chars'
395    if ($self->testDetect2Chars($text, ';', ';', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
396       return 1
397    }
398    # attribute => 'Keyword'
399    # beginRegion => 'func1'
400    # char => '{'
401    # context => '#stay'
402    # type => 'DetectChar'
403    if ($self->testDetectChar($text, '{', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
404       return 1
405    }
406    # attribute => 'Keyword'
407    # char => '}'
408    # context => '#stay'
409    # endRegion => 'func1'
410    # type => 'DetectChar'
411    if ($self->testDetectChar($text, '}', 0, 0, 0, undef, 0, '#stay', 'Keyword')) {
412       return 1
413    }
414    # String => 'commands'
415    # attribute => 'Command'
416    # context => '#stay'
417    # type => 'keyword'
418    if ($self->testKeyword($text, 'commands', 0, undef, 0, '#stay', 'Command')) {
419       return 1
420    }
421    # String => 'parameters'
422    # attribute => 'Parameter'
423    # context => '#stay'
424    # type => 'keyword'
425    if ($self->testKeyword($text, 'parameters', 0, undef, 0, '#stay', 'Parameter')) {
426       return 1
427    }
428    # String => 'options'
429    # attribute => 'Keyword'
430    # context => '#stay'
431    # type => 'keyword'
432    if ($self->testKeyword($text, 'options', 0, undef, 0, '#stay', 'Keyword')) {
433       return 1
434    }
435    # attribute => 'Decimal'
436    # context => '#stay'
437    # type => 'Int'
438    if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
439       return 1
440    }
441    # String => '\$[A-Za-z0-9_?{}!]+'
442    # attribute => 'Parameter'
443    # context => '#stay'
444    # type => 'RegExpr'
445    if ($self->testRegExpr($text, '\\$[A-Za-z0-9_?{}!]+', 0, 0, 0, undef, 0, '#stay', 'Parameter')) {
446       return 1
447    }
448    # attribute => 'String'
449    # char => '"'
450    # char1 => '"'
451    # context => '#stay'
452    # type => 'RangeDetect'
453    if ($self->testRangeDetect($text, '"', '"', 0, 0, undef, 0, '#stay', 'String')) {
454       return 1
455    }
456    # String => '|<>=;'
457    # attribute => 'Operator'
458    # context => '#stay'
459    # type => 'AnyChar'
460    if ($self->testAnyChar($text, '|<>=;', 0, 0, undef, 0, '#stay', 'Operator')) {
461       return 1
462    }
463    # attribute => 'String'
464    # char => '''
465    # context => 'Single Quote'
466    # type => 'DetectChar'
467    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'Single Quote', 'String')) {
468       return 1
469    }
470    # attribute => 'Substitution'
471    # char => '`'
472    # context => 'Substitution'
473    # type => 'DetectChar'
474    if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, 'Substitution', 'Substitution')) {
475       return 1
476    }
477    # attribute => 'Normal Text'
478    # char => '\'
479    # char1 => '#'
480    # context => '#stay'
481    # type => 'Detect2Chars'
482    if ($self->testDetect2Chars($text, '\\', '#', 0, 0, 0, undef, 0, '#stay', 'Normal Text')) {
483       return 1
484    }
485    # String => '#.*$'
486    # attribute => 'Comment'
487    # context => '#stay'
488    # type => 'RegExpr'
489    if ($self->testRegExpr($text, '#.*$', 0, 0, 0, undef, 0, '#stay', 'Comment')) {
490       return 1
491    }
492    return 0;
493 };
494
495 sub parseParameter {
496    my ($self, $text) = @_;
497    # String => '\$[A-Za-z0-9_?]+'
498    # attribute => 'Parameter'
499    # context => '#pop'
500    # type => 'RegExpr'
501    if ($self->testRegExpr($text, '\\$[A-Za-z0-9_?]+', 0, 0, 0, undef, 0, '#pop', 'Parameter')) {
502       return 1
503    }
504    return 0;
505 };
506
507 sub parseSingleQuote {
508    my ($self, $text) = @_;
509    # attribute => 'String'
510    # char => '\'
511    # char1 => '\'
512    # context => '#stay'
513    # type => 'Detect2Chars'
514    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String')) {
515       return 1
516    }
517    # attribute => 'String'
518    # char => '\'
519    # char1 => '''
520    # context => '#stay'
521    # type => 'Detect2Chars'
522    if ($self->testDetect2Chars($text, '\\', '\'', 0, 0, 0, undef, 0, '#stay', 'String')) {
523       return 1
524    }
525    # attribute => 'String'
526    # char => '''
527    # context => '#pop'
528    # type => 'DetectChar'
529    if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
530       return 1
531    }
532    return 0;
533 };
534
535 sub parseString {
536    my ($self, $text) = @_;
537    # attribute => 'String'
538    # char => '\'
539    # char1 => '\'
540    # context => '#stay'
541    # type => 'Detect2Chars'
542    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String')) {
543       return 1
544    }
545    # attribute => 'String'
546    # char => '\'
547    # char1 => '"'
548    # context => '#stay'
549    # type => 'Detect2Chars'
550    if ($self->testDetect2Chars($text, '\\', '"', 0, 0, 0, undef, 0, '#stay', 'String')) {
551       return 1
552    }
553    # attribute => 'String'
554    # char => '"'
555    # context => '#pop'
556    # type => 'DetectChar'
557    if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'String')) {
558       return 1
559    }
560    return 0;
561 };
562
563 sub parseSubstitution {
564    my ($self, $text) = @_;
565    # attribute => 'String'
566    # char => '\'
567    # char1 => '\'
568    # context => '#stay'
569    # type => 'Detect2Chars'
570    if ($self->testDetect2Chars($text, '\\', '\\', 0, 0, 0, undef, 0, '#stay', 'String')) {
571       return 1
572    }
573    # attribute => 'String'
574    # char => '\'
575    # char1 => '`'
576    # context => '#stay'
577    # type => 'Detect2Chars'
578    if ($self->testDetect2Chars($text, '\\', '`', 0, 0, 0, undef, 0, '#stay', 'String')) {
579       return 1
580    }
581    # attribute => 'Substitution'
582    # char => '`'
583    # context => '#pop'
584    # type => 'DetectChar'
585    if ($self->testDetectChar($text, '`', 0, 0, 0, undef, 0, '#pop', 'Substitution')) {
586       return 1
587    }
588    return 0;
589 };
590
591
592 1;
593
594 __END__
595
596 =head1 NAME
597
598 Syntax::Highlight::Engine::Kate::Cisco - a Plugin for Cisco syntax highlighting
599
600 =head1 SYNOPSIS
601
602  require Syntax::Highlight::Engine::Kate::Cisco;
603  my $sh = new Syntax::Highlight::Engine::Kate::Cisco([
604  ]);
605
606 =head1 DESCRIPTION
607
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.
610
611 This code is generated from the syntax definition files used
612 by the Kate project.
613 It works quite fine, but can use refinement and optimization.
614
615 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
616
617 =cut
618
619 =head1 AUTHOR
620
621 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
622
623 =cut
624
625 =head1 BUGS
626
627 Unknown. If you find any, please contact the author
628
629 =cut
630