diff options
author | Roberto Raggi <qtc-committer@nokia.com> | 2009-02-09 11:55:49 +0100 |
---|---|---|
committer | Roberto Raggi <qtc-committer@nokia.com> | 2009-02-09 11:56:21 +0100 |
commit | 0d314977f116eaad056d37cd301d61834f07a9c3 (patch) | |
tree | 6942a6df07e08e03b107d6caa4ce0f214f3cf8bd /src/shared/cplusplus | |
parent | 95d8b844044ec4893ad9478a533c81545eb6cf4c (diff) | |
download | qt-creator-0d314977f116eaad056d37cd301d61834f07a9c3.tar.gz |
Annotated the NameAST nodes.
Diffstat (limited to 'src/shared/cplusplus')
-rw-r--r-- | src/shared/cplusplus/AST.h | 6 | ||||
-rw-r--r-- | src/shared/cplusplus/CheckName.cpp | 6 | ||||
-rw-r--r-- | src/shared/cplusplus/CheckSpecifier.cpp | 1 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/cplusplus/AST.h b/src/shared/cplusplus/AST.h index f5e3ac42fc..ecb0ddc3fb 100644 --- a/src/shared/cplusplus/AST.h +++ b/src/shared/cplusplus/AST.h @@ -422,6 +422,9 @@ public: NameAST *name; BaseSpecifierAST *next; +public: // annotations + BaseClass *base_class_symbol; + public: virtual unsigned firstToken() const; virtual unsigned lastToken() const; @@ -1060,6 +1063,9 @@ protected: class CPLUSPLUS_EXPORT NameAST: public ExpressionAST { +public: // annotations + Name *name; + public: virtual NameAST *clone(MemoryPool *pool) const = 0; }; diff --git a/src/shared/cplusplus/CheckName.cpp b/src/shared/cplusplus/CheckName.cpp index 09b90f3cb8..dfd8158464 100644 --- a/src/shared/cplusplus/CheckName.cpp +++ b/src/shared/cplusplus/CheckName.cpp @@ -121,6 +121,8 @@ bool CheckName::visit(QualifiedNameAST *ast) names.push_back(semantic()->check(ast->unqualified_name, _scope)); _name = control()->qualifiedNameId(&names[0], names.size(), ast->global_scope_token != 0); + + ast->name = _name; return false; } @@ -302,6 +304,7 @@ bool CheckName::visit(OperatorFunctionIdAST *ast) } // switch _name = control()->operatorNameId(kind); + ast->name = _name; return false; } @@ -317,6 +320,7 @@ bool CheckName::visit(SimpleNameAST *ast) { Identifier *id = identifier(ast->identifier_token); _name = control()->nameId(id); + ast->name = _name; return false; } @@ -324,6 +328,7 @@ bool CheckName::visit(DestructorNameAST *ast) { Identifier *id = identifier(ast->identifier_token); _name = control()->destructorNameId(id); + ast->name = _name; return false; } @@ -342,6 +347,7 @@ bool CheckName::visit(TemplateIdAST *ast) else _name = control()->templateNameId(id, &templateArguments[0], templateArguments.size()); + ast->name = _name; return false; } diff --git a/src/shared/cplusplus/CheckSpecifier.cpp b/src/shared/cplusplus/CheckSpecifier.cpp index cb929b868c..bee510d31d 100644 --- a/src/shared/cplusplus/CheckSpecifier.cpp +++ b/src/shared/cplusplus/CheckSpecifier.cpp @@ -315,6 +315,7 @@ bool CheckSpecifier::visit(ClassSpecifierAST *ast) for (BaseSpecifierAST *base = ast->base_clause; base; base = base->next) { Name *baseClassName = semantic()->check(base->name, _scope); BaseClass *baseClass = control()->newBaseClass(ast->firstToken(), baseClassName); + base->base_class_symbol = baseClass; if (base->token_virtual) baseClass->setVirtual(true); if (base->token_access_specifier) { |