0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the QtScript module of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
#ifndef QSCRIPTASTVISITOR_P_H
|
|
43 |
#define QSCRIPTASTVISITOR_P_H
|
|
44 |
|
|
45 |
//
|
|
46 |
// W A R N I N G
|
|
47 |
// -------------
|
|
48 |
//
|
|
49 |
// This file is not part of the Qt API. It exists purely as an
|
|
50 |
// implementation detail. This header file may change from version to
|
|
51 |
// version without notice, or even be removed.
|
|
52 |
//
|
|
53 |
// We mean it.
|
|
54 |
//
|
|
55 |
|
|
56 |
#include "qscriptastfwd_p.h"
|
|
57 |
|
|
58 |
QT_BEGIN_NAMESPACE
|
|
59 |
|
|
60 |
namespace QScript { namespace AST {
|
|
61 |
|
|
62 |
class Visitor
|
|
63 |
{
|
|
64 |
public:
|
|
65 |
Visitor();
|
|
66 |
virtual ~Visitor();
|
|
67 |
|
|
68 |
virtual bool preVisit(Node *) { return true; }
|
|
69 |
virtual void postVisit(Node *) {}
|
|
70 |
|
|
71 |
virtual bool visit(ThisExpression *) { return true; }
|
|
72 |
virtual void endVisit(ThisExpression *) {}
|
|
73 |
|
|
74 |
virtual bool visit(IdentifierExpression *) { return true; }
|
|
75 |
virtual void endVisit(IdentifierExpression *) {}
|
|
76 |
|
|
77 |
virtual bool visit(NullExpression *) { return true; }
|
|
78 |
virtual void endVisit(NullExpression *) {}
|
|
79 |
|
|
80 |
virtual bool visit(TrueLiteral *) { return true; }
|
|
81 |
virtual void endVisit(TrueLiteral *) {}
|
|
82 |
|
|
83 |
virtual bool visit(FalseLiteral *) { return true; }
|
|
84 |
virtual void endVisit(FalseLiteral *) {}
|
|
85 |
|
|
86 |
virtual bool visit(StringLiteral *) { return true; }
|
|
87 |
virtual void endVisit(StringLiteral *) {}
|
|
88 |
|
|
89 |
virtual bool visit(NumericLiteral *) { return true; }
|
|
90 |
virtual void endVisit(NumericLiteral *) {}
|
|
91 |
|
|
92 |
virtual bool visit(RegExpLiteral *) { return true; }
|
|
93 |
virtual void endVisit(RegExpLiteral *) {}
|
|
94 |
|
|
95 |
virtual bool visit(ArrayLiteral *) { return true; }
|
|
96 |
virtual void endVisit(ArrayLiteral *) {}
|
|
97 |
|
|
98 |
virtual bool visit(ObjectLiteral *) { return true; }
|
|
99 |
virtual void endVisit(ObjectLiteral *) {}
|
|
100 |
|
|
101 |
virtual bool visit(ElementList *) { return true; }
|
|
102 |
virtual void endVisit(ElementList *) {}
|
|
103 |
|
|
104 |
virtual bool visit(Elision *) { return true; }
|
|
105 |
virtual void endVisit(Elision *) {}
|
|
106 |
|
|
107 |
virtual bool visit(PropertyNameAndValueList *) { return true; }
|
|
108 |
virtual void endVisit(PropertyNameAndValueList *) {}
|
|
109 |
|
|
110 |
virtual bool visit(IdentifierPropertyName *) { return true; }
|
|
111 |
virtual void endVisit(IdentifierPropertyName *) {}
|
|
112 |
|
|
113 |
virtual bool visit(StringLiteralPropertyName *) { return true; }
|
|
114 |
virtual void endVisit(StringLiteralPropertyName *) {}
|
|
115 |
|
|
116 |
virtual bool visit(NumericLiteralPropertyName *) { return true; }
|
|
117 |
virtual void endVisit(NumericLiteralPropertyName *) {}
|
|
118 |
|
|
119 |
virtual bool visit(ArrayMemberExpression *) { return true; }
|
|
120 |
virtual void endVisit(ArrayMemberExpression *) {}
|
|
121 |
|
|
122 |
virtual bool visit(FieldMemberExpression *) { return true; }
|
|
123 |
virtual void endVisit(FieldMemberExpression *) {}
|
|
124 |
|
|
125 |
virtual bool visit(NewMemberExpression *) { return true; }
|
|
126 |
virtual void endVisit(NewMemberExpression *) {}
|
|
127 |
|
|
128 |
virtual bool visit(NewExpression *) { return true; }
|
|
129 |
virtual void endVisit(NewExpression *) {}
|
|
130 |
|
|
131 |
virtual bool visit(CallExpression *) { return true; }
|
|
132 |
virtual void endVisit(CallExpression *) {}
|
|
133 |
|
|
134 |
virtual bool visit(ArgumentList *) { return true; }
|
|
135 |
virtual void endVisit(ArgumentList *) {}
|
|
136 |
|
|
137 |
virtual bool visit(PostIncrementExpression *) { return true; }
|
|
138 |
virtual void endVisit(PostIncrementExpression *) {}
|
|
139 |
|
|
140 |
virtual bool visit(PostDecrementExpression *) { return true; }
|
|
141 |
virtual void endVisit(PostDecrementExpression *) {}
|
|
142 |
|
|
143 |
virtual bool visit(DeleteExpression *) { return true; }
|
|
144 |
virtual void endVisit(DeleteExpression *) {}
|
|
145 |
|
|
146 |
virtual bool visit(VoidExpression *) { return true; }
|
|
147 |
virtual void endVisit(VoidExpression *) {}
|
|
148 |
|
|
149 |
virtual bool visit(TypeOfExpression *) { return true; }
|
|
150 |
virtual void endVisit(TypeOfExpression *) {}
|
|
151 |
|
|
152 |
virtual bool visit(PreIncrementExpression *) { return true; }
|
|
153 |
virtual void endVisit(PreIncrementExpression *) {}
|
|
154 |
|
|
155 |
virtual bool visit(PreDecrementExpression *) { return true; }
|
|
156 |
virtual void endVisit(PreDecrementExpression *) {}
|
|
157 |
|
|
158 |
virtual bool visit(UnaryPlusExpression *) { return true; }
|
|
159 |
virtual void endVisit(UnaryPlusExpression *) {}
|
|
160 |
|
|
161 |
virtual bool visit(UnaryMinusExpression *) { return true; }
|
|
162 |
virtual void endVisit(UnaryMinusExpression *) {}
|
|
163 |
|
|
164 |
virtual bool visit(TildeExpression *) { return true; }
|
|
165 |
virtual void endVisit(TildeExpression *) {}
|
|
166 |
|
|
167 |
virtual bool visit(NotExpression *) { return true; }
|
|
168 |
virtual void endVisit(NotExpression *) {}
|
|
169 |
|
|
170 |
virtual bool visit(BinaryExpression *) { return true; }
|
|
171 |
virtual void endVisit(BinaryExpression *) {}
|
|
172 |
|
|
173 |
virtual bool visit(ConditionalExpression *) { return true; }
|
|
174 |
virtual void endVisit(ConditionalExpression *) {}
|
|
175 |
|
|
176 |
virtual bool visit(Expression *) { return true; }
|
|
177 |
virtual void endVisit(Expression *) {}
|
|
178 |
|
|
179 |
virtual bool visit(Block *) { return true; }
|
|
180 |
virtual void endVisit(Block *) {}
|
|
181 |
|
|
182 |
virtual bool visit(StatementList *) { return true; }
|
|
183 |
virtual void endVisit(StatementList *) {}
|
|
184 |
|
|
185 |
virtual bool visit(VariableStatement *) { return true; }
|
|
186 |
virtual void endVisit(VariableStatement *) {}
|
|
187 |
|
|
188 |
virtual bool visit(VariableDeclarationList *) { return true; }
|
|
189 |
virtual void endVisit(VariableDeclarationList *) {}
|
|
190 |
|
|
191 |
virtual bool visit(VariableDeclaration *) { return true; }
|
|
192 |
virtual void endVisit(VariableDeclaration *) {}
|
|
193 |
|
|
194 |
virtual bool visit(EmptyStatement *) { return true; }
|
|
195 |
virtual void endVisit(EmptyStatement *) {}
|
|
196 |
|
|
197 |
virtual bool visit(ExpressionStatement *) { return true; }
|
|
198 |
virtual void endVisit(ExpressionStatement *) {}
|
|
199 |
|
|
200 |
virtual bool visit(IfStatement *) { return true; }
|
|
201 |
virtual void endVisit(IfStatement *) {}
|
|
202 |
|
|
203 |
virtual bool visit(DoWhileStatement *) { return true; }
|
|
204 |
virtual void endVisit(DoWhileStatement *) {}
|
|
205 |
|
|
206 |
virtual bool visit(WhileStatement *) { return true; }
|
|
207 |
virtual void endVisit(WhileStatement *) {}
|
|
208 |
|
|
209 |
virtual bool visit(ForStatement *) { return true; }
|
|
210 |
virtual void endVisit(ForStatement *) {}
|
|
211 |
|
|
212 |
virtual bool visit(LocalForStatement *) { return true; }
|
|
213 |
virtual void endVisit(LocalForStatement *) {}
|
|
214 |
|
|
215 |
virtual bool visit(ForEachStatement *) { return true; }
|
|
216 |
virtual void endVisit(ForEachStatement *) {}
|
|
217 |
|
|
218 |
virtual bool visit(LocalForEachStatement *) { return true; }
|
|
219 |
virtual void endVisit(LocalForEachStatement *) {}
|
|
220 |
|
|
221 |
virtual bool visit(ContinueStatement *) { return true; }
|
|
222 |
virtual void endVisit(ContinueStatement *) {}
|
|
223 |
|
|
224 |
virtual bool visit(BreakStatement *) { return true; }
|
|
225 |
virtual void endVisit(BreakStatement *) {}
|
|
226 |
|
|
227 |
virtual bool visit(ReturnStatement *) { return true; }
|
|
228 |
virtual void endVisit(ReturnStatement *) {}
|
|
229 |
|
|
230 |
virtual bool visit(WithStatement *) { return true; }
|
|
231 |
virtual void endVisit(WithStatement *) {}
|
|
232 |
|
|
233 |
virtual bool visit(SwitchStatement *) { return true; }
|
|
234 |
virtual void endVisit(SwitchStatement *) {}
|
|
235 |
|
|
236 |
virtual bool visit(CaseBlock *) { return true; }
|
|
237 |
virtual void endVisit(CaseBlock *) {}
|
|
238 |
|
|
239 |
virtual bool visit(CaseClauses *) { return true; }
|
|
240 |
virtual void endVisit(CaseClauses *) {}
|
|
241 |
|
|
242 |
virtual bool visit(CaseClause *) { return true; }
|
|
243 |
virtual void endVisit(CaseClause *) {}
|
|
244 |
|
|
245 |
virtual bool visit(DefaultClause *) { return true; }
|
|
246 |
virtual void endVisit(DefaultClause *) {}
|
|
247 |
|
|
248 |
virtual bool visit(LabelledStatement *) { return true; }
|
|
249 |
virtual void endVisit(LabelledStatement *) {}
|
|
250 |
|
|
251 |
virtual bool visit(ThrowStatement *) { return true; }
|
|
252 |
virtual void endVisit(ThrowStatement *) {}
|
|
253 |
|
|
254 |
virtual bool visit(TryStatement *) { return true; }
|
|
255 |
virtual void endVisit(TryStatement *) {}
|
|
256 |
|
|
257 |
virtual bool visit(Catch *) { return true; }
|
|
258 |
virtual void endVisit(Catch *) {}
|
|
259 |
|
|
260 |
virtual bool visit(Finally *) { return true; }
|
|
261 |
virtual void endVisit(Finally *) {}
|
|
262 |
|
|
263 |
virtual bool visit(FunctionDeclaration *) { return true; }
|
|
264 |
virtual void endVisit(FunctionDeclaration *) {}
|
|
265 |
|
|
266 |
virtual bool visit(FunctionExpression *) { return true; }
|
|
267 |
virtual void endVisit(FunctionExpression *) {}
|
|
268 |
|
|
269 |
virtual bool visit(FormalParameterList *) { return true; }
|
|
270 |
virtual void endVisit(FormalParameterList *) {}
|
|
271 |
|
|
272 |
virtual bool visit(FunctionBody *) { return true; }
|
|
273 |
virtual void endVisit(FunctionBody *) {}
|
|
274 |
|
|
275 |
virtual bool visit(Program *) { return true; }
|
|
276 |
virtual void endVisit(Program *) {}
|
|
277 |
|
|
278 |
virtual bool visit(SourceElements *) { return true; }
|
|
279 |
virtual void endVisit(SourceElements *) {}
|
|
280 |
|
|
281 |
virtual bool visit(FunctionSourceElement *) { return true; }
|
|
282 |
virtual void endVisit(FunctionSourceElement *) {}
|
|
283 |
|
|
284 |
virtual bool visit(StatementSourceElement *) { return true; }
|
|
285 |
virtual void endVisit(StatementSourceElement *) {}
|
|
286 |
|
|
287 |
virtual bool visit(DebuggerStatement *) { return true; }
|
|
288 |
virtual void endVisit(DebuggerStatement *) {}
|
|
289 |
};
|
|
290 |
|
|
291 |
} } // namespace AST
|
|
292 |
|
|
293 |
QT_END_NAMESPACE
|
|
294 |
|
|
295 |
#endif // QSCRIPTASTVISITOR_P_H
|