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.xml' file of the syntax highlight
6 # engine of the kate text editor (http://www.kate-editor.org
10 #kate author Yury Lebedev (yurylebedev@mail.ru)
11 #generated: Sun Feb 3 22:02:06 2008, localtime
13 package Syntax::Highlight::Engine::Kate::SQL;
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',
29 'External Variable' => 'Char',
31 'Function' => 'Function',
32 'Identifier' => 'Others',
33 'Keyword' => 'Keyword',
34 'Normal Text' => 'Normal',
35 'Operator' => 'Normal',
36 'Preprocessor' => 'Others',
38 'String Char' => 'Char',
41 $self->listAdd('functions',
127 'NLS_CHARSET_DECL_LEN',
146 'POWERMULTISET_BY_CARDINALITY',
182 'STATS_BINOMIAL_TEST',
188 'STATS_ONE_WAY_ANOVA',
189 'STATS_T_TEST_INDEP',
190 'STATS_T_TEST_INDEPU',
192 'STATS_T_TEST_PAIRED',
202 'SYS_CONNECT_BY_PATH',
253 $self->listAdd('keywords',
324 'CLOSE_CACHED_OPEN_CURSORS',
356 'CREATE_STORED_OUTLINES',
420 'FAILED_LOGIN_ATTEMPTS',
509 'LOGICAL_READS_PER_CALL',
510 'LOGICAL_READS_PER_SESSION',
563 'NLS_NUMERIC_CHARACTERS',
632 'PASSWORD_GRACE_TIME',
633 'PASSWORD_LIFE_TIME',
634 'PASSWORD_LOCK_TIME',
635 'PASSWORD_REUSE_MAX',
636 'PASSWORD_REUSE_TIME',
637 'PASSWORD_VERIFY_FUNCTION',
729 'SESSION_CACHED_CURSORS',
739 'SKIP_UNUSABLE_INDEXES',
770 'SYS_OP_ENFORCE_NOT_NULL$',
822 'USE_STORED_OUTLINES',
836 $self->listAdd('operators',
856 $self->listAdd('types',
917 'Multiline C-style comment' => {
918 callback => \&parseMultilineCstylecomment,
919 attribute => 'Comment',
922 callback => \&parseNormal,
923 attribute => 'Normal Text',
925 'SQL*Plus directive to include file' => {
926 callback => \&parseSQLPlusdirectivetoincludefile,
927 attribute => 'Preprocessor',
928 lineending => '#pop',
930 'SQL*Plus remark directive' => {
931 callback => \&parseSQLPlusremarkdirective,
932 attribute => 'Comment',
933 lineending => '#pop',
935 'Singleline PL/SQL-style comment' => {
936 callback => \&parseSinglelinePLSQLstylecomment,
937 attribute => 'Comment',
938 lineending => '#pop',
940 'String literal' => {
941 callback => \&parseStringliteral,
942 attribute => 'String',
944 'User-defined identifier' => {
945 callback => \&parseUserdefinedidentifier,
946 attribute => 'Identifier',
947 lineending => '#pop',
950 $self->deliminators('\\s||\\(|\\)|,|\\%|\\&|;|\\?|\\[|\\]|\\{|\\}|\\\\|\\+|-|\\*|\\/|\\||=|\\!|<|>|\\~|\\^|:|\\.');
951 $self->basecontext('Normal');
952 $self->keywordscase(0);
954 bless ($self, $class);
962 sub parseMultilineCstylecomment {
963 my ($self, $text) = @_;
964 # attribute => 'Comment'
968 # type => 'Detect2Chars'
969 if ($self->testDetect2Chars($text, '*', '/', 0, 0, 0, undef, 0, '#pop', 'Comment')) {
976 my ($self, $text) = @_;
977 # String => 'keywords'
978 # attribute => 'Keyword'
981 if ($self->testKeyword($text, 'keywords', 0, undef, 0, '#stay', 'Keyword')) {
984 # String => 'operators'
985 # attribute => 'Operator'
988 if ($self->testKeyword($text, 'operators', 0, undef, 0, '#stay', 'Operator')) {
991 # String => 'functions'
992 # attribute => 'Function'
995 if ($self->testKeyword($text, 'functions', 0, undef, 0, '#stay', 'Function')) {
999 # attribute => 'Data Type'
1000 # context => '#stay'
1002 if ($self->testKeyword($text, 'types', 0, undef, 0, '#stay', 'Data Type')) {
1005 # String => '%bulk_exceptions\b'
1006 # attribute => 'Data Type'
1007 # context => '#stay'
1008 # insensitive => 'true'
1010 if ($self->testRegExpr($text, '%bulk_exceptions\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
1013 # String => '%bulk_rowcount\b'
1014 # attribute => 'Data Type'
1015 # context => '#stay'
1016 # insensitive => 'true'
1018 if ($self->testRegExpr($text, '%bulk_rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
1021 # String => '%found\b'
1022 # attribute => 'Data Type'
1023 # context => '#stay'
1024 # insensitive => 'true'
1026 if ($self->testRegExpr($text, '%found\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
1029 # String => '%isopen\b'
1030 # attribute => 'Data Type'
1031 # context => '#stay'
1032 # insensitive => 'true'
1034 if ($self->testRegExpr($text, '%isopen\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
1037 # String => '%notfound\b'
1038 # attribute => 'Data Type'
1039 # context => '#stay'
1040 # insensitive => 'true'
1042 if ($self->testRegExpr($text, '%notfound\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
1045 # String => '%rowcount\b'
1046 # attribute => 'Data Type'
1047 # context => '#stay'
1048 # insensitive => 'true'
1050 if ($self->testRegExpr($text, '%rowcount\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
1053 # String => '%rowtype\b'
1054 # attribute => 'Data Type'
1055 # context => '#stay'
1056 # insensitive => 'true'
1058 if ($self->testRegExpr($text, '%rowtype\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
1061 # String => '%type\b'
1062 # attribute => 'Data Type'
1063 # context => '#stay'
1064 # insensitive => 'true'
1066 if ($self->testRegExpr($text, '%type\\b', 1, 0, 0, undef, 0, '#stay', 'Data Type')) {
1069 # attribute => 'Float'
1070 # context => '#stay'
1072 if ($self->testFloat($text, 0, undef, 0, '#stay', 'Float')) {
1075 # attribute => 'Decimal'
1076 # context => '#stay'
1078 if ($self->testInt($text, 0, undef, 0, '#stay', 'Decimal')) {
1081 # attribute => 'String'
1083 # context => 'String literal'
1084 # type => 'DetectChar'
1085 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, 'String literal', 'String')) {
1088 # attribute => 'Comment'
1091 # context => 'Singleline PL/SQL-style comment'
1092 # type => 'Detect2Chars'
1093 if ($self->testDetect2Chars($text, '-', '-', 0, 0, 0, undef, 0, 'Singleline PL/SQL-style comment', 'Comment')) {
1096 # attribute => 'Comment'
1099 # context => 'Multiline C-style comment'
1100 # type => 'Detect2Chars'
1101 if ($self->testDetect2Chars($text, '/', '*', 0, 0, 0, undef, 0, 'Multiline C-style comment', 'Comment')) {
1104 # String => '^rem\b'
1105 # attribute => 'Comment'
1107 # context => 'SQL*Plus remark directive'
1108 # insensitive => 'true'
1110 if ($self->testRegExpr($text, '^rem\\b', 1, 0, 0, 0, 0, 'SQL*Plus remark directive', 'Comment')) {
1113 # attribute => 'Identifier'
1115 # context => 'User-defined identifier'
1116 # type => 'DetectChar'
1117 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, 'User-defined identifier', 'Identifier')) {
1120 # String => '(:|&&?)\w+'
1121 # attribute => 'External Variable'
1122 # context => '#stay'
1124 if ($self->testRegExpr($text, '(:|&&?)\\w+', 0, 0, 0, undef, 0, '#stay', 'External Variable')) {
1128 # attribute => 'Symbol'
1130 # context => '#stay'
1132 if ($self->testRegExpr($text, '^/$', 0, 0, 0, 0, 0, '#stay', 'Symbol')) {
1135 # String => '^@@?[^@ \t\r\n]'
1136 # attribute => 'Preprocessor'
1138 # context => 'SQL*Plus directive to include file'
1140 if ($self->testRegExpr($text, '^@@?[^@ \\t\\r\\n]', 0, 0, 0, 0, 0, 'SQL*Plus directive to include file', 'Preprocessor')) {
1146 sub parseSQLPlusdirectivetoincludefile {
1147 my ($self, $text) = @_;
1151 sub parseSQLPlusremarkdirective {
1152 my ($self, $text) = @_;
1156 sub parseSinglelinePLSQLstylecomment {
1157 my ($self, $text) = @_;
1161 sub parseStringliteral {
1162 my ($self, $text) = @_;
1163 # attribute => 'String Char'
1164 # context => '#stay'
1165 # type => 'HlCStringChar'
1166 if ($self->testHlCStringChar($text, 0, undef, 0, '#stay', 'String Char')) {
1169 # String => '&&?\w+'
1170 # attribute => 'External Variable'
1171 # context => '#stay'
1173 if ($self->testRegExpr($text, '&&?\\w+', 0, 0, 0, undef, 0, '#stay', 'External Variable')) {
1176 # attribute => 'String'
1179 # type => 'DetectChar'
1180 if ($self->testDetectChar($text, '\'', 0, 0, 0, undef, 0, '#pop', 'String')) {
1186 sub parseUserdefinedidentifier {
1187 my ($self, $text) = @_;
1188 # attribute => 'Identifier'
1191 # type => 'DetectChar'
1192 if ($self->testDetectChar($text, '"', 0, 0, 0, undef, 0, '#pop', 'Identifier')) {
1205 Syntax::Highlight::Engine::Kate::SQL - a Plugin for SQL syntax highlighting
1209 require Syntax::Highlight::Engine::Kate::SQL;
1210 my $sh = new Syntax::Highlight::Engine::Kate::SQL([
1215 Syntax::Highlight::Engine::Kate::SQL is a plugin module that provides syntax highlighting
1216 for SQL to the Syntax::Haghlight::Engine::Kate highlighting engine.
1218 This code is generated from the syntax definition files used
1219 by the Kate project.
1220 It works quite fine, but can use refinement and optimization.
1222 It inherits Syntax::Higlight::Engine::Kate::Template. See also there.
1228 Hans Jeuken (haje <at> toneel <dot> demon <dot> nl)
1234 Unknown. If you find any, please contact the author