1 /*******************************************************************************
2 * Copyright (c) 2000, 2007 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.core.dom;
14 class DefaultASTVisitor extends ASTVisitor {
18 public DefaultASTVisitor() {
25 public DefaultASTVisitor(boolean visitDocTags) {
29 public void endVisit(AnnotationTypeDeclaration node) {
33 public void endVisit(AnnotationTypeMemberDeclaration node) {
37 public void endVisit(AnonymousClassDeclaration node) {
40 public void endVisit(ArrayAccess node) {
43 public void endVisit(ArrayCreation node) {
46 public void endVisit(ArrayInitializer node) {
49 public void endVisit(ArrayType node) {
52 public void endVisit(AssertStatement node) {
55 public void endVisit(Assignment node) {
58 public void endVisit(Block node) {
62 public void endVisit(BlockComment node) {
65 public void endVisit(BooleanLiteral node) {
68 public void endVisit(BreakStatement node) {
71 public void endVisit(CastExpression node) {
74 public void endVisit(CatchClause node) {
77 public void endVisit(CharacterLiteral node) {
80 public void endVisit(ClassInstanceCreation node) {
83 public void endVisit(CompilationUnit node) {
86 public void endVisit(ConditionalExpression node) {
89 public void endVisit(ConstructorInvocation node) {
92 public void endVisit(ContinueStatement node) {
95 public void endVisit(DoStatement node) {
98 public void endVisit(EmptyStatement node) {
101 public void endVisit(EnhancedForStatement node) {
104 public void endVisit(EnumConstantDeclaration node) {
107 public void endVisit(EnumDeclaration node) {
110 public void endVisit(ExpressionStatement node) {
113 public void endVisit(FieldAccess node) {
116 public void endVisit(FieldDeclaration node) {
119 public void endVisit(ForStatement node) {
122 public void endVisit(IfStatement node) {
125 public void endVisit(ImportDeclaration node) {
128 public void endVisit(InfixExpression node) {
131 public void endVisit(Initializer node) {
134 public void endVisit(InstanceofExpression node) {
137 public void endVisit(Javadoc node) {
140 public void endVisit(LabeledStatement node) {
143 public void endVisit(LineComment node) {
146 public void endVisit(MarkerAnnotation node) {
149 public void endVisit(MemberRef node) {
152 public void endVisit(MemberValuePair node) {
155 public void endVisit(MethodDeclaration node) {
158 public void endVisit(MethodInvocation node) {
161 public void endVisit(MethodRef node) {
164 public void endVisit(MethodRefParameter node) {
167 public void endVisit(NormalAnnotation node) {
170 public void endVisit(NullLiteral node) {
173 public void endVisit(NumberLiteral node) {
176 public void endVisit(PackageDeclaration node) {
179 public void endVisit(ParameterizedType node) {
182 public void endVisit(ParenthesizedExpression node) {
185 public void endVisit(PostfixExpression node) {
188 public void endVisit(PrefixExpression node) {
191 public void endVisit(PrimitiveType node) {
194 public void endVisit(QualifiedName node) {
197 public void endVisit(QualifiedType node) {
200 public void endVisit(ReturnStatement node) {
203 public void endVisit(SimpleName node) {
206 public void endVisit(SimpleType node) {
209 public void endVisit(SingleMemberAnnotation node) {
212 public void endVisit(SingleVariableDeclaration node) {
215 public void endVisit(StringLiteral node) {
218 public void endVisit(SuperConstructorInvocation node) {
221 public void endVisit(SuperFieldAccess node) {
224 public void endVisit(SuperMethodInvocation node) {
228 public void endVisit(SwitchCase node) {
231 public void endVisit(SwitchStatement node) {
234 public void endVisit(SynchronizedStatement node) {
237 public void endVisit(TagElement node) {
240 public void endVisit(TextElement node) {
243 public void endVisit(ThisExpression node) {
246 public void endVisit(ThrowStatement node) {
249 public void endVisit(TryStatement node) {
253 public void endVisit(TypeDeclaration node) {
256 public void endVisit(TypeDeclarationStatement node) {
259 public void endVisit(TypeLiteral node) {
262 public void endVisit(TypeParameter node) {
265 public void endVisit(VariableDeclarationExpression node) {
268 public void endVisit(VariableDeclarationFragment node) {
271 public void endVisit(VariableDeclarationStatement node) {
274 public void endVisit(WhileStatement node) {
277 public void endVisit(WildcardType node) {
280 protected void endVisitNode(ASTNode node) {
283 public boolean visit(AnnotationTypeDeclaration node) {
284 return visitNode(node);
286 public boolean visit(AnnotationTypeMemberDeclaration node) {
287 return visitNode(node);
289 public boolean visit(AnonymousClassDeclaration node) {
290 return visitNode(node);
292 public boolean visit(ArrayAccess node) {
293 return visitNode(node);
295 public boolean visit(ArrayCreation node) {
296 return visitNode(node);
298 public boolean visit(ArrayInitializer node) {
299 return visitNode(node);
301 public boolean visit(ArrayType node) {
305 public boolean visit(AssertStatement node) {
306 return visitNode(node);
308 public boolean visit(Assignment node) {
309 return visitNode(node);
311 public boolean visit(Block node) {
312 return visitNode(node);
315 public boolean visit(BlockComment node) {
316 return visitNode(node);
318 public boolean visit(BooleanLiteral node) {
319 return visitNode(node);
321 public boolean visit(BreakStatement node) {
322 return visitNode(node);
324 public boolean visit(CastExpression node) {
325 return visitNode(node);
327 public boolean visit(CatchClause node) {
328 return visitNode(node);
330 public boolean visit(CharacterLiteral node) {
331 return visitNode(node);
333 public boolean visit(ClassInstanceCreation node) {
334 return visitNode(node);
336 public boolean visit(CompilationUnit node) {
337 return visitNode(node);
339 public boolean visit(ConditionalExpression node) {
340 return visitNode(node);
342 public boolean visit(ConstructorInvocation node) {
343 return visitNode(node);
345 public boolean visit(ContinueStatement node) {
346 return visitNode(node);
348 public boolean visit(DoStatement node) {
349 return visitNode(node);
351 public boolean visit(EmptyStatement node) {
352 return visitNode(node);
354 public boolean visit(EnhancedForStatement node) {
355 return visitNode(node);
357 public boolean visit(EnumConstantDeclaration node) {
358 return visitNode(node);
360 public boolean visit(EnumDeclaration node) {
361 return visitNode(node);
363 public boolean visit(ExpressionStatement node) {
364 return visitNode(node);
366 public boolean visit(FieldAccess node) {
367 return visitNode(node);
369 public boolean visit(FieldDeclaration node) {
370 return visitNode(node);
372 public boolean visit(ForStatement node) {
373 return visitNode(node);
375 public boolean visit(IfStatement node) {
376 return visitNode(node);
378 public boolean visit(ImportDeclaration node) {
379 return visitNode(node);
381 public boolean visit(InfixExpression node) {
382 return visitNode(node);
384 public boolean visit(Initializer node) {
385 return visitNode(node);
387 public boolean visit(InstanceofExpression node) {
388 return visitNode(node);
390 public boolean visit(Javadoc node) {
391 // do not visit Javadoc tags by default. Use constructor with boolean to enable.
392 if (super.visit(node)) {
393 return visitNode(node);
397 public boolean visit(LabeledStatement node) {
398 return visitNode(node);
400 public boolean visit(LineComment node) {
401 return visitNode(node);
403 public boolean visit(MarkerAnnotation node) {
404 return visitNode(node);
406 public boolean visit(MemberRef node) {
407 return visitNode(node);
409 public boolean visit(MemberValuePair node) {
410 return visitNode(node);
412 public boolean visit(MethodDeclaration node) {
413 return visitNode(node);
415 public boolean visit(MethodInvocation node) {
416 return visitNode(node);
418 public boolean visit(MethodRef node) {
419 return visitNode(node);
421 public boolean visit(MethodRefParameter node) {
422 return visitNode(node);
424 public boolean visit(NormalAnnotation node) {
425 return visitNode(node);
427 public boolean visit(NullLiteral node) {
428 return visitNode(node);
430 public boolean visit(NumberLiteral node) {
431 return visitNode(node);
433 public boolean visit(PackageDeclaration node) {
434 return visitNode(node);
436 public boolean visit(ParameterizedType node) {
437 return visitNode(node);
439 public boolean visit(ParenthesizedExpression node) {
440 return visitNode(node);
442 public boolean visit(PostfixExpression node) {
443 return visitNode(node);
445 public boolean visit(PrefixExpression node) {
446 return visitNode(node);
449 public boolean visit(PrimitiveType node) {
450 return visitNode(node);
452 public boolean visit(QualifiedName node) {
453 return visitNode(node);
455 public boolean visit(QualifiedType node) {
456 return visitNode(node);
458 public boolean visit(ReturnStatement node) {
459 return visitNode(node);
461 public boolean visit(SimpleName node) {
462 return visitNode(node);
464 public boolean visit(SimpleType node) {
465 return visitNode(node);
467 public boolean visit(SingleMemberAnnotation node) {
468 return visitNode(node);
470 public boolean visit(SingleVariableDeclaration node) {
471 return visitNode(node);
474 public boolean visit(StringLiteral node) {
475 return visitNode(node);
478 public boolean visit(SuperConstructorInvocation node) {
479 return visitNode(node);
482 public boolean visit(SuperFieldAccess node) {
483 return visitNode(node);
486 public boolean visit(SuperMethodInvocation node) {
487 return visitNode(node);
490 public boolean visit(SwitchCase node) {
491 return visitNode(node);
494 public boolean visit(SwitchStatement node) {
495 return visitNode(node);
498 public boolean visit(SynchronizedStatement node) {
499 return visitNode(node);
502 public boolean visit(TagElement node) {
503 return visitNode(node);
506 public boolean visit(TextElement node) {
507 return visitNode(node);
510 public boolean visit(ThisExpression node) {
511 return visitNode(node);
514 public boolean visit(ThrowStatement node) {
515 return visitNode(node);
518 public boolean visit(TryStatement node) {
519 return visitNode(node);
522 public boolean visit(TypeDeclaration node) {
523 return visitNode(node);
526 public boolean visit(TypeDeclarationStatement node) {
527 return visitNode(node);
530 public boolean visit(TypeLiteral node) {
531 return visitNode(node);
534 public boolean visit(TypeParameter node) {
535 return visitNode(node);
538 public boolean visit(VariableDeclarationExpression node) {
539 return visitNode(node);
542 public boolean visit(VariableDeclarationFragment node) {
543 return visitNode(node);
546 public boolean visit(VariableDeclarationStatement node) {
547 return visitNode(node);
550 public boolean visit(WhileStatement node) {
551 return visitNode(node);
554 public boolean visit(WildcardType node) {
555 return visitNode(node);
558 protected boolean visitNode(ASTNode node) {