summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb/parser
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/kexidb/parser
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/kexidb/parser')
-rw-r--r--kexi/kexidb/parser/parser.cpp10
-rw-r--r--kexi/kexidb/parser/parser.h24
-rw-r--r--kexi/kexidb/parser/parser_p.cpp100
-rw-r--r--kexi/kexidb/parser/parser_p.h20
-rw-r--r--kexi/kexidb/parser/sqlparser.cpp84
-rw-r--r--kexi/kexidb/parser/sqlparser.h36
-rw-r--r--kexi/kexidb/parser/sqlparser.y6
-rw-r--r--kexi/kexidb/parser/sqlscanner.cpp16
-rw-r--r--kexi/kexidb/parser/sqltypes.h16
9 files changed, 156 insertions, 156 deletions
diff --git a/kexi/kexidb/parser/parser.cpp b/kexi/kexidb/parser/parser.cpp
index f64ec96d..eeb6e39d 100644
--- a/kexi/kexidb/parser/parser.cpp
+++ b/kexi/kexidb/parser/parser.cpp
@@ -41,7 +41,7 @@ Parser::~Parser()
Parser::OPCode Parser::operation() const { return (OPCode)d->operation; }
-QString
+TQString
Parser::operationString() const
{
switch((OPCode)d->operation) {
@@ -72,7 +72,7 @@ Connection *Parser::db() const { return d->db; }
ParserError Parser::error() const { return d->error; }
-QString Parser::statement() const { return d->statement; }
+TQString Parser::statement() const { return d->statement; }
void Parser::setOperation(OPCode op) { d->operation = op; }
@@ -109,11 +109,11 @@ void Parser::init()
bool Parser::isReservedKeyword(const char *str)
{
- return d->reservedKeywords.find(str);
+ return d->reservedKeywords.tqfind(str);
}
bool
-Parser::parse(const QString &statement)
+Parser::parse(const TQString &statement)
{
init();
clear();
@@ -141,7 +141,7 @@ ParserError::ParserError()
// m_isNull = true;
}
-ParserError::ParserError(const QString &type, const QString &error, const QString &hint, int at)
+ParserError::ParserError(const TQString &type, const TQString &error, const TQString &hint, int at)
{
m_type = type;
m_error = error;
diff --git a/kexi/kexidb/parser/parser.h b/kexi/kexidb/parser/parser.h
index ec2942e1..c408dec5 100644
--- a/kexi/kexidb/parser/parser.h
+++ b/kexi/kexidb/parser/parser.h
@@ -21,9 +21,9 @@
#ifndef KEXIDBPARSER_H
#define KEXIDBPARSER_H
-#include <qobject.h>
-#include <qptrlist.h>
-#include <qvariant.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
+#include <tqvariant.h>
#include <kexidb/field.h>
#include <kexidb/expression.h>
@@ -56,7 +56,7 @@ class KEXI_DB_EXPORT ParserError
* \param hint Token where the error happend.
* \param at The position where the error happend.
*/
- ParserError(const QString &type, const QString &error, const QString &hint, int at);
+ ParserError(const TQString &type, const TQString &error, const TQString &hint, int at);
/**
* Destructor.
@@ -66,12 +66,12 @@ class KEXI_DB_EXPORT ParserError
/**
* \return the errortype.
*/
- QString type() { return m_type; }
+ TQString type() { return m_type; }
/**
* \return a descriping error message.
*/
- QString error() { return m_error; }
+ TQString error() { return m_error; }
/**
* \return position where the error happend.
@@ -79,9 +79,9 @@ class KEXI_DB_EXPORT ParserError
int at() { return m_at; }
private:
- QString m_type;
- QString m_error;
- QString m_hint;
+ TQString m_type;
+ TQString m_error;
+ TQString m_hint;
int m_at;
// bool m_isNull;
};
@@ -138,7 +138,7 @@ class KEXI_DB_EXPORT Parser
/**
* clears previous results and runs the parser
*/
- bool parse(const QString &statement);
+ bool parse(const TQString &statement);
/**
* rests results
@@ -153,7 +153,7 @@ class KEXI_DB_EXPORT Parser
/**
* \return the resulting operation as string.
*/
- QString operationString() const;
+ TQString operationString() const;
/**
* \return a pointer to a KexiDBTable on CREATE TABLE
@@ -187,7 +187,7 @@ class KEXI_DB_EXPORT Parser
/**
* \return the statement passed on the last \a parse method-call.
*/
- QString statement() const;
+ TQString statement() const;
/**
* \internal
diff --git a/kexi/kexidb/parser/parser_p.cpp b/kexi/kexidb/parser/parser_p.cpp
index ca935d60..f64696e8 100644
--- a/kexi/kexidb/parser/parser_p.cpp
+++ b/kexi/kexidb/parser/parser_p.cpp
@@ -23,7 +23,7 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <assert.h>
@@ -32,9 +32,9 @@ using namespace KexiDB;
Parser *parser = 0;
Field *field = 0;
//bool requiresTable;
-QPtrList<Field> fieldList;
+TQPtrList<Field> fieldList;
int current = 0;
-QString ctoken = "";
+TQString ctoken = "";
//-------------------------------------
@@ -92,7 +92,7 @@ void yyerror(const char *str)
|| otherError)
{
KexiDBDbg << parser->statement() << endl;
- QString ptrline = "";
+ TQString ptrline = "";
for(int i=0; i < current; i++)
ptrline += " ";
@@ -101,21 +101,21 @@ void yyerror(const char *str)
KexiDBDbg << ptrline << endl;
//lexer may add error messages
- QString lexerErr = parser->error().error();
+ TQString lexerErr = parser->error().error();
- QString errtypestr(str);
+ TQString errtypestr(str);
if (lexerErr.isEmpty()) {
#if 0
if (errtypestr.startsWith("parse error, unexpected ")) {
//something like "parse error, unexpected IDENTIFIER, expecting ',' or ')'"
- QString e = errtypestr.mid(24);
+ TQString e = errtypestr.mid(24);
KexiDBDbg << e <<endl;
- QString token = "IDENTIFIER";
+ TQString token = "IDENTIFIER";
if (e.startsWith(token)) {
- QRegExp re("'.'");
+ TQRegExp re("'.'");
int pos=0;
pos = re.search(e, pos);
- QStringList captured=re.capturedTexts();
+ TQStringList captured=re.capturedTexts();
if (captured.count()>=2) {
// KexiDBDbg << "**" << captured.at(1) << endl;
// KexiDBDbg << "**" << captured.at(2) << endl;
@@ -142,21 +142,21 @@ void yyerror(const char *str)
if (parser->isReservedKeyword(ctoken.latin1()))
parser->setError( ParserError(i18n("Syntax Error"),
- i18n("\"%1\" is a reserved keyword").arg(ctoken)+lexerErr, ctoken, current) );
+ i18n("\"%1\" is a reserved keyword").tqarg(ctoken)+lexerErr, ctoken, current) );
else
parser->setError( ParserError(i18n("Syntax Error"),
- i18n("Syntax Error near \"%1\"").arg(ctoken)+lexerErr, ctoken, current) );
+ i18n("Syntax Error near \"%1\"").tqarg(ctoken)+lexerErr, ctoken, current) );
}
}
}
-void setError(const QString& errName, const QString& errDesc)
+void setError(const TQString& errName, const TQString& errDesc)
{
parser->setError( ParserError(errName, errDesc, ctoken, current) );
yyerror(errName.latin1());
}
-void setError(const QString& errDesc)
+void setError(const TQString& errDesc)
{
setError("other error", errDesc);
}
@@ -194,7 +194,7 @@ bool parseData(Parser *p, const char *data)
KexiDBDbg << "parseData(): ok" << endl;
// KexiDBDbg << "parseData(): " << tableDict.count() << " loaded tables" << endl;
/* TableSchema *ts;
- for(QDictIterator<TableSchema> it(tableDict); TableSchema *s = tableList.first(); s; s = tableList.next())
+ for(TQDictIterator<TableSchema> it(tableDict); TableSchema *s = tableList.first(); s; s = tableList.next())
{
KexiDBDbg << " " << s->name() << endl;
}*/
@@ -202,9 +202,9 @@ bool parseData(Parser *p, const char *data)
Field::ListIterator it = parser->select()->fieldsIterator();
for(Field *item; (item = it.current()); ++it)
{
- if(tableList.findRef(item->table()) == -1)
+ if(tableList.tqfindRef(item->table()) == -1)
{
- ParserError err(i18n("Field List Error"), i18n("Unknown table '%1' in field list").arg(item->table()->name()), ctoken, current);
+ ParserError err(i18n("Field List Error"), i18n("Unknown table '%1' in field list").tqarg(item->table()->name()), ctoken, current);
parser->setError(err);
yyerror("fieldlisterror");
@@ -263,8 +263,8 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
#if 0
KexiDBDbg << "found variable name: " << varName << endl;
- int dotPos = varName.find('.');
- QString tableName, fieldName;
+ int dotPos = varName.tqfind('.');
+ TQString tableName, fieldName;
//TODO: shall we also support db name?
if (dotPos>0) {
tableName = varName.left(dotPos);
@@ -288,15 +288,15 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
setError(i18n("Ambiguous field name"),
i18n("Both table \"%1\" and \"%2\" have defined \"%3\" field. "
"Use \"<tableName>.%4\" notation to specify table name.")
- .arg(firstField->table()->name()).arg(f->table()->name())
- .arg(fieldName).arg(fieldName));
+ .tqarg(firstField->table()->name()).tqarg(f->table()->name())
+ .tqarg(fieldName).tqarg(fieldName));
return false;
}
}
}
if (!firstField) {
setError(i18n("Field not found"),
- i18n("Table containing \"%1\" field not found").arg(fieldName));
+ i18n("Table containing \"%1\" field not found").tqarg(fieldName));
return false;
}
//ok
@@ -308,9 +308,9 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
TableSchema *ts = parseInfo.querySchema->table( tableName );
if (ts) {//table.fieldname
//check if "table" is covered by an alias
- const QValueList<int> tPositions = parseInfo.querySchema->tablePositions(tableName);
- QValueList<int>::ConstIterator it = tPositions.constBegin();
- QCString tableAlias;
+ const TQValueList<int> tPositions = parseInfo.querySchema->tablePositions(tableName);
+ TQValueList<int>::ConstIterator it = tPositions.constBegin();
+ TQCString tableAlias;
bool covered = true;
for (; it!=tPositions.constEnd() && covered; ++it) {
tableAlias = parseInfo.querySchema->tableAlias(*it);
@@ -321,8 +321,8 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
if (covered) {
setError(i18n("Could not access the table directly using its name"),
i18n("Table \"%1\" is covered by aliases. Instead of \"%2\", "
- "you can write \"%3\"").arg(tableName)
- .arg(tableName+"."+fieldName).arg(tableAlias+"."+fieldName.latin1()));
+ "you can write \"%3\"").tqarg(tableName)
+ .tqarg(tableName+"."+fieldName).tqarg(tableAlias+"."+fieldName.latin1()));
return false;
}
}
@@ -340,7 +340,7 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
if (ts) {
- QValueList<int> *positionsList = repeatedTablesAndAliases[ tableName ];
+ TQValueList<int> *positionsList = repeatedTablesAndAliases[ tableName ];
if (!positionsList) {
IMPL_ERROR(tableName + "." + fieldName + ", !positionsList ");
return false;
@@ -348,8 +348,8 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
if (fieldName=="*") {
if (positionsList->count()>1) {
- setError(i18n("Ambiguous \"%1.*\" expression").arg(tableName),
- i18n("More than one \"%1\" table or alias defined").arg(tableName));
+ setError(i18n("Ambiguous \"%1.*\" expression").tqarg(tableName),
+ i18n("More than one \"%1\" table or alias defined").tqarg(tableName));
return false;
}
parseInfo.querySchema->addAsterisk( new QueryAsterisk(parseInfo.querySchema, ts) );
@@ -361,16 +361,16 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
// check if table or alias is used twice and both have the same column
// (so the column is ambiguous)
int numberOfTheSameFields = 0;
- for (QValueList<int>::iterator it = positionsList->begin();
+ for (TQValueList<int>::iterator it = positionsList->begin();
it!=positionsList->end();++it)
{
TableSchema *otherTS = parseInfo.querySchema->tables()->at(*it);
if (otherTS->field(fieldName))
numberOfTheSameFields++;
if (numberOfTheSameFields>1) {
- setError(i18n("Ambiguous \"%1.%2\" expression").arg(tableName).arg(fieldName),
+ setError(i18n("Ambiguous \"%1.%2\" expression").tqarg(tableName).tqarg(fieldName),
i18n("More than one \"%1\" table or alias defined containing \"%2\" field")
- .arg(tableName).arg(fieldName));
+ .tqarg(tableName).tqarg(fieldName));
return false;
}
}
@@ -379,7 +379,7 @@ bool addColumn( ParseInfo& parseInfo, BaseExpr* columnExpr )
}
else {
setError(i18n("Field not found"), i18n("Table \"%1\" has no \"%2\" field")
- .arg(tableName).arg(fieldName));
+ .tqarg(tableName).tqarg(fieldName));
return false;
}
}
@@ -412,13 +412,13 @@ QuerySchema* buildSelectQuery(
/*TODO: use this later if there are columns that use database fields,
e.g. "SELECT 1 from table1 t, table2 t") is ok however. */
//used to collect information about first repeated table name or alias:
-// QDict<char> tableNamesAndTableAliases(997, false);
-// QString repeatedTableNameOrTableAlias;
+// TQDict<char> tableNamesAndTableAliases(997, false);
+// TQString repeatedTableNameOrTableAlias;
if (tablesList) {
for (int i=0; i<tablesList->args(); i++, columnNum++) {
BaseExpr *e = tablesList->arg(i);
VariableExpr* t_e = 0;
- QCString aliasString;
+ TQCString aliasString;
if (e->exprClass() == KexiDBExpr_SpecialBinary) {
BinaryExpr* t_with_alias = e->toBinary();
assert(t_with_alias);
@@ -432,16 +432,16 @@ QuerySchema* buildSelectQuery(
t_e = e->toVariable();
}
assert(t_e);
- QCString tname = t_e->name.latin1();
- TableSchema *s = parser->db()->tableSchema(tname);
+ TQCString tname = t_e->name.latin1();
+ TableSchema *s = parser->db()->tableSchema(TQString(tname));
if(!s) {
setError(//i18n("Field List Error"),
- i18n("Table \"%1\" does not exist").arg(tname));
+ i18n("Table \"%1\" does not exist").tqarg(TQString(tname)));
// yyerror("fieldlisterror");
CLEANUP;
return 0;
}
- QCString tableOrAliasName;
+ TQCString tableOrAliasName;
if (!aliasString.isEmpty()) {
tableOrAliasName = aliasString;
// KexiDBDbg << "- add alias for table: " << aliasString << endl;
@@ -450,14 +450,14 @@ QuerySchema* buildSelectQuery(
}
// 1. collect information about first repeated table name or alias
// (potential ambiguity)
- QValueList<int> *list = parseInfo.repeatedTablesAndAliases[tableOrAliasName];
+ TQValueList<int> *list = parseInfo.repeatedTablesAndAliases[tableOrAliasName];
if (list) {
//another table/alias with the same name
list->append( i );
// KexiDBDbg << "- another table/alias with name: " << tableOrAliasName << endl;
}
else {
- list = new QValueList<int>();
+ list = new TQValueList<int>();
list->append( i );
parseInfo.repeatedTablesAndAliases.insert( tableOrAliasName, list );
// KexiDBDbg << "- first table/alias with name: " << tableOrAliasName << endl;
@@ -485,7 +485,7 @@ QuerySchema* buildSelectQuery(
}
}
- /* set parent table if there's only one */
+ /* set tqparent table if there's only one */
// if (parser->select()->tables()->count()==1)
if (querySchema->tables()->count()==1)
querySchema->setMasterTable(querySchema->tables()->first());
@@ -511,7 +511,7 @@ QuerySchema* buildSelectQuery(
aliasVariable = e->toBinary()->right()->toVariable();
if (!aliasVariable) {
setError(i18n("Invalid alias definition for column \"%1\"")
- .arg(columnExpr->toString())); //ok?
+ .tqarg(columnExpr->toString())); //ok?
CLEANUP;
return 0;
}
@@ -542,7 +542,7 @@ QuerySchema* buildSelectQuery(
e->toBinary()->m_larg = 0;
}
else {
- setError(i18n("Invalid \"%1\" column definition").arg(e->toString())); //ok?
+ setError(i18n("Invalid \"%1\" column definition").tqarg(e->toString())); //ok?
CLEANUP;
return 0;
}
@@ -610,7 +610,7 @@ QuerySchema* buildSelectQuery(
(*it).ascending, (*it).columnNumber-1 ))
{
setError(i18n("Could not define sorting - no column at position %1")
- .arg((*it).columnNumber));
+ .tqarg((*it).columnNumber));
CLEANUP;
return 0;
}
@@ -619,7 +619,7 @@ QuerySchema* buildSelectQuery(
Field * f = querySchema->findTableField((*it).aliasOrName);
if (!f) {
setError(i18n("Could not define sorting - "
- "column name or alias \"%1\" does not exist").arg((*it).aliasOrName));
+ "column name or alias \"%1\" does not exist").tqarg((*it).aliasOrName));
CLEANUP;
return 0;
}
@@ -630,8 +630,8 @@ QuerySchema* buildSelectQuery(
}
}
-// KexiDBDbg << "Select ColViews=" << (colViews ? colViews->debugString() : QString::null)
-// << " Tables=" << (tablesList ? tablesList->debugString() : QString::null) << endl;
+// KexiDBDbg << "Select ColViews=" << (colViews ? colViews->debugString() : TQString())
+// << " Tables=" << (tablesList ? tablesList->debugString() : TQString()) << endl;
CLEANUP;
return querySchema;
diff --git a/kexi/kexidb/parser/parser_p.h b/kexi/kexidb/parser/parser_p.h
index 6a695bc5..d03955c8 100644
--- a/kexi/kexidb/parser/parser_p.h
+++ b/kexi/kexidb/parser/parser_p.h
@@ -20,10 +20,10 @@
#ifndef KEXIDB_PARSER_P_H
#define KEXIDB_PARSER_P_H
-#include <qvaluelist.h>
-#include <qdict.h>
-#include <qasciicache.h>
-#include <qstring.h>
+#include <tqvaluelist.h>
+#include <tqdict.h>
+#include <tqasciicache.h>
+#include <tqstring.h>
#include <kexidb/queryschema.h>
#include <kexidb/tableschema.h>
@@ -47,9 +47,9 @@ class ParserPrivate
TableSchema *table;
QuerySchema *select;
Connection *db;
- QString statement;
+ TQString statement;
ParserError error;
- QAsciiCache<char> reservedKeywords;
+ TQAsciiCache<char> reservedKeywords;
bool initialized : 1;
};
@@ -62,17 +62,17 @@ class ParseInfo
~ParseInfo();
//! collects positions of tables/aliases with the same names
- QDict< QValueList<int> > repeatedTablesAndAliases;
+ TQDict< TQValueList<int> > repeatedTablesAndAliases;
- QString errMsg, errDescr; //helpers
+ TQString errMsg, errDescr; //helpers
QuerySchema *querySchema;
};
}
void yyerror(const char *str);
-void setError(const QString& errName, const QString& errDesc);
-void setError(const QString& errDesc);
+void setError(const TQString& errName, const TQString& errDesc);
+void setError(const TQString& errDesc);
//bool parseData(KexiDB::Parser *p, const char *data);
bool addColumn( KexiDB::ParseInfo& parseInfo, KexiDB::BaseExpr* columnExpr );
KexiDB::QuerySchema* buildSelectQuery(
diff --git a/kexi/kexidb/parser/sqlparser.cpp b/kexi/kexidb/parser/sqlparser.cpp
index 682b8aa0..f4086b3b 100644
--- a/kexi/kexidb/parser/sqlparser.cpp
+++ b/kexi/kexidb/parser/sqlparser.cpp
@@ -20,7 +20,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-/* As a special exception, you may create a larger work that contains
+/* As a special exception, you may create a larger work that tqcontains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
@@ -174,12 +174,12 @@
DISTINCT = 363,
DOMAIN_TOKEN = 364,
SQL_DOUBLE = 365,
- DOUBLE_QUOTED_STRING = 366,
+ DOUBLE_TQUOTED_STRING = 366,
DROP = 367,
ELSE = 368,
END = 369,
END_EXEC = 370,
- EQUAL = 371,
+ ETQUAL = 371,
ESCAPE = 372,
EXCEPT = 373,
SQL_EXCEPTION = 374,
@@ -296,7 +296,7 @@
PARTIAL = 485,
SQL_PASCAL = 486,
PERSISTENT = 487,
- CQL_PI = 488,
+ CTQL_PI = 488,
PLI = 489,
POSITION = 490,
PRECISION = 491,
@@ -308,8 +308,8 @@
PROCEDURE = 497,
PRODUCT = 498,
PUBLIC = 499,
- QUARTER = 500,
- QUIT = 501,
+ TQUARTER = 500,
+ TQUIT = 501,
RAND = 502,
READ_ONLY = 503,
REAL = 504,
@@ -381,7 +381,7 @@
TWO_DIGITS = 570,
UCASE = 571,
UNION = 572,
- UNIQUE = 573,
+ UNITQUE = 573,
SQL_UNKNOWN = 574,
UPDATE = 575,
UPPER = 576,
@@ -389,7 +389,7 @@
USER = 578,
IDENTIFIER = 579,
IDENTIFIER_DOT_ASTERISK = 580,
- QUERY_PARAMETER = 581,
+ TQUERY_PARAMETER = 581,
USING = 582,
VALUE = 583,
VALUES = 584,
@@ -524,12 +524,12 @@
#define DISTINCT 363
#define DOMAIN_TOKEN 364
#define SQL_DOUBLE 365
-#define DOUBLE_QUOTED_STRING 366
+#define DOUBLE_TQUOTED_STRING 366
#define DROP 367
#define ELSE 368
#define END 369
#define END_EXEC 370
-#define EQUAL 371
+#define ETQUAL 371
#define ESCAPE 372
#define EXCEPT 373
#define SQL_EXCEPTION 374
@@ -646,7 +646,7 @@
#define PARTIAL 485
#define SQL_PASCAL 486
#define PERSISTENT 487
-#define CQL_PI 488
+#define CTQL_PI 488
#define PLI 489
#define POSITION 490
#define PRECISION 491
@@ -658,8 +658,8 @@
#define PROCEDURE 497
#define PRODUCT 498
#define PUBLIC 499
-#define QUARTER 500
-#define QUIT 501
+#define TQUARTER 500
+#define TQUIT 501
#define RAND 502
#define READ_ONLY 503
#define REAL 504
@@ -731,7 +731,7 @@
#define TWO_DIGITS 570
#define UCASE 571
#define UNION 572
-#define UNIQUE 573
+#define UNITQUE 573
#define SQL_UNKNOWN 574
#define UPDATE 575
#define UPPER 576
@@ -739,7 +739,7 @@
#define USER 578
#define IDENTIFIER 579
#define IDENTIFIER_DOT_ASTERISK 580
-#define QUERY_PARAMETER 581
+#define TQUERY_PARAMETER 581
#define USING 582
#define VALUE 583
#define VALUES 584
@@ -780,7 +780,7 @@
#include <assert.h>
#include <limits.h>
//TODO OK?
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
//workaround for bug on msvc
# undef LLONG_MIN
#endif
@@ -798,12 +798,12 @@
# include <malloc.h>
#endif
-#include <qobject.h>
+#include <tqobject.h>
#include <kdebug.h>
#include <klocale.h>
-#include <qptrlist.h>
-#include <qcstring.h>
-#include <qvariant.h>
+#include <tqptrlist.h>
+#include <tqcstring.h>
+#include <tqvariant.h>
#include <connection.h>
#include <queryschema.h>
@@ -834,7 +834,7 @@ using namespace KexiDB;
#if 0
struct yyval
{
- QString parserUserName;
+ TQString parserUserName;
int integerValue;
KexiDBField::ColumnType coltype;
}
@@ -864,8 +864,8 @@ using namespace KexiDB;
typedef union YYSTYPE
#line 511 "sqlparser.y"
{
- QString* stringValue;
- Q_LLONG integerValue;
+ TQString* stringValue;
+ TQ_LLONG integerValue;
bool booleanValue;
struct realType realValue;
KexiDB::Field::Type colType;
@@ -876,7 +876,7 @@ typedef union YYSTYPE
KexiDB::QuerySchema *querySchema;
SelectOptionsInternal *selectOptions;
OrderByColumnInternal::List *orderByColumns;
- QVariant *variantValue;
+ TQVariant *variantValue;
}
/* Line 193 of yacc.c. */
#line 883 "sqlparser.tab.c"
@@ -1290,8 +1290,8 @@ static const char *const yytname[] =
"DEC", "DECLARE", "DEFAULT", "DEFERRABLE", "DEFERRED", "SQL_DELETE",
"DESC", "DESCRIBE", "DESCRIPTOR", "DIAGNOSTICS", "DICTIONARY",
"DIRECTORY", "DISCONNECT", "DISPLACEMENT", "DISTINCT", "DOMAIN_TOKEN",
- "SQL_DOUBLE", "DOUBLE_QUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
- "EQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
+ "SQL_DOUBLE", "DOUBLE_TQUOTED_STRING", "DROP", "ELSE", "END", "END_EXEC",
+ "ETQUAL", "ESCAPE", "EXCEPT", "SQL_EXCEPTION", "EXEC", "EXECUTE",
"EXISTS", "EXP", "EXPONENT", "EXTERNAL", "EXTRACT", "SQL_FALSE", "FETCH",
"FIRST", "SQL_FLOAT", "FLOOR", "FN", "FOR", "FOREIGN", "FORTRAN",
"FOUND", "FOUR_DIGITS", "FROM", "FULL", "GET", "GLOBAL", "GO", "GOTO",
@@ -1308,9 +1308,9 @@ static const char *const yytname[] =
"NOW", "SQL_NULL", "SQL_IS", "SQL_IS_NULL", "SQL_IS_NOT_NULL", "NULLIF",
"NUMERIC", "OCTET_LENGTH", "ODBC", "OF", "SQL_OFF", "SQL_ON", "ONLY",
"OPEN", "OPTION", "OR", "ORDER", "OUTER", "OUTPUT", "OVERLAPS", "PAGE",
- "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CQL_PI", "PLI", "POSITION",
+ "PARTIAL", "SQL_PASCAL", "PERSISTENT", "CTQL_PI", "PLI", "POSITION",
"PRECISION", "PREPARE", "PRESERVE", "PRIMARY", "PRIOR", "PRIVILEGES",
- "PROCEDURE", "PRODUCT", "PUBLIC", "QUARTER", "QUIT", "RAND", "READ_ONLY",
+ "PROCEDURE", "PRODUCT", "PUBLIC", "TQUARTER", "TQUIT", "RAND", "READ_ONLY",
"REAL", "REFERENCES", "REPEAT", "REPLACE", "RESTRICT", "REVOKE", "RIGHT",
"ROLLBACK", "ROWS", "RPAD", "RTRIM", "SCHEMA", "SCREEN_WIDTH", "SCROLL",
"SECOND", "SECONDS_BETWEEN", "SELECT", "SEQUENCE", "SETOPT", "SET",
@@ -1322,9 +1322,9 @@ static const char *const yytname[] =
"TAN", "TEMPORARY", "THEN", "THREE_DIGITS", "TIME", "TIMESTAMP",
"TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYINT", "TO", "TO_CHAR",
"TO_DATE", "TRANSACTION", "TRANSLATE", "TRANSLATION", "TRUNCATE",
- "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNIQUE", "SQL_UNKNOWN",
+ "GENERAL_TITLE", "TWO_DIGITS", "UCASE", "UNION", "UNITQUE", "SQL_UNKNOWN",
"UPDATE", "UPPER", "USAGE", "USER", "IDENTIFIER",
- "IDENTIFIER_DOT_ASTERISK", "QUERY_PARAMETER", "USING", "VALUE", "VALUES",
+ "IDENTIFIER_DOT_ASTERISK", "TQUERY_PARAMETER", "USING", "VALUE", "VALUES",
"VARBINARY", "VARCHAR", "VARYING", "VENDOR", "VIEW", "WEEK", "WHEN",
"WHENEVER", "WHERE", "WHERE_CURRENT_OF", "WITH", "WORD_WRAPPED", "WORK",
"WRAPPED", "XOR", "YEAR", "YEARS_BETWEEN", "SCAN_ERROR", "__LAST_TOKEN",
@@ -2703,7 +2703,7 @@ YYACCEPT;
case 38:
#line 828 "sqlparser.y"
{
- (yyval.variantValue) = new QVariant( *(yyvsp[(1) - (1)].stringValue) );
+ (yyval.variantValue) = new TQVariant( *(yyvsp[(1) - (1)].stringValue) );
KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue) << endl;
delete (yyvsp[(1) - (1)].stringValue);
;}
@@ -2712,7 +2712,7 @@ YYACCEPT;
case 39:
#line 834 "sqlparser.y"
{
- (yyval.variantValue) = new QVariant( *(yyvsp[(1) - (3)].stringValue) + "." + *(yyvsp[(3) - (3)].stringValue) );
+ (yyval.variantValue) = new TQVariant( *(yyvsp[(1) - (3)].stringValue) + "." + *(yyvsp[(3) - (3)].stringValue) );
KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue) << endl;
delete (yyvsp[(1) - (3)].stringValue);
delete (yyvsp[(3) - (3)].stringValue);
@@ -2722,7 +2722,7 @@ YYACCEPT;
case 40:
#line 841 "sqlparser.y"
{
- (yyval.variantValue) = new QVariant((yyvsp[(1) - (1)].integerValue));
+ (yyval.variantValue) = new TQVariant((yyvsp[(1) - (1)].integerValue));
KexiDBDbg << "OrderByColumnId: " << *(yyval.variantValue) << endl;
;}
break;
@@ -2988,10 +2988,10 @@ YYACCEPT;
case 84:
#line 1054 "sqlparser.y"
{
- (yyval.expr) = new ConstExpr( SQL_NULL, QVariant() );
+ (yyval.expr) = new ConstExpr( SQL_NULL, TQVariant() );
KexiDBDbg << " + NULL" << endl;
// $$ = new Field();
- //$$->setName(QString::null);
+ //$$->setName(TQString());
;}
break;
@@ -3007,16 +3007,16 @@ YYACCEPT;
case 86:
#line 1067 "sqlparser.y"
{
- QVariant val;
+ TQVariant val;
if ((yyvsp[(1) - (1)].integerValue) <= INT_MAX && (yyvsp[(1) - (1)].integerValue) >= INT_MIN)
val = (int)(yyvsp[(1) - (1)].integerValue);
else if ((yyvsp[(1) - (1)].integerValue) <= UINT_MAX && (yyvsp[(1) - (1)].integerValue) >= 0)
val = (uint)(yyvsp[(1) - (1)].integerValue);
- else if ((yyvsp[(1) - (1)].integerValue) <= (Q_LLONG)LLONG_MAX && (yyvsp[(1) - (1)].integerValue) >= (Q_LLONG)LLONG_MIN)
- val = (Q_LLONG)(yyvsp[(1) - (1)].integerValue);
+ else if ((yyvsp[(1) - (1)].integerValue) <= (TQ_LLONG)LLONG_MAX && (yyvsp[(1) - (1)].integerValue) >= (TQ_LLONG)LLONG_MIN)
+ val = (TQ_LLONG)(yyvsp[(1) - (1)].integerValue);
// if ($1 < ULLONG_MAX)
-// val = (Q_ULLONG)$1;
+// val = (TQ_ULLONG)$1;
//TODO ok?
(yyval.expr) = new ConstExpr( INTEGER_CONST, val );
@@ -3027,7 +3027,7 @@ YYACCEPT;
case 87:
#line 1084 "sqlparser.y"
{
- (yyval.expr) = new ConstExpr( REAL_CONST, QPoint( (yyvsp[(1) - (1)].realValue).integer, (yyvsp[(1) - (1)].realValue).fractional ) );
+ (yyval.expr) = new ConstExpr( REAL_CONST, TQPoint( (yyvsp[(1) - (1)].realValue).integer, (yyvsp[(1) - (1)].realValue).fractional ) );
KexiDBDbg << " + real constant: " << (yyvsp[(1) - (1)].realValue).integer << "." << (yyvsp[(1) - (1)].realValue).fractional << endl;
;}
break;
@@ -3111,7 +3111,7 @@ YYACCEPT;
Field *f = item->table()->field(item->name());
if(!f)
{
- ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").arg(item->name()).arg(schema->name()), ctoken, current);
+ ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").tqarg(item->name()).tqarg(schema->name()), ctoken, current);
parser->setError(err);
yyerror("fieldlisterror");
}
@@ -3242,7 +3242,7 @@ YYACCEPT;
case 108:
#line 1352 "sqlparser.y"
{
- QString s( *(yyvsp[(1) - (3)].stringValue) );
+ TQString s( *(yyvsp[(1) - (3)].stringValue) );
s += ".*";
(yyval.expr) = new VariableExpr(s);
KexiDBDbg << " + all columns from " << s << endl;
diff --git a/kexi/kexidb/parser/sqlparser.h b/kexi/kexidb/parser/sqlparser.h
index 7caf4b87..6895e29f 100644
--- a/kexi/kexidb/parser/sqlparser.h
+++ b/kexi/kexidb/parser/sqlparser.h
@@ -27,7 +27,7 @@ bool parseData(KexiDB::Parser *p, const char *data);
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-/* As a special exception, you may create a larger work that contains
+/* As a special exception, you may create a larger work that tqcontains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
@@ -154,12 +154,12 @@ bool parseData(KexiDB::Parser *p, const char *data);
DISTINCT = 363,
DOMAIN_TOKEN = 364,
SQL_DOUBLE = 365,
- DOUBLE_QUOTED_STRING = 366,
+ DOUBLE_TQUOTED_STRING = 366,
DROP = 367,
ELSE = 368,
END = 369,
END_EXEC = 370,
- EQUAL = 371,
+ ETQUAL = 371,
ESCAPE = 372,
EXCEPT = 373,
SQL_EXCEPTION = 374,
@@ -276,7 +276,7 @@ bool parseData(KexiDB::Parser *p, const char *data);
PARTIAL = 485,
SQL_PASCAL = 486,
PERSISTENT = 487,
- CQL_PI = 488,
+ CTQL_PI = 488,
PLI = 489,
POSITION = 490,
PRECISION = 491,
@@ -288,8 +288,8 @@ bool parseData(KexiDB::Parser *p, const char *data);
PROCEDURE = 497,
PRODUCT = 498,
PUBLIC = 499,
- QUARTER = 500,
- QUIT = 501,
+ TQUARTER = 500,
+ TQUIT = 501,
RAND = 502,
READ_ONLY = 503,
REAL = 504,
@@ -361,7 +361,7 @@ bool parseData(KexiDB::Parser *p, const char *data);
TWO_DIGITS = 570,
UCASE = 571,
UNION = 572,
- UNIQUE = 573,
+ UNITQUE = 573,
SQL_UNKNOWN = 574,
UPDATE = 575,
UPPER = 576,
@@ -369,7 +369,7 @@ bool parseData(KexiDB::Parser *p, const char *data);
USER = 578,
IDENTIFIER = 579,
IDENTIFIER_DOT_ASTERISK = 580,
- QUERY_PARAMETER = 581,
+ TQUERY_PARAMETER = 581,
USING = 582,
VALUE = 583,
VALUES = 584,
@@ -504,12 +504,12 @@ bool parseData(KexiDB::Parser *p, const char *data);
#define DISTINCT 363
#define DOMAIN_TOKEN 364
#define SQL_DOUBLE 365
-#define DOUBLE_QUOTED_STRING 366
+#define DOUBLE_TQUOTED_STRING 366
#define DROP 367
#define ELSE 368
#define END 369
#define END_EXEC 370
-#define EQUAL 371
+#define ETQUAL 371
#define ESCAPE 372
#define EXCEPT 373
#define SQL_EXCEPTION 374
@@ -626,7 +626,7 @@ bool parseData(KexiDB::Parser *p, const char *data);
#define PARTIAL 485
#define SQL_PASCAL 486
#define PERSISTENT 487
-#define CQL_PI 488
+#define CTQL_PI 488
#define PLI 489
#define POSITION 490
#define PRECISION 491
@@ -638,8 +638,8 @@ bool parseData(KexiDB::Parser *p, const char *data);
#define PROCEDURE 497
#define PRODUCT 498
#define PUBLIC 499
-#define QUARTER 500
-#define QUIT 501
+#define TQUARTER 500
+#define TQUIT 501
#define RAND 502
#define READ_ONLY 503
#define REAL 504
@@ -711,7 +711,7 @@ bool parseData(KexiDB::Parser *p, const char *data);
#define TWO_DIGITS 570
#define UCASE 571
#define UNION 572
-#define UNIQUE 573
+#define UNITQUE 573
#define SQL_UNKNOWN 574
#define UPDATE 575
#define UPPER 576
@@ -719,7 +719,7 @@ bool parseData(KexiDB::Parser *p, const char *data);
#define USER 578
#define IDENTIFIER 579
#define IDENTIFIER_DOT_ASTERISK 580
-#define QUERY_PARAMETER 581
+#define TQUERY_PARAMETER 581
#define USING 582
#define VALUE 583
#define VALUES 584
@@ -751,8 +751,8 @@ bool parseData(KexiDB::Parser *p, const char *data);
typedef union YYSTYPE
#line 511 "sqlparser.y"
{
- QString* stringValue;
- Q_LLONG integerValue;
+ TQString* stringValue;
+ TQ_LLONG integerValue;
bool booleanValue;
struct realType realValue;
KexiDB::Field::Type colType;
@@ -763,7 +763,7 @@ typedef union YYSTYPE
KexiDB::QuerySchema *querySchema;
SelectOptionsInternal *selectOptions;
OrderByColumnInternal::List *orderByColumns;
- QVariant *variantValue;
+ TQVariant *variantValue;
}
/* Line 1528 of yacc.c. */
#line 763 "sqlparser.tab.h"
diff --git a/kexi/kexidb/parser/sqlparser.y b/kexi/kexidb/parser/sqlparser.y
index 5a8357f2..426dec48 100644
--- a/kexi/kexidb/parser/sqlparser.y
+++ b/kexi/kexidb/parser/sqlparser.y
@@ -1003,7 +1003,7 @@ aExpr9 '/' aExpr8
aExpr9
;
-/* parenthesis, unary operators, and terminals precedence */
+/* tqparenthesis, unary operators, and terminals precedence */
aExpr9:
/* --- unary logical left --- */
'-' aExpr9
@@ -1201,7 +1201,7 @@ IDENTIFIER
Field *f = item->table()->field(item->name());
if(!f)
{
- ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").arg(item->name()).arg(schema->name()), ctoken, current);
+ ParserError err(i18n("Field List Error"), i18n("Unknown column '%1' in table '%2'").tqarg(item->name()).tqarg(schema->name()), ctoken, current);
parser->setError(err);
yyerror("fieldlisterror");
}
@@ -1360,7 +1360,7 @@ ColWildCard:
{
$$ = new VariableExpr($1);
KexiDBDbg << " Invalid identifier! " << $1 << endl;
- setError(i18n("Invalid identifier \"%1\"").arg($1));
+ setError(i18n("Invalid identifier \"%1\"").tqarg($1));
}*/
;
diff --git a/kexi/kexidb/parser/sqlscanner.cpp b/kexi/kexidb/parser/sqlscanner.cpp
index c3984a39..10fe70a2 100644
--- a/kexi/kexidb/parser/sqlscanner.cpp
+++ b/kexi/kexidb/parser/sqlscanner.cpp
@@ -512,8 +512,8 @@ char *yytext;
#define YY_NO_UNPUT
#define ECOUNT current += yyleng; ctoken = yytext
-extern void setError(const QString& errDesc);
-extern void setError(const QString& errName, const QString& errDesc);
+extern void setError(const TQString& errDesc);
+extern void setError(const TQString& errName, const TQString& errDesc);
/* *** Please reflect changes to this file in ../driver_p.cpp *** */
#define YY_NEVER_INTERACTIVE 1
@@ -822,10 +822,10 @@ YY_RULE_SETUP
#line 91 "sqlscanner.l"
{
//TODO: what about hex or octal values?
- //we're using QString:toLongLong() here because atoll() is not so portable:
+ //we're using TQString:toLongLong() here because atoll() is not so portable:
ECOUNT;
bool ok;
- yylval.integerValue = QString(yytext).toLongLong( &ok );
+ yylval.integerValue = TQString(yytext).toLongLong( &ok );
if (!ok) {
setError(i18n("Invalid integer number"),i18n("This integer number may be too large."));
return SCAN_ERROR;
@@ -1097,7 +1097,7 @@ YY_RULE_SETUP
#line 273 "sqlscanner.l"
{
ECOUNT;
- yylval.stringValue = new QString(QString::fromUtf8(yytext+1, yyleng-2));
+ yylval.stringValue = new TQString(TQString::fromUtf8(yytext+1, yyleng-2));
return CHARACTER_STRING_LITERAL;
/* "ZZZ" sentinel for script */
@@ -1109,7 +1109,7 @@ YY_RULE_SETUP
{
KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
ECOUNT;
- yylval.stringValue = new QString(QString::fromUtf8(yytext, yyleng));
+ yylval.stringValue = new TQString(TQString::fromUtf8(yytext, yyleng));
if (yytext[0]>='0' && yytext[0]<='9') {
setError(i18n("Invalid identifier"),
i18n("Identifiers should start with a letter or '_' character"));
@@ -1124,8 +1124,8 @@ YY_RULE_SETUP
{
KexiDBDbg << "yytext: '" << yytext << "' (" << yyleng << ")" << endl;
ECOUNT;
- yylval.stringValue = new QString(QString::fromUtf8(yytext+1, yyleng-2));
- return QUERY_PARAMETER;
+ yylval.stringValue = new TQString(TQString::fromUtf8(yytext+1, yyleng-2));
+ return TQUERY_PARAMETER;
}
YY_BREAK
case 41:
diff --git a/kexi/kexidb/parser/sqltypes.h b/kexi/kexidb/parser/sqltypes.h
index c0879a3c..52d921e7 100644
--- a/kexi/kexidb/parser/sqltypes.h
+++ b/kexi/kexidb/parser/sqltypes.h
@@ -20,10 +20,10 @@
#ifndef SQLTYPES_H
#define SQLTYPES_H
-#include <qvariant.h>
+#include <tqvariant.h>
extern int current;
-extern QString ctoken;
+extern TQString ctoken;
struct dateType
{
@@ -41,26 +41,26 @@ struct realType
//! @internal
struct OrderByColumnInternal
{
- typedef QValueList<OrderByColumnInternal> List;
- typedef QValueListConstIterator<OrderByColumnInternal> ListConstIterator;
+ typedef TQValueList<OrderByColumnInternal> List;
+ typedef TQValueListConstIterator<OrderByColumnInternal> ListConstIterator;
OrderByColumnInternal()
: columnNumber(-1)
, ascending(true)
{
}
- void setColumnByNameOrNumber(const QVariant& nameOrNumber) {
- if (nameOrNumber.type()==QVariant::String) {
+ void setColumnByNameOrNumber(const TQVariant& nameOrNumber) {
+ if (nameOrNumber.type()==TQVariant::String) {
aliasOrName = nameOrNumber.toString();
columnNumber = -1;
}
else {
columnNumber = nameOrNumber.toInt();
- aliasOrName = QString::null;
+ aliasOrName = TQString();
}
}
- QString aliasOrName; //!< Can include a "tablename." prefix
+ TQString aliasOrName; //!< Can include a "tablename." prefix
int columnNumber; //!< Optional, used instead of aliasOrName to refer to column
//!< by its number rather than name.
bool ascending : 1;