From e2b9db7bd8dce881bdd69baa775ab53f9ec6a2f1 Mon Sep 17 00:00:00 2001 From: Roberto Raggi <qtc-committer@nokia.com> Date: Tue, 13 Jan 2009 15:05:48 +0100 Subject: [PATCH] More ObjC++ --- shared/cplusplus/Parser.cpp | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/shared/cplusplus/Parser.cpp b/shared/cplusplus/Parser.cpp index 0e49e9fe88a..d5fe83703dc 100644 --- a/shared/cplusplus/Parser.cpp +++ b/shared/cplusplus/Parser.cpp @@ -3573,6 +3573,9 @@ bool Parser::parseObjClassInstanceVariables() bool Parser::parseObjCInterfaceMemberDeclaration() { switch (LA()) { + case T_AT_END: + return false; + case T_AT_REQUIRED: case T_AT_OPTIONAL: consumeToken(); @@ -3591,9 +3594,20 @@ bool Parser::parseObjCInterfaceMemberDeclaration() case T_MINUS: return parseObjCMethodPrototype(); - default: - return false; + case T_ENUM: + case T_CLASS: + case T_STRUCT: + case T_UNION: { + DeclarationAST *declaration = 0; + return parseSimpleDeclaration(declaration, /*accept struct declarators */ true); } + + default: { + DeclarationAST *declaration = 0; + return parseSimpleDeclaration(declaration, /*accept struct declarators */ true); + } // default + + } // switch } // objc-instance-variable-declaration ::= objc-visibility-specifier @@ -3610,7 +3624,7 @@ bool Parser::parseObjCInstanceVariableDeclaration(DeclarationAST *&node) return true; default: - return parseBlockDeclaration(node); + return parseSimpleDeclaration(node, true); } } @@ -3633,7 +3647,7 @@ bool Parser::parseObjCPropertyDeclaration(DeclarationAST *&, SpecifierAST *) } DeclarationAST *simple_declaration = 0; - parseSimpleDeclaration(simple_declaration, /*accept-struct-declarators = */ false); + parseSimpleDeclaration(simple_declaration, /*accept-struct-declarators = */ true); return true; } @@ -3757,6 +3771,19 @@ bool Parser::parseObjCKeywordDeclaration() bool Parser::parseObjCTypeQualifiers() { + if (LA() != T_IDENTIFIER) + return false; + + Identifier *id = tok().identifier; + if (! strcmp("in", id->chars()) || + ! strcmp("out", id->chars()) || + ! strcmp("inout", id->chars()) || + ! strcmp("bycopy", id->chars()) || + ! strcmp("byref", id->chars()) || + ! strcmp("oneway", id->chars())) { + consumeToken(); + return true; + } return false; } -- GitLab