From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/cpp/cppevaluation.cpp | 68 ++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'languages/cpp/cppevaluation.cpp') diff --git a/languages/cpp/cppevaluation.cpp b/languages/cpp/cppevaluation.cpp index ff1f4ab9..b84185f5 100644 --- a/languages/cpp/cppevaluation.cpp +++ b/languages/cpp/cppevaluation.cpp @@ -27,7 +27,7 @@ extern SafetyCounter safetyCounter; namespace CppEvaluation { -void statusLog( const QString& str ) { +void statusLog( const TQString& str ) { ifVerboseMajor( dbgMajor() << str << endl ); statusBarText( str, 2000 ); } @@ -43,41 +43,41 @@ RegisterOperator< IndexOperator > IndexReg( AllOperators ); RegisterOperator< ParenOperator > ParenReg( AllOperators ); template -QValueList convertList( const QValueList& from ) { - QValueList ret; - for( typename QValueList::const_iterator it = from.begin(); it != from.end(); ++it ) { +TQValueList convertList( const TQValueList& from ) { + TQValueList ret; + for( typename TQValueList::const_iterator it = from.begin(); it != from.end(); ++it ) { ret << (To)*it; } return ret; } -QString nameFromType( SimpleType t ) { +TQString nameFromType( SimpleType t ) { return t->fullTypeResolved(); } -QString Operator::printTypeList( QValueList& lst ) +TQString Operator::printTypeList( TQValueList& lst ) { - QString ret; - for( QValueList::iterator it = lst.begin(); it != lst.end(); ++it ) { + TQString ret; + for( TQValueList::iterator it = lst.begin(); it != lst.end(); ++it ) { ret += "\"" + (*it)->fullNameChain() + "\", "; } ret.truncate( ret.length() - 3 ); return ret; } -void Operator::log( const QString& msg ) { +void Operator::log( const TQString& msg ) { statusLog( "\"" + name() + "\": " + msg ); //ifVerboseMajor( dbgMajor() << "\"" << name() << "\": " << msg << endl ); } OperatorSet::~OperatorSet() { - for( QValueList< Operator* >::iterator it = m_operators.begin(); it != m_operators.end(); ++it ) { + for( TQValueList< Operator* >::iterator it = m_operators.begin(); it != m_operators.end(); ++it ) { delete *it; } } -OperatorIdentification OperatorSet::identifyOperator( const QString& str_ , Operator::BindingSide allowedBindings) { - QString str = str_.stripWhiteSpace(); +OperatorIdentification OperatorSet::identifyOperator( const TQString& str_ , Operator::BindingSide allowedBindings) { + TQString str = str_.stripWhiteSpace(); for( OperatorList::iterator it = m_operators.begin(); it != m_operators.end(); ++it ) { if( ((*it)->binding() & allowedBindings) == (*it)->binding() ) { if( OperatorIdentification ident = (*it)->identify( str ) ) { @@ -89,7 +89,7 @@ OperatorIdentification OperatorSet::identifyOperator( const QString& str_ , Oper return OperatorIdentification(); } -OperatorIdentification UnaryOperator::identify( QString& str ) { +OperatorIdentification UnaryOperator::identify( TQString& str ) { OperatorIdentification ret; if( str.startsWith( m_identString ) ) { ret.start = 0; @@ -100,9 +100,9 @@ OperatorIdentification UnaryOperator::identify( QString& str ) { return ret; } -EvaluationResult UnaryOperator::apply( QValueList params, QValueList innerParams ) { +EvaluationResult UnaryOperator::apply( TQValueList params, TQValueList innerParams ) { if( !checkParams( params ) ) { - log( QString("parameter-check failed: %1 params: ").arg( params.size() ) + printTypeList( params ) ); + log( TQString("parameter-check failed: %1 params: ").arg( params.size() ) + printTypeList( params ) ); return EvaluationResult(); } else { EvaluationResult t = unaryApply( params.front(), innerParams ); @@ -116,11 +116,11 @@ EvaluationResult UnaryOperator::apply( QValueList params, QVal } } -EvaluationResult NestedTypeOperator::unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ) { +EvaluationResult NestedTypeOperator::unaryApply( EvaluationResult param, const TQValueList& /*innerParams*/ ) { return param; } -EvaluationResult DotOperator::unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ) { +EvaluationResult DotOperator::unaryApply( EvaluationResult param, const TQValueList& /*innerParams*/ ) { if( param->totalPointerDepth() == 0 ) { return param; } else { @@ -130,7 +130,7 @@ EvaluationResult DotOperator::unaryApply( EvaluationResult param, const QValueLi } -EvaluationResult ArrowOperator::unaryApply( EvaluationResult param, const QValueList& innerParams ) { +EvaluationResult ArrowOperator::unaryApply( EvaluationResult param, const TQValueList& innerParams ) { if( param->totalPointerDepth() == 1 ) { param->setTotalPointerDepth( param->totalPointerDepth() - 1 ); return param; @@ -149,7 +149,7 @@ EvaluationResult ArrowOperator::unaryApply( EvaluationResult param, const QValue }; } -EvaluationResult StarOperator::unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ) { +EvaluationResult StarOperator::unaryApply( EvaluationResult param, const TQValueList& /*innerParams*/ ) { if( param->totalPointerDepth() > 0 ) { param->setTotalPointerDepth( param->totalPointerDepth() - 1 ); return param; @@ -163,14 +163,14 @@ EvaluationResult StarOperator::unaryApply( EvaluationResult param, const QValueL }; } -EvaluationResult AddressOperator::unaryApply( EvaluationResult param, const QValueList& /*innerParams*/ ) { +EvaluationResult AddressOperator::unaryApply( EvaluationResult param, const TQValueList& /*innerParams*/ ) { param->setTotalPointerDepth( param->totalPointerDepth() + 1 ); return param; } -OperatorIdentification UnaryParenOperator::identify( QString& str ) { +OperatorIdentification UnaryParenOperator::identify( TQString& str ) { OperatorIdentification ret; - if( str.startsWith( QString( identString()[0] ) ) ) { + if( str.startsWith( TQString( identString()[0] ) ) ) { ret.start = 0; ret.end = findClose( str, 0 ); if( ret.end == -1 ) { @@ -200,7 +200,7 @@ OperatorIdentification UnaryParenOperator::identify( QString& str ) { } -EvaluationResult IndexOperator::unaryApply( EvaluationResult param, const QValueList& innerParams ) { +EvaluationResult IndexOperator::unaryApply( EvaluationResult param, const TQValueList& innerParams ) { if( param->totalPointerDepth() > 0 ) { param->setTotalPointerDepth( param->totalPointerDepth() - 1 ); return param; @@ -214,7 +214,7 @@ EvaluationResult IndexOperator::unaryApply( EvaluationResult param, const QValue }; } -EvaluationResult ParenOperator::unaryApply( EvaluationResult param, const QValueList& innerParams ) { +EvaluationResult ParenOperator::unaryApply( EvaluationResult param, const TQValueList& innerParams ) { if( param ) { if( param->resolved() ) { return param->resolved()->applyOperator( SimpleTypeImpl::ParenOp, convertList(innerParams) ); @@ -253,7 +253,7 @@ EvaluationResult ExpressionEvaluation::evaluate() { return res; } -EvaluationResult ExpressionEvaluation::evaluateExpressionInternal( QString expr, EvaluationResult scope, SimpleContext * ctx, SimpleContext* innerCtx , bool canBeTypeExpression) { +EvaluationResult ExpressionEvaluation::evaluateExpressionInternal( TQString expr, EvaluationResult scope, SimpleContext * ctx, SimpleContext* innerCtx , bool canBeTypeExpression) { LogDebug d( "#evl#" ); if( expr.isEmpty() || !safetyCounter ) { scope.expr.t = ExpressionInfo::NormalExpression; @@ -270,9 +270,9 @@ EvaluationResult ExpressionEvaluation::evaluateExpressionInternal( QString expr, expr = expr.stripWhiteSpace(); ///Find the rightmost operator with the lowest priority, for the first split. - QValueList idents; + TQValueList idents; for( uint a = 0; a < expr.length(); ++a ) { - QString part = expr.mid( a ); + TQString part = expr.mid( a ); OperatorIdentification ident = m_operators.identifyOperator( part ); if( ident ) { ifVerboseMajor( dbgMajor() << "identified \"" << ident.op->name() << "\" in string " << part << endl ); @@ -292,7 +292,7 @@ EvaluationResult ExpressionEvaluation::evaluateExpressionInternal( QString expr, if( !idents.isEmpty() ) { OperatorIdentification lowest; - for( QValueList::iterator it = idents.begin(); it != idents.end(); ++it ) { + for( TQValueList::iterator it = idents.begin(); it != idents.end(); ++it ) { if( lowest ) { if( lowest.op->priority() >= (*it).op->priority() ) lowest = *it; @@ -302,8 +302,8 @@ EvaluationResult ExpressionEvaluation::evaluateExpressionInternal( QString expr, } if( lowest ) { - QString leftSide = expr.left( lowest.start ).stripWhiteSpace(); - QString rightSide = expr.right( expr.length() - lowest.end ).stripWhiteSpace(); + TQString leftSide = expr.left( lowest.start ).stripWhiteSpace(); + TQString rightSide = expr.right( expr.length() - lowest.end ).stripWhiteSpace(); EvaluationResult left, right; if( !leftSide.isEmpty() ) { @@ -323,12 +323,12 @@ EvaluationResult ExpressionEvaluation::evaluateExpressionInternal( QString expr, ifVerboseMajor( dbgMajor() << "problem while evaluating expression \"" << expr << "\", the operator \"" << lowest.op->name() << "\" has a binding to the right side, but no right side could be evaluated: \"" << rightSide << "\"" << endl ); } - QValueList innerParams; - QValueList params; + TQValueList innerParams; + TQValueList params; if( lowest.op->binding() & Operator::Left ) params << left; if( lowest.op->binding() & Operator::Right ) params << right; - for( QValueList::iterator it = lowest.innerParams.begin(); it != lowest.innerParams.end(); ++it ) { + for( TQValueList::iterator it = lowest.innerParams.begin(); it != lowest.innerParams.end(); ++it ) { ifVerboseMajor(dbgMajor() << "evaluating inner parameter \"" + *it + "\"" ); innerParams << evaluateExpressionInternal( (*it), SimpleType(), innerCtx, innerCtx, lowest.op->canBeType( Operator::Neutral ) ); } @@ -465,7 +465,7 @@ EvaluationResult ExpressionEvaluation::evaluateAtomicExpression( TypeDesc expr, } /*} else { bestRet = EvaluationResult( type ); - QStringList s = split+exprList; + TQStringList s = split+exprList; s.pop_front(); if( !s.isEmpty() ) bestRet->append( new TypeDescShared( s.join("::") ) ); -- cgit v1.2.1