summaryrefslogtreecommitdiffstats
path: root/languages/cpp/cppevaluation.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /languages/cpp/cppevaluation.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz
tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/cppevaluation.cpp')
-rw-r--r--languages/cpp/cppevaluation.cpp68
1 files changed, 34 insertions, 34 deletions
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<class To, class From>
-QValueList<To> convertList( const QValueList<From>& from ) {
- QValueList<To> ret;
- for( typename QValueList<From>::const_iterator it = from.begin(); it != from.end(); ++it ) {
+TQValueList<To> convertList( const TQValueList<From>& from ) {
+ TQValueList<To> ret;
+ for( typename TQValueList<From>::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<EvaluationResult>& lst )
+TQString Operator::printTypeList( TQValueList<EvaluationResult>& lst )
{
- QString ret;
- for( QValueList<EvaluationResult>::iterator it = lst.begin(); it != lst.end(); ++it ) {
+ TQString ret;
+ for( TQValueList<EvaluationResult>::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<EvaluationResult> params, QValueList<EvaluationResult> innerParams ) {
+EvaluationResult UnaryOperator::apply( TQValueList<EvaluationResult> params, TQValueList<EvaluationResult> 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<EvaluationResult> params, QVal
}
}
-EvaluationResult NestedTypeOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ ) {
+EvaluationResult NestedTypeOperator::unaryApply( EvaluationResult param, const TQValueList<EvaluationResult>& /*innerParams*/ ) {
return param;
}
-EvaluationResult DotOperator::unaryApply( EvaluationResult param, const QValueList<EvaluationResult>& /*innerParams*/ ) {
+EvaluationResult DotOperator::unaryApply( EvaluationResult param, const TQValueList<EvaluationResult>& /*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<EvaluationResult>& innerParams ) {
+EvaluationResult ArrowOperator::unaryApply( EvaluationResult param, const TQValueList<EvaluationResult>& 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<EvaluationResult>& /*innerParams*/ ) {
+EvaluationResult StarOperator::unaryApply( EvaluationResult param, const TQValueList<EvaluationResult>& /*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<EvaluationResult>& /*innerParams*/ ) {
+EvaluationResult AddressOperator::unaryApply( EvaluationResult param, const TQValueList<EvaluationResult>& /*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<EvaluationResult>& innerParams ) {
+EvaluationResult IndexOperator::unaryApply( EvaluationResult param, const TQValueList<EvaluationResult>& 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<EvaluationResult>& innerParams ) {
+EvaluationResult ParenOperator::unaryApply( EvaluationResult param, const TQValueList<EvaluationResult>& innerParams ) {
if( param ) {
if( param->resolved() ) {
return param->resolved()->applyOperator( SimpleTypeImpl::ParenOp, convertList<LocateResult>(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<OperatorIdentification> idents;
+ TQValueList<OperatorIdentification> 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<OperatorIdentification>::iterator it = idents.begin(); it != idents.end(); ++it ) {
+ for( TQValueList<OperatorIdentification>::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<EvaluationResult> innerParams;
- QValueList<EvaluationResult> params;
+ TQValueList<EvaluationResult> innerParams;
+ TQValueList<EvaluationResult> params;
if( lowest.op->binding() & Operator::Left ) params << left;
if( lowest.op->binding() & Operator::Right ) params << right;
- for( QValueList<QString>::iterator it = lowest.innerParams.begin(); it != lowest.innerParams.end(); ++it ) {
+ for( TQValueList<TQString>::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("::") ) );