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