More 3.1 compatibility
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / IAbstractSyntaxTreeVisitor.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 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.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.AnonymousLocalTypeDeclaration;
21 import net.sourceforge.phpeclipse.internal.compiler.ast.Argument;
22 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayAllocationExpression;
23 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayInitializer;
24 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayQualifiedTypeReference;
25 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayReference;
26 import net.sourceforge.phpeclipse.internal.compiler.ast.ArrayTypeReference;
27 import net.sourceforge.phpeclipse.internal.compiler.ast.AssertStatement;
28 import net.sourceforge.phpeclipse.internal.compiler.ast.Assignment;
29 import net.sourceforge.phpeclipse.internal.compiler.ast.BinaryExpression;
30 import net.sourceforge.phpeclipse.internal.compiler.ast.Block;
31 import net.sourceforge.phpeclipse.internal.compiler.ast.BreakStatement;
32 import net.sourceforge.phpeclipse.internal.compiler.ast.CaseStatement;
33 import net.sourceforge.phpeclipse.internal.compiler.ast.CastExpression;
34 import net.sourceforge.phpeclipse.internal.compiler.ast.Clinit;
35 import net.sourceforge.phpeclipse.internal.compiler.ast.CompilationUnitDeclaration;
36 import net.sourceforge.phpeclipse.internal.compiler.ast.CompoundAssignment;
37 import net.sourceforge.phpeclipse.internal.compiler.ast.ConditionalExpression;
38 import net.sourceforge.phpeclipse.internal.compiler.ast.ConstructorDeclaration;
39 import net.sourceforge.phpeclipse.internal.compiler.ast.ContinueStatement;
40 import net.sourceforge.phpeclipse.internal.compiler.ast.DefaultCase;
41 import net.sourceforge.phpeclipse.internal.compiler.ast.DoStatement;
42 import net.sourceforge.phpeclipse.internal.compiler.ast.DoubleLiteral;
43 import net.sourceforge.phpeclipse.internal.compiler.ast.EmptyStatement;
44 import net.sourceforge.phpeclipse.internal.compiler.ast.EqualExpression;
45 import net.sourceforge.phpeclipse.internal.compiler.ast.ExplicitConstructorCall;
46 import net.sourceforge.phpeclipse.internal.compiler.ast.ExtendedStringLiteral;
47 import net.sourceforge.phpeclipse.internal.compiler.ast.FalseLiteral;
48 import net.sourceforge.phpeclipse.internal.compiler.ast.FieldDeclaration;
49 import net.sourceforge.phpeclipse.internal.compiler.ast.FieldReference;
50 import net.sourceforge.phpeclipse.internal.compiler.ast.FloatLiteral;
51 import net.sourceforge.phpeclipse.internal.compiler.ast.ForStatement;
52 import net.sourceforge.phpeclipse.internal.compiler.ast.IfStatement;
53 import net.sourceforge.phpeclipse.internal.compiler.ast.ImportReference;
54 import net.sourceforge.phpeclipse.internal.compiler.ast.Initializer;
55 import net.sourceforge.phpeclipse.internal.compiler.ast.InstanceOfExpression;
56 import net.sourceforge.phpeclipse.internal.compiler.ast.IntLiteral;
57 import net.sourceforge.phpeclipse.internal.compiler.ast.LabeledStatement;
58 import net.sourceforge.phpeclipse.internal.compiler.ast.LocalDeclaration;
59 import net.sourceforge.phpeclipse.internal.compiler.ast.LocalTypeDeclaration;
60 import net.sourceforge.phpeclipse.internal.compiler.ast.LongLiteral;
61 import net.sourceforge.phpeclipse.internal.compiler.ast.MemberTypeDeclaration;
62 import net.sourceforge.phpeclipse.internal.compiler.ast.MessageSend;
63 import net.sourceforge.phpeclipse.internal.compiler.ast.MethodDeclaration;
64 import net.sourceforge.phpeclipse.internal.compiler.ast.NullLiteral;
65 import net.sourceforge.phpeclipse.internal.compiler.ast.OR_OR_Expression;
66 import net.sourceforge.phpeclipse.internal.compiler.ast.PostfixExpression;
67 import net.sourceforge.phpeclipse.internal.compiler.ast.PrefixExpression;
68 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedAllocationExpression;
69 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedNameReference;
70 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedSuperReference;
71 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedThisReference;
72 import net.sourceforge.phpeclipse.internal.compiler.ast.QualifiedTypeReference;
73 import net.sourceforge.phpeclipse.internal.compiler.ast.ReturnStatement;
74 import net.sourceforge.phpeclipse.internal.compiler.ast.SingleNameReference;
75 import net.sourceforge.phpeclipse.internal.compiler.ast.SingleTypeReference;
76 import net.sourceforge.phpeclipse.internal.compiler.ast.StringLiteral;
77 import net.sourceforge.phpeclipse.internal.compiler.ast.SuperReference;
78 import net.sourceforge.phpeclipse.internal.compiler.ast.SwitchStatement;
79 import net.sourceforge.phpeclipse.internal.compiler.ast.ThisReference;
80 import net.sourceforge.phpeclipse.internal.compiler.ast.ThrowStatement;
81 import net.sourceforge.phpeclipse.internal.compiler.ast.TrueLiteral;
82 import net.sourceforge.phpeclipse.internal.compiler.ast.TryStatement;
83 import net.sourceforge.phpeclipse.internal.compiler.ast.TypeDeclaration;
84 import net.sourceforge.phpeclipse.internal.compiler.ast.UnaryExpression;
85 import net.sourceforge.phpeclipse.internal.compiler.ast.WhileStatement;
86
87 /**
88  * A visitor interface for interating through the parse tree.
89  */
90 public interface IAbstractSyntaxTreeVisitor {
91         void acceptProblem(IProblem problem);
92         void endVisit(AllocationExpression allocationExpression, BlockScope scope);
93         void endVisit(AND_AND_Expression and_and_Expression, BlockScope scope);
94         void endVisit(AnonymousLocalTypeDeclaration anonymousTypeDeclaration, BlockScope scope);
95         void endVisit(Argument argument, BlockScope scope);
96         void endVisit(ArrayAllocationExpression arrayAllocationExpression, BlockScope scope);
97         void endVisit(ArrayInitializer arrayInitializer, BlockScope scope);
98         void endVisit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope);
99         void endVisit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, ClassScope scope);
100         void endVisit(ArrayReference arrayReference, BlockScope scope);
101         void endVisit(ArrayTypeReference arrayTypeReference, BlockScope scope);
102         void endVisit(ArrayTypeReference arrayTypeReference, ClassScope scope);
103         void endVisit(AssertStatement assertStatement, BlockScope scope);
104         void endVisit(Assignment assignment, BlockScope scope);
105         void endVisit(BinaryExpression binaryExpression, BlockScope scope);
106         void endVisit(Block block, BlockScope scope);
107         void endVisit(BreakStatement breakStatement, BlockScope scope);
108         void endVisit(CaseStatement caseStatement, BlockScope scope);
109         void endVisit(CastExpression castExpression, BlockScope scope);
110 //      void endVisit(CharLiteral charLiteral, BlockScope scope);
111 //      void endVisit(ClassLiteralAccess classLiteral, BlockScope scope);
112         void endVisit(Clinit clinit, ClassScope scope);
113         void endVisit(CompilationUnitDeclaration compilationUnitDeclaration, CompilationUnitScope scope);
114         void endVisit(CompoundAssignment compoundAssignment, BlockScope scope);
115         void endVisit(ConditionalExpression conditionalExpression, BlockScope scope);
116         void endVisit(ConstructorDeclaration constructorDeclaration, ClassScope scope);
117         void endVisit(ContinueStatement continueStatement, BlockScope scope);
118         void endVisit(DefaultCase defaultCaseStatement, BlockScope scope);
119         void endVisit(DoStatement doStatement, BlockScope scope);
120         void endVisit(DoubleLiteral doubleLiteral, BlockScope scope);
121         void endVisit(EqualExpression equalExpression, BlockScope scope);
122         void endVisit(EmptyStatement statement, BlockScope scope);
123         void endVisit(ExplicitConstructorCall explicitConstructor, BlockScope scope);
124         void endVisit(ExtendedStringLiteral extendedStringLiteral, BlockScope scope);
125         void endVisit(FalseLiteral falseLiteral, BlockScope scope);
126         void endVisit(FieldDeclaration fieldDeclaration, MethodScope scope);
127         void endVisit(FieldReference fieldReference, BlockScope scope);
128         void endVisit(FloatLiteral floatLiteral, BlockScope scope);
129         void endVisit(ForStatement forStatement, BlockScope scope);
130         void endVisit(IfStatement ifStatement, BlockScope scope);
131         void endVisit(ImportReference importRef, CompilationUnitScope scope);
132         void endVisit(Initializer initializer, MethodScope scope);
133         void endVisit(InstanceOfExpression instanceOfExpression, BlockScope scope);
134         void endVisit(IntLiteral intLiteral, BlockScope scope);
135         void endVisit(LabeledStatement labeledStatement, BlockScope scope);
136         void endVisit(LocalDeclaration localDeclaration, BlockScope scope);
137         void endVisit(LocalTypeDeclaration localTypeDeclaration, BlockScope scope);
138         void endVisit(LongLiteral longLiteral, BlockScope scope);
139         void endVisit(MemberTypeDeclaration memberTypeDeclaration, ClassScope scope);
140         void endVisit(MessageSend messageSend, BlockScope scope);
141         void endVisit(MethodDeclaration methodDeclaration, ClassScope scope);
142         void endVisit(NullLiteral nullLiteral, BlockScope scope);
143         void endVisit(OR_OR_Expression or_or_Expression, BlockScope scope);
144         void endVisit(PostfixExpression postfixExpression, BlockScope scope);
145         void endVisit(PrefixExpression prefixExpression, BlockScope scope);
146         void endVisit(QualifiedAllocationExpression qualifiedAllocationExpression, BlockScope scope);
147         void endVisit(QualifiedNameReference qualifiedNameReference, BlockScope scope);
148         void endVisit(QualifiedSuperReference qualifiedSuperReference, BlockScope scope);
149         void endVisit(QualifiedThisReference qualifiedThisReference, BlockScope scope);
150         void endVisit(QualifiedTypeReference qualifiedTypeReference, BlockScope scope);
151         void endVisit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope);
152         void endVisit(ReturnStatement returnStatement, BlockScope scope);
153         void endVisit(SingleNameReference singleNameReference, BlockScope scope);
154         void endVisit(SingleTypeReference singleTypeReference, BlockScope scope);
155         void endVisit(SingleTypeReference singleTypeReference, ClassScope scope);
156         void endVisit(StringLiteral stringLiteral, BlockScope scope);
157         void endVisit(SuperReference superReference, BlockScope scope);
158         void endVisit(SwitchStatement switchStatement, BlockScope scope);
159 //      void endVisit(SynchronizedStatement synchronizedStatement, BlockScope scope);
160         void endVisit(ThisReference thisReference, BlockScope scope);
161         void endVisit(ThrowStatement throwStatement, BlockScope scope);
162         void endVisit(TrueLiteral trueLiteral, BlockScope scope);
163         void endVisit(TryStatement tryStatement, BlockScope scope);
164         void endVisit(TypeDeclaration typeDeclaration, CompilationUnitScope scope);
165         void endVisit(UnaryExpression unaryExpression, BlockScope scope);
166         void endVisit(WhileStatement whileStatement, BlockScope scope);
167         boolean visit(AllocationExpression allocationExpression, BlockScope scope);
168         boolean visit(AND_AND_Expression and_and_Expression, BlockScope scope);
169         boolean visit(AnonymousLocalTypeDeclaration anonymousTypeDeclaration, BlockScope scope);
170         boolean visit(Argument argument, BlockScope scope);
171         boolean visit(ArrayAllocationExpression arrayAllocationExpression, BlockScope scope);
172         boolean visit(ArrayInitializer arrayInitializer, BlockScope scope);
173         boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, BlockScope scope);
174         boolean visit(ArrayQualifiedTypeReference arrayQualifiedTypeReference, ClassScope scope);
175         boolean visit(ArrayReference arrayReference, BlockScope scope);
176         boolean visit(ArrayTypeReference arrayTypeReference, BlockScope scope);
177         boolean visit(ArrayTypeReference arrayTypeReference, ClassScope scope);
178         boolean visit(AssertStatement assertStatement, BlockScope scope);
179         boolean visit(Assignment assignment, BlockScope scope);
180         boolean visit(BinaryExpression binaryExpression, BlockScope scope);
181         boolean visit(Block block, BlockScope scope);
182         boolean visit(BreakStatement breakStatement, BlockScope scope);
183         boolean visit(CaseStatement caseStatement, BlockScope scope);
184         boolean visit(CastExpression castExpression, BlockScope scope);
185 //      boolean visit(CharLiteral charLiteral, BlockScope scope);
186 //      boolean visit(ClassLiteralAccess classLiteral, BlockScope scope);
187         boolean visit(Clinit clinit, ClassScope scope);
188         boolean visit(CompilationUnitDeclaration compilationUnitDeclaration, CompilationUnitScope scope);
189         boolean visit(CompoundAssignment compoundAssignment, BlockScope scope);
190         boolean visit(ConditionalExpression conditionalExpression, BlockScope scope);
191         boolean visit(ConstructorDeclaration constructorDeclaration, ClassScope scope);
192         boolean visit(ContinueStatement continueStatement, BlockScope scope);
193         boolean visit(DefaultCase defaultCaseStatement, BlockScope scope);
194         boolean visit(DoStatement doStatement, BlockScope scope);
195         boolean visit(DoubleLiteral doubleLiteral, BlockScope scope);
196         boolean visit(EqualExpression equalExpression, BlockScope scope);
197         boolean visit(EmptyStatement statement, BlockScope scope);
198         boolean visit(ExplicitConstructorCall explicitConstructor, BlockScope scope);
199         boolean visit(ExtendedStringLiteral extendedStringLiteral, BlockScope scope);
200         boolean visit(FalseLiteral falseLiteral, BlockScope scope);
201         boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope);
202         boolean visit(FieldReference fieldReference, BlockScope scope);
203         boolean visit(FloatLiteral floatLiteral, BlockScope scope);
204         boolean visit(ForStatement forStatement, BlockScope scope);
205         boolean visit(IfStatement ifStatement, BlockScope scope);
206         boolean visit(ImportReference importRef, CompilationUnitScope scope);
207         boolean visit(Initializer initializer, MethodScope scope);
208         boolean visit(InstanceOfExpression instanceOfExpression, BlockScope scope);
209         boolean visit(IntLiteral intLiteral, BlockScope scope);
210         boolean visit(LabeledStatement labeledStatement, BlockScope scope);
211         boolean visit(LocalDeclaration localDeclaration, BlockScope scope);
212         boolean visit(LocalTypeDeclaration localTypeDeclaration, BlockScope scope);
213         boolean visit(LongLiteral longLiteral, BlockScope scope);
214         boolean visit(MemberTypeDeclaration memberTypeDeclaration, ClassScope scope);
215         boolean visit(MessageSend messageSend, BlockScope scope);
216         boolean visit(MethodDeclaration methodDeclaration, ClassScope scope);
217         boolean visit(NullLiteral nullLiteral, BlockScope scope);
218         boolean visit(OR_OR_Expression or_or_Expression, BlockScope scope);
219         boolean visit(PostfixExpression postfixExpression, BlockScope scope);
220         boolean visit(PrefixExpression prefixExpression, BlockScope scope);
221         boolean visit(QualifiedAllocationExpression qualifiedAllocationExpression, BlockScope scope);
222         boolean visit(QualifiedNameReference qualifiedNameReference, BlockScope scope);
223         boolean visit(QualifiedSuperReference qualifiedSuperReference, BlockScope scope);
224         boolean visit(QualifiedThisReference qualifiedThisReference, BlockScope scope);
225         boolean visit(QualifiedTypeReference qualifiedTypeReference, BlockScope scope);
226         boolean visit(QualifiedTypeReference qualifiedTypeReference, ClassScope scope);
227         boolean visit(ReturnStatement returnStatement, BlockScope scope);
228         boolean visit(SingleNameReference singleNameReference, BlockScope scope);
229         boolean visit(SingleTypeReference singleTypeReference, BlockScope scope);
230         boolean visit(SingleTypeReference singleTypeReference, ClassScope scope);
231         boolean visit(StringLiteral stringLiteral, BlockScope scope);
232         boolean visit(SuperReference superReference, BlockScope scope);
233         boolean visit(SwitchStatement switchStatement, BlockScope scope);
234 //      boolean visit(SynchronizedStatement synchronizedStatement, BlockScope scope);
235         boolean visit(ThisReference thisReference, BlockScope scope);
236         boolean visit(ThrowStatement throwStatement, BlockScope scope);
237         boolean visit(TrueLiteral trueLiteral, BlockScope scope);
238         boolean visit(TryStatement tryStatement, BlockScope scope);
239         boolean visit(TypeDeclaration typeDeclaration, CompilationUnitScope scope);
240         boolean visit(UnaryExpression unaryExpression, BlockScope scope);
241         boolean visit(WhileStatement whileStatement, BlockScope scope);
242 }