Mercurial > projects > qtd
annotate generator/parser/visitor.cpp @ 321:d458ed66e871 signals
minor stuff
author | eldar_ins@eldar-laptop |
---|---|
date | Sat, 26 Dec 2009 05:10:16 +0500 |
parents | 09a0f1d048f2 |
children |
rev | line source |
---|---|
1 | 1 /**************************************************************************** |
2 ** | |
52
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
3 ** Copyright (C) 1992-2009 Nokia. All rights reserved. |
1 | 4 ** Copyright (C) 2002-2005 Roberto Raggi <roberto@kdevelop.org> |
5 ** | |
6 ** This file is part of Qt Jambi. | |
7 ** | |
52
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
8 ** Commercial Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
9 Licensees holding valid Qt Commercial licenses may use this file in |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
10 accordance with the Qt Commercial License Agreement provided with the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
11 Software or, alternatively, in accordance with the terms contained in |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
12 a written agreement between you and Nokia. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
13 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
14 GNU Lesser General Public License Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
15 Alternatively, this file may be used under the terms of the GNU Lesser |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
16 General Public License version 2.1 as published by the Free Software |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
17 Foundation and appearing in the file LICENSE.LGPL included in the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
18 packaging of this file. Please review the following information to |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
19 ensure the GNU Lesser General Public License version 2.1 requirements |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
20 will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
21 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
22 In addition, as a special exception, Nokia gives you certain |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
23 additional rights. These rights are described in the Nokia Qt LGPL |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
24 Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
25 package. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
26 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
27 GNU General Public License Usage |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
28 Alternatively, this file may be used under the terms of the GNU |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
29 General Public License version 3.0 as published by the Free Software |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
30 Foundation and appearing in the file LICENSE.GPL included in the |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
31 packaging of this file. Please review the following information to |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
32 ensure the GNU General Public License version 3.0 requirements will be |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
33 met: http://www.gnu.org/copyleft/gpl.html. |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
34 |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
35 If you are unsure which license is appropriate for your use, please |
09a0f1d048f2
update parser to that from jambi 4.5, attemt to fix building with gcc 4.4
eldar
parents:
1
diff
changeset
|
36 contact the sales department at qt-sales@nokia.com. |
1 | 37 |
38 ** | |
39 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | |
40 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
41 ** | |
42 ****************************************************************************/ | |
43 | |
44 | |
45 #include "visitor.h" | |
46 | |
47 Visitor::visitor_fun_ptr Visitor::_S_table[AST::NODE_KIND_COUNT] = { | |
48 0, | |
49 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitAccessSpecifier), | |
50 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitAsmDefinition), | |
51 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitBaseClause), | |
52 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitBaseSpecifier), | |
53 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitBinaryExpression), | |
54 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCastExpression), | |
55 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitClassMemberAccess), | |
56 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitClassSpecifier), | |
57 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCompoundStatement), | |
58 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCondition), | |
59 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitConditionalExpression), | |
60 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCppCastExpression), | |
61 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitCtorInitializer), | |
62 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitDeclarationStatement), | |
63 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitDeclarator), | |
64 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitDeleteExpression), | |
65 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitDoStatement), | |
66 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitElaboratedTypeSpecifier), | |
67 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitEnumSpecifier), | |
68 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitEnumerator), | |
69 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitExceptionSpecification), | |
70 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitExpressionOrDeclarationStatement), | |
71 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitExpressionStatement), | |
72 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitForStatement), | |
73 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitFunctionCall), | |
74 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitFunctionDefinition), | |
75 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitIfStatement), | |
76 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitIncrDecrExpression), | |
77 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitInitDeclarator), | |
78 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitInitializer), | |
79 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitInitializerClause), | |
80 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitLabeledStatement), | |
81 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitLinkageBody), | |
82 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitLinkageSpecification), | |
83 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitMemInitializer), | |
84 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitName), | |
85 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNamespace), | |
86 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNamespaceAliasDefinition), | |
87 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNewDeclarator), | |
88 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNewExpression), | |
89 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNewInitializer), | |
90 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitNewTypeId), | |
91 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitOperator), | |
92 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitOperatorFunctionId), | |
93 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitParameterDeclaration), | |
94 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitParameterDeclarationClause), | |
95 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitPostfixExpression), | |
96 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitPrimaryExpression), | |
97 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitPtrOperator), | |
98 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitPtrToMember), | |
99 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitReturnStatement), | |
100 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSimpleDeclaration), | |
101 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSimpleTypeSpecifier), | |
102 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSizeofExpression), | |
103 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitStringLiteral), | |
104 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSubscriptExpression), | |
105 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitSwitchStatement), | |
106 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTemplateArgument), | |
107 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTemplateDeclaration), | |
108 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTemplateParameter), | |
109 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitThrowExpression), | |
110 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTranslationUnit), | |
111 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTryBlockStatement), | |
112 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTypeId), | |
113 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTypeIdentification), | |
114 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTypeParameter), | |
115 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitTypedef), | |
116 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitUnaryExpression), | |
117 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitUnqualifiedName), | |
118 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitUsing), | |
119 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitUsingDirective), | |
120 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitWhileStatement), | |
121 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitWinDeclSpec), | |
122 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitQProperty), | |
123 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitForwardDeclarationSpecifier), | |
124 reinterpret_cast<Visitor::visitor_fun_ptr>(&Visitor::visitQEnums) | |
125 }; | |
126 | |
127 Visitor::Visitor() | |
128 { | |
129 } | |
130 | |
131 Visitor::~Visitor() | |
132 { | |
133 } | |
134 | |
135 void Visitor::visit(AST *node) | |
136 { | |
137 if (node) | |
138 (this->*_S_table[node->kind])(node); | |
139 } | |
140 | |
141 // kate: space-indent on; indent-width 2; replace-tabs on; |