Qt 4.8
qdeclarativejsastvisitor_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative 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 Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QDECLARATIVEJSASTVISITOR_P_H
43 #define QDECLARATIVEJSASTVISITOR_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 "private/qdeclarativejsastfwd_p.h"
57 #include "private/qdeclarativejsglobal_p.h"
58 
60 
61 namespace QDeclarativeJS { namespace AST {
62 
64 {
65 public:
66  Visitor();
67  virtual ~Visitor();
68 
69  virtual bool preVisit(Node *) { return true; }
70  virtual void postVisit(Node *) {}
71 
72  // Ui
73  virtual bool visit(UiProgram *) { return true; }
74  virtual bool visit(UiImportList *) { return true; }
75  virtual bool visit(UiImport *) { return true; }
76  virtual bool visit(UiPublicMember *) { return true; }
77  virtual bool visit(UiSourceElement *) { return true; }
78  virtual bool visit(UiObjectDefinition *) { return true; }
79  virtual bool visit(UiObjectInitializer *) { return true; }
80  virtual bool visit(UiObjectBinding *) { return true; }
81  virtual bool visit(UiScriptBinding *) { return true; }
82  virtual bool visit(UiArrayBinding *) { return true; }
83  virtual bool visit(UiObjectMemberList *) { return true; }
84  virtual bool visit(UiArrayMemberList *) { return true; }
85  virtual bool visit(UiQualifiedId *) { return true; }
86  virtual bool visit(UiSignature *) { return true; }
87  virtual bool visit(UiFormalList *) { return true; }
88  virtual bool visit(UiFormal *) { return true; }
89 
90  virtual void endVisit(UiProgram *) {}
91  virtual void endVisit(UiImportList *) {}
92  virtual void endVisit(UiImport *) {}
93  virtual void endVisit(UiPublicMember *) {}
94  virtual void endVisit(UiSourceElement *) {}
95  virtual void endVisit(UiObjectDefinition *) {}
96  virtual void endVisit(UiObjectInitializer *) {}
97  virtual void endVisit(UiObjectBinding *) {}
98  virtual void endVisit(UiScriptBinding *) {}
99  virtual void endVisit(UiArrayBinding *) {}
100  virtual void endVisit(UiObjectMemberList *) {}
101  virtual void endVisit(UiArrayMemberList *) {}
102  virtual void endVisit(UiQualifiedId *) {}
103  virtual void endVisit(UiSignature *) {}
104  virtual void endVisit(UiFormalList *) {}
105  virtual void endVisit(UiFormal *) {}
106 
107  // QDeclarativeJS
108  virtual bool visit(ThisExpression *) { return true; }
109  virtual void endVisit(ThisExpression *) {}
110 
111  virtual bool visit(IdentifierExpression *) { return true; }
112  virtual void endVisit(IdentifierExpression *) {}
113 
114  virtual bool visit(NullExpression *) { return true; }
115  virtual void endVisit(NullExpression *) {}
116 
117  virtual bool visit(TrueLiteral *) { return true; }
118  virtual void endVisit(TrueLiteral *) {}
119 
120  virtual bool visit(FalseLiteral *) { return true; }
121  virtual void endVisit(FalseLiteral *) {}
122 
123  virtual bool visit(StringLiteral *) { return true; }
124  virtual void endVisit(StringLiteral *) {}
125 
126  virtual bool visit(NumericLiteral *) { return true; }
127  virtual void endVisit(NumericLiteral *) {}
128 
129  virtual bool visit(RegExpLiteral *) { return true; }
130  virtual void endVisit(RegExpLiteral *) {}
131 
132  virtual bool visit(ArrayLiteral *) { return true; }
133  virtual void endVisit(ArrayLiteral *) {}
134 
135  virtual bool visit(ObjectLiteral *) { return true; }
136  virtual void endVisit(ObjectLiteral *) {}
137 
138  virtual bool visit(ElementList *) { return true; }
139  virtual void endVisit(ElementList *) {}
140 
141  virtual bool visit(Elision *) { return true; }
142  virtual void endVisit(Elision *) {}
143 
144  virtual bool visit(PropertyNameAndValueList *) { return true; }
146 
147  virtual bool visit(NestedExpression *) { return true; }
148  virtual void endVisit(NestedExpression *) {}
149 
150  virtual bool visit(IdentifierPropertyName *) { return true; }
151  virtual void endVisit(IdentifierPropertyName *) {}
152 
153  virtual bool visit(StringLiteralPropertyName *) { return true; }
155 
156  virtual bool visit(NumericLiteralPropertyName *) { return true; }
158 
159  virtual bool visit(ArrayMemberExpression *) { return true; }
160  virtual void endVisit(ArrayMemberExpression *) {}
161 
162  virtual bool visit(FieldMemberExpression *) { return true; }
163  virtual void endVisit(FieldMemberExpression *) {}
164 
165  virtual bool visit(NewMemberExpression *) { return true; }
166  virtual void endVisit(NewMemberExpression *) {}
167 
168  virtual bool visit(NewExpression *) { return true; }
169  virtual void endVisit(NewExpression *) {}
170 
171  virtual bool visit(CallExpression *) { return true; }
172  virtual void endVisit(CallExpression *) {}
173 
174  virtual bool visit(ArgumentList *) { return true; }
175  virtual void endVisit(ArgumentList *) {}
176 
177  virtual bool visit(PostIncrementExpression *) { return true; }
179 
180  virtual bool visit(PostDecrementExpression *) { return true; }
182 
183  virtual bool visit(DeleteExpression *) { return true; }
184  virtual void endVisit(DeleteExpression *) {}
185 
186  virtual bool visit(VoidExpression *) { return true; }
187  virtual void endVisit(VoidExpression *) {}
188 
189  virtual bool visit(TypeOfExpression *) { return true; }
190  virtual void endVisit(TypeOfExpression *) {}
191 
192  virtual bool visit(PreIncrementExpression *) { return true; }
193  virtual void endVisit(PreIncrementExpression *) {}
194 
195  virtual bool visit(PreDecrementExpression *) { return true; }
196  virtual void endVisit(PreDecrementExpression *) {}
197 
198  virtual bool visit(UnaryPlusExpression *) { return true; }
199  virtual void endVisit(UnaryPlusExpression *) {}
200 
201  virtual bool visit(UnaryMinusExpression *) { return true; }
202  virtual void endVisit(UnaryMinusExpression *) {}
203 
204  virtual bool visit(TildeExpression *) { return true; }
205  virtual void endVisit(TildeExpression *) {}
206 
207  virtual bool visit(NotExpression *) { return true; }
208  virtual void endVisit(NotExpression *) {}
209 
210  virtual bool visit(BinaryExpression *) { return true; }
211  virtual void endVisit(BinaryExpression *) {}
212 
213  virtual bool visit(ConditionalExpression *) { return true; }
214  virtual void endVisit(ConditionalExpression *) {}
215 
216  virtual bool visit(Expression *) { return true; }
217  virtual void endVisit(Expression *) {}
218 
219  virtual bool visit(Block *) { return true; }
220  virtual void endVisit(Block *) {}
221 
222  virtual bool visit(StatementList *) { return true; }
223  virtual void endVisit(StatementList *) {}
224 
225  virtual bool visit(VariableStatement *) { return true; }
226  virtual void endVisit(VariableStatement *) {}
227 
228  virtual bool visit(VariableDeclarationList *) { return true; }
230 
231  virtual bool visit(VariableDeclaration *) { return true; }
232  virtual void endVisit(VariableDeclaration *) {}
233 
234  virtual bool visit(EmptyStatement *) { return true; }
235  virtual void endVisit(EmptyStatement *) {}
236 
237  virtual bool visit(ExpressionStatement *) { return true; }
238  virtual void endVisit(ExpressionStatement *) {}
239 
240  virtual bool visit(IfStatement *) { return true; }
241  virtual void endVisit(IfStatement *) {}
242 
243  virtual bool visit(DoWhileStatement *) { return true; }
244  virtual void endVisit(DoWhileStatement *) {}
245 
246  virtual bool visit(WhileStatement *) { return true; }
247  virtual void endVisit(WhileStatement *) {}
248 
249  virtual bool visit(ForStatement *) { return true; }
250  virtual void endVisit(ForStatement *) {}
251 
252  virtual bool visit(LocalForStatement *) { return true; }
253  virtual void endVisit(LocalForStatement *) {}
254 
255  virtual bool visit(ForEachStatement *) { return true; }
256  virtual void endVisit(ForEachStatement *) {}
257 
258  virtual bool visit(LocalForEachStatement *) { return true; }
259  virtual void endVisit(LocalForEachStatement *) {}
260 
261  virtual bool visit(ContinueStatement *) { return true; }
262  virtual void endVisit(ContinueStatement *) {}
263 
264  virtual bool visit(BreakStatement *) { return true; }
265  virtual void endVisit(BreakStatement *) {}
266 
267  virtual bool visit(ReturnStatement *) { return true; }
268  virtual void endVisit(ReturnStatement *) {}
269 
270  virtual bool visit(WithStatement *) { return true; }
271  virtual void endVisit(WithStatement *) {}
272 
273  virtual bool visit(SwitchStatement *) { return true; }
274  virtual void endVisit(SwitchStatement *) {}
275 
276  virtual bool visit(CaseBlock *) { return true; }
277  virtual void endVisit(CaseBlock *) {}
278 
279  virtual bool visit(CaseClauses *) { return true; }
280  virtual void endVisit(CaseClauses *) {}
281 
282  virtual bool visit(CaseClause *) { return true; }
283  virtual void endVisit(CaseClause *) {}
284 
285  virtual bool visit(DefaultClause *) { return true; }
286  virtual void endVisit(DefaultClause *) {}
287 
288  virtual bool visit(LabelledStatement *) { return true; }
289  virtual void endVisit(LabelledStatement *) {}
290 
291  virtual bool visit(ThrowStatement *) { return true; }
292  virtual void endVisit(ThrowStatement *) {}
293 
294  virtual bool visit(TryStatement *) { return true; }
295  virtual void endVisit(TryStatement *) {}
296 
297  virtual bool visit(Catch *) { return true; }
298  virtual void endVisit(Catch *) {}
299 
300  virtual bool visit(Finally *) { return true; }
301  virtual void endVisit(Finally *) {}
302 
303  virtual bool visit(FunctionDeclaration *) { return true; }
304  virtual void endVisit(FunctionDeclaration *) {}
305 
306  virtual bool visit(FunctionExpression *) { return true; }
307  virtual void endVisit(FunctionExpression *) {}
308 
309  virtual bool visit(FormalParameterList *) { return true; }
310  virtual void endVisit(FormalParameterList *) {}
311 
312  virtual bool visit(FunctionBody *) { return true; }
313  virtual void endVisit(FunctionBody *) {}
314 
315  virtual bool visit(Program *) { return true; }
316  virtual void endVisit(Program *) {}
317 
318  virtual bool visit(SourceElements *) { return true; }
319  virtual void endVisit(SourceElements *) {}
320 
321  virtual bool visit(FunctionSourceElement *) { return true; }
322  virtual void endVisit(FunctionSourceElement *) {}
323 
324  virtual bool visit(StatementSourceElement *) { return true; }
325  virtual void endVisit(StatementSourceElement *) {}
326 
327  virtual bool visit(DebuggerStatement *) { return true; }
328  virtual void endVisit(DebuggerStatement *) {}
329 };
330 
331 } } // namespace AST
332 
334 
335 #endif // QDECLARATIVEJSASTVISITOR_P_H
virtual void endVisit(TryStatement *)
virtual void endVisit(EmptyStatement *)
virtual bool visit(RegExpLiteral *)
virtual bool visit(ThrowStatement *)
virtual void endVisit(BreakStatement *)
virtual bool visit(LocalForEachStatement *)
virtual void endVisit(ThisExpression *)
virtual bool visit(NotExpression *)
virtual bool visit(UiQualifiedId *)
virtual void endVisit(LocalForStatement *)
virtual void endVisit(ReturnStatement *)
virtual bool visit(EmptyStatement *)
virtual bool visit(BinaryExpression *)
virtual bool visit(UiObjectDefinition *)
virtual void endVisit(CallExpression *)
virtual bool visit(IdentifierPropertyName *)
virtual void endVisit(UnaryMinusExpression *)
virtual bool visit(NullExpression *)
virtual void endVisit(IdentifierPropertyName *)
virtual bool visit(UiArrayMemberList *)
virtual bool visit(PreDecrementExpression *)
virtual void endVisit(TrueLiteral *)
virtual bool visit(NestedExpression *)
virtual bool visit(FunctionBody *)
virtual void endVisit(ArrayLiteral *)
virtual void endVisit(CaseClauses *)
virtual bool visit(FormalParameterList *)
virtual bool visit(ConditionalExpression *)
virtual void endVisit(UiSourceElement *)
virtual bool visit(FunctionExpression *)
virtual void endVisit(NestedExpression *)
virtual void endVisit(NumericLiteral *)
virtual void endVisit(UiFormalList *)
virtual bool visit(NewExpression *)
virtual void endVisit(VariableDeclarationList *)
virtual void endVisit(FunctionSourceElement *)
virtual void endVisit(FunctionExpression *)
virtual void endVisit(PostDecrementExpression *)
virtual void endVisit(UiObjectMemberList *)
virtual bool visit(CallExpression *)
virtual bool visit(UiPublicMember *)
virtual bool visit(ArrayLiteral *)
virtual void endVisit(DebuggerStatement *)
virtual void endVisit(NotExpression *)
virtual bool visit(LocalForStatement *)
virtual void endVisit(StatementSourceElement *)
virtual void endVisit(FieldMemberExpression *)
virtual void endVisit(WhileStatement *)
virtual bool visit(UiScriptBinding *)
virtual void endVisit(PreDecrementExpression *)
virtual bool visit(ContinueStatement *)
virtual bool visit(LabelledStatement *)
virtual void endVisit(DoWhileStatement *)
virtual bool visit(SourceElements *)
virtual void endVisit(VariableDeclaration *)
virtual bool visit(ThisExpression *)
#define QML_PARSER_EXPORT
virtual void endVisit(PostIncrementExpression *)
virtual bool visit(PreIncrementExpression *)
virtual bool visit(WhileStatement *)
virtual void endVisit(FunctionDeclaration *)
virtual bool visit(IfStatement *)
virtual void endVisit(UiSignature *)
virtual bool visit(ElementList *)
virtual void endVisit(ConditionalExpression *)
virtual bool visit(VariableDeclaration *)
virtual bool visit(StringLiteral *)
virtual void endVisit(DeleteExpression *)
virtual void endVisit(StatementList *)
virtual bool visit(UiSourceElement *)
virtual bool visit(NewMemberExpression *)
virtual void endVisit(SwitchStatement *)
virtual bool visit(StatementSourceElement *)
virtual void endVisit(IdentifierExpression *)
virtual void endVisit(ObjectLiteral *)
virtual bool visit(TrueLiteral *)
virtual bool visit(UiSignature *)
virtual void endVisit(UnaryPlusExpression *)
virtual void endVisit(BinaryExpression *)
virtual void endVisit(LocalForEachStatement *)
virtual void endVisit(TypeOfExpression *)
virtual bool visit(ArgumentList *)
virtual bool visit(ForEachStatement *)
virtual void endVisit(FunctionBody *)
virtual void endVisit(UiScriptBinding *)
virtual bool visit(UiObjectInitializer *)
virtual bool visit(VoidExpression *)
virtual bool visit(FunctionDeclaration *)
virtual void endVisit(StringLiteralPropertyName *)
#define QT_QML_END_NAMESPACE
virtual bool visit(ObjectLiteral *)
virtual void endVisit(PreIncrementExpression *)
virtual void endVisit(IfStatement *)
virtual void endVisit(UiObjectBinding *)
virtual bool visit(FalseLiteral *)
virtual bool visit(ArrayMemberExpression *)
#define QT_QML_BEGIN_NAMESPACE
virtual void endVisit(ForStatement *)
virtual bool visit(WithStatement *)
virtual void endVisit(ThrowStatement *)
virtual bool visit(FunctionSourceElement *)
virtual void endVisit(ArrayMemberExpression *)
virtual bool visit(BreakStatement *)
virtual void endVisit(UiProgram *)
virtual bool visit(NumericLiteral *)
virtual void endVisit(PropertyNameAndValueList *)
virtual bool visit(TildeExpression *)
virtual void endVisit(ExpressionStatement *)
virtual void endVisit(ContinueStatement *)
virtual bool visit(PostIncrementExpression *)
virtual void endVisit(NewMemberExpression *)
virtual void endVisit(UiQualifiedId *)
virtual void endVisit(WithStatement *)
virtual void endVisit(ForEachStatement *)
virtual bool visit(UiObjectMemberList *)
virtual bool visit(PropertyNameAndValueList *)
virtual bool visit(DefaultClause *)
virtual bool visit(IdentifierExpression *)
virtual bool visit(TryStatement *)
virtual void endVisit(UiArrayMemberList *)
virtual void endVisit(CaseClause *)
virtual bool visit(NumericLiteralPropertyName *)
virtual bool visit(UnaryMinusExpression *)
virtual void endVisit(LabelledStatement *)
virtual bool visit(UiArrayBinding *)
virtual bool visit(TypeOfExpression *)
virtual void endVisit(VoidExpression *)
virtual void endVisit(UiPublicMember *)
virtual bool visit(SwitchStatement *)
virtual void endVisit(ElementList *)
virtual void endVisit(UiObjectInitializer *)
virtual void endVisit(NewExpression *)
virtual void endVisit(NumericLiteralPropertyName *)
virtual bool visit(VariableStatement *)
virtual void endVisit(DefaultClause *)
virtual void endVisit(NullExpression *)
virtual bool visit(PostDecrementExpression *)
virtual bool visit(DeleteExpression *)
virtual bool visit(UiImportList *)
virtual void endVisit(UiArrayBinding *)
virtual bool visit(FieldMemberExpression *)
virtual bool visit(UnaryPlusExpression *)
virtual bool visit(DebuggerStatement *)
virtual void endVisit(ArgumentList *)
virtual bool visit(ExpressionStatement *)
virtual bool visit(VariableDeclarationList *)
virtual bool visit(UiFormalList *)
virtual bool visit(UiObjectBinding *)
virtual bool visit(StringLiteralPropertyName *)
virtual void endVisit(TildeExpression *)
virtual bool visit(ReturnStatement *)
virtual bool visit(StatementList *)
virtual void endVisit(FormalParameterList *)
virtual void endVisit(UiImportList *)
virtual void endVisit(FalseLiteral *)
virtual bool visit(ForStatement *)
virtual void endVisit(UiObjectDefinition *)
virtual void endVisit(RegExpLiteral *)
virtual void endVisit(Expression *)
virtual bool visit(CaseClauses *)
virtual void endVisit(SourceElements *)
virtual void endVisit(StringLiteral *)
virtual bool visit(DoWhileStatement *)
virtual void endVisit(VariableStatement *)