diff options
Diffstat (limited to 'languages/cpp/tag_creator.cpp')
-rw-r--r-- | languages/cpp/tag_creator.cpp | 180 |
1 files changed, 90 insertions, 90 deletions
diff --git a/languages/cpp/tag_creator.cpp b/languages/cpp/tag_creator.cpp index 8ad22d38..15849ad1 100644 --- a/languages/cpp/tag_creator.cpp +++ b/languages/cpp/tag_creator.cpp @@ -17,12 +17,12 @@ #include "driver.h" #include <kdebug.h> -#include <qfileinfo.h> -#include <qregexp.h> +#include <tqfileinfo.h> +#include <tqregexp.h> -DoxyDoc* TagCreator::m_documentation = new DoxyDoc( QStringList() ); +DoxyDoc* TagCreator::m_documentation = new DoxyDoc( TQStringList() ); -TagCreator::TagCreator( const QString& fileName, Catalog* c ) +TagCreator::TagCreator( const TQString& fileName, Catalog* c ) : m_catalog( c ), m_fileName( fileName ), m_anon( 0 ) { } @@ -36,7 +36,7 @@ void TagCreator::destroyDocumentation() delete m_documentation; } -void TagCreator::setDocumentationDirectories( const QStringList& str ) +void TagCreator::setDocumentationDirectories( const TQStringList& str ) { if ( m_documentation ) delete m_documentation; @@ -59,28 +59,28 @@ void TagCreator::parseDeclaration( DeclarationAST* ast ) void TagCreator::parseTranslationUnit( const ParsedFile& ast ) { m_currentScope.clear(); - m_currentAccess = QString::null; + m_currentAccess = TQString::null; m_inSlots = false; m_inSignals = false; m_anon = 0; m_imports.clear(); m_inClass = false; - m_imports << QStringList(); + m_imports << TQStringList(); Tag tag; tag.setKind( Tag::Kind_TranslationUnit ); tag.setFileName( m_fileName ); tag.setName( m_fileName ); - QByteArray data; - QDataStream stream(data, IO_WriteOnly ); + TQByteArray data; + TQDataStream stream(data, IO_WriteOnly ); ast.write( stream ); tag.setAttribute( "cppparsedfile", data ); tag.setAttribute( "includedFrom", ast.includedFrom() ); - tag.setAttribute( "skippedLines", QString("%1").arg( ast.skippedLines()) ); - tag.setAttribute( "macroValueHash", QString("%1").arg( ast.usedMacros().valueHash()) ); - tag.setAttribute( "macroIdHash", QString("%1").arg( ast.usedMacros().idHash() ) ); + tag.setAttribute( "skippedLines", TQString("%1").arg( ast.skippedLines()) ); + tag.setAttribute( "macroValueHash", TQString("%1").arg( ast.usedMacros().valueHash()) ); + tag.setAttribute( "macroIdHash", TQString("%1").arg( ast.usedMacros().idHash() ) ); tag.setScope( m_currentScope ); if( !ast->comment().isEmpty() ) @@ -93,8 +93,8 @@ void TagCreator::parseTranslationUnit( const ParsedFile& ast ) } void TagCreator::parseNamespaceAlias( NamespaceAliasAST* ast ) { - QString nsName; - QString aliasName; + TQString nsName; + TQString aliasName; if( !ast->namespaceName() || ast->namespaceName()->text().isEmpty() ) { @@ -129,7 +129,7 @@ void TagCreator::parseNamespaceAlias( NamespaceAliasAST* ast ) { void TagCreator::parseNamespace( NamespaceAST* ast ) { - QString nsName; + TQString nsName; if( !ast->namespaceName() || ast->namespaceName()->text().isEmpty() ) { // anonymous namespace @@ -166,7 +166,7 @@ void TagCreator::parseElaboratedTypeSpecifier( ElaboratedTypeSpecifierAST* ast ) void TagCreator::parseUsingDirective( UsingDirectiveAST* ast ) { - QString name; + TQString name; if( ast->name() ) name = ast->name()->text(); @@ -196,19 +196,19 @@ void TagCreator::parseTypedef( TypedefAST* ast ) InitDeclaratorListAST* declarators = ast->initDeclaratorList(); if( typeSpec && declarators ){ - QString typeId; + TQString typeId; if( typeSpec->name() ) typeId = typeSpec->name()->text(); - QPtrList<InitDeclaratorAST> l( declarators->initDeclaratorList() ); - QPtrListIterator<InitDeclaratorAST> it( l ); + TQPtrList<InitDeclaratorAST> l( declarators->initDeclaratorList() ); + TQPtrListIterator<InitDeclaratorAST> it( l ); InitDeclaratorAST* initDecl = 0; while( 0 != (initDecl = it.current()) ) { - QString type, id; + TQString type, id; if( initDecl->declarator() ) { type = typeOfDeclaration( typeSpec, initDecl->declarator() ); @@ -272,9 +272,9 @@ void TagCreator::parseSimpleDeclaration( SimpleDeclarationAST* ast ) if( declarators ) { - QPtrList<InitDeclaratorAST> l = declarators->initDeclaratorList(); + TQPtrList<InitDeclaratorAST> l = declarators->initDeclaratorList(); - QPtrListIterator<InitDeclaratorAST> it( l ); + TQPtrListIterator<InitDeclaratorAST> it( l ); while( it.current() ) { parseMyDeclaration( ast->functionSpecifier(), ast->storageSpecifier(), typeSpec, it.current() ); @@ -304,11 +304,11 @@ void TagCreator::parseFunctionDefinition( FunctionDefinitionAST* ast ) if ( funSpec ) { - QPtrList<AST> l = funSpec->nodeList(); - QPtrListIterator<AST> it( l ); + TQPtrList<AST> l = funSpec->nodeList(); + TQPtrListIterator<AST> it( l ); while ( it.current() ) { - QString text = it.current() ->text(); + TQString text = it.current() ->text(); if ( text == "virtual" ) isVirtual = true; else if ( text == "inline" ) @@ -319,11 +319,11 @@ void TagCreator::parseFunctionDefinition( FunctionDefinitionAST* ast ) if ( storageSpec ) { - QPtrList<AST> l = storageSpec->nodeList(); - QPtrListIterator<AST> it( l ); + TQPtrList<AST> l = storageSpec->nodeList(); + TQPtrListIterator<AST> it( l ); while ( it.current() ) { - QString text = it.current() ->text(); + TQString text = it.current() ->text(); if ( text == "friend" ) isFriend = true; else if ( text == "static" ) @@ -333,8 +333,8 @@ void TagCreator::parseFunctionDefinition( FunctionDefinitionAST* ast ) } - QString id = d->declaratorId() ->unqualifiedName() ->text().stripWhiteSpace(); - QString scopeStr = scopeOfDeclarator( d ); + TQString id = d->declaratorId() ->unqualifiedName() ->text().stripWhiteSpace(); + TQString scopeStr = scopeOfDeclarator( d ); Tag tag; if( !comment() ) @@ -345,7 +345,7 @@ void TagCreator::parseFunctionDefinition( FunctionDefinitionAST* ast ) tag.setFileName( m_fileName ); tag.setName( id ); - tag.setScope( QStringList::split( ".", scopeStr ) ); + tag.setScope( TQStringList::split( ".", scopeStr ) ); if( !ast->comment().isEmpty() ) tag.setComment( ast->comment() ); @@ -361,8 +361,8 @@ void TagCreator::parseFunctionDefinition( FunctionDefinitionAST* ast ) parseFunctionArguments( tag, d ); checkTemplateDeclarator( tag ); - QString arguments = tag.attribute( "a" ).toStringList().join( "," ); -tag.setAttribute( "description", m_documentation->functionDescription( scopeStr.replace( QRegExp( "." ), ":" ), id, typeOfDeclaration( typeSpec, d ), arguments ) ); + TQString arguments = tag.attribute( "a" ).toStringList().join( "," ); +tag.setAttribute( "description", m_documentation->functionDescription( scopeStr.replace( TQRegExp( "." ), ":" ), id, typeOfDeclaration( typeSpec, d ), arguments ) ); tagBuilder.setAccess( TagUtils::stringToAccess( m_currentAccess ) ); @@ -386,8 +386,8 @@ tag.setAttribute( "description", m_documentation->functionDescription( scopeStr. void TagCreator::parseLinkageBody( LinkageBodyAST* ast ) { - QPtrList<DeclarationAST> l = ast->declarationList(); - QPtrListIterator<DeclarationAST> it( l ); + TQPtrList<DeclarationAST> l = ast->declarationList(); + TQPtrListIterator<DeclarationAST> it( l ); while ( it.current() ) { parseDeclaration( it.current() ); @@ -411,11 +411,11 @@ void TagCreator::checkTemplateDeclarator( Tag& tag ) { void TagCreator::takeTemplateParams( Tag& target, TemplateDeclarationAST* ast) { TemplateParameterListAST* pl = ast->templateParameterList(); if( pl ) { - QPtrList<TemplateParameterAST> list = pl->templateParameterList(); + TQPtrList<TemplateParameterAST> list = pl->templateParameterList(); TemplateParameterAST* curr = list.first(); while( curr != 0 ) { - QString a, b; + TQString a, b; if( curr->typeParameter() ) { if( curr->typeParameter()->name() ) a = curr->typeParameter()->name()->text(); @@ -437,11 +437,11 @@ void TagCreator::parseClassSpecifier( ClassSpecifierAST* ast ) ast->getStartPosition( &startLine, &startColumn ); ast->getEndPosition( &endLine, &endColumn ); - QString oldAccess = m_currentAccess; + TQString oldAccess = m_currentAccess; bool oldInSlots = m_inSlots; bool oldInSignals = m_inSignals; - QString kind = ast->classKey() ->text(); + TQString kind = ast->classKey() ->text(); if ( kind == "class" ) m_currentAccess = "private"; else @@ -449,11 +449,11 @@ void TagCreator::parseClassSpecifier( ClassSpecifierAST* ast ) m_inSlots = false; m_inSignals = false; - QString className; + TQString className; if ( !ast->name() ) { - //QFileInfo fileInfo( m_fileName ); - //QString shortFileName = fileInfo.baseName(); + //TQFileInfo fileInfo( m_fileName ); + //TQString shortFileName = fileInfo.baseName(); //className.sprintf( "(%s_%d)", shortFileName.local8Bit(), m_anon++ ); } else @@ -470,7 +470,7 @@ void TagCreator::parseClassSpecifier( ClassSpecifierAST* ast ) tag.setFileName( m_fileName ); int i = className.find( '<' ); - QString specialization; + TQString specialization; if( i != -1 ) { specialization = className.mid( i ); @@ -529,11 +529,11 @@ void TagCreator::parseEnumSpecifier( EnumSpecifierAST* ast ) m_catalog->addItem( tag ); - QPtrList<EnumeratorAST> l = ast->enumeratorList(); - QPtrListIterator<EnumeratorAST> it( l ); + TQPtrList<EnumeratorAST> l = ast->enumeratorList(); + TQPtrListIterator<EnumeratorAST> it( l ); while ( it.current() ) { - QString name = it.current() ->id() ->text(); + TQString name = it.current() ->id() ->text(); Tag tag; tag.setKind( Tag::Kind_Enumerator ); @@ -578,13 +578,13 @@ void TagCreator::parseMyDeclaration( GroupAST* funSpec, GroupAST* storageSpec, T while ( t && t->subDeclarator() ) t = t->subDeclarator(); - QString id; + TQString id; if ( t && t->declaratorId() && t->declaratorId() ->unqualifiedName() ) id = t->declaratorId() ->unqualifiedName() ->text(); - QString scopeStr = scopeOfDeclarator( d ); + TQString scopeStr = scopeOfDeclarator( d ); - QString type = typeOfDeclaration( typeSpec, d ); + TQString type = typeOfDeclaration( typeSpec, d ); bool isFriend = false; @@ -595,11 +595,11 @@ void TagCreator::parseMyDeclaration( GroupAST* funSpec, GroupAST* storageSpec, T if ( storageSpec ) { - QPtrList<AST> l = storageSpec->nodeList(); - QPtrListIterator<AST> it( l ); + TQPtrList<AST> l = storageSpec->nodeList(); + TQPtrListIterator<AST> it( l ); while ( it.current() ) { - QString text = it.current() ->text(); + TQString text = it.current() ->text(); if ( text == "friend" ) isFriend = true; else if ( text == "static" ) @@ -614,7 +614,7 @@ void TagCreator::parseMyDeclaration( GroupAST* funSpec, GroupAST* storageSpec, T tag.setKind( Tag::Kind_Variable ); tag.setFileName( m_fileName ); tag.setName( id ); - tag.setScope( QStringList::split( ".", scopeStr ) ); + tag.setScope( TQStringList::split( ".", scopeStr ) ); if( !comment().isEmpty() ) tag.setComment( comment() ); @@ -635,7 +635,7 @@ void TagCreator::parseMyDeclaration( GroupAST* funSpec, GroupAST* storageSpec, T void TagCreator::parseAccessDeclaration( AccessDeclarationAST * access ) { - QPtrList<AST> l = access->accessList(); + TQPtrList<AST> l = access->accessList(); m_currentAccess = l.at( 0 )->text(); if( m_currentAccess == "signals" ) @@ -656,11 +656,11 @@ void TagCreator::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storageS if ( funSpec ) { - QPtrList<AST> l = funSpec->nodeList(); - QPtrListIterator<AST> it( l ); + TQPtrList<AST> l = funSpec->nodeList(); + TQPtrListIterator<AST> it( l ); while ( it.current() ) { - QString text = it.current() ->text(); + TQString text = it.current() ->text(); if ( text == "virtual" ) isVirtual = true; else if ( text == "inline" ) @@ -671,11 +671,11 @@ void TagCreator::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storageS if ( storageSpec ) { - QPtrList<AST> l = storageSpec->nodeList(); - QPtrListIterator<AST> it( l ); + TQPtrList<AST> l = storageSpec->nodeList(); + TQPtrListIterator<AST> it( l ); while ( it.current() ) { - QString text = it.current() ->text(); + TQString text = it.current() ->text(); if ( text == "friend" ) isFriend = true; else if ( text == "static" ) @@ -690,9 +690,9 @@ void TagCreator::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storageS decl->getEndPosition( &endLine, &endColumn ); DeclaratorAST* d = decl->declarator(); - QString id = d->declaratorId() ->unqualifiedName() ->text(); + TQString id = d->declaratorId() ->unqualifiedName() ->text(); - QString type = typeOfDeclaration( typeSpec, d ); + TQString type = typeOfDeclaration( typeSpec, d ); Tag tag; CppFunction<Tag> tagBuilder( tag ); @@ -724,8 +724,8 @@ void TagCreator::parseFunctionDeclaration( GroupAST* funSpec, GroupAST* storageS parseFunctionArguments( tag, d ); checkTemplateDeclarator( tag ); - QString arguments = tag.attribute( "a" ).toStringList().join( "," ); - QString scopeStr = m_currentScope.join( "::" ); + TQString arguments = tag.attribute( "a" ).toStringList().join( "," ); + TQString scopeStr = m_currentScope.join( "::" ); tag.setAttribute( "description", m_documentation->functionDescription( scopeStr, id, type, arguments ) ); m_catalog->addItem( tag ); @@ -735,23 +735,23 @@ void TagCreator::parseFunctionArguments( Tag& tag, DeclaratorAST* declarator ) { ParameterDeclarationClauseAST* clause = declarator->parameterDeclarationClause(); - QStringList types; - QStringList args; + TQStringList types; + TQStringList args; if( clause && clause->parameterDeclarationList() ){ ParameterDeclarationListAST* params = clause->parameterDeclarationList(); - QPtrList<ParameterDeclarationAST> l( params->parameterList() ); - QPtrListIterator<ParameterDeclarationAST> it( l ); + TQPtrList<ParameterDeclarationAST> l( params->parameterList() ); + TQPtrListIterator<ParameterDeclarationAST> it( l ); while( it.current() ){ ParameterDeclarationAST* param = it.current(); ++it; - QString name; + TQString name; if( param->declarator() ){ - name = declaratorToString(param->declarator(), QString::null, true ); + name = declaratorToString(param->declarator(), TQString::null, true ); } - QString type = typeOfDeclaration( param->typeSpec(), param->declarator() ); + TQString type = typeOfDeclaration( param->typeSpec(), param->declarator() ); types << type; args << name; @@ -770,18 +770,18 @@ void TagCreator::parseFunctionArguments( Tag& tag, DeclaratorAST* declarator ) tagBuilder.setArgumentNames( args ); } -QString TagCreator::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator ) +TQString TagCreator::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST* declarator ) { if( !typeSpec || !declarator ) - return QString::null; + return TQString::null; - QString text; + TQString text; text += typeSpec->text(); text = text.simplifyWhiteSpace(); - QPtrList<AST> ptrOpList = declarator->ptrOpList(); - for( QPtrListIterator<AST> it(ptrOpList); it.current(); ++it ) + TQPtrList<AST> ptrOpList = declarator->ptrOpList(); + for( TQPtrListIterator<AST> it(ptrOpList); it.current(); ++it ) text += it.current()->text(); for( int a = 0; a < declarator->arrayDimensionList().count(); a++ ) @@ -790,22 +790,22 @@ QString TagCreator::typeOfDeclaration( TypeSpecifierAST* typeSpec, DeclaratorAST return text; } -void TagCreator::parseBaseClause( const QString& className, BaseClauseAST * baseClause ) +void TagCreator::parseBaseClause( const TQString& className, BaseClauseAST * baseClause ) { - QPtrList<BaseSpecifierAST> l = baseClause->baseSpecifierList(); - QPtrListIterator<BaseSpecifierAST> it( l ); + TQPtrList<BaseSpecifierAST> l = baseClause->baseSpecifierList(); + TQPtrListIterator<BaseSpecifierAST> it( l ); while ( it.current() ) { BaseSpecifierAST * baseSpecifier = it.current(); - QString access; + TQString access; if ( baseSpecifier->access() ) access = baseSpecifier->access() ->text(); bool isVirtual = baseSpecifier->isVirtual() != 0; if( baseSpecifier->name() == 0 ) return; ///Workaround for some bug elsewhere - QString baseName; + TQString baseName; if ( baseSpecifier->name() ) baseName = baseSpecifier->name() ->text(); @@ -834,15 +834,15 @@ void TagCreator::parseBaseClause( const QString& className, BaseClauseAST * base } } -QString TagCreator::scopeOfDeclarator( DeclaratorAST* d ) +TQString TagCreator::scopeOfDeclarator( DeclaratorAST* d ) { - QStringList scope = m_currentScope; + TQStringList scope = m_currentScope; if ( d && d->declaratorId() && d->declaratorId() ->classOrNamespaceNameList().count() ) { if ( d->declaratorId() ->isGlobal() ) scope.clear(); - QPtrList<ClassOrNamespaceNameAST> l = d->declaratorId() ->classOrNamespaceNameList(); - QPtrListIterator<ClassOrNamespaceNameAST> it( l ); + TQPtrList<ClassOrNamespaceNameAST> l = d->declaratorId() ->classOrNamespaceNameList(); + TQPtrListIterator<ClassOrNamespaceNameAST> it( l ); while ( it.current() ) { if ( it.current() ->name() ) @@ -855,9 +855,9 @@ QString TagCreator::scopeOfDeclarator( DeclaratorAST* d ) return scope.join( "." ); } -int TagUtils::stringToAccess( const QString & access ) +int TagUtils::stringToAccess( const TQString & access ) { - QStringList l = QStringList() + TQStringList l = TQStringList() << "public" << "protected" << "private" << "public slots" << "protected slots" << "private slots" << "signals"; @@ -866,11 +866,11 @@ int TagUtils::stringToAccess( const QString & access ) return idx == -1 ? 0 : idx+1; } -QString TagUtils::accessToString( int id ) +TQString TagUtils::accessToString( int id ) { if( id == 0 ) return "unknown"; - QStringList l = QStringList() + TQStringList l = TQStringList() << "public" << "protected" << "private" << "public slots" << "protected slots" << "private slots" << "signals"; @@ -878,7 +878,7 @@ QString TagUtils::accessToString( int id ) if( l.at(id-1) != l.end() ) return l[ id-1 ]; - return QString::null; + return TQString::null; } //kate: indent-mode csands; tab-width 4; space-indent off; |