Commit 688d382a authored by Roberto Raggi's avatar Roberto Raggi

Some cleanup in the C++ AST.

parent 4da21c61
......@@ -647,7 +647,7 @@ void FindUsages::parameterDeclarationClause(ParameterDeclarationClauseAST *ast)
if (! ast)
return;
for (DeclarationListAST *it = ast->parameter_declaration_list; it; it = it->next) {
for (ParameterDeclarationListAST *it = ast->parameter_declaration_list; it; it = it->next) {
this->declaration(it->value);
}
// unsigned dot_dot_dot_token = ast->dot_dot_dot_token;
......@@ -912,7 +912,7 @@ void FindUsages::trailingReturnType(TrailingReturnTypeAST *ast)
for (SpecifierListAST *it = ast->attributes; it; it = it->next) {
this->specifier(it->value);
}
for (SpecifierListAST *it = ast->type_specifiers; it; it = it->next) {
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
this->specifier(it->value);
}
this->declarator(ast->declarator);
......@@ -1474,7 +1474,7 @@ bool FindUsages::visit(QtPrivateSlotAST *ast)
// unsigned dptr_lparen_token = ast->dptr_lparen_token;
// unsigned dptr_rparen_token = ast->dptr_rparen_token;
// unsigned comma_token = ast->comma_token;
for (SpecifierListAST *it = ast->type_specifiers; it; it = it->next) {
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
this->specifier(it->value);
}
this->declarator(ast->declarator);
......@@ -1488,7 +1488,7 @@ bool FindUsages::visit(QtPropertyDeclarationAST *ast)
// unsigned lparen_token = ast->lparen_token;
this->expression(ast->type_id);
/*const Name *property_name =*/ this->name(ast->property_name);
for (QtPropertyDeclarationItemListAST *it = ast->property_declaration_items; it; it = it->next) {
for (QtPropertyDeclarationItemListAST *it = ast->property_declaration_item_list; it; it = it->next) {
this->qtPropertyDeclarationItem(it->value);
}
// unsigned rparen_token = ast->rparen_token;
......@@ -2126,7 +2126,7 @@ bool FindUsages::visit(NestedDeclaratorAST *ast)
bool FindUsages::visit(FunctionDeclaratorAST *ast)
{
// unsigned lparen_token = ast->lparen_token;
this->parameterDeclarationClause(ast->parameters);
this->parameterDeclarationClause(ast->parameter_declaration_clause);
// unsigned rparen_token = ast->rparen_token;
for (SpecifierListAST *it = ast->cv_qualifier_list; it; it = it->next) {
this->specifier(it->value);
......
......@@ -1379,8 +1379,8 @@ unsigned FunctionDeclaratorAST::firstToken() const
{
if (lparen_token)
return lparen_token;
if (parameters)
if (unsigned candidate = parameters->firstToken())
if (parameter_declaration_clause)
if (unsigned candidate = parameter_declaration_clause->firstToken())
return candidate;
if (rparen_token)
return rparen_token;
......@@ -1416,8 +1416,8 @@ unsigned FunctionDeclaratorAST::lastToken() const
return candidate;
if (rparen_token)
return rparen_token + 1;
if (parameters)
if (unsigned candidate = parameters->lastToken())
if (parameter_declaration_clause)
if (unsigned candidate = parameter_declaration_clause->lastToken())
return candidate;
if (lparen_token)
return lparen_token + 1;
......@@ -3317,8 +3317,8 @@ unsigned QtPrivateSlotAST::firstToken() const
return dptr_rparen_token;
if (comma_token)
return comma_token;
if (type_specifiers)
if (unsigned candidate = type_specifiers->firstToken())
if (type_specifier_list)
if (unsigned candidate = type_specifier_list->firstToken())
return candidate;
if (declarator)
if (unsigned candidate = declarator->firstToken())
......@@ -3336,8 +3336,8 @@ unsigned QtPrivateSlotAST::lastToken() const
if (declarator)
if (unsigned candidate = declarator->lastToken())
return candidate;
if (type_specifiers)
if (unsigned candidate = type_specifiers->lastToken())
if (type_specifier_list)
if (unsigned candidate = type_specifier_list->lastToken())
return candidate;
if (comma_token)
return comma_token + 1;
......@@ -3367,8 +3367,8 @@ unsigned QtPropertyDeclarationAST::firstToken() const
if (property_name)
if (unsigned candidate = property_name->firstToken())
return candidate;
if (property_declaration_items)
if (unsigned candidate = property_declaration_items->firstToken())
if (property_declaration_item_list)
if (unsigned candidate = property_declaration_item_list->firstToken())
return candidate;
if (rparen_token)
return rparen_token;
......@@ -3380,8 +3380,8 @@ unsigned QtPropertyDeclarationAST::lastToken() const
{
if (rparen_token)
return rparen_token + 1;
if (property_declaration_items)
if (unsigned candidate = property_declaration_items->lastToken())
if (property_declaration_item_list)
if (unsigned candidate = property_declaration_item_list->lastToken())
return candidate;
if (property_name)
if (unsigned candidate = property_name->lastToken())
......@@ -3818,8 +3818,8 @@ unsigned TrailingReturnTypeAST::firstToken() const
if (attributes)
if (unsigned candidate = attributes->firstToken())
return candidate;
if (type_specifiers)
if (unsigned candidate = type_specifiers->firstToken())
if (type_specifier_list)
if (unsigned candidate = type_specifier_list->firstToken())
return candidate;
if (declarator)
if (unsigned candidate = declarator->firstToken())
......@@ -3833,8 +3833,8 @@ unsigned TrailingReturnTypeAST::lastToken() const
if (declarator)
if (unsigned candidate = declarator->lastToken())
return candidate;
if (type_specifiers)
if (unsigned candidate = type_specifiers->lastToken())
if (type_specifier_list)
if (unsigned candidate = type_specifier_list->lastToken())
return candidate;
if (attributes)
if (unsigned candidate = attributes->lastToken())
......
......@@ -711,7 +711,7 @@ public:
unsigned dptr_lparen_token;
unsigned dptr_rparen_token;
unsigned comma_token;
SpecifierListAST *type_specifiers;
SpecifierListAST *type_specifier_list;
DeclaratorAST *declarator;
unsigned rparen_token;
......@@ -723,7 +723,7 @@ public:
, dptr_lparen_token(0)
, dptr_rparen_token(0)
, comma_token(0)
, type_specifiers(0)
, type_specifier_list(0)
, declarator(0)
, rparen_token(0)
{}
......@@ -771,7 +771,7 @@ public:
unsigned lparen_token;
ExpressionAST *type_id;
NameAST *property_name;
QtPropertyDeclarationItemListAST *property_declaration_items;
QtPropertyDeclarationItemListAST *property_declaration_item_list;
unsigned rparen_token;
public:
......@@ -780,7 +780,7 @@ public:
, lparen_token(0)
, type_id(0)
, property_name(0)
, property_declaration_items(0)
, property_declaration_item_list(0)
, rparen_token(0)
{}
......@@ -1442,7 +1442,7 @@ class CPLUSPLUS_EXPORT FunctionDeclaratorAST: public PostfixDeclaratorAST
{
public:
unsigned lparen_token;
ParameterDeclarationClauseAST *parameters;
ParameterDeclarationClauseAST *parameter_declaration_clause;
unsigned rparen_token;
SpecifierListAST *cv_qualifier_list;
ExceptionSpecificationAST *exception_specification;
......@@ -1455,7 +1455,7 @@ public: // annotations
public:
FunctionDeclaratorAST()
: lparen_token(0)
, parameters(0)
, parameter_declaration_clause(0)
, rparen_token(0)
, cv_qualifier_list(0)
, exception_specification(0)
......@@ -1733,8 +1733,8 @@ protected:
class CPLUSPLUS_EXPORT ExpressionOrDeclarationStatementAST: public StatementAST
{
public:
StatementAST *expression;
StatementAST *declaration;
ExpressionStatementAST *expression;
DeclarationStatementAST *declaration;
public:
ExpressionOrDeclarationStatementAST()
......@@ -2507,7 +2507,7 @@ protected:
class CPLUSPLUS_EXPORT ParameterDeclarationClauseAST: public AST
{
public:
DeclarationListAST *parameter_declaration_list;
ParameterDeclarationListAST *parameter_declaration_list;
unsigned dot_dot_dot_token;
public:
......@@ -4261,14 +4261,14 @@ class TrailingReturnTypeAST: public AST
public:
unsigned arrow_token;
SpecifierListAST *attributes;
SpecifierListAST *type_specifiers;
SpecifierListAST *type_specifier_list;
DeclaratorAST *declarator;
public:
TrailingReturnTypeAST()
: arrow_token(0)
, attributes(0)
, type_specifiers(0)
, type_specifier_list(0)
, declarator(0)
{}
......
......@@ -171,7 +171,7 @@ QtPrivateSlotAST *QtPrivateSlotAST::clone(MemoryPool *pool) const
ast->dptr_lparen_token = dptr_lparen_token;
ast->dptr_rparen_token = dptr_rparen_token;
ast->comma_token = comma_token;
for (SpecifierListAST *iter = type_specifiers, **ast_iter = &ast->type_specifiers;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
if (declarator)
......@@ -198,7 +198,7 @@ QtPropertyDeclarationAST *QtPropertyDeclarationAST::clone(MemoryPool *pool) cons
ast->type_id = type_id->clone(pool);
if (property_name)
ast->property_name = property_name->clone(pool);
for (QtPropertyDeclarationItemListAST *iter = property_declaration_items, **ast_iter = &ast->property_declaration_items;
for (QtPropertyDeclarationItemListAST *iter = property_declaration_item_list, **ast_iter = &ast->property_declaration_item_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) QtPropertyDeclarationItemListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->rparen_token = rparen_token;
......@@ -475,8 +475,8 @@ FunctionDeclaratorAST *FunctionDeclaratorAST::clone(MemoryPool *pool) const
{
FunctionDeclaratorAST *ast = new (pool) FunctionDeclaratorAST;
ast->lparen_token = lparen_token;
if (parameters)
ast->parameters = parameters->clone(pool);
if (parameter_declaration_clause)
ast->parameter_declaration_clause = parameter_declaration_clause->clone(pool);
ast->rparen_token = rparen_token;
for (SpecifierListAST *iter = cv_qualifier_list, **ast_iter = &ast->cv_qualifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
......@@ -927,9 +927,9 @@ ParameterDeclarationAST *ParameterDeclarationAST::clone(MemoryPool *pool) const
ParameterDeclarationClauseAST *ParameterDeclarationClauseAST::clone(MemoryPool *pool) const
{
ParameterDeclarationClauseAST *ast = new (pool) ParameterDeclarationClauseAST;
for (DeclarationListAST *iter = parameter_declaration_list, **ast_iter = &ast->parameter_declaration_list;
for (ParameterDeclarationListAST *iter = parameter_declaration_list, **ast_iter = &ast->parameter_declaration_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) DeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
*ast_iter = new (pool) ParameterDeclarationListAST((iter->value) ? iter->value->clone(pool) : 0);
ast->dot_dot_dot_token = dot_dot_dot_token;
return ast;
}
......@@ -1659,7 +1659,7 @@ TrailingReturnTypeAST *TrailingReturnTypeAST::clone(MemoryPool *pool) const
for (SpecifierListAST *iter = attributes, **ast_iter = &ast->attributes;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
for (SpecifierListAST *iter = type_specifiers, **ast_iter = &ast->type_specifiers;
for (SpecifierListAST *iter = type_specifier_list, **ast_iter = &ast->type_specifier_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) SpecifierListAST((iter->value) ? iter->value->clone(pool) : 0);
if (declarator)
......
......@@ -258,9 +258,9 @@ bool ASTMatcher::match(QtPrivateSlotAST *node, QtPrivateSlotAST *pattern)
pattern->comma_token = node->comma_token;
if (! pattern->type_specifiers)
pattern->type_specifiers = node->type_specifiers;
else if (! AST::match(node->type_specifiers, pattern->type_specifiers, this))
if (! pattern->type_specifier_list)
pattern->type_specifier_list = node->type_specifier_list;
else if (! AST::match(node->type_specifier_list, pattern->type_specifier_list, this))
return false;
if (! pattern->declarator)
......@@ -307,9 +307,9 @@ bool ASTMatcher::match(QtPropertyDeclarationAST *node, QtPropertyDeclarationAST
else if (! AST::match(node->property_name, pattern->property_name, this))
return false;
if (! pattern->property_declaration_items)
pattern->property_declaration_items = node->property_declaration_items;
else if (! AST::match(node->property_declaration_items, pattern->property_declaration_items, this))
if (! pattern->property_declaration_item_list)
pattern->property_declaration_item_list = node->property_declaration_item_list;
else if (! AST::match(node->property_declaration_item_list, pattern->property_declaration_item_list, this))
return false;
pattern->rparen_token = node->rparen_token;
......@@ -778,9 +778,9 @@ bool ASTMatcher::match(FunctionDeclaratorAST *node, FunctionDeclaratorAST *patte
pattern->lparen_token = node->lparen_token;
if (! pattern->parameters)
pattern->parameters = node->parameters;
else if (! AST::match(node->parameters, pattern->parameters, this))
if (! pattern->parameter_declaration_clause)
pattern->parameter_declaration_clause = node->parameter_declaration_clause;
else if (! AST::match(node->parameter_declaration_clause, pattern->parameter_declaration_clause, this))
return false;
pattern->rparen_token = node->rparen_token;
......@@ -2804,9 +2804,9 @@ bool ASTMatcher::match(TrailingReturnTypeAST *node, TrailingReturnTypeAST *patte
else if (! AST::match(node->attributes, pattern->attributes, this))
return false;
if (! pattern->type_specifiers)
pattern->type_specifiers = node->type_specifiers;
else if (! AST::match(node->type_specifiers, pattern->type_specifiers, this))
if (! pattern->type_specifier_list)
pattern->type_specifier_list = node->type_specifier_list;
else if (! AST::match(node->type_specifier_list, pattern->type_specifier_list, this))
return false;
if (! pattern->declarator)
......
......@@ -215,7 +215,7 @@ public:
FunctionDeclaratorAST *FunctionDeclarator(ParameterDeclarationClauseAST *parameters = 0, ExceptionSpecificationAST *exception_specification = 0, ExpressionAST *as_cpp_initializer = 0)
{
FunctionDeclaratorAST *__ast = new (&pool) FunctionDeclaratorAST;
__ast->parameters = parameters;
__ast->parameter_declaration_clause = parameters;
__ast->exception_specification = exception_specification;
__ast->as_cpp_initializer = as_cpp_initializer;
return __ast;
......@@ -284,7 +284,7 @@ public:
return __ast;
}
ExpressionOrDeclarationStatementAST *ExpressionOrDeclarationStatement(StatementAST *expression = 0, StatementAST *declaration = 0)
ExpressionOrDeclarationStatementAST *ExpressionOrDeclarationStatement(ExpressionStatementAST *expression = 0, DeclarationStatementAST *declaration = 0)
{
ExpressionOrDeclarationStatementAST *__ast = new (&pool) ExpressionOrDeclarationStatementAST;
__ast->expression = expression;
......
......@@ -133,7 +133,7 @@ void QtObjectTagAST::accept0(ASTVisitor *visitor)
void QtPrivateSlotAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
accept(type_specifiers, visitor);
accept(type_specifier_list, visitor);
accept(declarator, visitor);
}
visitor->endVisit(this);
......@@ -152,7 +152,7 @@ void QtPropertyDeclarationAST::accept0(ASTVisitor *visitor)
if (visitor->visit(this)) {
accept(type_id, visitor);
accept(property_name, visitor);
accept(property_declaration_items, visitor);
accept(property_declaration_item_list, visitor);
}
visitor->endVisit(this);
}
......@@ -355,7 +355,7 @@ void NestedDeclaratorAST::accept0(ASTVisitor *visitor)
void FunctionDeclaratorAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
accept(parameters, visitor);
accept(parameter_declaration_clause, visitor);
accept(cv_qualifier_list, visitor);
accept(exception_specification, visitor);
accept(trailing_return_type, visitor);
......@@ -1211,7 +1211,7 @@ void TrailingReturnTypeAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
accept(attributes, visitor);
accept(type_specifiers, visitor);
accept(type_specifier_list, visitor);
accept(declarator, visitor);
}
visitor->endVisit(this);
......
......@@ -226,6 +226,7 @@ typedef List<QtPropertyDeclarationItemAST *> QtPropertyDeclarationItemListAST;
typedef List<NameAST *> NameListAST;
typedef List<QtInterfaceNameAST *> QtInterfaceNameListAST;
typedef List<ParameterDeclarationAST *> ParameterDeclarationListAST;
typedef List<CaptureAST *> CaptureListAST;
typedef List<ObjCMessageArgumentAST *> ObjCMessageArgumentListAST;
......
......@@ -830,7 +830,7 @@ void Bind::parameterDeclarationClause(ParameterDeclarationClauseAST *ast, unsign
Scope *previousScope = switchScope(fun);
for (DeclarationListAST *it = ast->parameter_declaration_list; it; it = it->next) {
for (ParameterDeclarationListAST *it = ast->parameter_declaration_list; it; it = it->next) {
this->declaration(it->value);
}
......@@ -1128,7 +1128,7 @@ FullySpecifiedType Bind::trailingReturnType(TrailingReturnTypeAST *ast, const Fu
for (SpecifierListAST *it = ast->attributes; it; it = it->next) {
type = this->specifier(it->value, type);
}
for (SpecifierListAST *it = ast->type_specifiers; it; it = it->next) {
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
......@@ -1831,7 +1831,7 @@ bool Bind::visit(QtPrivateSlotAST *ast)
// unsigned dptr_rparen_token = ast->dptr_rparen_token;
// unsigned comma_token = ast->comma_token;
FullySpecifiedType type;
for (SpecifierListAST *it = ast->type_specifiers; it; it = it->next) {
for (SpecifierListAST *it = ast->type_specifier_list; it; it = it->next) {
type = this->specifier(it->value, type);
}
DeclaratorIdAST *declaratorId = 0;
......@@ -1846,7 +1846,7 @@ bool Bind::visit(QtPropertyDeclarationAST *ast)
// unsigned lparen_token = ast->lparen_token;
ExpressionTy type_id = this->expression(ast->type_id);
/*const Name *property_name =*/ this->name(ast->property_name);
for (QtPropertyDeclarationItemListAST *it = ast->property_declaration_items; it; it = it->next) {
for (QtPropertyDeclarationItemListAST *it = ast->property_declaration_item_list; it; it = it->next) {
this->qtPropertyDeclarationItem(it->value);
}
// unsigned rparen_token = ast->rparen_token;
......@@ -2882,7 +2882,7 @@ bool Bind::visit(FunctionDeclaratorAST *ast)
fun->setReturnType(_type);
// unsigned lparen_token = ast->lparen_token;
this->parameterDeclarationClause(ast->parameters, ast->lparen_token, fun);
this->parameterDeclarationClause(ast->parameter_declaration_clause, ast->lparen_token, fun);
// unsigned rparen_token = ast->rparen_token;
FullySpecifiedType type(fun);
for (SpecifierListAST *it = ast->cv_qualifier_list; it; it = it->next) {
......
......@@ -1338,7 +1338,7 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specif
FunctionDeclaratorAST *ast = new (_pool) FunctionDeclaratorAST;
ast->lparen_token = lparen_token;
ast->parameters = parameter_declaration_clause;
ast->parameter_declaration_clause = parameter_declaration_clause;
ast->as_cpp_initializer = initializer;
ast->rparen_token = rparen_token;
*postfix_ptr = new (_pool) PostfixDeclaratorListAST(ast);
......@@ -1362,7 +1362,7 @@ bool Parser::parseDeclarator(DeclaratorAST *&node, SpecifierListAST *decl_specif
FunctionDeclaratorAST *ast = new (_pool) FunctionDeclaratorAST;
ast->lparen_token = consumeToken();
parseParameterDeclarationClause(ast->parameters);
parseParameterDeclarationClause(ast->parameter_declaration_clause);
if (LA() != T_RPAREN) {
rewind(startOfPostDeclarator);
break;
......@@ -1457,7 +1457,7 @@ bool Parser::parseAbstractDeclarator(DeclaratorAST *&node, SpecifierListAST *dec
if (LA() == T_LPAREN) {
FunctionDeclaratorAST *ast = new (_pool) FunctionDeclaratorAST;
ast->lparen_token = consumeToken();
if (LA() == T_RPAREN || parseParameterDeclarationClause(ast->parameters)) {
if (LA() == T_RPAREN || parseParameterDeclarationClause(ast->parameter_declaration_clause)) {
if (LA() == T_RPAREN)
ast->rparen_token = consumeToken();
}
......@@ -1557,7 +1557,9 @@ bool Parser::parseTemplateParameter(DeclarationAST *&node)
if (parseTypeParameter(node))
return true;
bool previousTemplateArguments = switchTemplateArguments(true);
bool parsed = parseParameterDeclaration(node);
ParameterDeclarationAST *ast = 0;
bool parsed = parseParameterDeclaration(ast);
node = ast;
(void) switchTemplateArguments(previousTemplateArguments);
return parsed;
}
......@@ -1669,7 +1671,7 @@ bool Parser::parseParameterDeclarationClause(ParameterDeclarationClauseAST *&nod
if (LA() == T_RPAREN)
return true; // nothing to do
DeclarationListAST *parameter_declarations = 0;
ParameterDeclarationListAST *parameter_declarations = 0;
unsigned dot_dot_dot_token = 0;
if (LA() == T_DOT_DOT_DOT)
......@@ -1695,16 +1697,16 @@ bool Parser::parseParameterDeclarationClause(ParameterDeclarationClauseAST *&nod
return true;
}
bool Parser::parseParameterDeclarationList(DeclarationListAST *&node)
bool Parser::parseParameterDeclarationList(ParameterDeclarationListAST *&node)
{
DEBUG_THIS_RULE();
if (LA() == T_DOT_DOT_DOT || (LA() == T_COMMA && LA(2) == T_DOT_DOT_DOT))
return false; // nothing to do.
DeclarationListAST **parameter_declaration_ptr = &node;
DeclarationAST *declaration = 0;
ParameterDeclarationListAST **parameter_declaration_ptr = &node;
ParameterDeclarationAST *declaration = 0;
if (parseParameterDeclaration(declaration)) {
*parameter_declaration_ptr = new (_pool) DeclarationListAST;
*parameter_declaration_ptr = new (_pool) ParameterDeclarationListAST;
(*parameter_declaration_ptr)->value = declaration;
parameter_declaration_ptr = &(*parameter_declaration_ptr)->next;
while (LA() == T_COMMA) {
......@@ -1715,7 +1717,7 @@ bool Parser::parseParameterDeclarationList(DeclarationListAST *&node)
declaration = 0;
if (parseParameterDeclaration(declaration)) {
*parameter_declaration_ptr = new (_pool) DeclarationListAST;
*parameter_declaration_ptr = new (_pool) ParameterDeclarationListAST;
(*parameter_declaration_ptr)->value = declaration;
parameter_declaration_ptr = &(*parameter_declaration_ptr)->next;
}
......@@ -1725,7 +1727,7 @@ bool Parser::parseParameterDeclarationList(DeclarationListAST *&node)
return false;
}
bool Parser::parseParameterDeclaration(DeclarationAST *&node)
bool Parser::parseParameterDeclaration(ParameterDeclarationAST *&node)
{
DEBUG_THIS_RULE();
SpecifierListAST *decl_specifier_seq = 0;
......@@ -1950,7 +1952,7 @@ bool Parser::parseQtPropertyDeclaration(DeclarationAST *&node)
}
ast->property_name = property_name;
QtPropertyDeclarationItemListAST **iter = &ast->property_declaration_items;
QtPropertyDeclarationItemListAST **iter = &ast->property_declaration_item_list;
while (true) {
if (LA() == T_RPAREN) {
ast->rparen_token = consumeToken();
......@@ -2175,8 +2177,8 @@ bool Parser::parseMemberSpecification(DeclarationAST *&node, ClassSpecifierAST *
match(T_RPAREN, &ast->dptr_rparen_token);
}
match(T_COMMA, &ast->comma_token);
(void) parseTypeSpecifier(ast->type_specifiers);
parseDeclarator(ast->declarator, ast->type_specifiers);
(void) parseTypeSpecifier(ast->type_specifier_list);
parseDeclarator(ast->declarator, ast->type_specifier_list);
match(T_RPAREN, &ast->rparen_token);
node = ast;
} return true;
......@@ -5525,7 +5527,7 @@ bool Parser::parseObjCMethodPrototype(ObjCMethodPrototypeAST *&node)
}
// TODO: Is this still valid, and if so, should it be stored in the AST? (EV)
DeclarationAST *parameter_declaration = 0;
ParameterDeclarationAST *parameter_declaration = 0;
parseParameterDeclaration(parameter_declaration);
}
} else if (lookAtObjCSelector()) {
......@@ -5860,8 +5862,8 @@ bool Parser::parseTrailingReturnType(TrailingReturnTypeAST *&node)
while (parseAttributeSpecifier(*attr))
attr = &(*attr)->next;
parseTrailingTypeSpecifierSeq(ast->type_specifiers);
parseAbstractDeclarator(ast->declarator, ast->type_specifiers);
parseTrailingTypeSpecifierSeq(ast->type_specifier_list);
parseAbstractDeclarator(ast->declarator, ast->type_specifier_list);
node = ast;
return true;
}
......
......@@ -163,9 +163,9 @@ public:
bool parseOperator(OperatorAST *&node);
bool parseConversionFunctionId(NameAST *&node);
bool parseOperatorFunctionId(NameAST *&node);
bool parseParameterDeclaration(DeclarationAST *&node);
bool parseParameterDeclaration(ParameterDeclarationAST *&node);
bool parseParameterDeclarationClause(ParameterDeclarationClauseAST *&node);
bool parseParameterDeclarationList(DeclarationListAST *&node);
bool parseParameterDeclarationList(ParameterDeclarationListAST *&node);
bool parsePmExpression(ExpressionAST *&node);
bool parseTypeidExpression(ExpressionAST *&node);
bool parseTypenameCallExpression(ExpressionAST *&node);
......
......@@ -641,17 +641,17 @@ void tst_AST::cpp_initializer_or_function_declaration()
FunctionDeclaratorAST *fun_declarator = declarator->postfix_declarator_list->value->asFunctionDeclarator();
QVERIFY(fun_declarator != 0);
QCOMPARE(fun_declarator->lparen_token, 3U);
QVERIFY(fun_declarator->parameters != 0);
QVERIFY(fun_declarator->parameter_declaration_clause != 0);
QCOMPARE(fun_declarator->rparen_token, 5U);
// check the formal arguments
ParameterDeclarationClauseAST *param_clause = fun_declarator->parameters;
ParameterDeclarationClauseAST *param_clause = fun_declarator->parameter_declaration_clause;
QVERIFY(param_clause->parameter_declaration_list != 0);
QVERIFY(param_clause->parameter_declaration_list->next == 0);
QCOMPARE(param_clause->dot_dot_dot_token, 0U);
// check the parameter
DeclarationListAST *declarations = param_clause->parameter_declaration_list;
ParameterDeclarationListAST *declarations = param_clause->parameter_declaration_list;
QVERIFY(declarations);
QVERIFY(declarations->value);
QVERIFY(! declarations->next);
......
......@@ -172,7 +172,7 @@ virtual bool visit(QtPrivateSlotAST *ast)
terminal(ast->dptr_rparen_token, ast);
if (ast->comma_token)
terminal(ast->comma_token, ast);
for (SpecifierListAST *iter = ast->type_specifiers; iter; iter = iter->next)
for (SpecifierListAST *iter = ast->type_specifier_list; iter; iter = iter->next)
nonterminal(iter->value);
nonterminal(ast->declarator);
if (ast->rparen_token)
......@@ -196,7 +196,7 @@ virtual bool visit(QtPropertyDeclarationAST *ast)
terminal(ast->lparen_token, ast);
nonterminal(ast->type_id);
nonterminal(ast->property_name);
for (QtPropertyDeclarationItemListAST *iter = ast->property_declaration_items; iter; iter = iter->next)
for (QtPropertyDeclarationItemListAST *iter = ast->property_declaration_item_list; iter; iter = iter->next)
nonterminal(iter->value);
if (ast->rparen_token)
terminal(ast->rparen_token, ast);
......@@ -466,7 +466,7 @@ virtual bool visit(FunctionDeclaratorAST *ast)
{
if (ast->lparen_token)
terminal(ast->lparen_token, ast);
nonterminal(ast->parameters);
nonterminal(ast->parameter_declaration_clause);
if (ast->rparen_token)
terminal(ast->rparen_token, ast);
for (SpecifierListAST *iter = ast->cv_qualifier_list; iter; iter = iter->next)
......@@ -893,7 +893,7 @@ virtual bool visit(ParameterDeclarationAST *ast)
virtual bool visit(ParameterDeclarationClauseAST *ast)
{
for (DeclarationListAST *iter = ast->parameter_declaration_list; iter; iter = iter->next)
for (ParameterDeclarationListAST *iter = ast->parameter_declaration_list; iter; iter = iter->next)
nonterminal(iter->value);
if (ast->dot_dot_dot_token)
terminal(ast->dot_dot_dot_token, ast);
......@@ -1594,7 +1594,7 @@ virtual bool visit(TrailingReturnTypeAST *ast)
terminal(ast->arrow_token, ast);
for (SpecifierListAST *iter = ast->attributes; iter; iter = iter->next)
nonterminal(iter->value);
for (SpecifierListAST *iter = ast->type_specifiers; iter; iter = iter->next)
for (SpecifierListAST *iter = ast->type_specifier_list; iter; iter = iter->next)