bool* arguments can be used by wrappers
[lqt.git] / cpptoxml / parser / dumptree.cpp
blob98b94d9421284cb8f60483b4e8a8cd2dabd8656a
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 #include "dumptree.h"
28 #include <QtCore/QString>
29 #include <QtCore/qdebug.h>
31 static char const * const names[] = {
33 "AccessSpecifier",
34 "AsmDefinition",
35 "BaseClause",
36 "BaseSpecifier",
37 "BinaryExpression",
38 "CastExpression",
39 "ClassMemberAccess",
40 "ClassSpecifier",
41 "CompoundStatement",
42 "Condition",
43 "ConditionalExpression",
44 "CppCastExpression",
45 "CtorInitializer",
46 "DeclarationStatement",
47 "Declarator",
48 "DeleteExpression",
49 "DoStatement",
50 "ElaboratedTypeSpecifier",
51 "EnumSpecifier",
52 "Enumerator",
53 "ExceptionSpecification",
54 "ExpressionOrDeclarationStatement",
55 "ExpressionStatement",
56 "ForStatement",
57 "FunctionCall",
58 "FunctionDefinition",
59 "IfStatement",
60 "IncrDecrExpression",
61 "InitDeclarator",
62 "Initializer",
63 "InitializerClause",
64 "LabeledStatement",
65 "LinkageBody",
66 "LinkageSpecification",
67 "MemInitializer",
68 "Name",
69 "Namespace",
70 "NamespaceAliasDefinition",
71 "NewDeclarator",
72 "NewExpression",
73 "NewInitializer",
74 "NewTypeId",
75 "Operator",
76 "OperatorFunctionId",
77 "ParameterDeclaration",
78 "ParameterDeclarationClause",
79 "PostfixExpression",
80 "PrimaryExpression",
81 "PtrOperator",
82 "PtrToMember",
83 "ReturnStatement",
84 "SimpleDeclaration",
85 "SimpleTypeSpecifier",
86 "SizeofExpression",
87 "StringLiteral",
88 "SubscriptExpression",
89 "SwitchStatement",
90 "TemplateArgument",
91 "TemplateDeclaration",
92 "TemplateParameter",
93 "ThrowExpression",
94 "TranslationUnit",
95 "TryBlockStatement",
96 "TypeId",
97 "TypeIdentification",
98 "TypeParameter",
99 "Typedef",
100 "UnaryExpression",
101 "UnqualifiedName",
102 "Using",
103 "UsingDirective",
104 "WhileStatement",
105 "WinDeclSpec"
108 DumpTree::DumpTree()
112 void DumpTree::visit(AST *node)
114 static int indent = 0;
116 if (node)
117 qDebug() << QString(indent * 2, ' ').toLatin1().constData() << names[node->kind]
118 << '[' << node->start_token << ", " << node->end_token << ']';
120 ++indent;
121 DefaultVisitor::visit(node);
122 --indent;
125 // kate: space-indent on; indent-width 2; replace-tabs on;