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 'sql-mysql.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Shane Wright (me@shanewright.co.uk)
11 #generated: Sun Feb 3 22:02:06 2008, localtime
13 package Syntax::Highlight::Engine::Kate::SQL_MySQL;
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 'Comment' => 'Comment',
27 'Data Type' => 'DataType',
28 'Decimal' => 'DecVal',
30 'Function' => 'Function',
31 'Identifier' => 'Others',
32 'Keyword' => 'Keyword',
33 'Normal Text' => 'Normal',
34 'Operator' => 'Normal',
35 'Preprocessor' => 'Others',
37 'String Char' => 'Char',
40 $self->listAdd('functions',
190 $self->listAdd('keywords',
305 'SQL_CALC_FOUND_ROWS',
336 $self->listAdd('operators',
356 $self->listAdd('types',
388 callback => \&parseIdentifier,
389 attribute => 'Identifier',
390 lineending => '#pop',
392 'MultiLineComment' => {
393 callback => \&parseMultiLineComment,
394 attribute => 'Comment',
397 callback => \&parseNormal,
398 attribute => 'Normal Text',
401 callback => \&parsePreprocessor,
402 attribute => 'Preprocessor',
403 lineending => '#pop',
405 'SingleLineComment' => {
406 callback => \&parseSingleLineComment,
407 attribute => 'Comment',
408 lineending => '#pop',
411 callback => \&parseString,
412 attribute => 'String',
415 $self->deliminators('\\s||\\(|\\)|,|\\%|\\&|;|\\?|\\[|\\]|\\{|\\}|\\\\|\\+|-|\\*|\\/|\\||=|\\!|<|>|\\~|\\^|:|\\.');
416 $self->basecontext('Normal');
417 $self->keywordscase(0);
419 bless ($self, $class);
424 return 'SQL (MySQL)';
427 sub parseIdentifier {
428 my ($self, $text) = @_;
429 # attribute => 'Identifier'
432 # type => 'DetectChar'
433 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Identifier')) {
439 sub parseMultiLineComment {
440 my ($self, $text) = @_;
441 # attribute => 'Comment'
443 # type => 'LineContinue'
444 if ($self->testLineContinue($text, 0, undef, 0, '#pop', 'Comment')) {
447 # attribute => 'Comment'
451 # endRegion => 'Comment'
452 # type => 'Detect2Chars'
453 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
460 my ($self, $text) = @_;
461 # String => 'keywords'
462 # attribute => 'Keyword'
465 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
468 # String => 'operators'
469 # attribute => 'Operator'
472 if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) {
475 # String => 'functions'
476 # attribute => 'Function'
479 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
483 # attribute => 'Data Type'
486 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
489 # String => '%bulk_exceptions\b'
490 # attribute => 'Data Type'
492 # insensitive => 'true'
494 if ($self->testRegExpr($text, '%bulk_exceptions\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
497 # String => '%bulk_rowcount\b'
498 # attribute => 'Data Type'
500 # insensitive => 'true'
502 if ($self->testRegExpr($text, '%bulk_rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
505 # String => '%found\b'
506 # attribute => 'Data Type'
508 # insensitive => 'true'
510 if ($self->testRegExpr($text, '%found\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
513 # String => '%isopen\b'
514 # attribute => 'Data Type'
516 # insensitive => 'true'
518 if ($self->testRegExpr($text, '%isopen\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
521 # String => '%notfound\b'
522 # attribute => 'Data Type'
524 # insensitive => 'true'
526 if ($self->testRegExpr($text, '%notfound\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
529 # String => '%rowcount\b'
530 # attribute => 'Data Type'
532 # insensitive => 'true'
534 if ($self->testRegExpr($text, '%rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
537 # String => '%rowtype\b'
538 # attribute => 'Data Type'
540 # insensitive => 'true'
542 if ($self->testRegExpr($text, '%rowtype\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
545 # String => '%type\b'
546 # attribute => 'Data Type'
548 # insensitive => 'true'
550 if ($self->testRegExpr($text, '%type\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
553 # attribute => 'Float'
556 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
559 # attribute => 'Decimal'
562 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
565 # attribute => 'String'
567 # context => 'String'
568 # type => 'DetectChar'
569 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String', 'String')) {
572 # attribute => 'Comment'
574 # context => 'SingleLineComment'
575 # type => 'DetectChar'
576 if ($self->testDetectChar($text, '#', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) {
579 # attribute => 'Comment'
582 # context => 'SingleLineComment'
583 # type => 'Detect2Chars'
584 if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'SingleLineComment', 'Comment')) {
587 # attribute => 'Comment'
588 # beginRegion => 'Comment'
591 # context => 'MultiLineComment'
592 # type => 'Detect2Chars'
593 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'MultiLineComment', 'Comment')) {
597 # attribute => 'Comment'
599 # context => 'SingleLineComment'
600 # insensitive => 'true'
602 if ($self->testRegExpr($text, 'rem\\b', 1, 0, 0, 0, 0, 'SingleLineComment', 'Comment')) {
605 # attribute => 'Comment'
607 # context => 'Identifier'
608 # type => 'DetectChar'
609 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'Identifier', 'Comment')) {
613 # attribute => 'Symbol'
616 if ($self->testAnyChar($text, ':&', 0, 0, undef, 0, '#stay', 'Symbol')) {
620 # attribute => 'Symbol'
624 if ($self->testRegExpr($text, '/$', 0, 0, 0, 0, 0, '#stay', 'Symbol')) {
627 # String => '@@?[^@ \t\r\n]'
628 # attribute => 'Preprocessor'
630 # context => 'Preprocessor'
632 if ($self->testRegExpr($text, '@@?[^@ \\t\\r\\n]', 0, 0, 0, 0, 0, 'Preprocessor', 'Preprocessor')) {
638 sub parsePreprocessor {
639 my ($self, $text) = @_;
643 sub parseSingleLineComment {
644 my ($self, $text) = @_;
649 my ($self, $text) = @_;
650 # attribute => 'String'
652 # type => 'LineContinue'
653 if ($self->testLineContinue($text, 0, undef, 0, '#pop', 'String')) {
656 # attribute => 'String Char'
658 # type => 'HlCStringChar'
659 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
662 # attribute => 'Symbol'
665 # type => 'DetectChar'
666 if ($self->testDetectChar($text, '&', 0, 0, 0, undef, 0, '#stay', 'Symbol')) {
669 # attribute => 'String'
672 # type => 'DetectChar'
673 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
686 Syntax::Highlight::Engine::Kate::SQL_MySQL - a Plugin for SQL (MySQL) syntax highlighting
690 require Syntax::Highlight::Engine::Kate::SQL_MySQL;
691 my $sh = new Syntax::Highlight::Engine::Kate::SQL_MySQL([
696 Syntax::Highlight::Engine::Kate::SQL_MySQL is a plugin module that provides syntax highlighting
697 for SQL (MySQL) to the Syntax::Haghlight::Engine::Kate highlighting engine.
699 This code is generated from the syntax definition files used
701 It works quite fine, but can use refinement and optimization.
703 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
709 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
715 Unknown. If you find any, please contact the author