diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2010-05-25 14:53:21 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2010-05-25 17:15:22 +0200 |
commit | b68a16f1b5d69d63e7adaa67810b99c73bcfb979 (patch) | |
tree | f697265b0b7e07ed0cfb3b45aeda0fb17f6c499a /src/libs/cplusplus/CheckUndefinedSymbols.h | |
parent | 2a0f901e16faa4838a0bd09f7d41dc46256589ff (diff) | |
download | qt-creator-b68a16f1b5d69d63e7adaa67810b99c73bcfb979.tar.gz |
Highlight user defined types.
Diffstat (limited to 'src/libs/cplusplus/CheckUndefinedSymbols.h')
-rw-r--r-- | src/libs/cplusplus/CheckUndefinedSymbols.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libs/cplusplus/CheckUndefinedSymbols.h b/src/libs/cplusplus/CheckUndefinedSymbols.h index 58f0edd1d9..f375d904e8 100644 --- a/src/libs/cplusplus/CheckUndefinedSymbols.h +++ b/src/libs/cplusplus/CheckUndefinedSymbols.h @@ -33,6 +33,7 @@ #include "CppDocument.h" #include "LookupContext.h" #include <ASTVisitor.h> +#include <QtCore/QSet> namespace CPlusPlus { @@ -44,6 +45,17 @@ public: QList<Document::DiagnosticMessage> operator()(AST *ast); + struct Use { // ### remove me + unsigned line; + unsigned column; + unsigned length; + + Use(unsigned line = 0, unsigned column = 0, unsigned length = 0) + : line(line), column(column), length(length) {} + }; + + QList<Use> typeUsages() const; + protected: using ASTVisitor::visit; @@ -51,15 +63,25 @@ protected: bool warning(AST *ast, const QString &text); void checkNamespace(NameAST *name); + void addTypeUsage(ClassOrNamespace *b, NameAST *ast); + void addTypeUsage(const QList<Symbol *> &candidates, NameAST *ast); virtual bool visit(UsingDirectiveAST *); virtual bool visit(SimpleDeclarationAST *); virtual bool visit(NamedTypeSpecifierAST *); + virtual bool visit(SimpleNameAST *ast); + virtual bool visit(DestructorNameAST *ast); + virtual bool visit(QualifiedNameAST *ast); + virtual bool visit(TemplateIdAST *ast); + private: LookupContext _context; QString _fileName; QList<Document::DiagnosticMessage> _diagnosticMessages; + QSet<QByteArray> _potentialTypes; + QList<ScopedSymbol *> _scopes; + QList<Use> _typeUsages; }; } // end of namespace CPlusPlus |