use separate slot implementation for each module
[lqt.git] / cpptoxml / parser / codemodel_finder.h
blob12b84ec8610275872a972b3bb353d9ef06afec0e
1 /****************************************************************************
2 **
3 ** Copyright (C) 1992-2008 Trolltech ASA. All rights reserved.
4 ** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org>
5 **
6 ** This file is part of the Qt Script Generator project on Trolltech Labs.
7 **
8 ** This file may be used under the terms of the GNU General Public
9 ** License version 2.0 as published by the Free Software Foundation
10 ** and appearing in the file LICENSE.GPL included in the packaging of
11 ** this file. Please review the following information to ensure GNU
12 ** General Public Licensing requirements will be met:
13 ** http://www.trolltech.com/products/qt/opensource.html
15 ** If you are unsure which license is appropriate for your use, please
16 ** review the following information:
17 ** http://www.trolltech.com/products/qt/licensing.html or contact the
18 ** sales department at sales@trolltech.com.
20 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23 ****************************************************************************/
26 #ifndef CODEMODEL_FINDER_H
27 #define CODEMODEL_FINDER_H
29 #include "default_visitor.h"
30 #include "codemodel_fwd.h"
31 #include "name_compiler.h"
33 class TokenStream;
34 class Binder;
36 class CodeModelFinder: protected DefaultVisitor
38 enum ResolvePolicy
40 ResolveScope,
41 ResolveItem
44 public:
45 CodeModelFinder(CodeModel *model, Binder *binder);
46 virtual ~CodeModelFinder();
48 ScopeModelItem resolveScope(NameAST *name, ScopeModelItem scope);
50 inline CodeModel *model() const { return _M_model; }
52 protected:
53 virtual void visitName(NameAST *node);
54 virtual void visitUnqualifiedName(UnqualifiedNameAST *node);
56 ScopeModelItem changeCurrentScope(ScopeModelItem scope);
58 private:
59 CodeModel *_M_model;
60 Binder *_M_binder;
61 TokenStream *_M_token_stream;
62 NameCompiler name_cc;
64 ScopeModelItem _M_current_scope;
65 ResolvePolicy _M_resolve_policy;
68 #endif // CODEMODEL_FINDER_H
70 // kate: space-indent on; indent-width 2; replace-tabs on;