Replace auto_ptr

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/39/head
Michele Calgaro 10 months ago
parent c8d7b46522
commit 12c95f5db5
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -1459,9 +1459,9 @@ void GDBController::slotDbgStdout(TDEProcess *, char *buf, int buflen)
FileSymbol file; FileSymbol file;
file.contents = reply; file.contents = reply;
std::auto_ptr<GDBMI::Record> r(mi_parser_.parse(&file)); std::unique_ptr<GDBMI::Record> r(mi_parser_.parse(&file));
if (r.get() == 0) if (!r)
{ {
// FIXME: Issue an error! // FIXME: Issue an error!
kdDebug(9012) << "Invalid MI message: " << reply << "\n"; kdDebug(9012) << "Invalid MI message: " << reply << "\n";

@ -330,7 +330,7 @@ private:
// After highting current line we need to do something more, // After highting current line we need to do something more,
// like announcing write watchpoints, and so need to have // like announcing write watchpoints, and so need to have
// access to the stop packet. So store it here. // access to the stop packet. So store it here.
std::auto_ptr<GDBMI::ResultRecord> last_stop_result; std::unique_ptr<GDBMI::ResultRecord> last_stop_result;
// Gdb 6.4 (and 6.3) does not support "character" format with MI, // Gdb 6.4 (and 6.3) does not support "character" format with MI,
// so the only way it can work is via the "print" command. As gdb // so the only way it can work is via the "print" command. As gdb

@ -97,7 +97,7 @@ bool MIParser::parsePrompt(Record *&record)
bool MIParser::parseStreamRecord(Record *&record) bool MIParser::parseStreamRecord(Record *&record)
{ {
std::auto_ptr<StreamRecord> stream(new StreamRecord); std::unique_ptr<StreamRecord> stream(new StreamRecord);
switch (lex->lookAhead()) { switch (lex->lookAhead()) {
case '~': case '~':
@ -128,7 +128,7 @@ bool MIParser::parseResultRecord(Record *&record)
TQString reason = lex->currentTokenText(); TQString reason = lex->currentTokenText();
lex->nextToken(); lex->nextToken();
std::auto_ptr<ResultRecord> res(new ResultRecord); std::unique_ptr<ResultRecord> res(new ResultRecord);
res->reason = reason; res->reason = reason;
if (lex->lookAhead() != ',') { if (lex->lookAhead() != ',') {
@ -151,7 +151,7 @@ bool MIParser::parseResult(Result *&result)
TQString variable = lex->currentTokenText(); TQString variable = lex->currentTokenText();
lex->nextToken(); lex->nextToken();
std::auto_ptr<Result> res(new Result); std::unique_ptr<Result> res(new Result);
res->variable = variable; res->variable = variable;
if (lex->lookAhead() != '=') if (lex->lookAhead() != '=')
@ -207,7 +207,7 @@ bool MIParser::parseList(Value *&value)
{ {
ADVANCE('['); ADVANCE('[');
std::auto_ptr<ListValue> lst(new ListValue); std::unique_ptr<ListValue> lst(new ListValue);
// Note: can't use parseCSV here because of nested // Note: can't use parseCSV here because of nested
// "is this Value or Result" guessing. Too lazy to factor // "is this Value or Result" guessing. Too lazy to factor
@ -248,7 +248,7 @@ bool MIParser::parseList(Value *&value)
bool MIParser::parseCSV(TupleValue** value, bool MIParser::parseCSV(TupleValue** value,
char start, char end) char start, char end)
{ {
std::auto_ptr<TupleValue> tuple(new TupleValue); std::unique_ptr<TupleValue> tuple(new TupleValue);
if (!parseCSV(*tuple, start, end)) if (!parseCSV(*tuple, start, end))
return false; return false;

@ -433,7 +433,6 @@
<tocsect3 name="18.3.4: Pointing to a newly allocated object" url="cplusplus18.html#l324"/> <tocsect3 name="18.3.4: Pointing to a newly allocated object" url="cplusplus18.html#l324"/>
<tocsect3 name="18.3.5: Operators and members" url="cplusplus18.html#l325"/> <tocsect3 name="18.3.5: Operators and members" url="cplusplus18.html#l325"/>
<tocsect3 name="18.3.6: Using `unique_ptr' objects for arrays" url="cplusplus18.html#l326"/> <tocsect3 name="18.3.6: Using `unique_ptr' objects for arrays" url="cplusplus18.html#l326"/>
<tocsect3 name="18.3.7: The legacy class 'auto_ptr' (deprecated)" url="cplusplus18.html#l327"/>
</tocsect2> </tocsect2>
<tocsect2 name="18.4: The class 'shared_ptr'" url="cplusplus18.html#l328"> <tocsect2 name="18.4: The class 'shared_ptr'" url="cplusplus18.html#l328">
<tocsect3 name="18.4.1: Defining `shared_ptr' objects" url="cplusplus18.html#l329"/> <tocsect3 name="18.4.1: Defining `shared_ptr' objects" url="cplusplus18.html#l329"/>

@ -219,13 +219,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 );
@ -234,7 +234,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;
@ -249,7 +249,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;
@ -268,7 +268,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 );
@ -282,32 +282,32 @@ 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 );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
TranslationUnitAST::TranslationUnitAST() TranslationUnitAST::TranslationUnitAST()
{ {
////kdDebug(9007) << "++ TranslationUnitAST::TranslationUnitAST()" << endl; //kdDebug(9007) << "++ TranslationUnitAST::TranslationUnitAST()" << endl;
m_declarationList.setAutoDelete( true ); m_declarationList.setAutoDelete( true );
} }
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 );
@ -321,14 +321,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 );
} }
@ -339,14 +339,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 );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -356,14 +356,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 );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -373,8 +373,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()
@ -383,20 +383,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 );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -407,7 +407,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 );
@ -434,20 +434,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 );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -457,23 +457,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;
@ -486,27 +486,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;
@ -520,13 +520,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 );
@ -535,8 +535,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 );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -547,7 +547,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 );
@ -562,13 +562,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();
@ -586,14 +586,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 );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -604,7 +604,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 );
@ -618,20 +618,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 );
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -641,32 +641,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 );
} }
@ -678,7 +678,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 );
@ -694,52 +694,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( ParameterDeclarationClauseAST::Node& 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 );
@ -753,14 +753,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -770,38 +770,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -812,7 +812,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 );
@ -826,20 +826,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -849,14 +849,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -866,14 +866,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -883,26 +883,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -912,20 +912,20 @@ ForEachStatementAST::ForEachStatementAST()
void ForEachStatementAST::setExpression( AST::Node& expression ) void ForEachStatementAST::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 ForEachStatementAST::setStatement( StatementAST::Node& statement ) void ForEachStatementAST::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 ForEachStatementAST::setInitStatement( StatementAST::Node& initStatement ) void ForEachStatementAST::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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -935,14 +935,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -953,7 +953,7 @@ CatchStatementListAST::CatchStatementListAST()
void CatchStatementListAST::addStatement( CatchStatementAST::Node& statement ) void CatchStatementListAST::addStatement( CatchStatementAST::Node& statement )
{ {
if( !statement.get() ) if( !statement )
return; return;
statement->setParent( this ); statement->setParent( this );
@ -967,14 +967,14 @@ CatchStatementAST::CatchStatementAST()
void CatchStatementAST::setCondition( ConditionAST::Node& condition ) void CatchStatementAST::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 CatchStatementAST::setStatement( StatementAST::Node& statement ) void CatchStatementAST::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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -984,14 +984,14 @@ TryBlockStatementAST::TryBlockStatementAST()
void TryBlockStatementAST::setStatement( StatementAST::Node& statement ) void TryBlockStatementAST::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 TryBlockStatementAST::setCatchStatementList( CatchStatementListAST::Node& statementList ) void TryBlockStatementAST::setCatchStatementList( CatchStatementListAST::Node& statementList )
{ {
m_catchStatementList = statementList; m_catchStatementList = std::move(statementList);
if( m_catchStatementList.get() ) m_catchStatementList->setParent( this ); if( m_catchStatementList ) m_catchStatementList->setParent( this );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -1001,8 +1001,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -1012,8 +1012,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 );
} }
@ -1024,32 +1024,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;
@ -1063,7 +1063,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 );
@ -1091,24 +1091,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;
@ -1123,7 +1123,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 );
@ -1151,7 +1151,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 );
@ -1178,26 +1178,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( TemplateParameterListAST::Node& 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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -1207,14 +1207,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 );
} }
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
@ -1225,7 +1225,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 );
@ -1239,24 +1239,24 @@ 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 );
} }

@ -155,7 +155,7 @@ class CommentAST {
class AST : public CommentAST class AST : public CommentAST
{ {
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 )
@ -217,7 +217,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 )
@ -242,7 +242,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 )
@ -266,7 +266,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 )
@ -294,7 +294,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 )
@ -326,7 +326,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 )
@ -338,7 +338,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 );
@ -348,7 +348,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;
@ -360,7 +360,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 )
@ -376,7 +376,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 )
@ -400,7 +400,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 )
@ -432,7 +432,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 )
@ -462,7 +462,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 )
@ -484,7 +484,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 )
@ -517,7 +517,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 )
@ -543,7 +543,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 )
@ -565,7 +565,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 )
@ -590,7 +590,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 )
@ -612,7 +612,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 )
@ -642,7 +642,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 )
@ -668,7 +668,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 )
@ -694,7 +694,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 )
@ -720,7 +720,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 )
@ -742,7 +742,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 )
@ -754,7 +754,7 @@ public:
void addPtrOp( AST::Node& ptrOp ); void addPtrOp( AST::Node& ptrOp );
DeclaratorAST* subDeclarator() { return m_subDeclarator.get(); } DeclaratorAST* subDeclarator() { return m_subDeclarator.get(); }
void setSubDeclarator( std::auto_ptr<DeclaratorAST>& subDeclarator ); void setSubDeclarator( Node& subDeclarator );
NameAST* declaratorId() { return m_declaratorId.get(); } NameAST* declaratorId() { return m_declaratorId.get(); }
void setDeclaratorId( NameAST::Node& declaratorId ); void setDeclaratorId( NameAST::Node& declaratorId );
@ -766,7 +766,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(); }
@ -777,11 +777,11 @@ public:
private: private:
TQPtrList<AST> m_ptrOpList; TQPtrList<AST> m_ptrOpList;
std::auto_ptr<DeclaratorAST> m_subDeclarator; Node m_subDeclarator;
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;
@ -793,7 +793,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 )
@ -825,7 +825,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 )
@ -849,7 +849,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 )
@ -878,7 +878,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 )
@ -904,7 +904,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 )
@ -926,7 +926,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 )
@ -952,7 +952,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 )
@ -978,7 +978,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 )
@ -1000,7 +1000,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 )
@ -1030,7 +1030,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 )
@ -1068,7 +1068,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 )
@ -1084,7 +1084,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 )
@ -1106,7 +1106,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 )
@ -1136,7 +1136,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 )
@ -1166,7 +1166,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 )
@ -1192,7 +1192,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 )
@ -1218,7 +1218,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 )
@ -1252,7 +1252,7 @@ private:
class ForEachStatementAST: public StatementAST class ForEachStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<ForEachStatementAST> Node; typedef std::unique_ptr<ForEachStatementAST> Node;
enum { Type = NodeType_ForEachStatement }; enum { Type = NodeType_ForEachStatement };
DECLARE_ALLOC( ForEachStatementAST ) DECLARE_ALLOC( ForEachStatementAST )
@ -1282,7 +1282,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 )
@ -1308,7 +1308,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 )
@ -1330,7 +1330,7 @@ private:
class CatchStatementAST: public StatementAST class CatchStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<CatchStatementAST> Node; typedef std::unique_ptr<CatchStatementAST> Node;
enum { Type = NodeType_CatchStatement }; enum { Type = NodeType_CatchStatement };
DECLARE_ALLOC( CatchStatementAST ) DECLARE_ALLOC( CatchStatementAST )
@ -1356,7 +1356,7 @@ private:
class CatchStatementListAST: public StatementAST class CatchStatementListAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<CatchStatementListAST> Node; typedef std::unique_ptr<CatchStatementListAST> Node;
enum { Type = NodeType_CatchStatementList }; enum { Type = NodeType_CatchStatementList };
DECLARE_ALLOC( CatchStatementListAST ) DECLARE_ALLOC( CatchStatementListAST )
@ -1378,7 +1378,7 @@ private:
class TryBlockStatementAST: public StatementAST class TryBlockStatementAST: public StatementAST
{ {
public: public:
typedef std::auto_ptr<TryBlockStatementAST> Node; typedef std::unique_ptr<TryBlockStatementAST> Node;
enum { Type = NodeType_TryBlockStatement }; enum { Type = NodeType_TryBlockStatement };
DECLARE_ALLOC( TryBlockStatementAST ) DECLARE_ALLOC( TryBlockStatementAST )
@ -1404,7 +1404,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 )
@ -1426,7 +1426,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 )

@ -325,7 +325,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;
} }
@ -377,7 +377,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;
@ -428,7 +428,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;
} }
@ -441,7 +441,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);
if( lex->lookAhead(0) == Token_comment ) { if( lex->lookAhead(0) == Token_comment ) {
node->setComment( lex->lookAhead(0).text() ); node->setComment( lex->lookAhead(0).text() );
nextToken(); nextToken();
@ -539,7 +539,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;
} }
@ -587,7 +587,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;
} }
@ -604,7 +604,7 @@ bool Parser::parseLinkageBody( LinkageBodyAST::Node& node )
nextToken(); 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 );
@ -665,7 +665,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") );
@ -684,7 +684,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;
} }
@ -727,7 +727,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;
} }
@ -754,7 +754,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;
} }
@ -774,7 +774,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 {
@ -798,7 +798,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;
} }
@ -831,7 +831,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;
} }
@ -879,7 +879,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;
} }
@ -913,7 +913,7 @@ bool Parser::parseTemplateDeclaration( DeclarationAST::Node& node )
nextToken(); 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 ){
@ -939,7 +939,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;
} }
@ -1033,7 +1033,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;
} }
@ -1090,7 +1090,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;
} }
@ -1118,7 +1118,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;
} }
@ -1283,7 +1283,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;
} }
@ -1380,7 +1380,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;
} }
@ -1439,7 +1439,7 @@ bool Parser::parseEnumSpecifier( 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;
} }
@ -1470,7 +1470,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;
} }
@ -1498,7 +1498,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;
} }
@ -1586,7 +1586,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;
} }
@ -1615,7 +1615,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;
} }
@ -1644,7 +1644,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;
} }
@ -1665,7 +1665,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;
} }
@ -1696,7 +1696,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;
} }
@ -1735,7 +1735,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;
} }
@ -1844,7 +1844,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;
} }
@ -1887,7 +1887,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;
} }
@ -1905,7 +1905,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);
nextToken(); nextToken();
UPDATE_POS( classKey, classKeyStart, lex->index() ); UPDATE_POS( classKey, classKeyStart, lex->index() );
} else { } else {
@ -1968,7 +1968,7 @@ bool Parser::parseClassSpecifier( TypeSpecifierAST::Node& node )
nextToken(); nextToken();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -1984,7 +1984,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);
nextToken(); nextToken();
UPDATE_POS( node, start, lex->index() ); UPDATE_POS( node, start, lex->index() );
return true; return true;
@ -2016,7 +2016,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;
@ -2037,7 +2037,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;
} }
@ -2065,7 +2065,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;
} }
@ -2115,7 +2115,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;
} }
@ -2149,7 +2149,7 @@ bool Parser::parseExceptionSpecification( GroupAST::Node& node )
ast->addNode( ellipsis ); ast->addNode( ellipsis );
nextToken(); nextToken();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
} else if( lex->lookAhead(0) == ')' ) { } else if( lex->lookAhead(0) == ')' ) {
node = CreateNode<GroupAST>(); node = CreateNode<GroupAST>();
} else { } else {
@ -2174,7 +2174,7 @@ bool Parser::parseEnumerator( EnumeratorAST::Node& node )
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() );
@ -2219,7 +2219,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;
} }
@ -2255,7 +2255,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;
} }
@ -2346,7 +2346,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;
} }
@ -2383,7 +2383,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;
} }
@ -2491,7 +2491,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;
} }
@ -2526,7 +2526,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;
} }
@ -2620,7 +2620,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;
} }
@ -2629,7 +2629,7 @@ bool Parser::parseCondition( ConditionAST::Node& node )
ast->setDeclarator( decl ); ast->setDeclarator( decl );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -2644,7 +2644,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;
} }
@ -2673,7 +2673,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;
} }
@ -2707,7 +2707,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;
} }
@ -2743,7 +2743,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;
} }
@ -2768,7 +2768,7 @@ bool Parser::parseForEachStatement( StatementAST::Node& node )
// add here the parser results // add here the parser results
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;
} }
@ -2819,7 +2819,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;
} }
@ -2861,7 +2861,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;
} }
@ -2891,7 +2891,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;
} }
@ -2908,7 +2908,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;
} }
} }
@ -2932,7 +2932,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;
} }
} }
@ -2989,7 +2989,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;
} }
@ -3029,7 +3029,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;
@ -3093,7 +3093,7 @@ bool Parser::parseDeclarationInternal( DeclarationAST::Node& node )
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;
@ -3111,7 +3111,7 @@ bool Parser::parseDeclarationInternal( DeclarationAST::Node& node )
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;
} }
@ -3128,7 +3128,7 @@ bool Parser::parseDeclarationInternal( DeclarationAST::Node& node )
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;
} }
@ -3158,7 +3158,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;
} }
@ -3219,7 +3219,7 @@ start_decl:
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;
@ -3243,7 +3243,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;
} }
@ -3291,7 +3291,7 @@ bool Parser::parseFunctionBody( StatementListAST::Node& node )
nextToken(); nextToken();
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -3379,7 +3379,7 @@ bool Parser::parseTryBlockStatement( StatementAST::Node& node )
ast->setStatement( stmt ); ast->setStatement( stmt );
ast->setCatchStatementList( list ); ast->setCatchStatementList( list );
UPDATE_POS( ast, start, lex->index() ); UPDATE_POS( ast, start, lex->index() );
node = ast; node = std::move(ast);
return true; return true;
} }
@ -3905,7 +3905,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;
} }
@ -3950,7 +3950,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;
} }
@ -3961,7 +3961,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;
@ -3978,7 +3978,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;
} }
@ -4000,7 +4000,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;
} }
@ -4203,7 +4203,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