diff options
Diffstat (limited to 'src/evaluator.cpp')
-rw-r--r-- | src/evaluator.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/evaluator.cpp b/src/evaluator.cpp index 138e12f..68a21a6 100644 --- a/src/evaluator.cpp +++ b/src/evaluator.cpp @@ -24,11 +24,11 @@ #include "node.h" // For parser_yacc.hpp below #include "parser_yacc.hpp" -#include <qapplication.h> -#include <qmap.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluevector.h> +#include <tqapplication.h> +#include <tqmap.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluevector.h> #include <kdebug.h> @@ -44,15 +44,15 @@ Evaluator::~Evaluator() { } -void Evaluator::setExpression(const QString &expr) +void Evaluator::setExpression(const TQString &expr) { kdError() << k_funcinfo << " not implemented.\n"; } -QString Evaluator::expression() const +TQString Evaluator::expression() const { kdError() << k_funcinfo << " not implemented.\n"; - return QString(); + return TQString(); } void Evaluator::clear() @@ -72,7 +72,7 @@ Tokens Evaluator::tokens() const return Tokens(); } -Tokens Evaluator::scan(const QString &expr) +Tokens Evaluator::scan(const TQString &expr) { Lexer l(expr); Tokens tokens; @@ -118,7 +118,7 @@ Tokens Evaluator::scan(const QString &expr) return tokens; } -QString Evaluator::error() const +TQString Evaluator::error() const { kdError() << k_funcinfo << " not implemented.\n"; return "No Error Yet"; @@ -133,14 +133,14 @@ const Token Token::null; // helper function: return operator of given token text // e.g. "*" yields Operator::Asterisk, and so on -static Token::Op matchOperator( const QString& text ) +static Token::Op matchOperator( const TQString& text ) { Token::Op result = Token::InvalidOp; if( text.length() == 1 ) { - QChar p = text[0]; - switch( p.unicode() ) + TQChar p = text[0]; + switch( p.tqunicode() ) { case '+': result = Token::Plus; break; case '-': result = Token::Minus; break; @@ -165,7 +165,7 @@ static Token::Op matchOperator( const QString& text ) } // creates a token -Token::Token( Type type, const QString& text, int pos ) +Token::Token( Type type, const TQString& text, int pos ) { m_type = type; m_text = text; @@ -203,9 +203,9 @@ Token::Op Token::asOperator() const else return InvalidOp; } -QString Token::description() const +TQString Token::description() const { - QString desc; + TQString desc; switch (m_type ) { @@ -217,24 +217,24 @@ QString Token::description() const while( desc.length() < 10 ) desc.prepend( ' ' ); desc.prepend( " " ); - desc.prepend( QString::number( m_pos ) ); + desc.prepend( TQString::number( m_pos ) ); desc.append( " : " ).append( m_text ); return desc; } -QString Evaluator::autoFix( const QString& expr ) +TQString Evaluator::autoFix( const TQString& expr ) { int par = 0; - QString result; + TQString result; // strip off all funny characters for( unsigned c = 0; c < expr.length(); c++ ) - if( expr[c] >= QChar(32) ) + if( expr[c] >= TQChar(32) ) result.append( expr[c] ); - // automagically close all parenthesis + // automagically close all tqparenthesis Tokens tokens = Evaluator::scan( result ); for( unsigned i=0; i<tokens.count(); i++ ) if( tokens[i].asOperator() == Token::LeftPar ) par++; |