Commit d358c89f authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Removed ObjCMessageArgumentListAST

Done with Erik Verbruggen
parent 496ff15d
......@@ -1959,25 +1959,6 @@ unsigned ObjCMessageExpressionAST::lastToken() const
return lbracket_token + 1;
}
unsigned ObjCMessageArgumentListAST::firstToken() const
{
if (arg)
return arg->firstToken();
// ### assert?
return 0;
}
unsigned ObjCMessageArgumentListAST::lastToken() const
{
for (const ObjCMessageArgumentListAST *it = this; it; it = it->next) {
if (! it->next && it->arg) {
return it->arg->lastToken();
}
}
// ### assert?
return 0;
}
unsigned ObjCMessageArgumentAST::firstToken() const
{
return parameter_value_expression->firstToken();
......
......@@ -2211,22 +2211,6 @@ protected:
virtual void accept0(ASTVisitor *visitor);
};
class CPLUSPLUS_EXPORT ObjCMessageArgumentListAST: public AST
{
public:
ObjCMessageArgumentAST *arg;
ObjCMessageArgumentListAST *next;
public:
virtual ObjCMessageArgumentListAST *asObjCMessageArgumentList() { return this; }
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
protected:
virtual void accept0(ASTVisitor *visitor);
};
class CPLUSPLUS_EXPORT ObjCMessageExpressionAST: public ExpressionAST
{
public:
......
......@@ -958,14 +958,6 @@ void ObjCMessageArgumentAST::accept0(ASTVisitor *visitor)
visitor->endVisit(this);
}
void ObjCMessageArgumentListAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
accept(arg, visitor);
}
visitor->endVisit(this);
}
void ObjCMessageExpressionAST::accept0(ASTVisitor *visitor)
{
if (visitor->visit(this)) {
......
......@@ -91,6 +91,13 @@ public:
void accept(AST *ast);
template <typename _Tp>
void accept(List<_Tp> *it)
{
for (; it; it = it->next)
accept(it->value);
}
virtual bool preVisit(AST *) { return true; }
virtual void postVisit(AST *) {}
......
......@@ -132,7 +132,6 @@ class ObjCInstanceVariablesDeclarationAST;
class ObjCMessageArgumentAST;
class ObjCMessageArgumentDeclarationAST;
class ObjCMessageArgumentDeclarationListAST;
class ObjCMessageArgumentListAST;
class ObjCMessageExpressionAST;
class ObjCMethodDeclarationAST;
class ObjCMethodPrototypeAST;
......@@ -201,6 +200,7 @@ typedef List<DeclarationAST *> DeclarationListAST;
typedef List<StatementAST *> StatementListAST;
typedef List<DeclaratorAST *> DeclaratorListAST;
typedef List<NameAST *> ObjCIdentifierListAST;
typedef List<ObjCMessageArgumentAST *> ObjCMessageArgumentListAST;
typedef ExpressionListAST TemplateArgumentListAST;
......
......@@ -369,7 +369,7 @@ bool CheckExpression::visit(ObjCMessageExpressionAST *ast)
semantic()->check(ast->receiver_expression, _scope);
(void) semantic()->check(ast->selector, _scope);
accept(ast->argument_list);
accept(ast->argument_list); // ### not necessary.
return false;
}
......
......@@ -3257,7 +3257,7 @@ bool Parser::parseObjCMessageArguments(ObjCSelectorAST *&selNode, ObjCMessageArg
ObjCSelectorArgumentListAST *lastSelector = selAst;
ObjCMessageArgumentListAST *argAst = new (_pool) ObjCMessageArgumentListAST;
argAst->arg = messageArgument;
argAst->value = messageArgument;
ObjCMessageArgumentListAST *lastArgument = argAst;
while (parseObjCSelectorArg(selectorArgument, messageArgument)) {
......@@ -3268,11 +3268,11 @@ bool Parser::parseObjCMessageArguments(ObjCSelectorAST *&selNode, ObjCMessageArg
lastArgument->next = new (_pool) ObjCMessageArgumentListAST;
lastArgument = lastArgument->next;
lastArgument->arg = messageArgument;
lastArgument->value = messageArgument;
}
if (LA() == T_COMMA) {
ExpressionAST **lastExpression = &(lastArgument->arg->parameter_value_expression);
ExpressionAST **lastExpression = &(lastArgument->value->parameter_value_expression);
while (LA() == T_COMMA) {
BinaryExpressionAST *binaryExpression = new (_pool) BinaryExpressionAST;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment