Source update.

This commit is contained in:
Wolfgang Beck
2010-02-03 13:21:08 +10:00
parent cc278a593b
commit e134e24919
15 changed files with 617 additions and 203 deletions

View File

@@ -586,6 +586,8 @@ public:
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
virtual QPropertyDeclarationAST *clone(MemoryPool *pool) const;
protected:
virtual void accept0(ASTVisitor *visitor);
virtual bool match0(AST *, ASTMatcher *);
@@ -606,6 +608,8 @@ public:
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
virtual QEnumDeclarationAST *clone(MemoryPool *pool) const;
protected:
virtual void accept0(ASTVisitor *visitor);
virtual bool match0(AST *, ASTMatcher *);
@@ -626,6 +630,8 @@ public:
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
virtual QFlagsDeclarationAST *clone(MemoryPool *pool) const;
protected:
virtual void accept0(ASTVisitor *visitor);
virtual bool match0(AST *, ASTMatcher *);
@@ -647,6 +653,8 @@ public:
virtual unsigned firstToken() const;
virtual unsigned lastToken() const;
virtual QDeclareFlagsDeclarationAST *clone(MemoryPool *pool) const;
protected:
virtual void accept0(ASTVisitor *visitor);
virtual bool match0(AST *, ASTMatcher *);

View File

@@ -138,6 +138,67 @@ AccessDeclarationAST *AccessDeclarationAST::clone(MemoryPool *pool) const
return ast;
}
#ifdef ICHECK_BUILD
QPropertyDeclarationAST *QPropertyDeclarationAST::clone(MemoryPool *pool) const
{
QPropertyDeclarationAST *ast = new (pool) QPropertyDeclarationAST;
ast->property_specifier_token = property_specifier_token;
ast->lparen_token = lparen_token;
ast->type_token = type_token;
ast->type_name_token = type_name_token;
ast->read_token = read_token;
ast->read_function_token = read_function_token;
ast->write_token = write_token;
ast->write_function_token = write_function_token;
ast->reset_token = reset_token;
ast->reset_function_token = reset_function_token;
ast->notify_token = notify_token;
ast->notify_function_token = notify_function_token;
ast->rparen_token = rparen_token;
return ast;
}
QEnumDeclarationAST *QEnumDeclarationAST::clone(MemoryPool *pool) const
{
QEnumDeclarationAST *ast = new (pool)QEnumDeclarationAST;
ast->enum_specifier_token = enum_specifier_token;
ast->lparen_token = lparen_token;
ast->rparen_token = rparen_token;
EnumeratorListAST *enumerator_list;
for (EnumeratorListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : 0);
return ast;
}
QFlagsDeclarationAST *QFlagsDeclarationAST::clone(MemoryPool *pool) const
{
QFlagsDeclarationAST *ast = new (pool) QFlagsDeclarationAST;
ast->flags_specifier_token = flags_specifier_token;
ast->lparen_token = lparen_token;
ast->rparen_token = rparen_token;
EnumeratorListAST *enumerator_list;
for (EnumeratorListAST *iter = enumerator_list, **ast_iter = &ast->enumerator_list;
iter; iter = iter->next, ast_iter = &(*ast_iter)->next)
*ast_iter = new (pool) EnumeratorListAST((iter->value) ? iter->value->clone(pool) : 0);
return ast;
}
QDeclareFlagsDeclarationAST *QDeclareFlagsDeclarationAST::clone(MemoryPool *pool) const
{
QDeclareFlagsDeclarationAST *ast = new (pool) QDeclareFlagsDeclarationAST;
ast->declareflags_specifier_token = declareflags_specifier_token;
ast->lparen_token = lparen_token;
ast->flag_token = flag_token;
ast->enum_token = enum_token;
ast->rparen_token = rparen_token;
return ast;
}
#endif
AsmDefinitionAST *AsmDefinitionAST::clone(MemoryPool *pool) const
{
AsmDefinitionAST *ast = new (pool) AsmDefinitionAST;

View File

@@ -272,7 +272,7 @@ bool CheckDeclarator::visit(ObjCMethodPrototypeAST *ast)
if (semantic()->isObjCClassMethod(tokenKind(ast->method_type_token)))
method->setStorage(Symbol::Static);
if (ast->selector->asObjCSelectorWithArguments()) {
if (ast->selector && ast->selector->asObjCSelectorWithArguments()) {
for (ObjCMessageArgumentDeclarationListAST *it = ast->argument_list; it; it = it->next) {
ObjCMessageArgumentDeclarationAST *argDecl = it->value;

View File

@@ -210,6 +210,16 @@ public:
} // end of anonymous namespace
#ifdef ICHECK_BUILD
//Symbian compiler has some difficulties to understand the templates.
static void delete_array_entries(std::vector<Symbol *> vt)
{
std::vector<Symbol *>::iterator it;
for (it = vt.begin(); it != vt.end(); ++it) {
delete *it;
}
}
#else
template <typename _Iterator>
static void delete_array_entries(_Iterator first, _Iterator last)
{
@@ -220,6 +230,7 @@ static void delete_array_entries(_Iterator first, _Iterator last)
template <typename _Array>
static void delete_array_entries(const _Array &a)
{ delete_array_entries(a.begin(), a.end()); }
#endif
class Control::Data
{

View File

@@ -1748,11 +1748,12 @@ bool Parser::parseAccessSpecifier(SpecifierAST *&node)
bool Parser::parseAccessDeclaration(DeclarationAST *&node)
{
DEBUG_THIS_RULE();
if (LA() == T_PUBLIC || LA() == T_PROTECTED || LA() == T_PRIVATE || LA() == T_Q_SIGNALS) {
if (LA() == T_PUBLIC || LA() == T_PROTECTED || LA() == T_PRIVATE || LA() == T_Q_SIGNALS || LA() == T_Q_SLOTS) {
bool isSignals = LA() == T_Q_SIGNALS;
bool isSlots = LA() == T_Q_SLOTS;
AccessDeclarationAST *ast = new (_pool) AccessDeclarationAST;
ast->access_specifier_token = consumeToken();
if (! isSignals && LA() == T_Q_SLOTS)
if (! isSignals && (LA() == T_Q_SLOTS || isSlots))
ast->slots_token = consumeToken();
match(T_COLON, &ast->colon_token);
node = ast;
@@ -1930,6 +1931,7 @@ bool Parser::parseMemberSpecification(DeclarationAST *&node)
case T_PUBLIC:
case T_PROTECTED:
case T_PRIVATE:
case T_Q_SLOTS:
return parseAccessDeclaration(node);
#ifdef ICHECK_BUILD
@@ -2426,6 +2428,7 @@ bool Parser::parseStatement(StatementAST *&node)
return parseExpressionOrDeclarationStatement(node);
} // switch
return false; //Avoid compiler warning
}
bool Parser::parseBreakStatement(StatementAST *&node)

View File

@@ -222,7 +222,9 @@ bool Function::isEqualTo(const Type *other) const
else if (isVolatile() != o->isVolatile())
return false;
#ifdef ICHECK_BUILD
else if (isInvokable() != o->isInvokable())
else if (isInvokable() != o->isInvokable())
return false;
else if (isSignal() != o->isSignal())
return false;
#endif
@@ -258,6 +260,8 @@ bool Function::isEqualTo(const Function* fct, bool ignoreName/* = false*/) const
return false;
else if (isInvokable() != fct->isInvokable())
return false;
else if (isSignal() != fct->isSignal())
return false;
if (_arguments->symbolCount() != fct->_arguments->symbolCount())
return false;