1 /*******************************************************************************
2 * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v0.5
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v05.html
9 * IBM Corporation - initial API and implementation
10 ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler;
13 import net.sourceforge.phpdt.core.compiler.*;
14 import net.sourceforge.phpdt.internal.compiler.ast.*;
15 import net.sourceforge.phpdt.internal.compiler.lookup.*;
18 * An adapter class for interating through the parse tree.
21 public class AbstractSyntaxTreeVisitorAdapter implements IAbstractSyntaxTreeVisitor {
23 public void acceptProblem(IProblem problem) {}
25 AllocationExpression allocationExpression,
28 public void endVisit(AND_AND_Expression and_and_Expression, BlockScope scope) {
31 AnonymousLocalTypeDeclaration anonymousTypeDeclaration,
34 public void endVisit(Argument argument, BlockScope scope) {
37 ArrayAllocationExpression arrayAllocationExpression,
40 public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) {
43 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
47 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
50 public void endVisit(ArrayReference arrayReference, BlockScope scope) {
52 public void endVisit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
54 public void endVisit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
56 public void endVisit(Assignment assignment, BlockScope scope) {
58 public void endVisit(AssertStatement assertStatement, BlockScope scope) {
60 public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {
62 public void endVisit(Block block, BlockScope scope) {
64 public void endVisit(Break breakStatement, BlockScope scope) {
66 public void endVisit(Case caseStatement, BlockScope scope) {
68 public void endVisit(CastExpression castExpression, BlockScope scope) {
70 public void endVisit(CharLiteral charLiteral, BlockScope scope) {
72 public void endVisit(ClassLiteralAccess classLiteral, BlockScope scope) {
74 public void endVisit(Clinit clinit, ClassScope scope) {
77 CompilationUnitDeclaration compilationUnitDeclaration,
78 CompilationUnitScope scope) {
80 public void endVisit(CompoundAssignment compoundAssignment, BlockScope scope) {
83 ConditionalExpression conditionalExpression,
87 ConstructorDeclaration constructorDeclaration,
90 public void endVisit(Continue continueStatement, BlockScope scope) {
92 public void endVisit(DefaultCase defaultCaseStatement, BlockScope scope) {
94 public void endVisit(DoStatement doStatement, BlockScope scope) {
96 public void endVisit(DoubleLiteral doubleLiteral, BlockScope scope) {
98 public void endVisit(EqualExpression equalExpression, BlockScope scope) {
100 public void endVisit(
101 ExplicitConstructorCall explicitConstructor,
104 public void endVisit(
105 ExtendedStringLiteral extendedStringLiteral,
108 public void endVisit(FalseLiteral falseLiteral, BlockScope scope) {
110 public void endVisit(FieldDeclaration fieldDeclaration, MethodScope scope) {
112 public void endVisit(FieldReference fieldReference, BlockScope scope) {
114 public void endVisit(FloatLiteral floatLiteral, BlockScope scope) {
116 public void endVisit(EmptyStatement emptyStatement, BlockScope scope) {
118 public void endVisit(ForStatement forStatement, BlockScope scope) {
120 public void endVisit(IfStatement ifStatement, BlockScope scope) {
122 public void endVisit(ImportReference importRef, CompilationUnitScope scope) {
124 public void endVisit(Initializer initializer, MethodScope scope) {
126 public void endVisit(
127 InstanceOfExpression instanceOfExpression,
130 public void endVisit(IntLiteral intLiteral, BlockScope scope) {
132 public void endVisit(LabeledStatement labeledStatement, BlockScope scope) {
134 public void endVisit(LocalDeclaration localDeclaration, BlockScope scope) {
136 public void endVisit(LongLiteral longLiteral, BlockScope scope) {
138 public void endVisit(
139 MemberTypeDeclaration memberTypeDeclaration,
142 public void endVisit(MessageSend messageSend, BlockScope scope) {
144 public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
146 public void endVisit(NullLiteral nullLiteral, BlockScope scope) {
148 public void endVisit(OR_OR_Expression or_or_Expression, BlockScope scope) {
150 public void endVisit(PostfixExpression postfixExpression, BlockScope scope) {
152 public void endVisit(PrefixExpression prefixExpression, BlockScope scope) {
154 public void endVisit(
155 QualifiedAllocationExpression qualifiedAllocationExpression,
158 public void endVisit(
159 QualifiedNameReference qualifiedNameReference,
162 public void endVisit(
163 QualifiedSuperReference qualifiedSuperReference,
166 public void endVisit(
167 QualifiedThisReference qualifiedThisReference,
170 public void endVisit(
171 QualifiedTypeReference qualifiedTypeReference,
174 public void endVisit(
175 QualifiedTypeReference qualifiedTypeReference,
178 public void endVisit(ReturnStatement returnStatement, BlockScope scope) {
180 public void endVisit(
181 SingleNameReference singleNameReference,
184 public void endVisit(
185 SingleTypeReference singleTypeReference,
188 public void endVisit(
189 SingleTypeReference singleTypeReference,
192 public void endVisit(StringLiteral stringLiteral, BlockScope scope) {
194 public void endVisit(SuperReference superReference, BlockScope scope) {
196 public void endVisit(SwitchStatement switchStatement, BlockScope scope) {
198 public void endVisit(
199 SynchronizedStatement synchronizedStatement,
202 public void endVisit(ThisReference thisReference, BlockScope scope) {
204 public void endVisit(ThrowStatement throwStatement, BlockScope scope) {
206 public void endVisit(TrueLiteral trueLiteral, BlockScope scope) {
208 public void endVisit(TryStatement tryStatement, BlockScope scope) {
210 public void endVisit(
211 TypeDeclaration typeDeclaration,
212 CompilationUnitScope scope) {
214 public void endVisit(UnaryExpression unaryExpression, BlockScope scope) {
216 public void endVisit(WhileStatement whileStatement, BlockScope scope) {
218 public boolean visit(
219 AllocationExpression allocationExpression,
223 public boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope) {
226 public boolean visit(
227 AnonymousLocalTypeDeclaration anonymousTypeDeclaration,
231 public boolean visit(Argument argument, BlockScope scope) {
234 public boolean visit(
235 ArrayAllocationExpression arrayAllocationExpression,
239 public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
242 public boolean visit(
243 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
247 public boolean visit(
248 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
252 public boolean visit(ArrayReference arrayReference, BlockScope scope) {
255 public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
258 public boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
261 public boolean visit(Assignment assignment, BlockScope scope) {
264 public boolean visit(AssertStatement assertStatement, BlockScope scope) {
267 public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
270 public boolean visit(Block block, BlockScope scope) {
273 public boolean visit(Break breakStatement, BlockScope scope) {
276 public boolean visit(Case caseStatement, BlockScope scope) {
279 public boolean visit(CastExpression castExpression, BlockScope scope) {
282 public boolean visit(CharLiteral charLiteral, BlockScope scope) {
285 public boolean visit(ClassLiteralAccess classLiteral, BlockScope scope) {
288 public boolean visit(Clinit clinit, ClassScope scope) {
291 public boolean visit(
292 CompilationUnitDeclaration compilationUnitDeclaration,
293 CompilationUnitScope scope) {
296 public boolean visit(CompoundAssignment compoundAssignment, BlockScope scope) {
299 public boolean visit(
300 ConditionalExpression conditionalExpression,
304 public boolean visit(
305 ConstructorDeclaration constructorDeclaration,
309 public boolean visit(Continue continueStatement, BlockScope scope) {
312 public boolean visit(DefaultCase defaultCaseStatement, BlockScope scope) {
315 public boolean visit(DoStatement doStatement, BlockScope scope) {
318 public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) {
321 public boolean visit(EqualExpression equalExpression, BlockScope scope) {
324 public boolean visit(EmptyStatement emptyStatement, BlockScope scope) {
327 public boolean visit(
328 ExplicitConstructorCall explicitConstructor,
332 public boolean visit(
333 ExtendedStringLiteral extendedStringLiteral,
337 public boolean visit(FalseLiteral falseLiteral, BlockScope scope) {
340 public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
343 public boolean visit(FieldReference fieldReference, BlockScope scope) {
346 public boolean visit(FloatLiteral floatLiteral, BlockScope scope) {
349 public boolean visit(ForStatement forStatement, BlockScope scope) {
352 public boolean visit(IfStatement ifStatement, BlockScope scope) {
355 public boolean visit(ImportReference importRef, CompilationUnitScope scope) {
358 public boolean visit(Initializer initializer, MethodScope scope) {
361 public boolean visit(
362 InstanceOfExpression instanceOfExpression,
366 public boolean visit(IntLiteral intLiteral, BlockScope scope) {
369 public boolean visit(LabeledStatement labeledStatement, BlockScope scope) {
372 public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
375 public boolean visit(LongLiteral longLiteral, BlockScope scope) {
378 public boolean visit(
379 MemberTypeDeclaration memberTypeDeclaration,
383 public boolean visit(MessageSend messageSend, BlockScope scope) {
386 public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
389 public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
392 public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) {
395 public boolean visit(PostfixExpression postfixExpression, BlockScope scope) {
398 public boolean visit(PrefixExpression prefixExpression, BlockScope scope) {
401 public boolean visit(
402 QualifiedAllocationExpression qualifiedAllocationExpression,
406 public boolean visit(
407 QualifiedNameReference qualifiedNameReference,
411 public boolean visit(
412 QualifiedSuperReference qualifiedSuperReference,
416 public boolean visit(
417 QualifiedThisReference qualifiedThisReference,
421 public boolean visit(
422 QualifiedTypeReference qualifiedTypeReference,
426 public boolean visit(
427 QualifiedTypeReference qualifiedTypeReference,
431 public boolean visit(ReturnStatement returnStatement, BlockScope scope) {
434 public boolean visit(
435 SingleNameReference singleNameReference,
439 public boolean visit(
440 SingleTypeReference singleTypeReference,
444 public boolean visit(
445 SingleTypeReference singleTypeReference,
449 public boolean visit(StringLiteral stringLiteral, BlockScope scope) {
452 public boolean visit(SuperReference superReference, BlockScope scope) {
455 public boolean visit(SwitchStatement switchStatement, BlockScope scope) {
458 public boolean visit(
459 SynchronizedStatement synchronizedStatement,
463 public boolean visit(ThisReference thisReference, BlockScope scope) {
466 public boolean visit(ThrowStatement throwStatement, BlockScope scope) {
469 public boolean visit(TrueLiteral trueLiteral, BlockScope scope) {
472 public boolean visit(TryStatement tryStatement, BlockScope scope) {
475 public boolean visit(
476 TypeDeclaration typeDeclaration,
477 CompilationUnitScope scope) {
480 public boolean visit(UnaryExpression unaryExpression, BlockScope scope) {
483 public boolean visit(WhileStatement whileStatement, BlockScope scope) {
486 public boolean visit(
487 LocalTypeDeclaration localTypeDeclaration,
491 public void endVisit(
492 LocalTypeDeclaration localTypeDeclaration,