Added clone methods to the AST.

This commit is contained in:
Erik Verbruggen
2010-02-02 11:40:50 +01:00
parent 4bb0e85cfe
commit fcf67d7d8e
8 changed files with 1935 additions and 27 deletions

View File

@@ -2030,8 +2030,8 @@ unsigned ObjCTypeNameAST::lastToken() const
if (type_id)
return type_id->lastToken();
if (type_qualifier)
return type_qualifier + 1;
if (type_qualifier_token)
return type_qualifier_token + 1;
return lparen_token + 1;
}
@@ -2214,22 +2214,22 @@ unsigned ObjCMethodDeclarationAST::lastToken() const
unsigned ObjCSynthesizedPropertyAST::firstToken() const
{
if (property_identifier)
return property_identifier;
if (property_identifier_token)
return property_identifier_token;
else if (equals_token)
return equals_token;
else
return property_alias_identifier;
return alias_identifier_token;
}
unsigned ObjCSynthesizedPropertyAST::lastToken() const
{
if (property_alias_identifier)
return property_alias_identifier + 1;
if (alias_identifier_token)
return alias_identifier_token + 1;
else if (equals_token)
return equals_token + 1;
else
return property_identifier + 1;
return property_identifier_token + 1;
}
unsigned ObjCSynthesizedPropertiesDeclarationAST::firstToken() const

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4753,12 +4753,12 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
ObjCSynthesizedPropertyListAST *last = new (_pool) ObjCSynthesizedPropertyListAST;
ast->property_identifier_list = last;
last->value = new (_pool) ObjCSynthesizedPropertyAST;
match(T_IDENTIFIER, &(last->value->property_identifier));
match(T_IDENTIFIER, &(last->value->property_identifier_token));
if (LA() == T_EQUAL) {
last->value->equals_token = consumeToken();
match(T_IDENTIFIER, &(last->value->property_alias_identifier));
match(T_IDENTIFIER, &(last->value->alias_identifier_token));
}
while (LA() == T_COMMA) {
@@ -4768,12 +4768,12 @@ bool Parser::parseObjCMethodDefinitionList(DeclarationListAST *&node)
last = last->next;
last->value = new (_pool) ObjCSynthesizedPropertyAST;
match(T_IDENTIFIER, &(last->value->property_identifier));
match(T_IDENTIFIER, &(last->value->property_identifier_token));
if (LA() == T_EQUAL) {
last->value->equals_token = consumeToken();
match(T_IDENTIFIER, &(last->value->property_alias_identifier));
match(T_IDENTIFIER, &(last->value->alias_identifier_token));
}
}
@@ -5179,7 +5179,7 @@ bool Parser::parseObjCTypeName(ObjCTypeNameAST *&node)
ObjCTypeNameAST *ast = new (_pool) ObjCTypeNameAST;
match(T_LPAREN, &(ast->lparen_token));
parseObjCTypeQualifiers(ast->type_qualifier);
parseObjCTypeQualifiers(ast->type_qualifier_token);
parseTypeId(ast->type_id);
match(T_RPAREN, &(ast->rparen_token));
node = ast;

View File

@@ -46,6 +46,7 @@ SOURCES += \
$$PWD/ASTVisit.cpp \
$$PWD/ASTMatch0.cpp \
$$PWD/ASTVisitor.cpp \
$$PWD/ASTClone.cpp \
$$PWD/ASTPatternBuilder.cpp \
$$PWD/ASTMatcher.cpp \
$$PWD/TypeMatcher.cpp \