forked from qt-creator/qt-creator
Removed ObjCPropertyAttributeListAST
Done with Erik Verbruggen
This commit is contained in:
@@ -2114,27 +2114,6 @@ unsigned ObjCPropertyAttributeAST::lastToken() const
|
||||
return attribute_identifier_token + 1;
|
||||
}
|
||||
|
||||
unsigned ObjCPropertyAttributeListAST::firstToken() const
|
||||
{
|
||||
if (attr)
|
||||
return attr->firstToken();
|
||||
else if (next)
|
||||
return next->lastToken();
|
||||
else
|
||||
// ### Assert?
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned ObjCPropertyAttributeListAST::lastToken() const
|
||||
{
|
||||
for (const ObjCPropertyAttributeListAST *it = this; it; it = it->next) {
|
||||
if (! it->next && it->attr)
|
||||
return it->attr->lastToken();
|
||||
}
|
||||
// ### assert?
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned ObjCPropertyDeclarationAST::firstToken() const
|
||||
{
|
||||
if (attributes)
|
||||
@@ -2153,8 +2132,8 @@ unsigned ObjCPropertyDeclarationAST::lastToken() const
|
||||
return property_attributes->lastToken();
|
||||
else if (lparen_token)
|
||||
return lparen_token + 1;
|
||||
else
|
||||
return property_token + 1;
|
||||
|
||||
return property_token + 1;
|
||||
}
|
||||
|
||||
unsigned ObjCMessageArgumentDeclarationAST::firstToken() const
|
||||
@@ -2213,8 +2192,7 @@ unsigned ObjCMethodPrototypeAST::lastToken() const
|
||||
return arguments->lastToken();
|
||||
else if (type_name)
|
||||
return type_name->lastToken();
|
||||
else
|
||||
return method_type_token + 1;
|
||||
return method_type_token + 1;
|
||||
}
|
||||
|
||||
unsigned ObjCMethodDeclarationAST::firstToken() const
|
||||
|
@@ -2405,22 +2405,6 @@ protected:
|
||||
virtual void accept0(ASTVisitor *visitor);
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT ObjCPropertyAttributeListAST: public AST
|
||||
{
|
||||
public:
|
||||
ObjCPropertyAttributeAST *attr;
|
||||
ObjCPropertyAttributeListAST *next;
|
||||
|
||||
public:
|
||||
virtual ObjCPropertyAttributeListAST *asObjCPropertyAttributeList() { return this; }
|
||||
|
||||
virtual unsigned firstToken() const;
|
||||
virtual unsigned lastToken() const;
|
||||
|
||||
protected:
|
||||
virtual void accept0(ASTVisitor *visitor);
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT ObjCPropertyDeclarationAST: public DeclarationAST
|
||||
{
|
||||
public:
|
||||
|
@@ -1047,14 +1047,6 @@ void ObjCPropertyAttributeAST::accept0(ASTVisitor *visitor)
|
||||
visitor->endVisit(this);
|
||||
}
|
||||
|
||||
void ObjCPropertyAttributeListAST::accept0(ASTVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
accept(attr, visitor);
|
||||
}
|
||||
visitor->endVisit(this);
|
||||
}
|
||||
|
||||
void ObjCPropertyDeclarationAST::accept0(ASTVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
|
@@ -136,7 +136,6 @@ class ObjCMessageExpressionAST;
|
||||
class ObjCMethodDeclarationAST;
|
||||
class ObjCMethodPrototypeAST;
|
||||
class ObjCPropertyAttributeAST;
|
||||
class ObjCPropertyAttributeListAST;
|
||||
class ObjCPropertyDeclarationAST;
|
||||
class ObjCProtocolDeclarationAST;
|
||||
class ObjCProtocolExpressionAST;
|
||||
@@ -201,6 +200,7 @@ typedef List<DeclaratorAST *> DeclaratorListAST;
|
||||
typedef List<NameAST *> ObjCIdentifierListAST;
|
||||
typedef List<ObjCMessageArgumentAST *> ObjCMessageArgumentListAST;
|
||||
typedef List<ObjCSelectorArgumentAST *> ObjCSelectorArgumentListAST;
|
||||
typedef List<ObjCPropertyAttributeAST *> ObjCPropertyAttributeListAST;
|
||||
|
||||
typedef ExpressionListAST TemplateArgumentListAST;
|
||||
|
||||
|
@@ -719,7 +719,7 @@ bool CheckDeclaration::visit(ObjCPropertyDeclarationAST *ast)
|
||||
int propAttrs = None;
|
||||
|
||||
for (ObjCPropertyAttributeListAST *iter= ast->property_attributes; iter; iter = iter->next) {
|
||||
ObjCPropertyAttributeAST *attrAst = iter->attr;
|
||||
ObjCPropertyAttributeAST *attrAst = iter->value;
|
||||
if (!attrAst)
|
||||
continue;
|
||||
|
||||
|
@@ -4845,14 +4845,14 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&node, SpecifierAST *a
|
||||
ObjCPropertyAttributeAST *property_attribute = 0;
|
||||
if (parseObjCPropertyAttribute(property_attribute)) {
|
||||
ast->property_attributes = new (_pool) ObjCPropertyAttributeListAST;
|
||||
ast->property_attributes->attr = property_attribute;
|
||||
ast->property_attributes->value = property_attribute;
|
||||
ObjCPropertyAttributeListAST *last = ast->property_attributes;
|
||||
|
||||
while (LA() == T_COMMA) {
|
||||
consumeToken(); // consume T_COMMA
|
||||
last->next = new (_pool) ObjCPropertyAttributeListAST;
|
||||
last = last->next;
|
||||
if (!parseObjCPropertyAttribute(last->attr)) {
|
||||
if (!parseObjCPropertyAttribute(last->value)) {
|
||||
_translationUnit->error(_tokenIndex, "expected token `%s' got `%s'",
|
||||
Token::name(T_IDENTIFIER), tok().spell());
|
||||
while (LA() != T_RPAREN)
|
||||
|
Reference in New Issue
Block a user