forked from qt-creator/qt-creator
C++: Rename NewPlacementAST to ExpressionListParenAST.
It'll be reused as the initializer expression for declarators that are followed by "( expression-list )". Change-Id: I6c76a76641941874ef1ed21daa7b6e057c6d170f Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
4
src/libs/3rdparty/cplusplus/AST.cpp
vendored
4
src/libs/3rdparty/cplusplus/AST.cpp
vendored
@@ -2069,7 +2069,7 @@ unsigned NewInitializerAST::lastToken() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \generated */
|
/** \generated */
|
||||||
unsigned NewPlacementAST::firstToken() const
|
unsigned ExpressionListParenAST::firstToken() const
|
||||||
{
|
{
|
||||||
if (lparen_token)
|
if (lparen_token)
|
||||||
return lparen_token;
|
return lparen_token;
|
||||||
@@ -2082,7 +2082,7 @@ unsigned NewPlacementAST::firstToken() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** \generated */
|
/** \generated */
|
||||||
unsigned NewPlacementAST::lastToken() const
|
unsigned ExpressionListParenAST::lastToken() const
|
||||||
{
|
{
|
||||||
if (rparen_token)
|
if (rparen_token)
|
||||||
return rparen_token + 1;
|
return rparen_token + 1;
|
||||||
|
|||||||
12
src/libs/3rdparty/cplusplus/AST.h
vendored
12
src/libs/3rdparty/cplusplus/AST.h
vendored
@@ -168,6 +168,7 @@ public:
|
|||||||
virtual ExceptionDeclarationAST *asExceptionDeclaration() { return 0; }
|
virtual ExceptionDeclarationAST *asExceptionDeclaration() { return 0; }
|
||||||
virtual ExceptionSpecificationAST *asExceptionSpecification() { return 0; }
|
virtual ExceptionSpecificationAST *asExceptionSpecification() { return 0; }
|
||||||
virtual ExpressionAST *asExpression() { return 0; }
|
virtual ExpressionAST *asExpression() { return 0; }
|
||||||
|
virtual ExpressionListParenAST *asExpressionListParen() { return 0; }
|
||||||
virtual ExpressionOrDeclarationStatementAST *asExpressionOrDeclarationStatement() { return 0; }
|
virtual ExpressionOrDeclarationStatementAST *asExpressionOrDeclarationStatement() { return 0; }
|
||||||
virtual ExpressionStatementAST *asExpressionStatement() { return 0; }
|
virtual ExpressionStatementAST *asExpressionStatement() { return 0; }
|
||||||
virtual ForStatementAST *asForStatement() { return 0; }
|
virtual ForStatementAST *asForStatement() { return 0; }
|
||||||
@@ -196,7 +197,6 @@ public:
|
|||||||
virtual NewArrayDeclaratorAST *asNewArrayDeclarator() { return 0; }
|
virtual NewArrayDeclaratorAST *asNewArrayDeclarator() { return 0; }
|
||||||
virtual NewExpressionAST *asNewExpression() { return 0; }
|
virtual NewExpressionAST *asNewExpression() { return 0; }
|
||||||
virtual NewInitializerAST *asNewInitializer() { return 0; }
|
virtual NewInitializerAST *asNewInitializer() { return 0; }
|
||||||
virtual NewPlacementAST *asNewPlacement() { return 0; }
|
|
||||||
virtual NewTypeIdAST *asNewTypeId() { return 0; }
|
virtual NewTypeIdAST *asNewTypeId() { return 0; }
|
||||||
virtual NoExceptSpecificationAST *asNoExceptSpecification() { return 0; }
|
virtual NoExceptSpecificationAST *asNoExceptSpecification() { return 0; }
|
||||||
virtual NumericLiteralAST *asNumericLiteral() { return 0; }
|
virtual NumericLiteralAST *asNumericLiteral() { return 0; }
|
||||||
@@ -2402,7 +2402,7 @@ protected:
|
|||||||
virtual bool match0(AST *, ASTMatcher *);
|
virtual bool match0(AST *, ASTMatcher *);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CPLUSPLUS_EXPORT NewPlacementAST: public AST
|
class CPLUSPLUS_EXPORT ExpressionListParenAST: public ExpressionAST
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
unsigned lparen_token;
|
unsigned lparen_token;
|
||||||
@@ -2410,18 +2410,18 @@ public:
|
|||||||
unsigned rparen_token;
|
unsigned rparen_token;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NewPlacementAST()
|
ExpressionListParenAST()
|
||||||
: lparen_token(0)
|
: lparen_token(0)
|
||||||
, expression_list(0)
|
, expression_list(0)
|
||||||
, rparen_token(0)
|
, rparen_token(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
virtual NewPlacementAST *asNewPlacement() { return this; }
|
virtual ExpressionListParenAST *asExpressionListParen() { return this; }
|
||||||
|
|
||||||
virtual unsigned firstToken() const;
|
virtual unsigned firstToken() const;
|
||||||
virtual unsigned lastToken() const;
|
virtual unsigned lastToken() const;
|
||||||
|
|
||||||
virtual NewPlacementAST *clone(MemoryPool *pool) const;
|
virtual ExpressionListParenAST *clone(MemoryPool *pool) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void accept0(ASTVisitor *visitor);
|
virtual void accept0(ASTVisitor *visitor);
|
||||||
@@ -2459,7 +2459,7 @@ class CPLUSPLUS_EXPORT NewExpressionAST: public ExpressionAST
|
|||||||
public:
|
public:
|
||||||
unsigned scope_token;
|
unsigned scope_token;
|
||||||
unsigned new_token;
|
unsigned new_token;
|
||||||
NewPlacementAST *new_placement;
|
ExpressionListParenAST *new_placement;
|
||||||
|
|
||||||
unsigned lparen_token;
|
unsigned lparen_token;
|
||||||
ExpressionAST *type_id;
|
ExpressionAST *type_id;
|
||||||
|
|||||||
4
src/libs/3rdparty/cplusplus/ASTClone.cpp
vendored
4
src/libs/3rdparty/cplusplus/ASTClone.cpp
vendored
@@ -878,9 +878,9 @@ NamespaceAliasDefinitionAST *NamespaceAliasDefinitionAST::clone(MemoryPool *pool
|
|||||||
return ast;
|
return ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewPlacementAST *NewPlacementAST::clone(MemoryPool *pool) const
|
ExpressionListParenAST *ExpressionListParenAST::clone(MemoryPool *pool) const
|
||||||
{
|
{
|
||||||
NewPlacementAST *ast = new (pool) NewPlacementAST;
|
ExpressionListParenAST *ast = new (pool) ExpressionListParenAST;
|
||||||
ast->lparen_token = lparen_token;
|
ast->lparen_token = lparen_token;
|
||||||
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
|
for (ExpressionListAST *iter = expression_list, **ast_iter = &ast->expression_list;
|
||||||
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
|
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
|
||||||
|
|||||||
4
src/libs/3rdparty/cplusplus/ASTMatch0.cpp
vendored
4
src/libs/3rdparty/cplusplus/ASTMatch0.cpp
vendored
@@ -592,9 +592,9 @@ bool NamespaceAliasDefinitionAST::match0(AST *pattern, ASTMatcher *matcher)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NewPlacementAST::match0(AST *pattern, ASTMatcher *matcher)
|
bool ExpressionListParenAST::match0(AST *pattern, ASTMatcher *matcher)
|
||||||
{
|
{
|
||||||
if (NewPlacementAST *_other = pattern->asNewPlacement())
|
if (ExpressionListParenAST *_other = pattern->asExpressionListParen())
|
||||||
return matcher->match(this, _other);
|
return matcher->match(this, _other);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/ASTMatcher.cpp
vendored
2
src/libs/3rdparty/cplusplus/ASTMatcher.cpp
vendored
@@ -1492,7 +1492,7 @@ bool ASTMatcher::match(NamespaceAliasDefinitionAST *node, NamespaceAliasDefiniti
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ASTMatcher::match(NewPlacementAST *node, NewPlacementAST *pattern)
|
bool ASTMatcher::match(ExpressionListParenAST *node, ExpressionListParenAST *pattern)
|
||||||
{
|
{
|
||||||
(void) node;
|
(void) node;
|
||||||
(void) pattern;
|
(void) pattern;
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/ASTMatcher.h
vendored
2
src/libs/3rdparty/cplusplus/ASTMatcher.h
vendored
@@ -71,6 +71,7 @@ public:
|
|||||||
virtual bool match(EnumSpecifierAST *node, EnumSpecifierAST *pattern);
|
virtual bool match(EnumSpecifierAST *node, EnumSpecifierAST *pattern);
|
||||||
virtual bool match(EnumeratorAST *node, EnumeratorAST *pattern);
|
virtual bool match(EnumeratorAST *node, EnumeratorAST *pattern);
|
||||||
virtual bool match(ExceptionDeclarationAST *node, ExceptionDeclarationAST *pattern);
|
virtual bool match(ExceptionDeclarationAST *node, ExceptionDeclarationAST *pattern);
|
||||||
|
virtual bool match(ExpressionListParenAST *node, ExpressionListParenAST *pattern);
|
||||||
virtual bool match(ExpressionOrDeclarationStatementAST *node, ExpressionOrDeclarationStatementAST *pattern);
|
virtual bool match(ExpressionOrDeclarationStatementAST *node, ExpressionOrDeclarationStatementAST *pattern);
|
||||||
virtual bool match(ExpressionStatementAST *node, ExpressionStatementAST *pattern);
|
virtual bool match(ExpressionStatementAST *node, ExpressionStatementAST *pattern);
|
||||||
virtual bool match(ForStatementAST *node, ForStatementAST *pattern);
|
virtual bool match(ForStatementAST *node, ForStatementAST *pattern);
|
||||||
@@ -98,7 +99,6 @@ public:
|
|||||||
virtual bool match(NewArrayDeclaratorAST *node, NewArrayDeclaratorAST *pattern);
|
virtual bool match(NewArrayDeclaratorAST *node, NewArrayDeclaratorAST *pattern);
|
||||||
virtual bool match(NewExpressionAST *node, NewExpressionAST *pattern);
|
virtual bool match(NewExpressionAST *node, NewExpressionAST *pattern);
|
||||||
virtual bool match(NewInitializerAST *node, NewInitializerAST *pattern);
|
virtual bool match(NewInitializerAST *node, NewInitializerAST *pattern);
|
||||||
virtual bool match(NewPlacementAST *node, NewPlacementAST *pattern);
|
|
||||||
virtual bool match(NewTypeIdAST *node, NewTypeIdAST *pattern);
|
virtual bool match(NewTypeIdAST *node, NewTypeIdAST *pattern);
|
||||||
virtual bool match(NoExceptSpecificationAST *node, NoExceptSpecificationAST *pattern);
|
virtual bool match(NoExceptSpecificationAST *node, NoExceptSpecificationAST *pattern);
|
||||||
virtual bool match(NumericLiteralAST *node, NumericLiteralAST *pattern);
|
virtual bool match(NumericLiteralAST *node, NumericLiteralAST *pattern);
|
||||||
|
|||||||
@@ -578,9 +578,9 @@ public:
|
|||||||
return __ast;
|
return __ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewPlacementAST *NewPlacement(ExpressionListAST *expression_list = 0)
|
ExpressionListParenAST *ExpressionListParen(ExpressionListAST *expression_list = 0)
|
||||||
{
|
{
|
||||||
NewPlacementAST *__ast = new (&pool) NewPlacementAST;
|
ExpressionListParenAST *__ast = new (&pool) ExpressionListParenAST;
|
||||||
__ast->expression_list = expression_list;
|
__ast->expression_list = expression_list;
|
||||||
return __ast;
|
return __ast;
|
||||||
}
|
}
|
||||||
@@ -592,7 +592,7 @@ public:
|
|||||||
return __ast;
|
return __ast;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewExpressionAST *NewExpression(NewPlacementAST *new_placement = 0, ExpressionAST *type_id = 0, NewTypeIdAST *new_type_id = 0, NewInitializerAST *new_initializer = 0)
|
NewExpressionAST *NewExpression(ExpressionListParenAST *new_placement = 0, ExpressionAST *type_id = 0, NewTypeIdAST *new_type_id = 0, NewInitializerAST *new_initializer = 0)
|
||||||
{
|
{
|
||||||
NewExpressionAST *__ast = new (&pool) NewExpressionAST;
|
NewExpressionAST *__ast = new (&pool) NewExpressionAST;
|
||||||
__ast->new_placement = new_placement;
|
__ast->new_placement = new_placement;
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/ASTVisit.cpp
vendored
2
src/libs/3rdparty/cplusplus/ASTVisit.cpp
vendored
@@ -636,7 +636,7 @@ void NamespaceAliasDefinitionAST::accept0(ASTVisitor *visitor)
|
|||||||
visitor->endVisit(this);
|
visitor->endVisit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewPlacementAST::accept0(ASTVisitor *visitor)
|
void ExpressionListParenAST::accept0(ASTVisitor *visitor)
|
||||||
{
|
{
|
||||||
if (visitor->visit(this)) {
|
if (visitor->visit(this)) {
|
||||||
accept(expression_list, visitor);
|
accept(expression_list, visitor);
|
||||||
|
|||||||
4
src/libs/3rdparty/cplusplus/ASTVisitor.h
vendored
4
src/libs/3rdparty/cplusplus/ASTVisitor.h
vendored
@@ -113,6 +113,7 @@ public:
|
|||||||
virtual bool visit(EnumSpecifierAST *) { return true; }
|
virtual bool visit(EnumSpecifierAST *) { return true; }
|
||||||
virtual bool visit(EnumeratorAST *) { return true; }
|
virtual bool visit(EnumeratorAST *) { return true; }
|
||||||
virtual bool visit(ExceptionDeclarationAST *) { return true; }
|
virtual bool visit(ExceptionDeclarationAST *) { return true; }
|
||||||
|
virtual bool visit(ExpressionListParenAST *) { return true; }
|
||||||
virtual bool visit(ExpressionOrDeclarationStatementAST *) { return true; }
|
virtual bool visit(ExpressionOrDeclarationStatementAST *) { return true; }
|
||||||
virtual bool visit(ExpressionStatementAST *) { return true; }
|
virtual bool visit(ExpressionStatementAST *) { return true; }
|
||||||
virtual bool visit(ForStatementAST *) { return true; }
|
virtual bool visit(ForStatementAST *) { return true; }
|
||||||
@@ -140,7 +141,6 @@ public:
|
|||||||
virtual bool visit(NewArrayDeclaratorAST *) { return true; }
|
virtual bool visit(NewArrayDeclaratorAST *) { return true; }
|
||||||
virtual bool visit(NewExpressionAST *) { return true; }
|
virtual bool visit(NewExpressionAST *) { return true; }
|
||||||
virtual bool visit(NewInitializerAST *) { return true; }
|
virtual bool visit(NewInitializerAST *) { return true; }
|
||||||
virtual bool visit(NewPlacementAST *) { return true; }
|
|
||||||
virtual bool visit(NewTypeIdAST *) { return true; }
|
virtual bool visit(NewTypeIdAST *) { return true; }
|
||||||
virtual bool visit(NoExceptSpecificationAST *) { return true; }
|
virtual bool visit(NoExceptSpecificationAST *) { return true; }
|
||||||
virtual bool visit(NumericLiteralAST *) { return true; }
|
virtual bool visit(NumericLiteralAST *) { return true; }
|
||||||
@@ -257,6 +257,7 @@ public:
|
|||||||
virtual void endVisit(EnumSpecifierAST *) {}
|
virtual void endVisit(EnumSpecifierAST *) {}
|
||||||
virtual void endVisit(EnumeratorAST *) {}
|
virtual void endVisit(EnumeratorAST *) {}
|
||||||
virtual void endVisit(ExceptionDeclarationAST *) {}
|
virtual void endVisit(ExceptionDeclarationAST *) {}
|
||||||
|
virtual void endVisit(ExpressionListParenAST *) {}
|
||||||
virtual void endVisit(ExpressionOrDeclarationStatementAST *) {}
|
virtual void endVisit(ExpressionOrDeclarationStatementAST *) {}
|
||||||
virtual void endVisit(ExpressionStatementAST *) {}
|
virtual void endVisit(ExpressionStatementAST *) {}
|
||||||
virtual void endVisit(ForStatementAST *) {}
|
virtual void endVisit(ForStatementAST *) {}
|
||||||
@@ -284,7 +285,6 @@ public:
|
|||||||
virtual void endVisit(NewArrayDeclaratorAST *) {}
|
virtual void endVisit(NewArrayDeclaratorAST *) {}
|
||||||
virtual void endVisit(NewExpressionAST *) {}
|
virtual void endVisit(NewExpressionAST *) {}
|
||||||
virtual void endVisit(NewInitializerAST *) {}
|
virtual void endVisit(NewInitializerAST *) {}
|
||||||
virtual void endVisit(NewPlacementAST *) {}
|
|
||||||
virtual void endVisit(NewTypeIdAST *) {}
|
virtual void endVisit(NewTypeIdAST *) {}
|
||||||
virtual void endVisit(NoExceptSpecificationAST *) {}
|
virtual void endVisit(NoExceptSpecificationAST *) {}
|
||||||
virtual void endVisit(NumericLiteralAST *) {}
|
virtual void endVisit(NumericLiteralAST *) {}
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/ASTfwd.h
vendored
2
src/libs/3rdparty/cplusplus/ASTfwd.h
vendored
@@ -75,6 +75,7 @@ class EnumeratorAST;
|
|||||||
class ExceptionDeclarationAST;
|
class ExceptionDeclarationAST;
|
||||||
class ExceptionSpecificationAST;
|
class ExceptionSpecificationAST;
|
||||||
class ExpressionAST;
|
class ExpressionAST;
|
||||||
|
class ExpressionListParenAST;
|
||||||
class ExpressionOrDeclarationStatementAST;
|
class ExpressionOrDeclarationStatementAST;
|
||||||
class ExpressionStatementAST;
|
class ExpressionStatementAST;
|
||||||
class ForStatementAST;
|
class ForStatementAST;
|
||||||
@@ -103,7 +104,6 @@ class NestedNameSpecifierAST;
|
|||||||
class NewArrayDeclaratorAST;
|
class NewArrayDeclaratorAST;
|
||||||
class NewExpressionAST;
|
class NewExpressionAST;
|
||||||
class NewInitializerAST;
|
class NewInitializerAST;
|
||||||
class NewPlacementAST;
|
|
||||||
class NewTypeIdAST;
|
class NewTypeIdAST;
|
||||||
class NoExceptSpecificationAST;
|
class NoExceptSpecificationAST;
|
||||||
class NumericLiteralAST;
|
class NumericLiteralAST;
|
||||||
|
|||||||
4
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
4
src/libs/3rdparty/cplusplus/Bind.cpp
vendored
@@ -539,14 +539,14 @@ const Name *Bind::nestedNameSpecifier(NestedNameSpecifierAST *ast)
|
|||||||
return class_or_namespace_name;
|
return class_or_namespace_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Bind::visit(NewPlacementAST *ast)
|
bool Bind::visit(ExpressionListParenAST *ast)
|
||||||
{
|
{
|
||||||
(void) ast;
|
(void) ast;
|
||||||
assert(!"unreachable");
|
assert(!"unreachable");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bind::newPlacement(NewPlacementAST *ast)
|
void Bind::newPlacement(ExpressionListParenAST *ast)
|
||||||
{
|
{
|
||||||
if (! ast)
|
if (! ast)
|
||||||
return;
|
return;
|
||||||
|
|||||||
4
src/libs/3rdparty/cplusplus/Bind.h
vendored
4
src/libs/3rdparty/cplusplus/Bind.h
vendored
@@ -85,7 +85,7 @@ protected:
|
|||||||
FullySpecifiedType exceptionSpecification(ExceptionSpecificationAST *ast, const FullySpecifiedType &init);
|
FullySpecifiedType exceptionSpecification(ExceptionSpecificationAST *ast, const FullySpecifiedType &init);
|
||||||
void memInitializer(MemInitializerAST *ast, Function *fun);
|
void memInitializer(MemInitializerAST *ast, Function *fun);
|
||||||
const Name *nestedNameSpecifier(NestedNameSpecifierAST *ast);
|
const Name *nestedNameSpecifier(NestedNameSpecifierAST *ast);
|
||||||
void newPlacement(NewPlacementAST *ast);
|
void newPlacement(ExpressionListParenAST *ast);
|
||||||
FullySpecifiedType newArrayDeclarator(NewArrayDeclaratorAST *ast, const FullySpecifiedType &init);
|
FullySpecifiedType newArrayDeclarator(NewArrayDeclaratorAST *ast, const FullySpecifiedType &init);
|
||||||
void newInitializer(NewInitializerAST *ast);
|
void newInitializer(NewInitializerAST *ast);
|
||||||
FullySpecifiedType newTypeId(NewTypeIdAST *ast);
|
FullySpecifiedType newTypeId(NewTypeIdAST *ast);
|
||||||
@@ -122,7 +122,7 @@ protected:
|
|||||||
virtual bool visit(DynamicExceptionSpecificationAST *ast);
|
virtual bool visit(DynamicExceptionSpecificationAST *ast);
|
||||||
virtual bool visit(MemInitializerAST *ast);
|
virtual bool visit(MemInitializerAST *ast);
|
||||||
virtual bool visit(NestedNameSpecifierAST *ast);
|
virtual bool visit(NestedNameSpecifierAST *ast);
|
||||||
virtual bool visit(NewPlacementAST *ast);
|
virtual bool visit(ExpressionListParenAST *ast);
|
||||||
virtual bool visit(NewArrayDeclaratorAST *ast);
|
virtual bool visit(NewArrayDeclaratorAST *ast);
|
||||||
virtual bool visit(NewInitializerAST *ast);
|
virtual bool visit(NewInitializerAST *ast);
|
||||||
virtual bool visit(NewTypeIdAST *ast);
|
virtual bool visit(NewTypeIdAST *ast);
|
||||||
|
|||||||
14
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
14
src/libs/3rdparty/cplusplus/Parser.cpp
vendored
@@ -2731,6 +2731,8 @@ bool Parser::parseTypeIdList(ExpressionListAST *&node)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note that this function doesn't parse a C++11-style expression-list
|
||||||
|
// yet, so it doesn't allow for brace-initializers.
|
||||||
bool Parser::parseExpressionList(ExpressionListAST *&node)
|
bool Parser::parseExpressionList(ExpressionListAST *&node)
|
||||||
{
|
{
|
||||||
DEBUG_THIS_RULE();
|
DEBUG_THIS_RULE();
|
||||||
@@ -4827,7 +4829,7 @@ bool Parser::parseUnaryExpression(ExpressionAST *&node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// new-placement ::= T_LPAREN expression-list T_RPAREN
|
// new-placement ::= T_LPAREN expression-list T_RPAREN
|
||||||
bool Parser::parseNewPlacement(NewPlacementAST *&node)
|
bool Parser::parseExpressionListParen(ExpressionListParenAST *&node)
|
||||||
{
|
{
|
||||||
DEBUG_THIS_RULE();
|
DEBUG_THIS_RULE();
|
||||||
if (LA() == T_LPAREN) {
|
if (LA() == T_LPAREN) {
|
||||||
@@ -4835,7 +4837,7 @@ bool Parser::parseNewPlacement(NewPlacementAST *&node)
|
|||||||
ExpressionListAST *expression_list = 0;
|
ExpressionListAST *expression_list = 0;
|
||||||
if (parseExpressionList(expression_list) && expression_list && LA() == T_RPAREN) {
|
if (parseExpressionList(expression_list) && expression_list && LA() == T_RPAREN) {
|
||||||
unsigned rparen_token = consumeToken();
|
unsigned rparen_token = consumeToken();
|
||||||
NewPlacementAST *ast = new (_pool) NewPlacementAST;
|
ExpressionListParenAST *ast = new (_pool) ExpressionListParenAST;
|
||||||
ast->lparen_token = lparen_token;
|
ast->lparen_token = lparen_token;
|
||||||
ast->expression_list = expression_list;
|
ast->expression_list = expression_list;
|
||||||
ast->rparen_token = rparen_token;
|
ast->rparen_token = rparen_token;
|
||||||
@@ -4863,14 +4865,14 @@ bool Parser::parseNewExpression(ExpressionAST *&node)
|
|||||||
|
|
||||||
ast->new_token = consumeToken();
|
ast->new_token = consumeToken();
|
||||||
|
|
||||||
NewPlacementAST *new_placement = 0;
|
ExpressionListParenAST *parenExpressionList = 0;
|
||||||
|
|
||||||
if (parseNewPlacement(new_placement)) {
|
if (parseExpressionListParen(parenExpressionList)) {
|
||||||
unsigned after_new_placement = cursor();
|
unsigned after_new_placement = cursor();
|
||||||
|
|
||||||
NewTypeIdAST *new_type_id = 0;
|
NewTypeIdAST *new_type_id = 0;
|
||||||
if (parseNewTypeId(new_type_id)) {
|
if (parseNewTypeId(new_type_id)) {
|
||||||
ast->new_placement = new_placement;
|
ast->new_placement = parenExpressionList;
|
||||||
ast->new_type_id = new_type_id;
|
ast->new_type_id = new_type_id;
|
||||||
parseNewInitializer(ast->new_initializer);
|
parseNewInitializer(ast->new_initializer);
|
||||||
// recognized new-placement.opt new-type-id new-initializer.opt
|
// recognized new-placement.opt new-type-id new-initializer.opt
|
||||||
@@ -4883,7 +4885,7 @@ bool Parser::parseNewExpression(ExpressionAST *&node)
|
|||||||
unsigned lparen_token = consumeToken();
|
unsigned lparen_token = consumeToken();
|
||||||
ExpressionAST *type_id = 0;
|
ExpressionAST *type_id = 0;
|
||||||
if (parseTypeId(type_id) && LA() == T_RPAREN) {
|
if (parseTypeId(type_id) && LA() == T_RPAREN) {
|
||||||
ast->new_placement = new_placement;
|
ast->new_placement = parenExpressionList;
|
||||||
ast->lparen_token = lparen_token;
|
ast->lparen_token = lparen_token;
|
||||||
ast->type_id = type_id;
|
ast->type_id = type_id;
|
||||||
ast->rparen_token = consumeToken();
|
ast->rparen_token = consumeToken();
|
||||||
|
|||||||
2
src/libs/3rdparty/cplusplus/Parser.h
vendored
2
src/libs/3rdparty/cplusplus/Parser.h
vendored
@@ -131,7 +131,7 @@ public:
|
|||||||
bool parseNamespaceAliasDefinition(DeclarationAST *&node);
|
bool parseNamespaceAliasDefinition(DeclarationAST *&node);
|
||||||
bool parseNewArrayDeclarator(NewArrayDeclaratorListAST *&node);
|
bool parseNewArrayDeclarator(NewArrayDeclaratorListAST *&node);
|
||||||
bool parseNewExpression(ExpressionAST *&node);
|
bool parseNewExpression(ExpressionAST *&node);
|
||||||
bool parseNewPlacement(NewPlacementAST *&node);
|
bool parseExpressionListParen(ExpressionListParenAST *&node);
|
||||||
bool parseNewInitializer(NewInitializerAST *&node);
|
bool parseNewInitializer(NewInitializerAST *&node);
|
||||||
bool parseNewTypeId(NewTypeIdAST *&node);
|
bool parseNewTypeId(NewTypeIdAST *&node);
|
||||||
bool parseOperator(OperatorAST *&node);
|
bool parseOperator(OperatorAST *&node);
|
||||||
|
|||||||
@@ -559,14 +559,14 @@ void FindUsages::nestedNameSpecifier(NestedNameSpecifierAST *ast)
|
|||||||
// unsigned scope_token = ast->scope_token;
|
// unsigned scope_token = ast->scope_token;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FindUsages::visit(NewPlacementAST *ast)
|
bool FindUsages::visit(ExpressionListParenAST *ast)
|
||||||
{
|
{
|
||||||
(void) ast;
|
(void) ast;
|
||||||
Q_ASSERT(!"unreachable");
|
Q_ASSERT(!"unreachable");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindUsages::newPlacement(NewPlacementAST *ast)
|
void FindUsages::newPlacement(ExpressionListParenAST *ast)
|
||||||
{
|
{
|
||||||
if (! ast)
|
if (! ast)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ protected:
|
|||||||
void exceptionSpecification(ExceptionSpecificationAST *ast);
|
void exceptionSpecification(ExceptionSpecificationAST *ast);
|
||||||
void memInitializer(MemInitializerAST *ast);
|
void memInitializer(MemInitializerAST *ast);
|
||||||
void nestedNameSpecifier(NestedNameSpecifierAST *ast);
|
void nestedNameSpecifier(NestedNameSpecifierAST *ast);
|
||||||
void newPlacement(NewPlacementAST *ast);
|
void newPlacement(ExpressionListParenAST *ast);
|
||||||
void newArrayDeclarator(NewArrayDeclaratorAST *ast);
|
void newArrayDeclarator(NewArrayDeclaratorAST *ast);
|
||||||
void newInitializer(NewInitializerAST *ast);
|
void newInitializer(NewInitializerAST *ast);
|
||||||
void newTypeId(NewTypeIdAST *ast);
|
void newTypeId(NewTypeIdAST *ast);
|
||||||
@@ -137,7 +137,7 @@ protected:
|
|||||||
virtual bool visit(DynamicExceptionSpecificationAST *ast);
|
virtual bool visit(DynamicExceptionSpecificationAST *ast);
|
||||||
virtual bool visit(MemInitializerAST *ast);
|
virtual bool visit(MemInitializerAST *ast);
|
||||||
virtual bool visit(NestedNameSpecifierAST *ast);
|
virtual bool visit(NestedNameSpecifierAST *ast);
|
||||||
virtual bool visit(NewPlacementAST *ast);
|
virtual bool visit(ExpressionListParenAST *ast);
|
||||||
virtual bool visit(NewArrayDeclaratorAST *ast);
|
virtual bool visit(NewArrayDeclaratorAST *ast);
|
||||||
virtual bool visit(NewInitializerAST *ast);
|
virtual bool visit(NewInitializerAST *ast);
|
||||||
virtual bool visit(NewTypeIdAST *ast);
|
virtual bool visit(NewTypeIdAST *ast);
|
||||||
|
|||||||
@@ -359,6 +359,8 @@ virtual bool visit(ClassSpecifierAST *ast)
|
|||||||
for (SpecifierListAST *iter = ast->attribute_list; iter; iter = iter->next)
|
for (SpecifierListAST *iter = ast->attribute_list; iter; iter = iter->next)
|
||||||
nonterminal(iter->value);
|
nonterminal(iter->value);
|
||||||
nonterminal(ast->name);
|
nonterminal(ast->name);
|
||||||
|
if (ast->final_token)
|
||||||
|
terminal(ast->final_token, ast);
|
||||||
if (ast->colon_token)
|
if (ast->colon_token)
|
||||||
terminal(ast->colon_token, ast);
|
terminal(ast->colon_token, ast);
|
||||||
for (BaseSpecifierListAST *iter = ast->base_clause_list; iter; iter = iter->next)
|
for (BaseSpecifierListAST *iter = ast->base_clause_list; iter; iter = iter->next)
|
||||||
@@ -649,6 +651,25 @@ virtual bool visit(ForeachStatementAST *ast)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool visit(RangeBasedForStatementAST *ast)
|
||||||
|
{
|
||||||
|
if (ast->for_token)
|
||||||
|
terminal(ast->for_token, ast);
|
||||||
|
if (ast->lparen_token)
|
||||||
|
terminal(ast->lparen_token, ast);
|
||||||
|
for (SpecifierListAST *iter = ast->type_specifier_list; iter; iter = iter->next)
|
||||||
|
nonterminal(iter->value);
|
||||||
|
nonterminal(ast->declarator);
|
||||||
|
nonterminal(ast->initializer);
|
||||||
|
if (ast->colon_token)
|
||||||
|
terminal(ast->colon_token, ast);
|
||||||
|
nonterminal(ast->expression);
|
||||||
|
if (ast->rparen_token)
|
||||||
|
terminal(ast->rparen_token, ast);
|
||||||
|
nonterminal(ast->statement);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
virtual bool visit(ForStatementAST *ast)
|
virtual bool visit(ForStatementAST *ast)
|
||||||
{
|
{
|
||||||
if (ast->for_token)
|
if (ast->for_token)
|
||||||
@@ -831,7 +852,7 @@ virtual bool visit(NamespaceAliasDefinitionAST *ast)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool visit(NewPlacementAST *ast)
|
virtual bool visit(ExpressionListParenAST *ast)
|
||||||
{
|
{
|
||||||
if (ast->lparen_token)
|
if (ast->lparen_token)
|
||||||
terminal(ast->lparen_token, ast);
|
terminal(ast->lparen_token, ast);
|
||||||
|
|||||||
Reference in New Issue
Block a user