Added word wrap option (problem: conflicts with folding)
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / ASTVisitor.java
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
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler;
12
13 import net.sourceforge.phpdt.core.compiler.*;
14 import net.sourceforge.phpeclipse.internal.compiler.ast.*; 
15 import net.sourceforge.phpdt.internal.compiler.lookup.*;
16
17 /** 
18  * A visitor for iterating through the parse tree.
19  */
20 public abstract class ASTVisitor {
21
22         public void acceptProblem(IProblem problem) {
23                 // do nothing by default
24         }
25         public void endVisit(
26                 AllocationExpression allocationExpression,
27                 BlockScope scope) {
28                 // do nothing by default
29         }
30         public void endVisit(AND_AND_Expression and_and_Expression, BlockScope scope) {
31                 // do nothing by default
32         }
33 //      public void endVisit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) {
34 //              // do nothing by default
35 //      }
36 //      public void endVisit(JavadocArraySingleTypeReference typeRef, BlockScope scope) {
37 //              // do nothing by default
38 //      }
39 //      public void endVisit(JavadocArgumentExpression expression, BlockScope scope) {
40 //              // do nothing by default
41 //      }
42 //      public void endVisit(JavadocFieldReference fieldRef, BlockScope scope) {
43 //              // do nothing by default
44 //      }
45 //      public void endVisit(JavadocMessageSend messageSend, BlockScope scope) {
46 //              // do nothing by default
47 //      }
48 //      public void endVisit(JavadocQualifiedTypeReference typeRef, BlockScope scope) {
49 //              // do nothing by default
50 //      }
51 //      public void endVisit(JavadocReturnStatement statement, BlockScope scope) {
52 //              // do nothing by default
53 //      }
54 //      public void endVisit(JavadocSingleNameReference argument, BlockScope scope) {
55 //              // do nothing by default
56 //      }
57 //      public void endVisit(JavadocSingleTypeReference typeRef, BlockScope scope) {
58 //              // do nothing by default
59 //      }
60         public void endVisit(Argument argument, BlockScope scope) {
61                 // do nothing by default
62         }
63         public void endVisit(
64                 ArrayAllocationExpression arrayAllocationExpression,
65                 BlockScope scope) {
66                 // do nothing by default
67         }
68         public void endVisit(ArrayInitializer arrayInitializer, BlockScope scope) {
69                 // do nothing by default
70         }
71         public void endVisit(
72                 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
73                 BlockScope scope) {
74                 // do nothing by default
75         }
76         public void endVisit(
77                 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
78                 ClassScope scope) {
79                 // do nothing by default
80         }
81         public void endVisit(ArrayReference arrayReference, BlockScope scope) {
82                 // do nothing by default
83         }
84         public void endVisit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
85                 // do nothing by default
86         }
87         public void endVisit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
88                 // do nothing by default
89         }
90         public void endVisit(Assignment assignment, BlockScope scope) {
91                 // do nothing by default
92         }
93         public void endVisit(AssertStatement assertStatement, BlockScope scope) {
94                 // do nothing by default
95         }
96         public void endVisit(BinaryExpression binaryExpression, BlockScope scope) {
97                 // do nothing by default
98         }
99         public void endVisit(Block block, BlockScope scope) {
100                 // do nothing by default
101         }
102         public void endVisit(Break breakStatement, BlockScope scope) {
103                 // do nothing by default
104         }
105         public void endVisit(Case caseStatement, BlockScope scope) {
106                 // do nothing by default
107         }
108         public void endVisit(CastExpression castExpression, BlockScope scope) {
109                 // do nothing by default
110         }
111         public void endVisit(CharLiteral charLiteral, BlockScope scope) {
112                 // do nothing by default
113         }
114         public void endVisit(ClassLiteralAccess classLiteral, BlockScope scope) {
115                 // do nothing by default
116         }
117         public void endVisit(Clinit clinit, ClassScope scope) {
118                 // do nothing by default
119         }
120         public void endVisit(
121                 CompilationUnitDeclaration compilationUnitDeclaration,
122                 CompilationUnitScope scope) {
123                 // do nothing by default
124         }
125         public void endVisit(CompoundAssignment compoundAssignment, BlockScope scope) {
126                 // do nothing by default
127         }
128         public void endVisit(
129                 ConditionalExpression conditionalExpression,
130                 BlockScope scope) {
131                 // do nothing by default
132         }
133         public void endVisit(
134                 ConstructorDeclaration constructorDeclaration,
135                 ClassScope scope) {
136                 // do nothing by default
137         }
138         public void endVisit(Continue continueStatement, BlockScope scope) {
139                 // do nothing by default
140         }
141         public void endVisit(DoStatement doStatement, BlockScope scope) {
142                 // do nothing by default
143         }
144         public void endVisit(DoubleLiteral doubleLiteral, BlockScope scope) {
145                 // do nothing by default
146         }
147         public void endVisit(EqualExpression equalExpression, BlockScope scope) {
148                 // do nothing by default
149         }
150         public void endVisit(
151                 ExplicitConstructorCall explicitConstructor,
152                 BlockScope scope) {
153                 // do nothing by default
154         }
155         public void endVisit(
156                 ExtendedStringLiteral extendedStringLiteral,
157                 BlockScope scope) {
158                 // do nothing by default
159         }
160         public void endVisit(FalseLiteral falseLiteral, BlockScope scope) {
161                 // do nothing by default
162         }
163         public void endVisit(FieldDeclaration fieldDeclaration, MethodScope scope) {
164                 // do nothing by default
165         }
166         public void endVisit(FieldReference fieldReference, BlockScope scope) {
167                 // do nothing by default
168         }
169         public void endVisit(FloatLiteral floatLiteral, BlockScope scope) {
170                 // do nothing by default
171         }
172         public void endVisit(EmptyStatement emptyStatement, BlockScope scope) {
173                 // do nothing by default
174         }
175         public void endVisit(ForStatement forStatement, BlockScope scope) {
176                 // do nothing by default
177         }
178         public void endVisit(IfStatement ifStatement, BlockScope scope) {
179                 // do nothing by default
180         }
181         public void endVisit(ImportReference importRef, CompilationUnitScope scope) {
182                 // do nothing by default
183         }
184         public void endVisit(Initializer initializer, MethodScope scope) {
185                 // do nothing by default
186         }
187         public void endVisit(
188                 InstanceOfExpression instanceOfExpression,
189                 BlockScope scope) {
190                 // do nothing by default
191         }
192         public void endVisit(IntLiteral intLiteral, BlockScope scope) {
193                 // do nothing by default
194         }
195         public void endVisit(LabeledStatement labeledStatement, BlockScope scope) {
196                 // do nothing by default
197         }
198         public void endVisit(LocalDeclaration localDeclaration, BlockScope scope) {
199                 // do nothing by default
200         }
201         public void endVisit(LongLiteral longLiteral, BlockScope scope) {
202                 // do nothing by default
203         }
204         public void endVisit(MessageSend messageSend, BlockScope scope) {
205                 // do nothing by default
206         }
207         public void endVisit(MethodDeclaration methodDeclaration, ClassScope scope) {
208                 // do nothing by default
209         }
210 //      public void endVisit(StringLiteralConcatenation literal, BlockScope scope) {
211 //              // do nothing by default
212 //      }
213         public void endVisit(NullLiteral nullLiteral, BlockScope scope) {
214                 // do nothing by default
215         }
216         public void endVisit(OR_OR_Expression or_or_Expression, BlockScope scope) {
217                 // do nothing by default
218         }
219         public void endVisit(PostfixExpression postfixExpression, BlockScope scope) {
220                 // do nothing by default
221         }
222         public void endVisit(PrefixExpression prefixExpression, BlockScope scope) {
223                 // do nothing by default
224         }
225         public void endVisit(
226                 QualifiedAllocationExpression qualifiedAllocationExpression,
227                 BlockScope scope) {
228                 // do nothing by default
229         }
230         public void endVisit(
231                 QualifiedNameReference qualifiedNameReference,
232                 BlockScope scope) {
233                 // do nothing by default
234         }
235         public void endVisit(
236                 QualifiedSuperReference qualifiedSuperReference,
237                 BlockScope scope) {
238                 // do nothing by default
239         }
240         public void endVisit(
241                 QualifiedThisReference qualifiedThisReference,
242                 BlockScope scope) {
243                 // do nothing by default
244         }
245         public void endVisit(
246                 QualifiedTypeReference qualifiedTypeReference,
247                 BlockScope scope) {
248                 // do nothing by default
249         }
250         public void endVisit(
251                 QualifiedTypeReference qualifiedTypeReference,
252                 ClassScope scope) {
253                 // do nothing by default
254         }
255         public void endVisit(ReturnStatement returnStatement, BlockScope scope) {
256                 // do nothing by default
257         }
258         public void endVisit(
259                 SingleNameReference singleNameReference,
260                 BlockScope scope) {
261                 // do nothing by default
262         }
263         public void endVisit(
264                 SingleTypeReference singleTypeReference,
265                 BlockScope scope) {
266                 // do nothing by default
267         }
268         public void endVisit(
269                 SingleTypeReference singleTypeReference,
270                 ClassScope scope) {
271                 // do nothing by default
272         }
273         public void endVisit(StringLiteral stringLiteral, BlockScope scope) {
274                 // do nothing by default
275         }
276         public void endVisit(SuperReference superReference, BlockScope scope) {
277                 // do nothing by default
278         }
279         public void endVisit(SwitchStatement switchStatement, BlockScope scope) {
280                 // do nothing by default
281         }
282         public void endVisit(
283                 SynchronizedStatement synchronizedStatement,
284                 BlockScope scope) {
285                 // do nothing by default
286         }
287         public void endVisit(ThisReference thisReference, BlockScope scope) {
288                 // do nothing by default
289         }
290         public void endVisit(ThrowStatement throwStatement, BlockScope scope) {
291                 // do nothing by default
292         }
293         public void endVisit(TrueLiteral trueLiteral, BlockScope scope) {
294                 // do nothing by default
295         }
296         public void endVisit(TryStatement tryStatement, BlockScope scope) {
297                 // do nothing by default
298         }
299         public void endVisit(
300                 TypeDeclaration localTypeDeclaration,
301                 BlockScope scope) {
302                 // do nothing by default
303         }       
304         public void endVisit(
305                 TypeDeclaration memberTypeDeclaration,
306                 ClassScope scope) {
307                 // do nothing by default
308         }
309         public void endVisit(
310                 TypeDeclaration typeDeclaration,
311                 CompilationUnitScope scope) {
312                 // do nothing by default
313         }       
314         public void endVisit(UnaryExpression unaryExpression, BlockScope scope) {
315                 // do nothing by default
316         }
317         public void endVisit(WhileStatement whileStatement, BlockScope scope) {
318                 // do nothing by default
319         }
320         public boolean visit(
321                 AllocationExpression allocationExpression,
322                 BlockScope scope) {
323                 return true; // do nothing by default, keep traversing
324                 // do nothing by default
325         }
326         public boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope) {
327                 return true; // do nothing by default, keep traversing
328         }
329 //      public boolean visit(JavadocArrayQualifiedTypeReference typeRef, BlockScope scope) {
330 //              return true; // do nothing by default, keep traversing
331 //      }
332 //      public boolean visit(JavadocArraySingleTypeReference typeRef, BlockScope scope) {
333 //              return true; // do nothing by default, keep traversing
334 //      }
335 //      public boolean visit(JavadocArgumentExpression expression, BlockScope scope) {
336 //              return true; // do nothing by default, keep traversing
337 //      }
338 //      public boolean visit(JavadocFieldReference fieldRef, BlockScope scope) {
339 //              return true; // do nothing by default, keep traversing
340 //      }
341 //      public boolean visit(JavadocMessageSend messageSend, BlockScope scope) {
342 //              return true; // do nothing by default, keep traversing
343 //      }
344 //      public boolean visit(JavadocQualifiedTypeReference typeRef, BlockScope scope) {
345 //              return true; // do nothing by default, keep traversing
346 //      }
347 //      public boolean visit(JavadocReturnStatement statement, BlockScope scope) {
348 //              return true; // do nothing by default, keep traversing
349 //      }
350 //      public boolean visit(JavadocSingleNameReference argument, BlockScope scope) {
351 //              return true; // do nothing by default, keep traversing
352 //      }
353 //      public boolean visit(JavadocSingleTypeReference typeRef, BlockScope scope) {
354 //              return true; // do nothing by default, keep traversing
355 //      }
356         public boolean visit(Argument argument, BlockScope scope) {
357                 return true; // do nothing by default, keep traversing
358         }
359         public boolean visit(
360                 ArrayAllocationExpression arrayAllocationExpression,
361                 BlockScope scope) {
362                 return true; // do nothing by default, keep traversing
363         }
364         public boolean visit(ArrayInitializer arrayInitializer, BlockScope scope) {
365                 return true; // do nothing by default, keep traversing
366         }
367         public boolean visit(
368                 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
369                 BlockScope scope) {
370                 return true; // do nothing by default, keep traversing
371         }
372         public boolean visit(
373                 ArrayQualifiedTypeReference arrayQualifiedTypeReference,
374                 ClassScope scope) {
375                 return true; // do nothing by default, keep traversing
376         }
377         public boolean visit(ArrayReference arrayReference, BlockScope scope) {
378                 return true; // do nothing by default, keep traversing
379         }
380         public boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope) {
381                 return true; // do nothing by default, keep traversing
382         }
383         public boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope) {
384                 return true; // do nothing by default, keep traversing
385         }
386         public boolean visit(Assignment assignment, BlockScope scope) {
387                 return true; // do nothing by default, keep traversing
388         }
389         public boolean visit(AssertStatement assertStatement, BlockScope scope) {
390                 return true; // do nothing by default, keep traversing
391         }
392         public boolean visit(BinaryExpression binaryExpression, BlockScope scope) {
393                 return true; // do nothing by default, keep traversing
394         }
395         public boolean visit(Block block, BlockScope scope) {
396                 return true; // do nothing by default, keep traversing
397         }
398         public boolean visit(Break breakStatement, BlockScope scope) {
399                 return true; // do nothing by default, keep traversing
400         }
401         public boolean visit(Case caseStatement, BlockScope scope) {
402                 return true; // do nothing by default, keep traversing
403         }
404         public boolean visit(CastExpression castExpression, BlockScope scope) {
405                 return true; // do nothing by default, keep traversing
406         }
407         public boolean visit(CharLiteral charLiteral, BlockScope scope) {
408                 return true; // do nothing by default, keep traversing
409         }
410         public boolean visit(ClassLiteralAccess classLiteral, BlockScope scope) {
411                 return true; // do nothing by default, keep traversing
412         }
413         public boolean visit(Clinit clinit, ClassScope scope) {
414                 return true; // do nothing by default, keep traversing
415         }
416         public boolean visit(
417                 CompilationUnitDeclaration compilationUnitDeclaration,
418                 CompilationUnitScope scope) {
419                 return true; // do nothing by default, keep traversing
420         }
421         public boolean visit(CompoundAssignment compoundAssignment, BlockScope scope) {
422                 return true; // do nothing by default, keep traversing
423         }
424         public boolean visit(
425                 ConditionalExpression conditionalExpression,
426                 BlockScope scope) {
427                 return true; // do nothing by default, keep traversing
428         }
429         public boolean visit(
430                 ConstructorDeclaration constructorDeclaration,
431                 ClassScope scope) {
432                 return true; // do nothing by default, keep traversing
433         }
434         public boolean visit(Continue continueStatement, BlockScope scope) {
435                 return true; // do nothing by default, keep traversing
436         }
437         public boolean visit(DoStatement doStatement, BlockScope scope) {
438                 return true; // do nothing by default, keep traversing
439         }
440         public boolean visit(DoubleLiteral doubleLiteral, BlockScope scope) {
441                 return true; // do nothing by default, keep traversing
442         }
443         public boolean visit(EqualExpression equalExpression, BlockScope scope) {
444                 return true; // do nothing by default, keep traversing
445         }
446         public boolean visit(EmptyStatement emptyStatement, BlockScope scope) {
447                 return true; // do nothing by default, keep traversing
448         }
449         public boolean visit(
450                 ExplicitConstructorCall explicitConstructor,
451                 BlockScope scope) {
452                 return true; // do nothing by default, keep traversing
453         }
454         public boolean visit(
455                 ExtendedStringLiteral extendedStringLiteral,
456                 BlockScope scope) {
457                 return true; // do nothing by default, keep traversing
458         }
459         public boolean visit(FalseLiteral falseLiteral, BlockScope scope) {
460                 return true; // do nothing by default, keep traversing
461         }
462         public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
463                 return true; // do nothing by default, keep traversing
464         }
465         public boolean visit(FieldReference fieldReference, BlockScope scope) {
466                 return true; // do nothing by default, keep traversing
467         }
468         public boolean visit(FloatLiteral floatLiteral, BlockScope scope) {
469                 return true; // do nothing by default, keep traversing
470         }
471         public boolean visit(ForStatement forStatement, BlockScope scope) {
472                 return true; // do nothing by default, keep traversing
473         }
474         public boolean visit(IfStatement ifStatement, BlockScope scope) {
475                 return true; // do nothing by default, keep traversing
476         }
477         public boolean visit(ImportReference importRef, CompilationUnitScope scope) {
478                 return true; // do nothing by default, keep traversing
479         }
480         public boolean visit(Initializer initializer, MethodScope scope) {
481                 return true; // do nothing by default, keep traversing
482         }
483         public boolean visit(
484                 InstanceOfExpression instanceOfExpression,
485                 BlockScope scope) {
486                 return true; // do nothing by default, keep traversing
487         }
488         public boolean visit(IntLiteral intLiteral, BlockScope scope) {
489                 return true; // do nothing by default, keep traversing
490         }
491         public boolean visit(LabeledStatement labeledStatement, BlockScope scope) {
492                 return true; // do nothing by default, keep traversing
493         }
494         public boolean visit(LocalDeclaration localDeclaration, BlockScope scope) {
495                 return true; // do nothing by default, keep traversing
496         }
497         public boolean visit(LongLiteral longLiteral, BlockScope scope) {
498                 return true; // do nothing by default, keep traversing
499         }
500         public boolean visit(MessageSend messageSend, BlockScope scope) {
501                 return true; // do nothing by default, keep traversing
502         }
503         public boolean visit(MethodDeclaration methodDeclaration, ClassScope scope) {
504                 return true; // do nothing by default, keep traversing
505         }
506 //      public boolean visit(
507 //                      StringLiteralConcatenation literal,
508 //                      BlockScope scope) {
509 //              return true; // do nothing by default, keep traversing
510 //      }
511         public boolean visit(NullLiteral nullLiteral, BlockScope scope) {
512                 return true; // do nothing by default, keep traversing
513         }
514         public boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope) {
515                 return true; // do nothing by default, keep traversing
516         }
517         public boolean visit(PostfixExpression postfixExpression, BlockScope scope) {
518                 return true; // do nothing by default, keep traversing
519         }
520         public boolean visit(PrefixExpression prefixExpression, BlockScope scope) {
521                 return true; // do nothing by default, keep traversing
522         }
523         public boolean visit(
524                 QualifiedAllocationExpression qualifiedAllocationExpression,
525                 BlockScope scope) {
526                 return true; // do nothing by default, keep traversing
527         }
528         public boolean visit(
529                 QualifiedNameReference qualifiedNameReference,
530                 BlockScope scope) {
531                 return true; // do nothing by default, keep traversing
532         }
533         public boolean visit(
534                 QualifiedSuperReference qualifiedSuperReference,
535                 BlockScope scope) {
536                 return true; // do nothing by default, keep traversing
537         }
538         public boolean visit(
539                 QualifiedThisReference qualifiedThisReference,
540                 BlockScope scope) {
541                 return true; // do nothing by default, keep traversing
542         }
543         public boolean visit(
544                 QualifiedTypeReference qualifiedTypeReference,
545                 BlockScope scope) {
546                 return true; // do nothing by default, keep traversing
547         }
548         public boolean visit(
549                 QualifiedTypeReference qualifiedTypeReference,
550                 ClassScope scope) {
551                 return true; // do nothing by default, keep traversing
552         }
553         public boolean visit(ReturnStatement returnStatement, BlockScope scope) {
554                 return true; // do nothing by default, keep traversing
555         }
556         public boolean visit(
557                 SingleNameReference singleNameReference,
558                 BlockScope scope) {
559                 return true; // do nothing by default, keep traversing
560         }
561         public boolean visit(
562                 SingleTypeReference singleTypeReference,
563                 BlockScope scope) {
564                 return true; // do nothing by default, keep traversing
565         }
566         public boolean visit(
567                 SingleTypeReference singleTypeReference,
568                 ClassScope scope) {
569                 return true; // do nothing by default, keep traversing
570         }
571         public boolean visit(StringLiteral stringLiteral, BlockScope scope) {
572                 return true; // do nothing by default, keep traversing
573         }
574         public boolean visit(SuperReference superReference, BlockScope scope) {
575                 return true; // do nothing by default, keep traversing
576         }
577         public boolean visit(SwitchStatement switchStatement, BlockScope scope) {
578                 return true; // do nothing by default, keep traversing
579         }
580         public boolean visit(
581                 SynchronizedStatement synchronizedStatement,
582                 BlockScope scope) {
583                 return true; // do nothing by default, keep traversing
584         }
585         public boolean visit(ThisReference thisReference, BlockScope scope) {
586                 return true; // do nothing by default, keep traversing
587         }
588         public boolean visit(ThrowStatement throwStatement, BlockScope scope) {
589                 return true; // do nothing by default, keep traversing
590         }
591         public boolean visit(TrueLiteral trueLiteral, BlockScope scope) {
592                 return true; // do nothing by default, keep traversing
593         }
594         public boolean visit(TryStatement tryStatement, BlockScope scope) {
595                 return true; // do nothing by default, keep traversing
596         }
597         public boolean visit(
598                 TypeDeclaration localTypeDeclaration,
599                 BlockScope scope) {
600                 return true; // do nothing by default, keep traversing
601         }
602         public boolean visit(
603                 TypeDeclaration memberTypeDeclaration,
604                 ClassScope scope) {
605                 return true; // do nothing by default, keep traversing
606         }       
607         public boolean visit(
608                 TypeDeclaration typeDeclaration,
609                 CompilationUnitScope scope) {
610                 return true; // do nothing by default, keep traversing
611         }
612         public boolean visit(UnaryExpression unaryExpression, BlockScope scope) {
613                 return true; // do nothing by default, keep traversing
614         }
615         public boolean visit(WhileStatement whileStatement, BlockScope scope) {
616                 return true; // do nothing by default, keep traversing
617         }
618 }