summaryrefslogtreecommitdiff
path: root/src/shared/cplusplus
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2009-11-10 12:47:08 +0100
committerRoberto Raggi <roberto.raggi@nokia.com>2009-11-10 16:20:11 +0100
commit98802456b3b7573e0f76779c9ed4fb2007a8612d (patch)
treef47bb05d3cfc70cb9e5d0a86cd887e2ba66f2902 /src/shared/cplusplus
parente5c9aaab4b1c4ac709eab50dc043e3c69235ecf7 (diff)
downloadqt-creator-98802456b3b7573e0f76779c9ed4fb2007a8612d.tar.gz
Removed ObjCPropertyAttributeListAST
Done with Erik Verbruggen
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r--src/shared/cplusplus/AST.cpp28
-rw-r--r--src/shared/cplusplus/AST.h16
-rw-r--r--src/shared/cplusplus/ASTVisit.cpp8
-rw-r--r--src/shared/cplusplus/ASTfwd.h2
-rw-r--r--src/shared/cplusplus/CheckDeclaration.cpp2
-rw-r--r--src/shared/cplusplus/Parser.cpp4
6 files changed, 7 insertions, 53 deletions
diff --git a/src/shared/cplusplus/AST.cpp b/src/shared/cplusplus/AST.cpp
index 6aaf352701..4d7deaafd8 100644
--- a/src/shared/cplusplus/AST.cpp
+++ b/src/shared/cplusplus/AST.cpp
@@ -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
diff --git a/src/shared/cplusplus/AST.h b/src/shared/cplusplus/AST.h
index 6a0e4d96cc..c46fca5a50 100644
--- a/src/shared/cplusplus/AST.h
+++ b/src/shared/cplusplus/AST.h
@@ -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:
diff --git a/src/shared/cplusplus/ASTVisit.cpp b/src/shared/cplusplus/ASTVisit.cpp
index fe685c3111..ff1a76b5cf 100644
--- a/src/shared/cplusplus/ASTVisit.cpp
+++ b/src/shared/cplusplus/ASTVisit.cpp
@@ -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)) {
diff --git a/src/shared/cplusplus/ASTfwd.h b/src/shared/cplusplus/ASTfwd.h
index a03eabc1cd..dc453748be 100644
--- a/src/shared/cplusplus/ASTfwd.h
+++ b/src/shared/cplusplus/ASTfwd.h
@@ -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;
diff --git a/src/shared/cplusplus/CheckDeclaration.cpp b/src/shared/cplusplus/CheckDeclaration.cpp
index 6dc9c9a75b..eb67596a35 100644
--- a/src/shared/cplusplus/CheckDeclaration.cpp
+++ b/src/shared/cplusplus/CheckDeclaration.cpp
@@ -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;
diff --git a/src/shared/cplusplus/Parser.cpp b/src/shared/cplusplus/Parser.cpp
index a1536608f6..4f31a9e07d 100644
--- a/src/shared/cplusplus/Parser.cpp
+++ b/src/shared/cplusplus/Parser.cpp
@@ -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)