Replace auto_ptr

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/37/head
Michele Calgaro 4 months ago
parent b0c86264e0
commit a120985048
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -80,8 +80,8 @@ void KBCatalogListViewItem::setup()
widthChanged(); widthChanged();
m_doc_msgid.reset(0); m_doc_msgid.reset();
m_doc_msgstr.reset(0); m_doc_msgstr.reset();
makeDocAvailable(); makeDocAvailable();
@ -170,7 +170,7 @@ void KBCatalogListViewItem::paintMsgStrCell(TQPainter* p, const TQColorGroup& cg
void KBCatalogListViewItem::paintCell(TQPainter* p, const TQColorGroup& cg, void KBCatalogListViewItem::paintCell(TQPainter* p, const TQColorGroup& cg,
int column, int width, int align) int column, int width, int align)
{ {
assert(m_doc_msgid.get() && m_doc_msgstr.get() && p); assert(m_doc_msgid && m_doc_msgstr && p);
// paint background (empty text) // paint background (empty text)
@ -191,7 +191,7 @@ void KBCatalogListViewItem::paintCell(TQPainter* p, const TQColorGroup& cg,
void KBCatalogListViewItem::makeDocAvailable() void KBCatalogListViewItem::makeDocAvailable()
{ {
if (m_doc_msgid.get() && m_doc_msgstr.get()) if (m_doc_msgid && m_doc_msgstr)
return; return;
assert(listView()); assert(listView());

@ -65,8 +65,8 @@ private:
TQString m_msgid; TQString m_msgid;
TQString m_msgstr; TQString m_msgstr;
std::auto_ptr<TQSimpleRichText> m_doc_msgid; std::unique_ptr<TQSimpleRichText> m_doc_msgid;
std::auto_ptr<TQSimpleRichText> m_doc_msgstr; std::unique_ptr<TQSimpleRichText> m_doc_msgstr;
}; };
#endif #endif

@ -211,13 +211,13 @@ void NameAST::setGlobal( bool b )
void NameAST::setUnqualifiedName( ClassOrNamespaceNameAST::Node& unqualifiedName ) void NameAST::setUnqualifiedName( ClassOrNamespaceNameAST::Node& unqualifiedName )
{ {
m_unqualifiedName = unqualifiedName; m_unqualifiedName = std::move(unqualifiedName);
if( m_unqualifiedName.get() ) m_unqualifiedName->setParent( this ); if( m_unqualifiedName ) m_unqualifiedName->setParent( this );
} }
void NameAST::addClassOrNamespaceName( ClassOrNamespaceNameAST::Node& classOrNamespaceName ) void NameAST::addClassOrNamespaceName( ClassOrNamespaceNameAST::Node& classOrNamespaceName )
{ {
if( !classOrNamespaceName.get() ) if( !classOrNamespaceName )
return; return;
classOrNamespaceName->setParent( this ); classOrNamespaceName->setParent( this );
@ -226,7 +226,7 @@ void NameAST::addClassOrNamespaceName( ClassOrNamespaceNameAST::Node& classOrNam
TQString NameAST::text() const TQString NameAST::text() const
{ {
if( !m_unqualifiedName.get() ) if( !m_unqualifiedName )
return TQString(); return TQString();
TQString str; TQString str;
@ -241,7 +241,7 @@ TQString NameAST::text() const
++it; ++it;
} }
if( m_unqualifiedName.get() ) if( m_unqualifiedName )
str += m_unqualifiedName->text(); str += m_unqualifiedName->text();
return str; return str;
@ -260,7 +260,7 @@ LinkageBodyAST::LinkageBodyAST()
void LinkageBodyAST::addDeclaration( DeclarationAST::Node& ast ) void LinkageBodyAST::addDeclaration( DeclarationAST::Node& ast )
{ {
if( !ast.get() ) if( !ast )
return; return;
ast->setParent( this ); ast->setParent( this );
@ -274,20 +274,20 @@ LinkageSpecificationAST::LinkageSpecificationAST()
void LinkageSpecificationAST::setExternType( AST::Node& externType ) void LinkageSpecificationAST::setExternType( AST::Node& externType )
{ {
m_externType = externType; m_externType = std::move(externType);
if( m_externType.get() ) m_externType->setParent( this ); if( m_externType ) m_externType->setParent( this );
} }
void LinkageSpecificationAST::setLinkageBody( LinkageBodyAST::Node& linkageBody ) void LinkageSpecificationAST::setLinkageBody( LinkageBodyAST::Node& linkageBody )
{ {
m_linkageBody = linkageBody; m_linkageBody = std::move(linkageBody);
if( m_linkageBody.get() ) m_linkageBody->setParent( this ); if( m_linkageBody ) m_linkageBody->setParent( this );
} }
void LinkageSpecificationAST::setDeclaration( DeclarationAST::Node& decl ) void LinkageSpecificationAST::setDeclaration( DeclarationAST::Node& decl )
{ {
m_declaration = decl; m_declaration = std::move(decl);
if( m_declaration.get() ) m_declaration->setParent( this ); if( m_declaration ) m_declaration->setParent( this );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -299,7 +299,7 @@ TranslationUnitAST::TranslationUnitAST()
void TranslationUnitAST::addDeclaration( DeclarationAST::Node& ast ) void TranslationUnitAST::addDeclaration( DeclarationAST::Node& ast )
{ {
if( !ast.get() ) if( !ast )
return; return;
ast->setParent( this ); ast->setParent( this );
@ -313,14 +313,14 @@ NamespaceAST::NamespaceAST()
void NamespaceAST::setNamespaceName( AST::Node& namespaceName ) void NamespaceAST::setNamespaceName( AST::Node& namespaceName )
{ {
m_namespaceName = namespaceName; m_namespaceName = std::move(namespaceName);
if( m_namespaceName.get() ) m_namespaceName->setParent( this ); if( m_namespaceName ) m_namespaceName->setParent( this );
} }
void NamespaceAST::setLinkageBody( LinkageBodyAST::Node& linkageBody ) void NamespaceAST::setLinkageBody( LinkageBodyAST::Node& linkageBody )
{ {
m_linkageBody = linkageBody; m_linkageBody = std::move(linkageBody);
if( m_linkageBody.get() ) m_linkageBody->setParent( this ); if( m_linkageBody ) m_linkageBody->setParent( this );
} }
@ -331,14 +331,14 @@ NamespaceAliasAST::NamespaceAliasAST()
void NamespaceAliasAST::setNamespaceName( AST::Node& namespaceName ) void NamespaceAliasAST::setNamespaceName( AST::Node& namespaceName )
{ {
m_namespaceName = namespaceName; m_namespaceName = std::move(namespaceName);
if( m_namespaceName.get() ) m_namespaceName->setParent( this ); if( m_namespaceName ) m_namespaceName->setParent( this );
} }
void NamespaceAliasAST::setAliasName( NameAST::Node& name ) void NamespaceAliasAST::setAliasName( NameAST::Node& name )
{ {
m_aliasName = name; m_aliasName = std::move(name);
if( m_aliasName.get() ) m_aliasName->setParent( this ); if( m_aliasName ) m_aliasName->setParent( this );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -348,14 +348,14 @@ UsingAST::UsingAST()
void UsingAST::setTypeName( AST::Node& typeName ) void UsingAST::setTypeName( AST::Node& typeName )
{ {
m_typeName = typeName; m_typeName = std::move(typeName);
if( m_typeName.get() ) m_typeName->setParent( this ); if( m_typeName ) m_typeName->setParent( this );
} }
void UsingAST::setName( NameAST::Node& name ) void UsingAST::setName( NameAST::Node& name )
{ {
m_name = name; m_name = std::move(name);
if( m_name.get() ) m_name->setParent( this ); if( m_name ) m_name->setParent( this );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -365,8 +365,8 @@ UsingDirectiveAST::UsingDirectiveAST()
void UsingDirectiveAST::setName( NameAST::Node& name ) void UsingDirectiveAST::setName( NameAST::Node& name )
{ {
m_name = name; m_name = std::move(name);
if( m_name.get() ) m_name->setParent( this ); if( m_name ) m_name->setParent( this );
} }
TypedefAST::TypedefAST() TypedefAST::TypedefAST()
@ -375,20 +375,20 @@ TypedefAST::TypedefAST()
void TypeSpecifierAST::setName( NameAST::Node& name ) void TypeSpecifierAST::setName( NameAST::Node& name )
{ {
m_name = name; m_name = std::move(name);
if( m_name.get() ) m_name->setParent( this ); if( m_name ) m_name->setParent( this );
} }
void TypedefAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec ) void TypedefAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
{ {
m_typeSpec = typeSpec; m_typeSpec = std::move(typeSpec);
if( m_typeSpec.get() ) m_typeSpec->setParent( this ); if( m_typeSpec ) m_typeSpec->setParent( this );
} }
void TypedefAST::setInitDeclaratorList( InitDeclaratorListAST::Node& initDeclaratorList ) void TypedefAST::setInitDeclaratorList( InitDeclaratorListAST::Node& initDeclaratorList )
{ {
m_initDeclaratorList = initDeclaratorList; m_initDeclaratorList = std::move(initDeclaratorList);
if( m_initDeclaratorList.get() ) m_initDeclaratorList->setParent( this ); if( m_initDeclaratorList ) m_initDeclaratorList->setParent( this );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -399,7 +399,7 @@ TemplateArgumentListAST::TemplateArgumentListAST()
void TemplateArgumentListAST::addArgument( AST::Node& arg ) void TemplateArgumentListAST::addArgument( AST::Node& arg )
{ {
if( !arg.get() ) if( !arg )
return; return;
arg->setParent( this ); arg->setParent( this );
@ -426,20 +426,20 @@ TemplateDeclarationAST::TemplateDeclarationAST()
void TemplateDeclarationAST::setExported( AST::Node& exported ) void TemplateDeclarationAST::setExported( AST::Node& exported )
{ {
m_exported = exported; m_exported = std::move(exported);
if( m_exported.get() ) m_exported->setParent( this ); if( m_exported ) m_exported->setParent( this );
} }
void TemplateDeclarationAST::setTemplateParameterList( TemplateParameterListAST::Node& templateParameterList ) void TemplateDeclarationAST::setTemplateParameterList( TemplateParameterListAST::Node& templateParameterList )
{ {
m_templateParameterList = templateParameterList; m_templateParameterList = std::move(templateParameterList);
if( m_templateParameterList.get() ) m_templateParameterList->setParent( this ); if( m_templateParameterList ) m_templateParameterList->setParent( this );
} }
void TemplateDeclarationAST::setDeclaration( DeclarationAST::Node& declaration ) void TemplateDeclarationAST::setDeclaration( DeclarationAST::Node& declaration )
{ {
m_declaration = declaration; m_declaration = std::move(declaration);
if( m_declaration.get() ) m_declaration->setParent( this ); if( m_declaration ) m_declaration->setParent( this );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -449,23 +449,23 @@ ClassOrNamespaceNameAST::ClassOrNamespaceNameAST()
void ClassOrNamespaceNameAST::setName( AST::Node& name ) void ClassOrNamespaceNameAST::setName( AST::Node& name )
{ {
m_name = name; m_name = std::move(name);
if( m_name.get() ) m_name->setParent( this ); if( m_name ) m_name->setParent( this );
} }
void ClassOrNamespaceNameAST::setTemplateArgumentList( TemplateArgumentListAST::Node& templateArgumentList ) void ClassOrNamespaceNameAST::setTemplateArgumentList( TemplateArgumentListAST::Node& templateArgumentList )
{ {
m_templateArgumentList = templateArgumentList; m_templateArgumentList = std::move(templateArgumentList);
if( m_templateArgumentList.get() ) m_templateArgumentList->setParent( this ); if( m_templateArgumentList ) m_templateArgumentList->setParent( this );
} }
TQString ClassOrNamespaceNameAST::text() const TQString ClassOrNamespaceNameAST::text() const
{ {
if( !m_name.get() ) if( !m_name )
return TQString(); return TQString();
TQString str = m_name->text(); TQString str = m_name->text();
if( m_templateArgumentList.get() ) if( m_templateArgumentList )
str += TQString::fromLatin1("< ") + m_templateArgumentList->text() + TQString::fromLatin1(" >"); str += TQString::fromLatin1("< ") + m_templateArgumentList->text() + TQString::fromLatin1(" >");
return str; return str;
@ -478,27 +478,27 @@ TypeSpecifierAST::TypeSpecifierAST()
void TypeSpecifierAST::setCvQualify( GroupAST::Node& cvQualify ) void TypeSpecifierAST::setCvQualify( GroupAST::Node& cvQualify )
{ {
m_cvQualify = cvQualify; m_cvQualify = std::move(cvQualify);
if( m_cvQualify.get() ) m_cvQualify->setParent( this ); if( m_cvQualify ) m_cvQualify->setParent( this );
} }
void TypeSpecifierAST::setCv2Qualify( GroupAST::Node& cv2Qualify ) void TypeSpecifierAST::setCv2Qualify( GroupAST::Node& cv2Qualify )
{ {
m_cv2Qualify = cv2Qualify; m_cv2Qualify = std::move(cv2Qualify);
if( m_cv2Qualify.get() ) m_cv2Qualify->setParent( this ); if( m_cv2Qualify ) m_cv2Qualify->setParent( this );
} }
TQString TypeSpecifierAST::text() const TQString TypeSpecifierAST::text() const
{ {
TQString str; TQString str;
if( m_cvQualify.get() ) if( m_cvQualify )
str += m_cvQualify->text() + ' '; str += m_cvQualify->text() + ' ';
if( m_name.get() ) if( m_name )
str += m_name->text(); str += m_name->text();
if( m_cv2Qualify.get() ) if( m_cv2Qualify )
str += TQString(" ") + m_cv2Qualify->text(); str += TQString(" ") + m_cv2Qualify->text();
return str; return str;
@ -512,13 +512,13 @@ ClassSpecifierAST::ClassSpecifierAST()
void ClassSpecifierAST::setClassKey( AST::Node& classKey ) void ClassSpecifierAST::setClassKey( AST::Node& classKey )
{ {
m_classKey = classKey; m_classKey = std::move(classKey);
if( m_classKey.get() ) m_classKey->setParent( this ); if( m_classKey ) m_classKey->setParent( this );
} }
void ClassSpecifierAST::addDeclaration( DeclarationAST::Node& declaration ) void ClassSpecifierAST::addDeclaration( DeclarationAST::Node& declaration )
{ {
if( !declaration.get() ) if( !declaration )
return; return;
declaration->setParent( this ); declaration->setParent( this );
@ -527,8 +527,8 @@ void ClassSpecifierAST::addDeclaration( DeclarationAST::Node& declaration )
void ClassSpecifierAST::setBaseClause( BaseClauseAST::Node& baseClause ) void ClassSpecifierAST::setBaseClause( BaseClauseAST::Node& baseClause )
{ {
m_baseClause = baseClause; m_baseClause = std::move(baseClause);
if( m_baseClause.get() ) m_baseClause->setParent( this ); if( m_baseClause ) m_baseClause->setParent( this );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -539,7 +539,7 @@ EnumSpecifierAST::EnumSpecifierAST()
void EnumSpecifierAST::addEnumerator( EnumeratorAST::Node& enumerator ) void EnumSpecifierAST::addEnumerator( EnumeratorAST::Node& enumerator )
{ {
if( !enumerator.get() ) if( !enumerator )
return; return;
enumerator->setParent( this ); enumerator->setParent( this );
@ -554,13 +554,13 @@ ElaboratedTypeSpecifierAST::ElaboratedTypeSpecifierAST()
void ElaboratedTypeSpecifierAST::setKind( AST::Node& kind ) void ElaboratedTypeSpecifierAST::setKind( AST::Node& kind )
{ {
m_kind = kind; m_kind = std::move(kind);
if( m_kind.get() ) m_kind->setParent( this ); if( m_kind ) m_kind->setParent( this );
} }
TQString ElaboratedTypeSpecifierAST::text() const TQString ElaboratedTypeSpecifierAST::text() const
{ {
if( m_kind.get() ) if( m_kind )
return m_kind->text() + ' ' + TypeSpecifierAST::text(); return m_kind->text() + ' ' + TypeSpecifierAST::text();
return TypeSpecifierAST::text(); return TypeSpecifierAST::text();
@ -578,14 +578,14 @@ EnumeratorAST::EnumeratorAST()
void EnumeratorAST::setId( AST::Node& id ) void EnumeratorAST::setId( AST::Node& id )
{ {
m_id = id; m_id = std::move(id);
if( m_id.get() ) m_id->setParent( this ); if( m_id ) m_id->setParent( this );
} }
void EnumeratorAST::setExpr( AST::Node& expr ) void EnumeratorAST::setExpr( AST::Node& expr )
{ {
m_expr = expr; m_expr = std::move(expr);
if( m_expr.get() ) m_expr->setParent( this ); if( m_expr ) m_expr->setParent( this );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -596,7 +596,7 @@ BaseClauseAST::BaseClauseAST()
void BaseClauseAST::addBaseSpecifier( BaseSpecifierAST::Node& baseSpecifier ) void BaseClauseAST::addBaseSpecifier( BaseSpecifierAST::Node& baseSpecifier )
{ {
if( !baseSpecifier.get() ) if( !baseSpecifier )
return; return;
baseSpecifier->setParent( this ); baseSpecifier->setParent( this );
@ -610,20 +610,20 @@ BaseSpecifierAST::BaseSpecifierAST()
void BaseSpecifierAST::setIsVirtual( AST::Node& isVirtual ) void BaseSpecifierAST::setIsVirtual( AST::Node& isVirtual )
{ {
m_isVirtual = isVirtual; m_isVirtual = std::move(isVirtual);
if( m_isVirtual.get() ) m_isVirtual->setParent( this ); if( m_isVirtual ) m_isVirtual->setParent( this );
} }
void BaseSpecifierAST::setAccess( AST::Node& access ) void BaseSpecifierAST::setAccess( AST::Node& access )
{ {
m_access = access; m_access = std::move(access);
if( m_access.get() ) m_access->setParent( this ); if( m_access ) m_access->setParent( this );
} }
void BaseSpecifierAST::setName( NameAST::Node& name ) void BaseSpecifierAST::setName( NameAST::Node& name )
{ {
m_name = name; m_name = std::move(name);
if( m_name.get() ) m_name->setParent( this ); if( m_name ) m_name->setParent( this );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -633,32 +633,32 @@ SimpleDeclarationAST::SimpleDeclarationAST()
void SimpleDeclarationAST::setFunctionSpecifier( GroupAST::Node& functionSpecifier ) void SimpleDeclarationAST::setFunctionSpecifier( GroupAST::Node& functionSpecifier )
{ {
m_functionSpecifier = functionSpecifier; m_functionSpecifier = std::move(functionSpecifier);
if( m_functionSpecifier.get() ) m_functionSpecifier->setParent( this ); if( m_functionSpecifier ) m_functionSpecifier->setParent( this );
} }
void SimpleDeclarationAST::setStorageSpecifier( GroupAST::Node& storageSpecifier ) void SimpleDeclarationAST::setStorageSpecifier( GroupAST::Node& storageSpecifier )
{ {
m_storageSpecifier = storageSpecifier; m_storageSpecifier = std::move(storageSpecifier);
if( m_storageSpecifier.get() ) m_storageSpecifier->setParent( this ); if( m_storageSpecifier ) m_storageSpecifier->setParent( this );
} }
void SimpleDeclarationAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec ) void SimpleDeclarationAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
{ {
m_typeSpec = typeSpec; m_typeSpec = std::move(typeSpec);
if( m_typeSpec.get() ) m_typeSpec->setParent( this ); if( m_typeSpec ) m_typeSpec->setParent( this );
} }
void SimpleDeclarationAST::setInitDeclaratorList( InitDeclaratorListAST::Node& initDeclaratorList ) void SimpleDeclarationAST::setInitDeclaratorList( InitDeclaratorListAST::Node& initDeclaratorList )
{ {
m_initDeclaratorList = initDeclaratorList; m_initDeclaratorList = std::move(initDeclaratorList);
if( m_initDeclaratorList.get() ) m_initDeclaratorList->setParent( this ); if( m_initDeclaratorList ) m_initDeclaratorList->setParent( this );
} }
void SimpleDeclarationAST::setWinDeclSpec( GroupAST::Node& winDeclSpec ) void SimpleDeclarationAST::setWinDeclSpec( GroupAST::Node& winDeclSpec )
{ {
m_winDeclSpec = winDeclSpec; m_winDeclSpec = std::move(winDeclSpec);
if( m_winDeclSpec.get() ) m_winDeclSpec->setParent( this ); if( m_winDeclSpec ) m_winDeclSpec->setParent( this );
} }
@ -670,7 +670,7 @@ InitDeclaratorListAST::InitDeclaratorListAST()
void InitDeclaratorListAST::addInitDeclarator( InitDeclaratorAST::Node& decl ) void InitDeclaratorListAST::addInitDeclarator( InitDeclaratorAST::Node& decl )
{ {
if( !decl.get() ) if( !decl )
return; return;
decl->setParent( this ); decl->setParent( this );
@ -686,52 +686,52 @@ DeclaratorAST::DeclaratorAST()
void DeclaratorAST::setSubDeclarator( DeclaratorAST::Node& subDeclarator ) void DeclaratorAST::setSubDeclarator( DeclaratorAST::Node& subDeclarator )
{ {
m_subDeclarator = subDeclarator; m_subDeclarator = std::move(subDeclarator);
if( m_subDeclarator.get() ) m_subDeclarator->setParent( this ); if( m_subDeclarator ) m_subDeclarator->setParent( this );
} }
void DeclaratorAST::setDeclaratorId( NameAST::Node& declaratorId ) void DeclaratorAST::setDeclaratorId( NameAST::Node& declaratorId )
{ {
m_declaratorId = declaratorId; m_declaratorId = std::move(declaratorId);
if( m_declaratorId.get() ) m_declaratorId->setParent( this ); if( m_declaratorId ) m_declaratorId->setParent( this );
} }
void DeclaratorAST::setBitfieldInitialization( AST::Node& bitfieldInitialization ) void DeclaratorAST::setBitfieldInitialization( AST::Node& bitfieldInitialization )
{ {
m_bitfieldInitialization = bitfieldInitialization; m_bitfieldInitialization = std::move(bitfieldInitialization);
if( m_bitfieldInitialization.get() ) m_bitfieldInitialization->setParent( this ); if( m_bitfieldInitialization ) m_bitfieldInitialization->setParent( this );
} }
void DeclaratorAST::addArrayDimension( AST::Node& arrayDimension ) void DeclaratorAST::addArrayDimension( AST::Node& arrayDimension )
{ {
if( !arrayDimension.get() ) if( !arrayDimension )
return; return;
arrayDimension->setParent( this ); arrayDimension->setParent( this );
m_arrayDimensionList.append( arrayDimension.release() ); m_arrayDimensionList.append( arrayDimension.release() );
} }
void DeclaratorAST::setParameterDeclarationClause( std::auto_ptr<class ParameterDeclarationClauseAST>& parameterDeclarationClause ) void DeclaratorAST::setParameterDeclarationClause( std::unique_ptr<class ParameterDeclarationClauseAST>& parameterDeclarationClause )
{ {
m_parameterDeclarationClause = parameterDeclarationClause; m_parameterDeclarationClause = std::move(parameterDeclarationClause);
if( m_parameterDeclarationClause.get() ) m_parameterDeclarationClause->setParent( this ); if( m_parameterDeclarationClause ) m_parameterDeclarationClause->setParent( this );
} }
void DeclaratorAST::setConstant( AST::Node& constant ) void DeclaratorAST::setConstant( AST::Node& constant )
{ {
m_constant = constant; m_constant = std::move(constant);
if( m_constant.get() ) m_constant->setParent( this ); if( m_constant ) m_constant->setParent( this );
} }
void DeclaratorAST::setExceptionSpecification( GroupAST::Node& exceptionSpecification ) void DeclaratorAST::setExceptionSpecification( GroupAST::Node& exceptionSpecification )
{ {
m_exceptionSpecification = exceptionSpecification; m_exceptionSpecification = std::move(exceptionSpecification);
if( m_exceptionSpecification.get() ) m_exceptionSpecification->setParent( this ); if( m_exceptionSpecification ) m_exceptionSpecification->setParent( this );
} }
void DeclaratorAST::addPtrOp( AST::Node& ptrOp ) void DeclaratorAST::addPtrOp( AST::Node& ptrOp )
{ {
if( !ptrOp.get() ) if( !ptrOp )
return; return;
ptrOp->setParent( this ); ptrOp->setParent( this );
@ -745,14 +745,14 @@ InitDeclaratorAST::InitDeclaratorAST()
void InitDeclaratorAST::setDeclarator( DeclaratorAST::Node& declarator ) void InitDeclaratorAST::setDeclarator( DeclaratorAST::Node& declarator )
{ {
m_declarator = declarator; m_declarator = std::move(declarator);
if( m_declarator.get() ) m_declarator->setParent( this ); if( m_declarator ) m_declarator->setParent( this );
} }
void InitDeclaratorAST::setInitializer( AST::Node& initializer ) void InitDeclaratorAST::setInitializer( AST::Node& initializer )
{ {
m_initializer = initializer; m_initializer = std::move(initializer);
if( m_initializer.get() ) m_initializer->setParent( this ); if( m_initializer ) m_initializer->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -762,38 +762,38 @@ FunctionDefinitionAST::FunctionDefinitionAST()
void FunctionDefinitionAST::setFunctionSpecifier( GroupAST::Node& functionSpecifier ) void FunctionDefinitionAST::setFunctionSpecifier( GroupAST::Node& functionSpecifier )
{ {
m_functionSpecifier = functionSpecifier; m_functionSpecifier = std::move(functionSpecifier);
if( m_functionSpecifier.get() ) m_functionSpecifier->setParent( this ); if( m_functionSpecifier ) m_functionSpecifier->setParent( this );
} }
void FunctionDefinitionAST::setStorageSpecifier( GroupAST::Node& storageSpecifier ) void FunctionDefinitionAST::setStorageSpecifier( GroupAST::Node& storageSpecifier )
{ {
m_storageSpecifier = storageSpecifier; m_storageSpecifier = std::move(storageSpecifier);
if( m_storageSpecifier.get() ) m_storageSpecifier->setParent( this ); if( m_storageSpecifier ) m_storageSpecifier->setParent( this );
} }
void FunctionDefinitionAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec ) void FunctionDefinitionAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
{ {
m_typeSpec = typeSpec; m_typeSpec = std::move(typeSpec);
if( m_typeSpec.get() ) m_typeSpec->setParent( this ); if( m_typeSpec ) m_typeSpec->setParent( this );
} }
void FunctionDefinitionAST::setInitDeclarator( InitDeclaratorAST::Node& initDeclarator ) void FunctionDefinitionAST::setInitDeclarator( InitDeclaratorAST::Node& initDeclarator )
{ {
m_initDeclarator = initDeclarator; m_initDeclarator = std::move(initDeclarator);
if( m_initDeclarator.get() ) m_initDeclarator->setParent( this ); if( m_initDeclarator ) m_initDeclarator->setParent( this );
} }
void FunctionDefinitionAST::setFunctionBody( StatementListAST::Node& functionBody ) void FunctionDefinitionAST::setFunctionBody( StatementListAST::Node& functionBody )
{ {
m_functionBody = functionBody; m_functionBody = std::move(functionBody);
if( m_functionBody.get() ) m_functionBody->setParent( this ); if( m_functionBody ) m_functionBody->setParent( this );
} }
void FunctionDefinitionAST::setWinDeclSpec( GroupAST::Node& winDeclSpec ) void FunctionDefinitionAST::setWinDeclSpec( GroupAST::Node& winDeclSpec )
{ {
m_winDeclSpec = winDeclSpec; m_winDeclSpec = std::move(winDeclSpec);
if( m_winDeclSpec.get() ) m_winDeclSpec->setParent( this ); if( m_winDeclSpec ) m_winDeclSpec->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -804,7 +804,7 @@ StatementListAST::StatementListAST()
void StatementListAST::addStatement( StatementAST::Node& statement ) void StatementListAST::addStatement( StatementAST::Node& statement )
{ {
if( !statement.get() ) if( !statement )
return; return;
statement->setParent( this ); statement->setParent( this );
@ -818,20 +818,20 @@ IfStatementAST::IfStatementAST()
void IfStatementAST::setCondition( ConditionAST::Node& condition ) void IfStatementAST::setCondition( ConditionAST::Node& condition )
{ {
m_condition = condition; m_condition = std::move(condition);
if( m_condition.get() ) m_condition->setParent( this ); if( m_condition ) m_condition->setParent( this );
} }
void IfStatementAST::setStatement( StatementAST::Node& statement ) void IfStatementAST::setStatement( StatementAST::Node& statement )
{ {
m_statement = statement; m_statement = std::move(statement);
if( m_statement.get() ) m_statement->setParent( this ); if( m_statement ) m_statement->setParent( this );
} }
void IfStatementAST::setElseStatement( StatementAST::Node& elseStatement ) void IfStatementAST::setElseStatement( StatementAST::Node& elseStatement )
{ {
m_elseStatement = elseStatement; m_elseStatement = std::move(elseStatement);
if( m_elseStatement.get() ) m_elseStatement->setParent( this ); if( m_elseStatement ) m_elseStatement->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -841,14 +841,14 @@ WhileStatementAST::WhileStatementAST()
void WhileStatementAST::setCondition( ConditionAST::Node& condition ) void WhileStatementAST::setCondition( ConditionAST::Node& condition )
{ {
m_condition = condition; m_condition = std::move(condition);
if( m_condition.get() ) m_condition->setParent( this ); if( m_condition ) m_condition->setParent( this );
} }
void WhileStatementAST::setStatement( StatementAST::Node& statement ) void WhileStatementAST::setStatement( StatementAST::Node& statement )
{ {
m_statement = statement; m_statement = std::move(statement);
if( m_statement.get() ) m_statement->setParent( this ); if( m_statement ) m_statement->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -858,14 +858,14 @@ DoStatementAST::DoStatementAST()
void DoStatementAST::setCondition( ConditionAST::Node& condition ) void DoStatementAST::setCondition( ConditionAST::Node& condition )
{ {
m_condition = condition; m_condition = std::move(condition);
if( m_condition.get() ) m_condition->setParent( this ); if( m_condition ) m_condition->setParent( this );
} }
void DoStatementAST::setStatement( StatementAST::Node& statement ) void DoStatementAST::setStatement( StatementAST::Node& statement )
{ {
m_statement = statement; m_statement = std::move(statement);
if( m_statement.get() ) m_statement->setParent( this ); if( m_statement ) m_statement->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -875,26 +875,26 @@ ForStatementAST::ForStatementAST()
void ForStatementAST::setCondition( ConditionAST::Node& condition ) void ForStatementAST::setCondition( ConditionAST::Node& condition )
{ {
m_condition = condition; m_condition = std::move(condition);
if( m_condition.get() ) m_condition->setParent( this ); if( m_condition ) m_condition->setParent( this );
} }
void ForStatementAST::setExpression( AST::Node& expression ) void ForStatementAST::setExpression( AST::Node& expression )
{ {
m_expression = expression; m_expression = std::move(expression);
if( m_expression.get() ) m_expression->setParent( this ); if( m_expression ) m_expression->setParent( this );
} }
void ForStatementAST::setStatement( StatementAST::Node& statement ) void ForStatementAST::setStatement( StatementAST::Node& statement )
{ {
m_statement = statement; m_statement = std::move(statement);
if( m_statement.get() ) m_statement->setParent( this ); if( m_statement ) m_statement->setParent( this );
} }
void ForStatementAST::setInitStatement( StatementAST::Node& initStatement ) void ForStatementAST::setInitStatement( StatementAST::Node& initStatement )
{ {
m_initStatement = initStatement; m_initStatement = std::move(initStatement);
if( m_initStatement.get() ) m_initStatement->setParent( this ); if( m_initStatement ) m_initStatement->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -904,14 +904,14 @@ SwitchStatementAST::SwitchStatementAST()
void SwitchStatementAST::setCondition( ConditionAST::Node& condition ) void SwitchStatementAST::setCondition( ConditionAST::Node& condition )
{ {
m_condition = condition; m_condition = std::move(condition);
if( m_condition.get() ) m_condition->setParent( this ); if( m_condition ) m_condition->setParent( this );
} }
void SwitchStatementAST::setStatement( StatementAST::Node& statement ) void SwitchStatementAST::setStatement( StatementAST::Node& statement )
{ {
m_statement = statement; m_statement = std::move(statement);
if( m_statement.get() ) m_statement->setParent( this ); if( m_statement ) m_statement->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -921,8 +921,8 @@ DeclarationStatementAST::DeclarationStatementAST()
void DeclarationStatementAST::setDeclaration( DeclarationAST::Node& declaration ) void DeclarationStatementAST::setDeclaration( DeclarationAST::Node& declaration )
{ {
m_declaration = declaration; m_declaration = std::move(declaration);
if( m_declaration.get() ) m_declaration->setParent( this ); if( m_declaration ) m_declaration->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -932,8 +932,8 @@ ExpressionStatementAST::ExpressionStatementAST()
void ExpressionStatementAST::setExpression( AST::Node& expression ) void ExpressionStatementAST::setExpression( AST::Node& expression )
{ {
m_expression = expression; m_expression = std::move(expression);
if( m_expression.get() ) m_expression->setParent( this ); if( m_expression ) m_expression->setParent( this );
} }
@ -944,32 +944,32 @@ ParameterDeclarationAST::ParameterDeclarationAST()
void ParameterDeclarationAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec ) void ParameterDeclarationAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
{ {
m_typeSpec = typeSpec; m_typeSpec = std::move(typeSpec);
if( m_typeSpec.get() ) m_typeSpec->setParent( this ); if( m_typeSpec ) m_typeSpec->setParent( this );
} }
void ParameterDeclarationAST::setDeclarator( DeclaratorAST::Node& declarator ) void ParameterDeclarationAST::setDeclarator( DeclaratorAST::Node& declarator )
{ {
m_declarator = declarator; m_declarator = std::move(declarator);
if( m_declarator.get() ) m_declarator->setParent( this ); if( m_declarator ) m_declarator->setParent( this );
} }
void ParameterDeclarationAST::setExpression( AST::Node& expression ) void ParameterDeclarationAST::setExpression( AST::Node& expression )
{ {
m_expression = expression; m_expression = std::move(expression);
if( m_expression.get() ) m_expression->setParent( this ); if( m_expression ) m_expression->setParent( this );
} }
TQString ParameterDeclarationAST::text() const TQString ParameterDeclarationAST::text() const
{ {
TQString str; TQString str;
if( m_typeSpec.get() ) if( m_typeSpec )
str += m_typeSpec->text() + ' '; str += m_typeSpec->text() + ' ';
if( m_declarator.get() ) if( m_declarator )
str += m_declarator->text(); str += m_declarator->text();
if( m_expression.get() ) if( m_expression )
str += TQString( " = " ) + m_expression->text(); str += TQString( " = " ) + m_expression->text();
return str; return str;
@ -983,7 +983,7 @@ ParameterDeclarationListAST::ParameterDeclarationListAST()
void ParameterDeclarationListAST::addParameter( ParameterDeclarationAST::Node& parameter ) void ParameterDeclarationListAST::addParameter( ParameterDeclarationAST::Node& parameter )
{ {
if( !parameter.get() ) if( !parameter )
return; return;
parameter->setParent( this ); parameter->setParent( this );
@ -1011,24 +1011,24 @@ ParameterDeclarationClauseAST::ParameterDeclarationClauseAST()
void ParameterDeclarationClauseAST::setParameterDeclarationList( ParameterDeclarationListAST::Node& parameterDeclarationList ) void ParameterDeclarationClauseAST::setParameterDeclarationList( ParameterDeclarationListAST::Node& parameterDeclarationList )
{ {
m_parameterDeclarationList = parameterDeclarationList; m_parameterDeclarationList = std::move(parameterDeclarationList);
if( m_parameterDeclarationList.get() ) m_parameterDeclarationList->setParent( this ); if( m_parameterDeclarationList ) m_parameterDeclarationList->setParent( this );
} }
void ParameterDeclarationClauseAST::setEllipsis( AST::Node& ellipsis ) void ParameterDeclarationClauseAST::setEllipsis( AST::Node& ellipsis )
{ {
m_ellipsis = ellipsis; m_ellipsis = std::move(ellipsis);
if( m_ellipsis.get() ) m_ellipsis->setParent( this ); if( m_ellipsis ) m_ellipsis->setParent( this );
} }
TQString ParameterDeclarationClauseAST::text() const TQString ParameterDeclarationClauseAST::text() const
{ {
TQString str; TQString str;
if( m_parameterDeclarationList.get() ) if( m_parameterDeclarationList )
str += m_parameterDeclarationList->text(); str += m_parameterDeclarationList->text();
if( m_ellipsis.get() ) if( m_ellipsis )
str += " ..."; str += " ...";
return str; return str;
@ -1043,7 +1043,7 @@ GroupAST::GroupAST()
void GroupAST::addNode( AST::Node& node ) void GroupAST::addNode( AST::Node& node )
{ {
if( !node.get() ) if( !node )
return; return;
node->setParent( this ); node->setParent( this );
@ -1071,7 +1071,7 @@ AccessDeclarationAST::AccessDeclarationAST()
void AccessDeclarationAST::addAccess( AST::Node& access ) void AccessDeclarationAST::addAccess( AST::Node& access )
{ {
if( !access.get() ) if( !access )
return; return;
access->setParent( this ); access->setParent( this );
@ -1098,26 +1098,26 @@ TypeParameterAST::TypeParameterAST()
void TypeParameterAST::setKind( AST::Node& kind ) void TypeParameterAST::setKind( AST::Node& kind )
{ {
m_kind = kind; m_kind = std::move(kind);
if( m_kind.get() ) m_kind->setParent( this ); if( m_kind ) m_kind->setParent( this );
} }
void TypeParameterAST::setTemplateParameterList( std::auto_ptr<class TemplateParameterListAST>& templateParameterList ) void TypeParameterAST::setTemplateParameterList( std::unique_ptr<class TemplateParameterListAST>& templateParameterList )
{ {
m_templateParameterList = templateParameterList; m_templateParameterList = std::move(templateParameterList);
if( m_templateParameterList.get() ) m_templateParameterList->setParent( this ); if( m_templateParameterList ) m_templateParameterList->setParent( this );
} }
void TypeParameterAST::setName( NameAST::Node& name ) void TypeParameterAST::setName( NameAST::Node& name )
{ {
m_name = name; m_name = std::move(name);
if( m_name.get() ) m_name->setParent( this ); if( m_name ) m_name->setParent( this );
} }
void TypeParameterAST::setTypeId( AST::Node& typeId ) void TypeParameterAST::setTypeId( AST::Node& typeId )
{ {
m_typeId = typeId; m_typeId = std::move(typeId);
if( m_typeId.get() ) m_typeId->setParent( this ); if( m_typeId ) m_typeId->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -1127,14 +1127,14 @@ TemplateParameterAST::TemplateParameterAST()
void TemplateParameterAST::setTypeParameter( TypeParameterAST::Node& typeParameter ) void TemplateParameterAST::setTypeParameter( TypeParameterAST::Node& typeParameter )
{ {
m_typeParameter = typeParameter; m_typeParameter = std::move(typeParameter);
if( m_typeParameter.get() ) m_typeParameter->setParent( this ); if( m_typeParameter ) m_typeParameter->setParent( this );
} }
void TemplateParameterAST::setTypeValueParameter( ParameterDeclarationAST::Node& typeValueParameter ) void TemplateParameterAST::setTypeValueParameter( ParameterDeclarationAST::Node& typeValueParameter )
{ {
m_typeValueParameter = typeValueParameter; m_typeValueParameter = std::move(typeValueParameter);
if( m_typeValueParameter.get() ) m_typeValueParameter->setParent( this ); if( m_typeValueParameter ) m_typeValueParameter->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -1145,7 +1145,7 @@ TemplateParameterListAST::TemplateParameterListAST()
void TemplateParameterListAST::addTemplateParameter( TemplateParameterAST::Node& templateParameter ) void TemplateParameterListAST::addTemplateParameter( TemplateParameterAST::Node& templateParameter )
{ {
if( !templateParameter.get() ) if( !templateParameter )
return; return;
templateParameter->setParent( this ); templateParameter->setParent( this );
@ -1159,25 +1159,25 @@ ConditionAST::ConditionAST()
void ConditionAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec ) void ConditionAST::setTypeSpec( TypeSpecifierAST::Node& typeSpec )
{ {
m_typeSpec = typeSpec; m_typeSpec = std::move(typeSpec);
if( m_typeSpec.get() ) m_typeSpec->setParent( this ); if( m_typeSpec ) m_typeSpec->setParent( this );
} }
void ConditionAST::setDeclarator( DeclaratorAST::Node& declarator ) void ConditionAST::setDeclarator( DeclaratorAST::Node& declarator )
{ {
m_declarator = declarator; m_declarator = std::move(declarator);
if( m_declarator.get() ) m_declarator->setParent( this ); if( m_declarator ) m_declarator->setParent( this );
} }
void ConditionAST::setExpression( AST::Node& expression ) void ConditionAST::setExpression( AST::Node& expression )
{ {
m_expression = expression; m_expression = std::move(expression);
if( m_expression.get() ) m_expression->setParent( this ); if( m_expression ) m_expression->setParent( this );
} }
void ClassSpecifierAST::setWinDeclSpec( GroupAST::Node & winDeclSpec ) void ClassSpecifierAST::setWinDeclSpec( GroupAST::Node & winDeclSpec )
{ {
m_winDeclSpec = winDeclSpec; m_winDeclSpec = std::move(winDeclSpec);
if( m_winDeclSpec.get() ) m_winDeclSpec->setParent( this ); if( m_winDeclSpec ) m_winDeclSpec->setParent( this );
} }

@ -124,7 +124,7 @@ struct Slice
class AST class AST
{ {
public: public:
typedef std::auto_ptr<AST> Node; typedef std::unique_ptr<AST> Node;
enum { Type=NodeType_Generic }; enum { Type=NodeType_Generic };
DECLARE_ALLOC( AST ) DECLARE_ALLOC( AST )
@ -192,7 +192,7 @@ private:
class GroupAST: public AST class GroupAST: public AST
{ {
public: public:
typedef std::auto_ptr<GroupAST> Node; typedef std::unique_ptr<GroupAST> Node;
enum { Type = NodeType_Group }; enum { Type = NodeType_Group };
DECLARE_ALLOC( GroupAST ) DECLARE_ALLOC( GroupAST )
@ -217,7 +217,7 @@ private:
class TemplateArgumentListAST: public AST class TemplateArgumentListAST: public AST
{ {
public: public:
typedef std::auto_ptr<TemplateArgumentListAST> Node; typedef std::unique_ptr<TemplateArgumentListAST> Node;
enum { Type = NodeType_TemplateArgumentList }; enum { Type = NodeType_TemplateArgumentList };
DECLARE_ALLOC( TemplateArgumentListAST ) DECLARE_ALLOC( TemplateArgumentListAST )
@ -241,7 +241,7 @@ private:
class ClassOrNamespaceNameAST: public AST class ClassOrNamespaceNameAST: public AST
{ {
public: public:
typedef std::auto_ptr<ClassOrNamespaceNameAST> Node; typedef std::unique_ptr<ClassOrNamespaceNameAST> Node;
enum { Type = NodeType_ClassOrNamespaceName }; enum { Type = NodeType_ClassOrNamespaceName };
DECLARE_ALLOC( ClassOrNamespaceNameAST ) DECLARE_ALLOC( ClassOrNamespaceNameAST )
@ -269,7 +269,7 @@ private:
class NameAST: public AST class NameAST: public AST
{ {
public: public:
typedef std::auto_ptr<NameAST> Node; typedef std::unique_ptr<NameAST> Node;
enum { Type = NodeType_Name }; enum { Type = NodeType_Name };
DECLARE_ALLOC( NameAST ) DECLARE_ALLOC( NameAST )
@ -301,7 +301,7 @@ private:
class TypeParameterAST: public AST class TypeParameterAST: public AST
{ {
public: public:
typedef std::auto_ptr<TypeParameterAST> Node; typedef std::unique_ptr<TypeParameterAST> Node;
enum { Type = NodeType_TypeParameter }; enum { Type = NodeType_TypeParameter };
DECLARE_ALLOC( TypeParameterAST ) DECLARE_ALLOC( TypeParameterAST )
@ -313,7 +313,7 @@ public:
void setKind( AST::Node& kind ); void setKind( AST::Node& kind );
class TemplateParameterListAST* templateParameterList() { return m_templateParameterList.get(); } class TemplateParameterListAST* templateParameterList() { return m_templateParameterList.get(); }
void setTemplateParameterList( std::auto_ptr<class TemplateParameterListAST>& templateParameterList ); void setTemplateParameterList( std::unique_ptr<class TemplateParameterListAST>& templateParameterList );
NameAST* name() { return m_name.get(); } NameAST* name() { return m_name.get(); }
void setName( NameAST::Node& name ); void setName( NameAST::Node& name );
@ -323,7 +323,7 @@ public:
private: private:
AST::Node m_kind; AST::Node m_kind;
std::auto_ptr<class TemplateParameterListAST> m_templateParameterList; std::unique_ptr<class TemplateParameterListAST> m_templateParameterList;
NameAST::Node m_name; NameAST::Node m_name;
AST::Node m_typeId; AST::Node m_typeId;
@ -335,7 +335,7 @@ private:
class DeclarationAST: public AST class DeclarationAST: public AST
{ {
public: public:
typedef std::auto_ptr<DeclarationAST> Node; typedef std::unique_ptr<DeclarationAST> Node;
enum { Type = NodeType_Declaration }; enum { Type = NodeType_Declaration };
DECLARE_ALLOC( DeclarationAST ) DECLARE_ALLOC( DeclarationAST )
@ -351,7 +351,7 @@ private:
class AccessDeclarationAST: public DeclarationAST class AccessDeclarationAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<AccessDeclarationAST> Node; typedef std::unique_ptr<AccessDeclarationAST> Node;
enum { Type = NodeType_AccessDeclaration }; enum { Type = NodeType_AccessDeclaration };
DECLARE_ALLOC( AccessDeclarationAST ) DECLARE_ALLOC( AccessDeclarationAST )
@ -375,7 +375,7 @@ private:
class TypeSpecifierAST: public AST class TypeSpecifierAST: public AST
{ {
public: public:
typedef std::auto_ptr<TypeSpecifierAST> Node; typedef std::unique_ptr<TypeSpecifierAST> Node;
enum { Type = NodeType_TypeSpecifier }; enum { Type = NodeType_TypeSpecifier };
DECLARE_ALLOC( TypeSpecifierAST ) DECLARE_ALLOC( TypeSpecifierAST )
@ -407,7 +407,7 @@ private:
class BaseSpecifierAST: public AST class BaseSpecifierAST: public AST
{ {
public: public:
typedef std::auto_ptr<BaseSpecifierAST> Node; typedef std::unique_ptr<BaseSpecifierAST> Node;
enum { Type = NodeType_BaseSpecifier }; enum { Type = NodeType_BaseSpecifier };
DECLARE_ALLOC( BaseSpecifierAST ) DECLARE_ALLOC( BaseSpecifierAST )
@ -437,7 +437,7 @@ private:
class BaseClauseAST: public AST class BaseClauseAST: public AST
{ {
public: public:
typedef std::auto_ptr<BaseClauseAST> Node; typedef std::unique_ptr<BaseClauseAST> Node;
enum { Type = NodeType_BaseClause }; enum { Type = NodeType_BaseClause };
DECLARE_ALLOC( BaseClauseAST ) DECLARE_ALLOC( BaseClauseAST )
@ -459,7 +459,7 @@ private:
class ClassSpecifierAST: public TypeSpecifierAST class ClassSpecifierAST: public TypeSpecifierAST
{ {
public: public:
typedef std::auto_ptr<ClassSpecifierAST> Node; typedef std::unique_ptr<ClassSpecifierAST> Node;
enum { Type = NodeType_ClassSpecifier }; enum { Type = NodeType_ClassSpecifier };
DECLARE_ALLOC( ClassSpecifierAST ) DECLARE_ALLOC( ClassSpecifierAST )
@ -493,7 +493,7 @@ private:
class EnumeratorAST: public AST class EnumeratorAST: public AST
{ {
public: public:
typedef std::auto_ptr<EnumeratorAST> Node; typedef std::unique_ptr<EnumeratorAST> Node;
enum { Type = NodeType_Enumerator }; enum { Type = NodeType_Enumerator };
DECLARE_ALLOC( EnumeratorAST ) DECLARE_ALLOC( EnumeratorAST )
@ -519,7 +519,7 @@ private:
class EnumSpecifierAST: public TypeSpecifierAST class EnumSpecifierAST: public TypeSpecifierAST
{ {
public: public:
typedef std::auto_ptr<EnumSpecifierAST> Node; typedef std::unique_ptr<EnumSpecifierAST> Node;
enum { Type = NodeType_EnumSpecifier }; enum { Type = NodeType_EnumSpecifier };
DECLARE_ALLOC( EnumSpecifierAST ) DECLARE_ALLOC( EnumSpecifierAST )
@ -541,7 +541,7 @@ private:
class ElaboratedTypeSpecifierAST: public TypeSpecifierAST class ElaboratedTypeSpecifierAST: public TypeSpecifierAST
{ {
public: public:
typedef std::auto_ptr<ElaboratedTypeSpecifierAST> Node; typedef std::unique_ptr<ElaboratedTypeSpecifierAST> Node;
enum { Type = NodeType_ElaboratedTypeSpecifier }; enum { Type = NodeType_ElaboratedTypeSpecifier };
DECLARE_ALLOC( ElaboratedTypeSpecifierAST ) DECLARE_ALLOC( ElaboratedTypeSpecifierAST )
@ -566,7 +566,7 @@ private:
class LinkageBodyAST: public AST class LinkageBodyAST: public AST
{ {
public: public:
typedef std::auto_ptr<LinkageBodyAST> Node; typedef std::unique_ptr<LinkageBodyAST> Node;
enum { Type = NodeType_LinkageBody }; enum { Type = NodeType_LinkageBody };
DECLARE_ALLOC( LinkageBodyAST ) DECLARE_ALLOC( LinkageBodyAST )
@ -588,7 +588,7 @@ private:
class LinkageSpecificationAST: public DeclarationAST class LinkageSpecificationAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<LinkageSpecificationAST> Node; typedef std::unique_ptr<LinkageSpecificationAST> Node;
enum { Type = NodeType_LinkageSpecification }; enum { Type = NodeType_LinkageSpecification };
DECLARE_ALLOC( LinkageSpecificationAST ) DECLARE_ALLOC( LinkageSpecificationAST )
@ -618,7 +618,7 @@ private:
class NamespaceAST: public DeclarationAST class NamespaceAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<NamespaceAST> Node; typedef std::unique_ptr<NamespaceAST> Node;
enum { Type = NodeType_Namespace }; enum { Type = NodeType_Namespace };
DECLARE_ALLOC( NamespaceAST ) DECLARE_ALLOC( NamespaceAST )
@ -644,7 +644,7 @@ private:
class NamespaceAliasAST: public DeclarationAST class NamespaceAliasAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<NamespaceAliasAST> Node; typedef std::unique_ptr<NamespaceAliasAST> Node;
enum { Type = NodeType_NamespaceAlias }; enum { Type = NodeType_NamespaceAlias };
DECLARE_ALLOC( NamespaceAliasAST ) DECLARE_ALLOC( NamespaceAliasAST )
@ -670,7 +670,7 @@ private:
class UsingAST: public DeclarationAST class UsingAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<UsingAST> Node; typedef std::unique_ptr<UsingAST> Node;
enum { Type = NodeType_Using }; enum { Type = NodeType_Using };
DECLARE_ALLOC( UsingAST ) DECLARE_ALLOC( UsingAST )
@ -696,7 +696,7 @@ private:
class UsingDirectiveAST: public DeclarationAST class UsingDirectiveAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<UsingDirectiveAST> Node; typedef std::unique_ptr<UsingDirectiveAST> Node;
enum { Type = NodeType_UsingDirective }; enum { Type = NodeType_UsingDirective };
DECLARE_ALLOC( UsingDirectiveAST ) DECLARE_ALLOC( UsingDirectiveAST )
@ -718,7 +718,7 @@ private:
class DeclaratorAST: public AST class DeclaratorAST: public AST
{ {
public: public:
typedef std::auto_ptr<DeclaratorAST> Node; typedef std::unique_ptr<DeclaratorAST> Node;
enum { Type = NodeType_Declarator }; enum { Type = NodeType_Declarator };
DECLARE_ALLOC( DeclaratorAST ) DECLARE_ALLOC( DeclaratorAST )
@ -742,7 +742,7 @@ public:
void addArrayDimension( AST::Node& arrayDimension ); void addArrayDimension( AST::Node& arrayDimension );
class ParameterDeclarationClauseAST* parameterDeclarationClause() { return m_parameterDeclarationClause.get(); } class ParameterDeclarationClauseAST* parameterDeclarationClause() { return m_parameterDeclarationClause.get(); }
void setParameterDeclarationClause( std::auto_ptr<class ParameterDeclarationClauseAST>& parameterDeclarationClause ); void setParameterDeclarationClause( std::unique_ptr<class ParameterDeclarationClauseAST>& parameterDeclarationClause );
// ### replace 'constant' with cvQualify // ### replace 'constant' with cvQualify
AST* constant() { return m_constant.get(); } AST* constant() { return m_constant.get(); }
@ -757,7 +757,7 @@ private:
NameAST::Node m_declaratorId; NameAST::Node m_declaratorId;
AST::Node m_bitfieldInitialization; AST::Node m_bitfieldInitialization;
TQPtrList<AST> m_arrayDimensionList; TQPtrList<AST> m_arrayDimensionList;
std::auto_ptr<class ParameterDeclarationClauseAST> m_parameterDeclarationClause; std::unique_ptr<class ParameterDeclarationClauseAST> m_parameterDeclarationClause;
AST::Node m_constant; AST::Node m_constant;
GroupAST::Node m_exceptionSpecification; GroupAST::Node m_exceptionSpecification;
@ -769,7 +769,7 @@ private:
class ParameterDeclarationAST: public AST class ParameterDeclarationAST: public AST
{ {
public: public:
typedef std::auto_ptr<ParameterDeclarationAST> Node; typedef std::unique_ptr<ParameterDeclarationAST> Node;
enum { Type = NodeType_ParameterDeclaration }; enum { Type = NodeType_ParameterDeclaration };
DECLARE_ALLOC( ParameterDeclarationAST ) DECLARE_ALLOC( ParameterDeclarationAST )
@ -801,7 +801,7 @@ private:
class ParameterDeclarationListAST: public AST class ParameterDeclarationListAST: public AST
{ {
public: public:
typedef std::auto_ptr<ParameterDeclarationListAST> Node; typedef std::unique_ptr<ParameterDeclarationListAST> Node;
enum { Type = NodeType_ParameterDeclarationList }; enum { Type = NodeType_ParameterDeclarationList };
DECLARE_ALLOC( ParameterDeclarationListAST ) DECLARE_ALLOC( ParameterDeclarationListAST )
@ -825,7 +825,7 @@ private:
class ParameterDeclarationClauseAST: public AST class ParameterDeclarationClauseAST: public AST
{ {
public: public:
typedef std::auto_ptr<ParameterDeclarationClauseAST> Node; typedef std::unique_ptr<ParameterDeclarationClauseAST> Node;
enum { Type = NodeType_ParameterDeclarationClause }; enum { Type = NodeType_ParameterDeclarationClause };
DECLARE_ALLOC( ParameterDeclarationClauseAST ) DECLARE_ALLOC( ParameterDeclarationClauseAST )
@ -854,7 +854,7 @@ private:
class InitDeclaratorAST: public AST class InitDeclaratorAST: public AST
{ {
public: public:
typedef std::auto_ptr<InitDeclaratorAST> Node; typedef std::unique_ptr<InitDeclaratorAST> Node;
enum { Type = NodeType_InitDeclarator }; enum { Type = NodeType_InitDeclarator };
DECLARE_ALLOC( InitDeclaratorAST ) DECLARE_ALLOC( InitDeclaratorAST )
@ -880,7 +880,7 @@ private:
class InitDeclaratorListAST: public AST class InitDeclaratorListAST: public AST
{ {
public: public:
typedef std::auto_ptr<InitDeclaratorListAST> Node; typedef std::unique_ptr<InitDeclaratorListAST> Node;
enum { Type = NodeType_InitDeclaratorList }; enum { Type = NodeType_InitDeclaratorList };
DECLARE_ALLOC( InitDeclaratorListAST ) DECLARE_ALLOC( InitDeclaratorListAST )
@ -902,7 +902,7 @@ private:
class TypedefAST: public DeclarationAST class TypedefAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<TypedefAST> Node; typedef std::unique_ptr<TypedefAST> Node;
enum { Type = NodeType_Typedef }; enum { Type = NodeType_Typedef };
DECLARE_ALLOC( TypedefAST ) DECLARE_ALLOC( TypedefAST )
@ -928,7 +928,7 @@ private:
class TemplateParameterAST: public AST class TemplateParameterAST: public AST
{ {
public: public:
typedef std::auto_ptr<TemplateParameterAST> Node; typedef std::unique_ptr<TemplateParameterAST> Node;
enum { Type = NodeType_TemplateParameter }; enum { Type = NodeType_TemplateParameter };
DECLARE_ALLOC( TemplateParameterAST ) DECLARE_ALLOC( TemplateParameterAST )
@ -954,7 +954,7 @@ private:
class TemplateParameterListAST: public AST class TemplateParameterListAST: public AST
{ {
public: public:
typedef std::auto_ptr<TemplateParameterListAST> Node; typedef std::unique_ptr<TemplateParameterListAST> Node;
enum { Type = NodeType_TemplateParameterList }; enum { Type = NodeType_TemplateParameterList };
DECLARE_ALLOC( TemplateParameterListAST ) DECLARE_ALLOC( TemplateParameterListAST )
@ -976,7 +976,7 @@ private:
class TemplateDeclarationAST: public DeclarationAST class TemplateDeclarationAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<TemplateDeclarationAST> Node; typedef std::unique_ptr<TemplateDeclarationAST> Node;
enum { Type = NodeType_TemplateDeclaration }; enum { Type = NodeType_TemplateDeclaration };
DECLARE_ALLOC( TemplateDeclarationAST ) DECLARE_ALLOC( TemplateDeclarationAST )
@ -1006,7 +1006,7 @@ private:
class SimpleDeclarationAST: public DeclarationAST class SimpleDeclarationAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<SimpleDeclarationAST> Node; typedef std::unique_ptr<SimpleDeclarationAST> Node;
enum { Type = NodeType_SimpleDeclaration }; enum { Type = NodeType_SimpleDeclaration };
DECLARE_ALLOC( SimpleDeclarationAST ) DECLARE_ALLOC( SimpleDeclarationAST )
@ -1044,7 +1044,7 @@ private:
class StatementAST: public AST class StatementAST: public AST
{ {
public: public:
typedef std::auto_ptr<StatementAST> Node; typedef std::unique_ptr<StatementAST> Node;
enum { Type = NodeType_Statement }; enum { Type = NodeType_Statement };
DECLARE_ALLOC( StatementAST ) DECLARE_ALLOC( StatementAST )
@ -1060,7 +1060,7 @@ private:
class ExpressionStatementAST: public StatementAST class ExpressionStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<ExpressionStatementAST> Node; typedef std::unique_ptr<ExpressionStatementAST> Node;
enum { Type = NodeType_ExpressionStatement }; enum { Type = NodeType_ExpressionStatement };
DECLARE_ALLOC( ExpressionStatementAST ) DECLARE_ALLOC( ExpressionStatementAST )
@ -1082,7 +1082,7 @@ private:
class ConditionAST: public AST class ConditionAST: public AST
{ {
public: public:
typedef std::auto_ptr<ConditionAST> Node; typedef std::unique_ptr<ConditionAST> Node;
enum { Type = NodeType_Condition }; enum { Type = NodeType_Condition };
DECLARE_ALLOC( ConditionAST ) DECLARE_ALLOC( ConditionAST )
@ -1112,7 +1112,7 @@ private:
class IfStatementAST: public StatementAST class IfStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<IfStatementAST> Node; typedef std::unique_ptr<IfStatementAST> Node;
enum { Type = NodeType_IfStatement }; enum { Type = NodeType_IfStatement };
DECLARE_ALLOC( IfStatementAST ) DECLARE_ALLOC( IfStatementAST )
@ -1142,7 +1142,7 @@ private:
class WhileStatementAST: public StatementAST class WhileStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<WhileStatementAST> Node; typedef std::unique_ptr<WhileStatementAST> Node;
enum { Type = NodeType_WhileStatement }; enum { Type = NodeType_WhileStatement };
DECLARE_ALLOC( WhileStatementAST ) DECLARE_ALLOC( WhileStatementAST )
@ -1168,7 +1168,7 @@ private:
class DoStatementAST: public StatementAST class DoStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<DoStatementAST> Node; typedef std::unique_ptr<DoStatementAST> Node;
enum { Type = NodeType_DoStatement }; enum { Type = NodeType_DoStatement };
DECLARE_ALLOC( DoStatementAST ) DECLARE_ALLOC( DoStatementAST )
@ -1194,7 +1194,7 @@ private:
class ForStatementAST: public StatementAST class ForStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<ForStatementAST> Node; typedef std::unique_ptr<ForStatementAST> Node;
enum { Type = NodeType_ForStatement }; enum { Type = NodeType_ForStatement };
DECLARE_ALLOC( ForStatementAST ) DECLARE_ALLOC( ForStatementAST )
@ -1228,7 +1228,7 @@ private:
class SwitchStatementAST: public StatementAST class SwitchStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<SwitchStatementAST> Node; typedef std::unique_ptr<SwitchStatementAST> Node;
enum { Type = NodeType_SwitchStatement }; enum { Type = NodeType_SwitchStatement };
DECLARE_ALLOC( SwitchStatementAST ) DECLARE_ALLOC( SwitchStatementAST )
@ -1254,7 +1254,7 @@ private:
class StatementListAST: public StatementAST class StatementListAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<StatementListAST> Node; typedef std::unique_ptr<StatementListAST> Node;
enum { Type = NodeType_StatementList }; enum { Type = NodeType_StatementList };
DECLARE_ALLOC( StatementListAST ) DECLARE_ALLOC( StatementListAST )
@ -1276,7 +1276,7 @@ private:
class DeclarationStatementAST: public StatementAST class DeclarationStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<DeclarationStatementAST> Node; typedef std::unique_ptr<DeclarationStatementAST> Node;
enum { Type = NodeType_DeclarationStatement }; enum { Type = NodeType_DeclarationStatement };
DECLARE_ALLOC( DeclarationStatementAST ) DECLARE_ALLOC( DeclarationStatementAST )
@ -1298,7 +1298,7 @@ private:
class FunctionDefinitionAST: public DeclarationAST class FunctionDefinitionAST: public DeclarationAST
{ {
public: public:
typedef std::auto_ptr<FunctionDefinitionAST> Node; typedef std::unique_ptr<FunctionDefinitionAST> Node;
enum { Type = NodeType_FunctionDefinition }; enum { Type = NodeType_FunctionDefinition };
DECLARE_ALLOC( FunctionDefinitionAST ) DECLARE_ALLOC( FunctionDefinitionAST )
@ -1341,7 +1341,7 @@ private:
class TranslationUnitAST: public AST class TranslationUnitAST: public AST
{ {
public: public:
typedef std::auto_ptr<TranslationUnitAST> Node; typedef std::unique_ptr<TranslationUnitAST> Node;
enum { Type = NodeType_TranslationUnit }; enum { Type = NodeType_TranslationUnit };
DECLARE_ALLOC( TranslationUnitAST ) DECLARE_ALLOC( TranslationUnitAST )

@ -327,7 +327,7 @@ bool Parser::skipCommaExpression( AST::Node& node )
AST::Node ast = CreateNode<AST>(); AST::Node ast = CreateNode<AST>();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -379,7 +379,7 @@ bool Parser::skipExpression( AST::Node& node )
{ {
AST::Node ast = CreateNode<AST>(); AST::Node ast = CreateNode<AST>();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
} }
return true; return true;
@ -430,7 +430,7 @@ bool Parser::parseName( NameAST::Node& node )
return false; return false;
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -443,7 +443,7 @@ bool Parser::parseTranslationUnit( TranslationUnitAST::Node& node )
m_problems = 0; m_problems = 0;
TranslationUnitAST::Node tun = CreateNode<TranslationUnitAST>(); TranslationUnitAST::Node tun = CreateNode<TranslationUnitAST>();
node = tun; node = std::move(tun);
while( !lex->lookAhead(0).isNull() ){ while( !lex->lookAhead(0).isNull() ){
DeclarationAST::Node def; DeclarationAST::Node def;
int startDecl = lex->index(); int startDecl = lex->index();
@ -548,7 +548,7 @@ bool Parser::parseDeclaration( DeclarationAST::Node& node )
ast->setTypeSpec( spec ); ast->setTypeSpec( spec );
ast->setInitDeclaratorList( declarators ); ast->setInitDeclaratorList( declarators );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -602,7 +602,7 @@ bool Parser::parseLinkageSpecification( DeclarationAST::Node& node )
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -619,7 +619,7 @@ bool Parser::parseLinkageBody( LinkageBodyAST::Node& node )
lex->nextToken(); lex->nextToken();
LinkageBodyAST::Node lba = CreateNode<LinkageBodyAST>(); LinkageBodyAST::Node lba = CreateNode<LinkageBodyAST>();
node = lba; node = std::move(lba);
while( !lex->lookAhead(0).isNull() ){ while( !lex->lookAhead(0).isNull() ){
int tk = lex->lookAhead( 0 ); int tk = lex->lookAhead( 0 );
@ -678,7 +678,7 @@ bool Parser::parseNamespace( DeclarationAST::Node& node )
ast->setNamespaceName( namespaceName ); ast->setNamespaceName( namespaceName );
ast->setAliasName( name ); ast->setAliasName( name );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} else { } else {
reportError( i18n("namespace expected") ); reportError( i18n("namespace expected") );
@ -697,7 +697,7 @@ bool Parser::parseNamespace( DeclarationAST::Node& node )
ast->setLinkageBody( linkageBody ); ast->setLinkageBody( linkageBody );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -740,7 +740,7 @@ bool Parser::parseUsing( DeclarationAST::Node& node )
ADVANCE( ';', ";" ); ADVANCE( ';', ";" );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -767,7 +767,7 @@ bool Parser::parseUsingDirective( DeclarationAST::Node& node )
UsingDirectiveAST::Node ast = CreateNode<UsingDirectiveAST>(); UsingDirectiveAST::Node ast = CreateNode<UsingDirectiveAST>();
ast->setName( name ); ast->setName( name );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -787,7 +787,7 @@ bool Parser::parseOperatorFunctionId( AST::Node& node )
AST::Node op; AST::Node op;
if( parseOperator(op) ){ if( parseOperator(op) ){
AST::Node asn = CreateNode<AST>(); AST::Node asn = CreateNode<AST>();
node = asn; node = std::move(asn);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
} else { } else {
@ -811,7 +811,7 @@ bool Parser::parseOperatorFunctionId( AST::Node& node )
; ;
AST::Node asn = CreateNode<AST>(); AST::Node asn = CreateNode<AST>();
node = asn; node = std::move(asn);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
} }
@ -848,7 +848,7 @@ bool Parser::parseTemplateArgumentList( TemplateArgumentListAST::Node& node, boo
} }
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -882,7 +882,7 @@ bool Parser::parseTypedef( DeclarationAST::Node& node )
ast->setTypeSpec( spec ); ast->setTypeSpec( spec );
ast->setInitDeclaratorList( declarators ); ast->setInitDeclaratorList( declarators );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -916,7 +916,7 @@ bool Parser::parseTemplateDeclaration( DeclarationAST::Node& node )
lex->nextToken(); lex->nextToken();
AST::Node n = CreateNode<AST>(); AST::Node n = CreateNode<AST>();
UPDATE_POS( n, startExport, lex->index() ); UPDATE_POS( n, startExport, lex->index() );
exp = n; exp = std::move(n);
} }
if( lex->lookAhead(0) != Token_template ){ if( lex->lookAhead(0) != Token_template ){
@ -943,7 +943,7 @@ bool Parser::parseTemplateDeclaration( DeclarationAST::Node& node )
ast->setTemplateParameterList( params ); ast->setTemplateParameterList( params );
ast->setDeclaration( def ); ast->setDeclaration( def );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1037,7 +1037,7 @@ bool Parser::parseCvQualify( GroupAST::Node& node )
//kdDebug(9007)<< "-----------------> token = " << lex->lookAhead(0).text() << endl; //kdDebug(9007)<< "-----------------> token = " << lex->lookAhead(0).text() << endl;
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1094,7 +1094,7 @@ bool Parser::parseSimpleTypeSpecifier( TypeSpecifierAST::Node& node )
} }
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1122,7 +1122,7 @@ bool Parser::parsePtrOperator( AST::Node& node )
AST::Node ast = CreateNode<AST>(); AST::Node ast = CreateNode<AST>();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1287,7 +1287,7 @@ bool Parser::parseDeclarator( DeclaratorAST::Node& node )
update_pos: update_pos:
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1384,7 +1384,7 @@ bool Parser::parseAbstractDeclarator( DeclaratorAST::Node& node )
UPDATE_POS: UPDATE_POS:
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1453,7 +1453,7 @@ bool Parser::parseEnumSpecifier( TypeSpecifierAST::Node& node )
lex->nextToken(); lex->nextToken();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1488,7 +1488,7 @@ bool Parser::parseTemplateParameterList( TemplateParameterListAST::Node& node )
} }
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1516,7 +1516,7 @@ bool Parser::parseTemplateParameter( TemplateParameterAST::Node& node )
ok: ok:
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1604,7 +1604,7 @@ bool Parser::parseTypeParameter( TypeParameterAST::Node& node )
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1633,7 +1633,7 @@ bool Parser::parseStorageClassSpecifier( GroupAST::Node& node )
return false; return false;
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1662,7 +1662,7 @@ bool Parser::parseFunctionSpecifier( GroupAST::Node& node )
return false; return false;
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1683,7 +1683,7 @@ bool Parser::parseTypeId( AST::Node& node )
parseAbstractDeclarator( decl ); parseAbstractDeclarator( decl );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1718,7 +1718,7 @@ bool Parser::parseInitDeclaratorList( InitDeclaratorListAST::Node& node )
//kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseInitDeclaratorList() -- end" << endl; //kdDebug(9007)<< "--- tok = " << lex->lookAhead(0).text() << " -- " << "Parser::parseInitDeclaratorList() -- end" << endl;
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1757,7 +1757,7 @@ good:
/// @todo add ellipsis /// @todo add ellipsis
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1795,7 +1795,7 @@ bool Parser::parseParameterDeclarationList( ParameterDeclarationListAST::Node& n
} }
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1838,7 +1838,7 @@ bool Parser::parseParameterDeclaration( ParameterDeclarationAST::Node& node )
ast->setExpression( expr ); ast->setExpression( expr );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1855,7 +1855,7 @@ bool Parser::parseClassSpecifier( TypeSpecifierAST::Node& node )
int kind = lex->lookAhead( 0 ); int kind = lex->lookAhead( 0 );
if( kind == Token_class || kind == Token_struct || kind == Token_union ){ if( kind == Token_class || kind == Token_struct || kind == Token_union ){
AST::Node asn = CreateNode<AST>(); AST::Node asn = CreateNode<AST>();
classKey = asn; classKey = std::move(asn);
lex->nextToken(); lex->nextToken();
UPDATE_POS( classKey, classKeyStart, lex->index() ); UPDATE_POS( classKey, classKeyStart, lex->index() );
} else { } else {
@ -1916,7 +1916,7 @@ bool Parser::parseClassSpecifier( TypeSpecifierAST::Node& node )
lex->nextToken(); lex->nextToken();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1932,7 +1932,7 @@ bool Parser::parseAccessSpecifier( AST::Node& node )
case Token_protected: case Token_protected:
case Token_private: { case Token_private: {
AST::Node asn = CreateNode<AST>(); AST::Node asn = CreateNode<AST>();
node = asn; node = std::move(asn);
lex->nextToken(); lex->nextToken();
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
@ -1991,7 +1991,7 @@ bool Parser::parseMemberSpecification( DeclarationAST::Node& node )
ast->addAccess( n ); ast->addAccess( n );
ADVANCE( ':', ":" ); ADVANCE( ':', ":" );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} else if( parseTypedef(node) ){ } else if( parseTypedef(node) ){
return true; return true;
@ -2012,7 +2012,7 @@ bool Parser::parseMemberSpecification( DeclarationAST::Node& node )
} }
ADVANCE( ':', ":" ); ADVANCE( ':', ":" );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2045,7 +2045,7 @@ bool Parser::parseMemberSpecification( DeclarationAST::Node& node )
ast->setTypeSpec( spec ); ast->setTypeSpec( spec );
ast->setInitDeclaratorList( declarators ); ast->setInitDeclaratorList( declarators );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2101,7 +2101,7 @@ bool Parser::parseElaboratedTypeSpecifier( TypeSpecifierAST::Node& node )
ast->setKind( kind ); ast->setKind( kind );
ast->setName( name ); ast->setName( name );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2135,7 +2135,7 @@ bool Parser::parseExceptionSpecification( GroupAST::Node& node )
ast->addNode( ellipsis ); ast->addNode( ellipsis );
lex->nextToken(); lex->nextToken();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
} else { } else {
parseTypeIdList( node ); parseTypeIdList( node );
} }
@ -2164,7 +2164,7 @@ bool Parser::parseEnumerator( EnumeratorAST::Node& node )
lex->nextToken(); lex->nextToken();
EnumeratorAST::Node ena = CreateNode<EnumeratorAST>(); EnumeratorAST::Node ena = CreateNode<EnumeratorAST>();
node = ena; node = std::move(ena);
AST::Node id = CreateNode<AST>(); AST::Node id = CreateNode<AST>();
UPDATE_POS( id, start, lex->index() ); UPDATE_POS( id, start, lex->index() );
@ -2203,7 +2203,7 @@ bool Parser::parseInitDeclarator( InitDeclaratorAST::Node& node )
ast->setDeclarator( decl ); ast->setDeclarator( decl );
ast->setInitializer( init ); ast->setInitializer( init );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2243,7 +2243,7 @@ bool Parser::parseBaseClause( BaseClauseAST::Node& node )
return false; return false;
UPDATE_POS( bca, start, lex->index() ); UPDATE_POS( bca, start, lex->index() );
node = bca; node = std::move(bca);
return true; return true;
} }
@ -2340,7 +2340,7 @@ bool Parser::parseTypeIdList( GroupAST::Node& node )
} }
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2377,7 +2377,7 @@ bool Parser::parseBaseSpecifier( BaseSpecifierAST::Node& node )
ast->setAccess( access ); ast->setAccess( access );
ast->setName( name ); ast->setName( name );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2483,7 +2483,7 @@ bool Parser::parseUnqualifiedName( ClassOrNamespaceNameAST::Node& node )
} }
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2518,7 +2518,7 @@ bool Parser::skipExpressionStatement( StatementAST::Node& node )
ExpressionStatementAST::Node ast = CreateNode<ExpressionStatementAST>(); ExpressionStatementAST::Node ast = CreateNode<ExpressionStatementAST>();
ast->setExpression( expr ); ast->setExpression( expr );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2608,7 +2608,7 @@ bool Parser::parseCondition( ConditionAST::Node& node )
ast->setExpression( expr ); ast->setExpression( expr );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2623,7 +2623,7 @@ bool Parser::parseCondition( ConditionAST::Node& node )
ast->setExpression( expr ); ast->setExpression( expr );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2653,7 +2653,7 @@ bool Parser::parseWhileStatement( StatementAST::Node& node )
ast->setCondition( cond ); ast->setCondition( cond );
ast->setStatement( body ); ast->setStatement( body );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2687,7 +2687,7 @@ bool Parser::parseDoStatement( StatementAST::Node& node )
ast->setStatement( body ); ast->setStatement( body );
//ast->setCondition( condition ); //ast->setCondition( condition );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2724,7 +2724,7 @@ bool Parser::parseForStatement( StatementAST::Node& node )
// ast->setExpression( expression ); // ast->setExpression( expression );
ast->setStatement( body ); ast->setStatement( body );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2773,7 +2773,7 @@ bool Parser::parseCompoundStatement( StatementAST::Node& node )
} }
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2817,7 +2817,7 @@ bool Parser::parseIfStatement( StatementAST::Node& node )
} }
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2847,7 +2847,7 @@ bool Parser::parseSwitchStatement( StatementAST::Node& node )
ast->setCondition( cond ); ast->setCondition( cond );
ast->setStatement( stmt ); ast->setStatement( stmt );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2864,7 +2864,7 @@ bool Parser::parseLabeledStatement( StatementAST::Node& node )
StatementAST::Node stmt; StatementAST::Node stmt;
if( parseStatement(stmt) ){ if( parseStatement(stmt) ){
node = stmt; node = std::move(stmt);
return true; return true;
} }
} }
@ -2888,7 +2888,7 @@ bool Parser::parseLabeledStatement( StatementAST::Node& node )
StatementAST::Node stmt; StatementAST::Node stmt;
if( parseStatement(stmt) ){ if( parseStatement(stmt) ){
node = stmt; node = std::move(stmt);
return true; return true;
} }
} }
@ -2945,7 +2945,7 @@ bool Parser::parseBlockDeclaration( DeclarationAST::Node& node )
ast->setTypeSpec( spec ); ast->setTypeSpec( spec );
ast->setInitDeclaratorList( declarators ); ast->setInitDeclaratorList( declarators );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2985,7 +2985,7 @@ bool Parser::parseDeclarationStatement( StatementAST::Node& node )
DeclarationStatementAST::Node ast = CreateNode<DeclarationStatementAST>(); DeclarationStatementAST::Node ast = CreateNode<DeclarationStatementAST>();
ast->setDeclaration( decl ); ast->setDeclaration( decl );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
//kdDebug(9007)<< "---------------------> found a block declaration" << endl; //kdDebug(9007)<< "---------------------> found a block declaration" << endl;
return true; return true;
@ -3049,7 +3049,7 @@ bool Parser::parseDeclarationInternal( DeclarationAST::Node& node, TQString& com
SimpleDeclarationAST::Node ast = CreateNode<SimpleDeclarationAST>(); SimpleDeclarationAST::Node ast = CreateNode<SimpleDeclarationAST>();
ast->setInitDeclaratorList( declarators ); ast->setInitDeclaratorList( declarators );
ast->setText( toString(start, endSignature) ); ast->setText( toString(start, endSignature) );
node = ast; node = std::move(ast);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
@ -3067,7 +3067,7 @@ bool Parser::parseDeclarationInternal( DeclarationAST::Node& node, TQString& com
ast->setInitDeclarator( declarator ); ast->setInitDeclarator( declarator );
ast->setFunctionBody( funBody ); ast->setFunctionBody( funBody );
ast->setText( toString(start, endSignature) ); ast->setText( toString(start, endSignature) );
node = ast; node = std::move(ast);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
} }
@ -3084,7 +3084,7 @@ bool Parser::parseDeclarationInternal( DeclarationAST::Node& node, TQString& com
ast->setInitDeclarator( declarator ); ast->setInitDeclarator( declarator );
ast->setText( toString(start, endSignature) ); ast->setText( toString(start, endSignature) );
ast->setFunctionBody( funBody ); ast->setFunctionBody( funBody );
node = ast; node = std::move(ast);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
} }
@ -3114,7 +3114,7 @@ start_decl:
if( parseInitDeclaratorList(declarators) ){ if( parseInitDeclaratorList(declarators) ){
ADVANCE( ';', ";" ); ADVANCE( ';', ";" );
DeclarationAST::Node ast = CreateNode<DeclarationAST>(); DeclarationAST::Node ast = CreateNode<DeclarationAST>();
node = ast; node = std::move(ast);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
} }
@ -3159,7 +3159,7 @@ start_decl:
ast->setTypeSpec( spec ); ast->setTypeSpec( spec );
ast->setWinDeclSpec( winDeclSpec ); ast->setWinDeclSpec( winDeclSpec );
ast->setInitDeclaratorList( declarators ); ast->setInitDeclaratorList( declarators );
node = ast; node = std::move(ast);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
} }
return true; return true;
@ -3180,7 +3180,7 @@ start_decl:
ast->setTypeSpec( spec ); ast->setTypeSpec( spec );
ast->setFunctionBody( funBody ); ast->setFunctionBody( funBody );
ast->setInitDeclarator( decl ); ast->setInitDeclarator( decl );
node = ast; node = std::move(ast);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
} }
@ -3226,7 +3226,7 @@ bool Parser::parseFunctionBody( StatementListAST::Node& node )
lex->nextToken(); lex->nextToken();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -3291,7 +3291,7 @@ bool Parser::parseTryBlockStatement( StatementAST::Node& node )
} }
} }
node = stmt; node = std::move(stmt);
return true; return true;
} }
@ -3816,7 +3816,7 @@ bool Parser::parseLogicalOrExpression( AST::Node& node, bool templArgs )
AST::Node ast = CreateNode<AST>(); AST::Node ast = CreateNode<AST>();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -3861,7 +3861,7 @@ bool Parser::parseAssignmentExpression( AST::Node& node )
AST::Node ast = CreateNode<AST>(); AST::Node ast = CreateNode<AST>();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -3872,7 +3872,7 @@ bool Parser::parseConstantExpression( AST::Node& node )
if( parseConditionalExpression(node) ){ if( parseConditionalExpression(node) ){
AST::Node ast = CreateNode<AST>(); AST::Node ast = CreateNode<AST>();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
return false; return false;
@ -3889,7 +3889,7 @@ bool Parser::parseExpression( AST::Node& node )
AST::Node ast = CreateNode<AST>(); AST::Node ast = CreateNode<AST>();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -3915,7 +3915,7 @@ bool Parser::parseCommaExpression( AST::Node& node )
AST::Node ast = CreateNode<AST>(); AST::Node ast = CreateNode<AST>();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -4120,7 +4120,7 @@ bool Parser::parseIdentifierList( GroupAST::Node & node )
ADVANCE( Token_identifier, "identifier" ); ADVANCE( Token_identifier, "identifier" );
} }
node = ast; node = std::move(ast);
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
} }

Loading…
Cancel
Save