diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-07-03 09:11:52 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-07-03 09:12:58 +0200 |
commit | 3cdd48067c8c865d050a19766948d05c86ec6e40 (patch) | |
tree | 339702b3a68d8703f87ab01b79cfb5f4894eb54c /src/shared/cplusplus/ASTClone.cpp | |
parent | 16286b763d74b5793cf1b564252510d4a43ad71f (diff) | |
download | qt-creator-3cdd48067c8c865d050a19766948d05c86ec6e40.tar.gz |
Introduced ForeachStatementAST and the bits to parse foreach statements when qtMocRun is enabled.
Diffstat (limited to 'src/shared/cplusplus/ASTClone.cpp')
-rw-r--r-- | src/shared/cplusplus/ASTClone.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shared/cplusplus/ASTClone.cpp b/src/shared/cplusplus/ASTClone.cpp index c3eb1ab40f..2e446c89ef 100644 --- a/src/shared/cplusplus/ASTClone.cpp +++ b/src/shared/cplusplus/ASTClone.cpp @@ -514,6 +514,23 @@ FunctionDefinitionAST *FunctionDefinitionAST::clone(MemoryPool *pool) const return ast; } +ForeachStatementAST *ForeachStatementAST::clone(MemoryPool *pool) const +{ + ForeachStatementAST *ast = new (pool) ForeachStatementAST; + // copy StatementAST + // copy ForeachStatementAST + ast->foreach_token = foreach_token; + ast->lparen_token = lparen_token; + if (type_specifiers) ast->type_specifiers = type_specifiers->clone(pool); + if (declarator) ast->declarator = declarator->clone(pool); + if (initializer) ast->initializer = initializer->clone(pool); + ast->comma_token = comma_token; + if (expression) ast->expression = expression->clone(pool); + ast->rparen_token = rparen_token; + if (statement) ast->statement = statement->clone(pool); + return ast; +} + ForStatementAST *ForStatementAST::clone(MemoryPool *pool) const { ForStatementAST *ast = new (pool) ForStatementAST; |