1 /*******************************************************************************
2 * Copyright (c) 2000, 2004 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler;
13 import net.sourceforge.phpdt.core.compiler.IProblem;
14 import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope;
15 import net.sourceforge.phpdt.internal.compiler.lookup.ClassScope;
16 import net.sourceforge.phpdt.internal.compiler.lookup.CompilationUnitScope;
17 import net.sourceforge.phpdt.internal.compiler.lookup.MethodScope;
18 import net.sourceforge.phpeclipse.internal.compiler.ast.AND_AND_Expression;
19 import net.sourceforge.phpeclipse.internal.compiler.ast.AllocationExpression;
20 import net.sourceforge.phpeclipse.internal.compiler.ast.Argument;
21 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayAllocationExpression;
22 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayInitializer;
23 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayQualifiedTypeReference;
24 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayReference;
25 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayTypeReference;
26 import net.sourceforge.phpeclipse.internal.compiler.ast.AssertStatement;
27 import net.sourceforge.phpeclipse.internal.compiler.ast.Assignment;
28 import net.sourceforge.phpeclipse.internal.compiler.ast.BinaryExpression;
29 import net.sourceforge.phpeclipse.internal.compiler.ast.Block;
30 import net.sourceforge.phpeclipse.internal.compiler.ast.BreakStatement;
31 import net.sourceforge.phpeclipse.internal.compiler.ast.CaseStatement;
32 import net.sourceforge.phpeclipse.internal.compiler.ast.CastExpression;
33 import net.sourceforge.phpeclipse.internal.compiler.ast.Clinit;
34 import net.sourceforge.phpeclipse.internal.compiler.ast.CompilationUnitDeclaration;
35 import net.sourceforge.phpeclipse.internal.compiler.ast.CompoundAssignment;
36 import net.sourceforge.phpeclipse.internal.compiler.ast.ConditionalExpression;
37 import net.sourceforge.phpeclipse.internal.compiler.ast.ConstructorDeclaration;
38 import net.sourceforge.phpeclipse.internal.compiler.ast.ContinueStatement;
39 import net.sourceforge.phpeclipse.internal.compiler.ast.DoStatement;
40 import net.sourceforge.phpeclipse.internal.compiler.ast.DoubleLiteral;
41 import net.sourceforge.phpeclipse.internal.compiler.ast.EmptyStatement;
42 import net.sourceforge.phpeclipse.internal.compiler.ast.EqualExpression;
43 import net.sourceforge.phpeclipse.internal.compiler.ast.ExplicitConstructorCall;
44 import net.sourceforge.phpeclipse.internal.compiler.ast.ExtendedStringLiteral;
45 import net.sourceforge.phpeclipse.internal.compiler.ast.FalseLiteral;
46 import net.sourceforge.phpeclipse.internal.compiler.ast.FieldDeclaration;
47 import net.sourceforge.phpeclipse.internal.compiler.ast.FieldReference;
48 import net.sourceforge.phpeclipse.internal.compiler.ast.FloatLiteral;
49 import net.sourceforge.phpeclipse.internal.compiler.ast.ForStatement;
50 import net.sourceforge.phpeclipse.internal.compiler.ast.IfStatement;
51 import net.sourceforge.phpeclipse.internal.compiler.ast.ImportReference;
52 import net.sourceforge.phpeclipse.internal.compiler.ast.Initializer;
53 import net.sourceforge.phpeclipse.internal.compiler.ast.InstanceOfExpression;
54 import net.sourceforge.phpeclipse.internal.compiler.ast.IntLiteral;
55 import net.sourceforge.phpeclipse.internal.compiler.ast.LabeledStatement;
56 import net.sourceforge.phpeclipse.internal.compiler.ast.LocalDeclaration;
57 import net.sourceforge.phpeclipse.internal.compiler.ast.LongLiteral;
58 import net.sourceforge.phpeclipse.internal.compiler.ast.MessageSend;
59 import net.sourceforge.phpeclipse.internal.compiler.ast.MethodDeclaration;
60 import net.sourceforge.phpeclipse.internal.compiler.ast.NullLiteral;
61 import net.sourceforge.phpeclipse.internal.compiler.ast.OR_OR_Expression;
62 import net.sourceforge.phpeclipse.internal.compiler.ast.PostfixExpression;
63 import net.sourceforge.phpeclipse.internal.compiler.ast.PrefixExpression;
64 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedAllocationExpression;
65 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedNameReference;
66 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedSuperReference;
67 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedThisReference;
68 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedTypeReference;
69 import net.sourceforge.phpeclipse.internal.compiler.ast.ReturnStatement;
70 import net.sourceforge.phpeclipse.internal.compiler.ast.SingleNameReference;
71 import net.sourceforge.phpeclipse.internal.compiler.ast.SingleTypeReference;
72 import net.sourceforge.phpeclipse.internal.compiler.ast.StringLiteral;
73 import net.sourceforge.phpeclipse.internal.compiler.ast.SuperReference;
74 import net.sourceforge.phpeclipse.internal.compiler.ast.SwitchStatement;
75 import net.sourceforge.phpeclipse.internal.compiler.ast.ThisReference;
76 import net.sourceforge.phpeclipse.internal.compiler.ast.ThrowStatement;
77 import net.sourceforge.phpeclipse.internal.compiler.ast.TrueLiteral;
78 import net.sourceforge.phpeclipse.internal.compiler.ast.TryStatement;
79 import net.sourceforge.phpeclipse.internal.compiler.ast.TypeDeclaration;
80 import net.sourceforge.phpeclipse.internal.compiler.ast.UnaryExpression;
81 import net.sourceforge.phpeclipse.internal.compiler.ast.WhileStatement;
84 * A visitor for iterating through the parse tree.
86 public abstract class ASTVisitor {
88 public void acceptProblem(IProblem problem) {
89 // do nothing by default
92 AllocationExpression allocationExpression,
94 // do nothing by default
96 public void endVisit(AND_AND_Expression and_and_Expression, BlockScope scope) {
97 // do nothing by default
99 // public void endVisit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) {
100 // // do nothing by default
102 // public void endVisit(JavadocArraySingleTypeReference typeRef, BlockScope scope) {
103 // // do nothing by default
105 // public void endVisit(JavadocArgumentExpression expression, BlockScope scope) {
106 // // do nothing by default
108 // public void endVisit(JavadocFieldReference fieldRef, BlockScope scope) {
109 // // do nothing by default
111 // public void endVisit(JavadocMessageSend messageSend, BlockScope scope) {
112 // // do nothing by default
114 // public void endVisit(JavadocQualifiedTypeReference typeRef, BlockScope scope) {
115 // // do nothing by default
117 // public void endVisit(JavadocReturnStatement statement, BlockScope scope) {
118 // // do nothing by default
120 // public void endVisit(JavadocSingleNameReference argument, BlockScope scope) {
121 // // do nothing by default
123 // public void endVisit(JavadocSingleTypeReference typeRef, BlockScope scope) {
124 // // do nothing by default
126 public void endVisit(Argument argument, BlockScope scope) {
127 // do nothing by default
129 public void endVisit(
130 ArrayAllocationExpression arrayAllocationExpression,
132 // do nothing by default
134 public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) {
135 // do nothing by default
137 public void endVisit(
138 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
140 // do nothing by default
142 public void endVisit(
143 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
145 // do nothing by default
147 public void endVisit(ArrayReference arrayReference, BlockScope scope) {
148 // do nothing by default
150 public void endVisit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
151 // do nothing by default
153 public void endVisit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
154 // do nothing by default
156 public void endVisit(Assignment assignment, BlockScope scope) {
157 // do nothing by default
159 public void endVisit(AssertStatement assertStatement, BlockScope scope) {
160 // do nothing by default
162 public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {
163 // do nothing by default
165 public void endVisit(Block block, BlockScope scope) {
166 // do nothing by default
168 public void endVisit(BreakStatement breakStatement, BlockScope scope) {
169 // do nothing by default
171 public void endVisit(CaseStatement caseStatement, BlockScope scope) {
172 // do nothing by default
174 public void endVisit(CastExpression castExpression, BlockScope scope) {
175 // do nothing by default
178 public void endVisit(Clinit clinit, ClassScope scope) {
179 // do nothing by default
181 public void endVisit(
182 CompilationUnitDeclaration compilationUnitDeclaration,
183 CompilationUnitScope scope) {
184 // do nothing by default
186 public void endVisit(CompoundAssignment compoundAssignment, BlockScope scope) {
187 // do nothing by default
189 public void endVisit(
190 ConditionalExpression conditionalExpression,
192 // do nothing by default
194 public void endVisit(
195 ConstructorDeclaration constructorDeclaration,
197 // do nothing by default
199 public void endVisit(ContinueStatement continueStatement, BlockScope scope) {
200 // do nothing by default
202 public void endVisit(DoStatement doStatement, BlockScope scope) {
203 // do nothing by default
205 public void endVisit(DoubleLiteral doubleLiteral, BlockScope scope) {
206 // do nothing by default
208 public void endVisit(EqualExpression equalExpression, BlockScope scope) {
209 // do nothing by default
211 public void endVisit(
212 ExplicitConstructorCall explicitConstructor,
214 // do nothing by default
216 public void endVisit(
217 ExtendedStringLiteral extendedStringLiteral,
219 // do nothing by default
221 public void endVisit(FalseLiteral falseLiteral, BlockScope scope) {
222 // do nothing by default
224 public void endVisit(FieldDeclaration fieldDeclaration, MethodScope scope) {
225 // do nothing by default
227 public void endVisit(FieldReference fieldReference, BlockScope scope) {
228 // do nothing by default
230 public void endVisit(FloatLiteral floatLiteral, BlockScope scope) {
231 // do nothing by default
233 public void endVisit(EmptyStatement emptyStatement, BlockScope scope) {
234 // do nothing by default
236 public void endVisit(ForStatement forStatement, BlockScope scope) {
237 // do nothing by default
239 public void endVisit(IfStatement ifStatement, BlockScope scope) {
240 // do nothing by default
242 public void endVisit(ImportReference importRef, CompilationUnitScope scope) {
243 // do nothing by default
245 public void endVisit(Initializer initializer, MethodScope scope) {
246 // do nothing by default
248 public void endVisit(
249 InstanceOfExpression instanceOfExpression,
251 // do nothing by default
253 public void endVisit(IntLiteral intLiteral, BlockScope scope) {
254 // do nothing by default
256 public void endVisit(LabeledStatement labeledStatement, BlockScope scope) {
257 // do nothing by default
259 public void endVisit(LocalDeclaration localDeclaration, BlockScope scope) {
260 // do nothing by default
262 public void endVisit(LongLiteral longLiteral, BlockScope scope) {
263 // do nothing by default
265 public void endVisit(MessageSend messageSend, BlockScope scope) {
266 // do nothing by default
268 public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
269 // do nothing by default
271 // public void endVisit(StringLiteralConcatenation literal, BlockScope scope) {
272 // // do nothing by default
274 public void endVisit(NullLiteral nullLiteral, BlockScope scope) {
275 // do nothing by default
277 public void endVisit(OR_OR_Expression or_or_Expression, BlockScope scope) {
278 // do nothing by default
280 public void endVisit(PostfixExpression postfixExpression, BlockScope scope) {
281 // do nothing by default
283 public void endVisit(PrefixExpression prefixExpression, BlockScope scope) {
284 // do nothing by default
286 public void endVisit(
287 QualifiedAllocationExpression qualifiedAllocationExpression,
289 // do nothing by default
291 public void endVisit(
292 QualifiedNameReference qualifiedNameReference,
294 // do nothing by default
296 public void endVisit(
297 QualifiedSuperReference qualifiedSuperReference,
299 // do nothing by default
301 public void endVisit(
302 QualifiedThisReference qualifiedThisReference,
304 // do nothing by default
306 public void endVisit(
307 QualifiedTypeReference qualifiedTypeReference,
309 // do nothing by default
311 public void endVisit(
312 QualifiedTypeReference qualifiedTypeReference,
314 // do nothing by default
316 public void endVisit(ReturnStatement returnStatement, BlockScope scope) {
317 // do nothing by default
319 public void endVisit(
320 SingleNameReference singleNameReference,
322 // do nothing by default
324 public void endVisit(
325 SingleTypeReference singleTypeReference,
327 // do nothing by default
329 public void endVisit(
330 SingleTypeReference singleTypeReference,
332 // do nothing by default
334 public void endVisit(StringLiteral stringLiteral, BlockScope scope) {
335 // do nothing by default
337 public void endVisit(SuperReference superReference, BlockScope scope) {
338 // do nothing by default
340 public void endVisit(SwitchStatement switchStatement, BlockScope scope) {
341 // do nothing by default
344 public void endVisit(ThisReference thisReference, BlockScope scope) {
345 // do nothing by default
347 public void endVisit(ThrowStatement throwStatement, BlockScope scope) {
348 // do nothing by default
350 public void endVisit(TrueLiteral trueLiteral, BlockScope scope) {
351 // do nothing by default
353 public void endVisit(TryStatement tryStatement, BlockScope scope) {
354 // do nothing by default
356 public void endVisit(
357 TypeDeclaration localTypeDeclaration,
359 // do nothing by default
361 public void endVisit(
362 TypeDeclaration memberTypeDeclaration,
364 // do nothing by default
366 public void endVisit(
367 TypeDeclaration typeDeclaration,
368 CompilationUnitScope scope) {
369 // do nothing by default
371 public void endVisit(UnaryExpression unaryExpression, BlockScope scope) {
372 // do nothing by default
374 public void endVisit(WhileStatement whileStatement, BlockScope scope) {
375 // do nothing by default
377 public boolean visit(
378 AllocationExpression allocationExpression,
380 return true; // do nothing by default, keep traversing
381 // do nothing by default
383 public boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope) {
384 return true; // do nothing by default, keep traversing
386 // public boolean visit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) {
387 // return true; // do nothing by default, keep traversing
389 // public boolean visit(JavadocArraySingleTypeReference typeRef, BlockScope scope) {
390 // return true; // do nothing by default, keep traversing
392 // public boolean visit(JavadocArgumentExpression expression, BlockScope scope) {
393 // return true; // do nothing by default, keep traversing
395 // public boolean visit(JavadocFieldReference fieldRef, BlockScope scope) {
396 // return true; // do nothing by default, keep traversing
398 // public boolean visit(JavadocMessageSend messageSend, BlockScope scope) {
399 // return true; // do nothing by default, keep traversing
401 // public boolean visit(JavadocQualifiedTypeReference typeRef, BlockScope scope) {
402 // return true; // do nothing by default, keep traversing
404 // public boolean visit(JavadocReturnStatement statement, BlockScope scope) {
405 // return true; // do nothing by default, keep traversing
407 // public boolean visit(JavadocSingleNameReference argument, BlockScope scope) {
408 // return true; // do nothing by default, keep traversing
410 // public boolean visit(JavadocSingleTypeReference typeRef, BlockScope scope) {
411 // return true; // do nothing by default, keep traversing
413 public boolean visit(Argument argument, BlockScope scope) {
414 return true; // do nothing by default, keep traversing
416 public boolean visit(
417 ArrayAllocationExpression arrayAllocationExpression,
419 return true; // do nothing by default, keep traversing
421 public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
422 return true; // do nothing by default, keep traversing
424 public boolean visit(
425 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
427 return true; // do nothing by default, keep traversing
429 public boolean visit(
430 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
432 return true; // do nothing by default, keep traversing
434 public boolean visit(ArrayReference arrayReference, BlockScope scope) {
435 return true; // do nothing by default, keep traversing
437 public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
438 return true; // do nothing by default, keep traversing
440 public boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
441 return true; // do nothing by default, keep traversing
443 public boolean visit(Assignment assignment, BlockScope scope) {
444 return true; // do nothing by default, keep traversing
446 public boolean visit(AssertStatement assertStatement, BlockScope scope) {
447 return true; // do nothing by default, keep traversing
449 public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
450 return true; // do nothing by default, keep traversing
452 public boolean visit(Block block, BlockScope scope) {
453 return true; // do nothing by default, keep traversing
455 public boolean visit(BreakStatement breakStatement, BlockScope scope) {
456 return true; // do nothing by default, keep traversing
458 public boolean visit(CaseStatement caseStatement, BlockScope scope) {
459 return true; // do nothing by default, keep traversing
461 public boolean visit(CastExpression castExpression, BlockScope scope) {
462 return true; // do nothing by default, keep traversing
465 public boolean visit(Clinit clinit, ClassScope scope) {
466 return true; // do nothing by default, keep traversing
468 public boolean visit(
469 CompilationUnitDeclaration compilationUnitDeclaration,
470 CompilationUnitScope scope) {
471 return true; // do nothing by default, keep traversing
473 public boolean visit(CompoundAssignment compoundAssignment, BlockScope scope) {
474 return true; // do nothing by default, keep traversing
476 public boolean visit(
477 ConditionalExpression conditionalExpression,
479 return true; // do nothing by default, keep traversing
481 public boolean visit(
482 ConstructorDeclaration constructorDeclaration,
484 return true; // do nothing by default, keep traversing
486 public boolean visit(ContinueStatement continueStatement, BlockScope scope) {
487 return true; // do nothing by default, keep traversing
489 public boolean visit(DoStatement doStatement, BlockScope scope) {
490 return true; // do nothing by default, keep traversing
492 public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) {
493 return true; // do nothing by default, keep traversing
495 public boolean visit(EqualExpression equalExpression, BlockScope scope) {
496 return true; // do nothing by default, keep traversing
498 public boolean visit(EmptyStatement emptyStatement, BlockScope scope) {
499 return true; // do nothing by default, keep traversing
501 public boolean visit(
502 ExplicitConstructorCall explicitConstructor,
504 return true; // do nothing by default, keep traversing
506 public boolean visit(
507 ExtendedStringLiteral extendedStringLiteral,
509 return true; // do nothing by default, keep traversing
511 public boolean visit(FalseLiteral falseLiteral, BlockScope scope) {
512 return true; // do nothing by default, keep traversing
514 public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
515 return true; // do nothing by default, keep traversing
517 public boolean visit(FieldReference fieldReference, BlockScope scope) {
518 return true; // do nothing by default, keep traversing
520 public boolean visit(FloatLiteral floatLiteral, BlockScope scope) {
521 return true; // do nothing by default, keep traversing
523 public boolean visit(ForStatement forStatement, BlockScope scope) {
524 return true; // do nothing by default, keep traversing
526 public boolean visit(IfStatement ifStatement, BlockScope scope) {
527 return true; // do nothing by default, keep traversing
529 public boolean visit(ImportReference importRef, CompilationUnitScope scope) {
530 return true; // do nothing by default, keep traversing
532 public boolean visit(Initializer initializer, MethodScope scope) {
533 return true; // do nothing by default, keep traversing
535 public boolean visit(
536 InstanceOfExpression instanceOfExpression,
538 return true; // do nothing by default, keep traversing
540 public boolean visit(IntLiteral intLiteral, BlockScope scope) {
541 return true; // do nothing by default, keep traversing
543 public boolean visit(LabeledStatement labeledStatement, BlockScope scope) {
544 return true; // do nothing by default, keep traversing
546 public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
547 return true; // do nothing by default, keep traversing
549 public boolean visit(LongLiteral longLiteral, BlockScope scope) {
550 return true; // do nothing by default, keep traversing
552 public boolean visit(MessageSend messageSend, BlockScope scope) {
553 return true; // do nothing by default, keep traversing
555 public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
556 return true; // do nothing by default, keep traversing
558 // public boolean visit(
559 // StringLiteralConcatenation literal,
560 // BlockScope scope) {
561 // return true; // do nothing by default, keep traversing
563 public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
564 return true; // do nothing by default, keep traversing
566 public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) {
567 return true; // do nothing by default, keep traversing
569 public boolean visit(PostfixExpression postfixExpression, BlockScope scope) {
570 return true; // do nothing by default, keep traversing
572 public boolean visit(PrefixExpression prefixExpression, BlockScope scope) {
573 return true; // do nothing by default, keep traversing
575 public boolean visit(
576 QualifiedAllocationExpression qualifiedAllocationExpression,
578 return true; // do nothing by default, keep traversing
580 public boolean visit(
581 QualifiedNameReference qualifiedNameReference,
583 return true; // do nothing by default, keep traversing
585 public boolean visit(
586 QualifiedSuperReference qualifiedSuperReference,
588 return true; // do nothing by default, keep traversing
590 public boolean visit(
591 QualifiedThisReference qualifiedThisReference,
593 return true; // do nothing by default, keep traversing
595 public boolean visit(
596 QualifiedTypeReference qualifiedTypeReference,
598 return true; // do nothing by default, keep traversing
600 public boolean visit(
601 QualifiedTypeReference qualifiedTypeReference,
603 return true; // do nothing by default, keep traversing
605 public boolean visit(ReturnStatement returnStatement, BlockScope scope) {
606 return true; // do nothing by default, keep traversing
608 public boolean visit(
609 SingleNameReference singleNameReference,
611 return true; // do nothing by default, keep traversing
613 public boolean visit(
614 SingleTypeReference singleTypeReference,
616 return true; // do nothing by default, keep traversing
618 public boolean visit(
619 SingleTypeReference singleTypeReference,
621 return true; // do nothing by default, keep traversing
623 public boolean visit(StringLiteral stringLiteral, BlockScope scope) {
624 return true; // do nothing by default, keep traversing
626 public boolean visit(SuperReference superReference, BlockScope scope) {
627 return true; // do nothing by default, keep traversing
629 public boolean visit(SwitchStatement switchStatement, BlockScope scope) {
630 return true; // do nothing by default, keep traversing
633 public boolean visit(ThisReference thisReference, BlockScope scope) {
634 return true; // do nothing by default, keep traversing
636 public boolean visit(ThrowStatement throwStatement, BlockScope scope) {
637 return true; // do nothing by default, keep traversing
639 public boolean visit(TrueLiteral trueLiteral, BlockScope scope) {
640 return true; // do nothing by default, keep traversing
642 public boolean visit(TryStatement tryStatement, BlockScope scope) {
643 return true; // do nothing by default, keep traversing
645 public boolean visit(
646 TypeDeclaration localTypeDeclaration,
648 return true; // do nothing by default, keep traversing
650 public boolean visit(
651 TypeDeclaration memberTypeDeclaration,
653 return true; // do nothing by default, keep traversing
655 public boolean visit(
656 TypeDeclaration typeDeclaration,
657 CompilationUnitScope scope) {
658 return true; // do nothing by default, keep traversing
660 public boolean visit(UnaryExpression unaryExpression, BlockScope scope) {
661 return true; // do nothing by default, keep traversing
663 public boolean visit(WhileStatement whileStatement, BlockScope scope) {
664 return true; // do nothing by default, keep traversing