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

source code of qtscript/src/script/parser/qscriptastvisitor_p.h