editors/qeditor/sql_colorizer.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#include "sql_colorizer.h"
00020
00021 static const char *
sql_keywords[] = {
00022
"alter",
"analyze",
"audit",
"comment",
"commit",
"create",
00023
"delete",
"drop",
"execute",
"explain",
"grant",
"insert",
"lock",
"noaudit",
00024
"rename",
"revoke",
"rollback",
"savepoint",
"select",
"set",
00025
"truncate",
"update",
00026
00027
"boolean",
"char",
"character",
"date",
"float",
"integer",
"long",
00028
"number",
"raw",
"rowid",
"varchar",
"varchar2",
"varray",
00029
00030
"false",
"null",
"true",
00031
00032
"access",
"add",
"as",
"asc",
"begin",
"by",
"check",
"cluster",
"column",
00033
"compress",
"connect",
"current",
"cursor",
"decimal",
"default",
"desc",
00034
"else",
"elsif",
"end",
"exception",
"exclusive",
"file",
"for",
"from",
00035
"function",
"group",
"having",
"identified",
"if",
"immediate",
"increment",
00036
"index",
"initial",
"into",
"is",
"level",
"loop",
"maxextents",
"mode",
"modify",
00037
"nocompress",
"nowait",
"of",
"offline",
"on",
"online",
"start",
00038
"successful",
"synonym",
"table",
"then",
"to",
"trigger",
"uid",
00039
"unique",
"user",
"validate",
"values",
"view",
"whenever",
00040
"where",
"with",
"option",
"order",
"pctfree",
"privileges",
"procedure",
00041
"public",
"resource",
"return",
"row",
"rowlabel",
"rownum",
"rows",
00042
"session",
"share",
"size",
"smallint",
"type",
"using",
00043
00044
"not",
"and",
"or",
"in",
"any",
"some",
"all",
"between",
"exists",
00045
"like",
"escape",
"union",
"intersect",
"minus",
"prior",
"distinct",
00046
"sysdate",
"out",
00047
00048
"left",
"right",
"outer",
"inner",
"join",
00049
00050 0
00051 };
00052
00053 SqlColorizer::SqlColorizer(
QEditor* editor )
00054 :
QSourceColorizer( editor )
00055 {
00056
00057
HLItemCollection* context0 =
new HLItemCollection( 0 );
00058 context0->
appendChild(
new KeywordsHLItem(
sql_keywords, Keyword, Normal, 0,
true,
true ) );
00059 context0->
appendChild(
new StartsWithHLItem(
"--", Comment, 0 ) );
00060 context0->
appendChild(
new StringHLItem(
"'", String, 1 ) );
00061 context0->
appendChild(
new StringHLItem(
"\"", String, 2 ) );
00062
00063 HLItemCollection* context1 =
new HLItemCollection( String );
00064 context1->
appendChild(
new StringHLItem(
"\\\\", String, 1 ) );
00065 context1->
appendChild(
new StringHLItem(
"\\'", String, 1 ) );
00066 context1->
appendChild(
new StringHLItem(
"'", String, 0 ) );
00067
00068 HLItemCollection* context2 =
new HLItemCollection( String );
00069 context2->
appendChild(
new StringHLItem(
"\\\\", String, 2 ) );
00070 context2->
appendChild(
new StringHLItem(
"\\\"", String, 2 ) );
00071 context2->
appendChild(
new StringHLItem(
"\"", String, 0 ) );
00072
00073 m_items.append( context0 );
00074 m_items.append( context1 );
00075 m_items.append( context2 );
00076 }
00077
00078 SqlColorizer::~SqlColorizer()
00079 {
00080 }
00081
This file is part of the documentation for KDevelop Version 3.0.4.