Added Semantic checks for ObjC methods.

This commit is contained in:
Erik Verbruggen
2009-07-31 16:03:48 +02:00
parent b713f1772a
commit 4a0da2c6f2
22 changed files with 281 additions and 35 deletions

View File

@@ -383,4 +383,29 @@ bool CheckExpression::visit(MemberAccessAST *ast)
return false;
}
bool CheckExpression::visit(ObjCMessageExpressionAST *ast)
{
semantic()->check(ast->receiver_expression, _scope);
if (Name *name = semantic()->check(ast->selector, _scope))
_scope->addUse(ast->selector->firstToken(), name);
accept(ast->argument_list);
return false;
}
bool CheckExpression::visit(ObjCEncodeExpressionAST * /*ast*/)
{
// TODO: visit the type name, but store the type here? (EV)
return true;
}
bool CheckExpression::visit(ObjCSelectorExpressionAST *ast)
{
if (Name *name = semantic()->check(ast->selector, _scope))
_scope->addUse(ast->selector->firstToken(), name);
return false;
}
CPLUSPLUS_END_NAMESPACE