support for creating template instance classes
[lqt/mk.git] / cpptoxml / parser / class_compiler.h
blob3fa92f011a833d06d399ba1d986f6c37fa0ce9b8
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 CLASS_COMPILER_H
27 #define CLASS_COMPILER_H
29 #include <QtCore/qglobal.h>
30 #include <QtCore/QStringList>
32 #include "default_visitor.h"
33 #include "name_compiler.h"
34 #include "type_compiler.h"
36 class TokenStream;
37 class Binder;
39 class ClassCompiler: protected DefaultVisitor
41 public:
42 ClassCompiler(Binder *binder);
43 virtual ~ClassCompiler();
45 inline QString name() const { return _M_name; }
46 inline QStringList baseClasses() const { return _M_base_classes; }
47 inline QStringList baseModifiers() const { return _M_base_classes_mod; }
49 void run(ClassSpecifierAST *node);
51 protected:
52 virtual void visitClassSpecifier(ClassSpecifierAST *node);
53 virtual void visitBaseSpecifier(BaseSpecifierAST *node);
55 private:
56 Binder *_M_binder;
57 TokenStream *_M_token_stream;
58 QString _M_name;
59 QStringList _M_base_classes;
60 QStringList _M_base_classes_mod;
61 NameCompiler name_cc;
62 TypeCompiler type_cc;
65 #endif // CLASS_COMPILER_H
67 // kate: space-indent on; indent-width 2; replace-tabs on;