summaryrefslogtreecommitdiffstats
path: root/src/rpnmuncher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpnmuncher.cpp')
-rw-r--r--src/rpnmuncher.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/rpnmuncher.cpp b/src/rpnmuncher.cpp
index 191196a..94cbd92 100644
--- a/src/rpnmuncher.cpp
+++ b/src/rpnmuncher.cpp
@@ -21,10 +21,10 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qvaluestack.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqvaluestack.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
#include "rpnmuncher.h"
#include "valuemanager.h"
@@ -37,7 +37,7 @@ class Operand
{
public:
Operand() : m_isValue(true), m_value(0) { }
- Operand(const QString &ident) : m_isValue(false), m_text(ident) { }
+ Operand(const TQString &ident) : m_isValue(false), m_text(ident) { }
Operand(Abakus::number_t value) : m_isValue(true), m_value(value) { }
Abakus::number_t value() const
@@ -53,19 +53,19 @@ class Operand
return value();
}
- QString text() const { return m_text; }
+ TQString text() const { return m_text; }
private:
bool m_isValue;
- QString m_text;
+ TQString m_text;
Abakus::number_t m_value;
};
typedef enum { Number = 256, Func, Ident, Power, Set, Remove, Pop, Clear, Unknown } Token;
-static int tokenize (const QString &token);
+static int tokenize (const TQString &token);
-QString RPNParser::m_errorStr;
+TQString RPNParser::m_errorStr;
bool RPNParser::m_error(false);
OperandStack RPNParser::m_stack;
@@ -77,9 +77,9 @@ struct Counter
}
};
-Abakus::number_t RPNParser::rpnParseString(const QString &text)
+Abakus::number_t RPNParser::rpnParseString(const TQString &text)
{
- QStringList tokens = QStringList::split(QRegExp("\\s"), text);
+ TQStringList tokens = TQStringList::split(TQRegExp("\\s"), text);
Counter counter; // Will update stack count when we leave proc.
(void) counter; // Avoid warnings about it being unused.
@@ -89,9 +89,9 @@ Abakus::number_t RPNParser::rpnParseString(const QString &text)
Function *fn = 0;
m_error = false;
- m_errorStr = QString::null;
+ m_errorStr = TQString();
- for(QStringList::ConstIterator it = tokens.begin(); it != tokens.end(); ++it) {
+ for(TQStringList::ConstIterator it = tokens.begin(); it != tokens.end(); ++it) {
switch(tokenize(*it))
{
case Number:
@@ -115,7 +115,7 @@ Abakus::number_t RPNParser::rpnParseString(const QString &text)
case Func:
if(m_stack.count() < 1) {
m_error = true;
- m_errorStr = i18n("Insufficient operands for function %1").arg(*it);
+ m_errorStr = i18n("Insufficient operands for function %1").tqarg(*it);
return Abakus::number_t::nan();
}
@@ -150,7 +150,7 @@ Abakus::number_t RPNParser::rpnParseString(const QString &text)
case Unknown:
m_error = true;
- m_errorStr = i18n("Unknown token %1").arg(*it);
+ m_errorStr = i18n("Unknown token %1").tqarg(*it);
return Abakus::number_t::nan();
break;
@@ -226,7 +226,7 @@ Abakus::number_t RPNParser::rpnParseString(const QString &text)
return m_stack.top();
}
-static int tokenize (const QString &token)
+static int tokenize (const TQString &token)
{
bool isOK;
@@ -252,13 +252,13 @@ static int tokenize (const QString &token)
if(token.lower() == "remove")
return Remove;
- if(QRegExp("^\\w+$").search(token) != -1 &&
- QRegExp("\\d").search(token) == -1)
+ if(TQRegExp("^\\w+$").search(token) != -1 &&
+ TQRegExp("\\d").search(token) == -1)
{
return Ident;
}
- if(QRegExp("^[-+*/=]$").search(token) != -1)
+ if(TQRegExp("^[-+*/=]$").search(token) != -1)
return token[0];
return Unknown;