001: /*
002: * Copyright (C) 2007 Júlio Vilmar Gesser.
003: *
004: * This file is part of Java 1.5 parser and Abstract Syntax Tree.
005: *
006: * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify
007: * it under the terms of the GNU Lesser General Public License as published by
008: * the Free Software Foundation, either version 3 of the License, or
009: * (at your option) any later version.
010: *
011: * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public License
017: * along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>.
018: */
019: /*
020: * Created on 05/10/2006
021: */
022: package japa.parser.ast.visitor;
023:
024: import japa.parser.ast.CompilationUnit;
025: import japa.parser.ast.ImportDeclaration;
026: import japa.parser.ast.Node;
027: import japa.parser.ast.PackageDeclaration;
028: import japa.parser.ast.TypeParameter;
029: import japa.parser.ast.body.AnnotationDeclaration;
030: import japa.parser.ast.body.AnnotationMemberDeclaration;
031: import japa.parser.ast.body.ClassOrInterfaceDeclaration;
032: import japa.parser.ast.body.ConstructorDeclaration;
033: import japa.parser.ast.body.EmptyMemberDeclaration;
034: import japa.parser.ast.body.EmptyTypeDeclaration;
035: import japa.parser.ast.body.EnumConstantDeclaration;
036: import japa.parser.ast.body.EnumDeclaration;
037: import japa.parser.ast.body.FieldDeclaration;
038: import japa.parser.ast.body.InitializerDeclaration;
039: import japa.parser.ast.body.MethodDeclaration;
040: import japa.parser.ast.body.Parameter;
041: import japa.parser.ast.body.VariableDeclarator;
042: import japa.parser.ast.body.VariableDeclaratorId;
043: import japa.parser.ast.expr.ArrayAccessExpr;
044: import japa.parser.ast.expr.ArrayCreationExpr;
045: import japa.parser.ast.expr.ArrayInitializerExpr;
046: import japa.parser.ast.expr.AssignExpr;
047: import japa.parser.ast.expr.BinaryExpr;
048: import japa.parser.ast.expr.BooleanLiteralExpr;
049: import japa.parser.ast.expr.CastExpr;
050: import japa.parser.ast.expr.CharLiteralExpr;
051: import japa.parser.ast.expr.ClassExpr;
052: import japa.parser.ast.expr.ConditionalExpr;
053: import japa.parser.ast.expr.DoubleLiteralExpr;
054: import japa.parser.ast.expr.EnclosedExpr;
055: import japa.parser.ast.expr.FieldAccessExpr;
056: import japa.parser.ast.expr.InstanceOfExpr;
057: import japa.parser.ast.expr.IntegerLiteralExpr;
058: import japa.parser.ast.expr.IntegerLiteralMinValueExpr;
059: import japa.parser.ast.expr.LongLiteralExpr;
060: import japa.parser.ast.expr.LongLiteralMinValueExpr;
061: import japa.parser.ast.expr.MarkerAnnotationExpr;
062: import japa.parser.ast.expr.MemberValuePair;
063: import japa.parser.ast.expr.MethodCallExpr;
064: import japa.parser.ast.expr.NameExpr;
065: import japa.parser.ast.expr.NormalAnnotationExpr;
066: import japa.parser.ast.expr.NullLiteralExpr;
067: import japa.parser.ast.expr.ObjectCreationExpr;
068: import japa.parser.ast.expr.QualifiedNameExpr;
069: import japa.parser.ast.expr.SingleMemberAnnotationExpr;
070: import japa.parser.ast.expr.StringLiteralExpr;
071: import japa.parser.ast.expr.SuperExpr;
072: import japa.parser.ast.expr.SuperMemberAccessExpr;
073: import japa.parser.ast.expr.ThisExpr;
074: import japa.parser.ast.expr.UnaryExpr;
075: import japa.parser.ast.expr.VariableDeclarationExpr;
076: import japa.parser.ast.stmt.AssertStmt;
077: import japa.parser.ast.stmt.BlockStmt;
078: import japa.parser.ast.stmt.BreakStmt;
079: import japa.parser.ast.stmt.CatchClause;
080: import japa.parser.ast.stmt.ContinueStmt;
081: import japa.parser.ast.stmt.DoStmt;
082: import japa.parser.ast.stmt.EmptyStmt;
083: import japa.parser.ast.stmt.ExplicitConstructorInvocationStmt;
084: import japa.parser.ast.stmt.ExpressionStmt;
085: import japa.parser.ast.stmt.ForStmt;
086: import japa.parser.ast.stmt.ForeachStmt;
087: import japa.parser.ast.stmt.IfStmt;
088: import japa.parser.ast.stmt.LabeledStmt;
089: import japa.parser.ast.stmt.ReturnStmt;
090: import japa.parser.ast.stmt.SwitchEntryStmt;
091: import japa.parser.ast.stmt.SwitchStmt;
092: import japa.parser.ast.stmt.SynchronizedStmt;
093: import japa.parser.ast.stmt.ThrowStmt;
094: import japa.parser.ast.stmt.TryStmt;
095: import japa.parser.ast.stmt.TypeDeclarationStmt;
096: import japa.parser.ast.stmt.WhileStmt;
097: import japa.parser.ast.type.ClassOrInterfaceType;
098: import japa.parser.ast.type.PrimitiveType;
099: import japa.parser.ast.type.ReferenceType;
100: import japa.parser.ast.type.VoidType;
101: import japa.parser.ast.type.WildcardType;
102:
103: /**
104: * @author Julio Vilmar Gesser
105: */
106: public interface GenericVisitor<R, A> {
107:
108: public R visit(Node n, A arg);
109:
110: //- Compilation Unit ----------------------------------
111:
112: public R visit(CompilationUnit n, A arg);
113:
114: public R visit(PackageDeclaration n, A arg);
115:
116: public R visit(ImportDeclaration n, A arg);
117:
118: public R visit(TypeParameter n, A arg);
119:
120: //- Body ----------------------------------------------
121:
122: public R visit(ClassOrInterfaceDeclaration n, A arg);
123:
124: public R visit(EnumDeclaration n, A arg);
125:
126: public R visit(EmptyTypeDeclaration n, A arg);
127:
128: public R visit(EnumConstantDeclaration n, A arg);
129:
130: public R visit(AnnotationDeclaration n, A arg);
131:
132: public R visit(AnnotationMemberDeclaration n, A arg);
133:
134: public R visit(FieldDeclaration n, A arg);
135:
136: public R visit(VariableDeclarator n, A arg);
137:
138: public R visit(VariableDeclaratorId n, A arg);
139:
140: public R visit(ConstructorDeclaration n, A arg);
141:
142: public R visit(MethodDeclaration n, A arg);
143:
144: public R visit(Parameter n, A arg);
145:
146: public R visit(EmptyMemberDeclaration n, A arg);
147:
148: public R visit(InitializerDeclaration n, A arg);
149:
150: //- Type ----------------------------------------------
151:
152: public R visit(ClassOrInterfaceType n, A arg);
153:
154: public R visit(PrimitiveType n, A arg);
155:
156: public R visit(ReferenceType n, A arg);
157:
158: public R visit(VoidType n, A arg);
159:
160: public R visit(WildcardType n, A arg);
161:
162: //- Expression ----------------------------------------
163:
164: public R visit(ArrayAccessExpr n, A arg);
165:
166: public R visit(ArrayCreationExpr n, A arg);
167:
168: public R visit(ArrayInitializerExpr n, A arg);
169:
170: public R visit(AssignExpr n, A arg);
171:
172: public R visit(BinaryExpr n, A arg);
173:
174: public R visit(CastExpr n, A arg);
175:
176: public R visit(ClassExpr n, A arg);
177:
178: public R visit(ConditionalExpr n, A arg);
179:
180: public R visit(EnclosedExpr n, A arg);
181:
182: public R visit(FieldAccessExpr n, A arg);
183:
184: public R visit(InstanceOfExpr n, A arg);
185:
186: public R visit(StringLiteralExpr n, A arg);
187:
188: public R visit(IntegerLiteralExpr n, A arg);
189:
190: public R visit(LongLiteralExpr n, A arg);
191:
192: public R visit(IntegerLiteralMinValueExpr n, A arg);
193:
194: public R visit(LongLiteralMinValueExpr n, A arg);
195:
196: public R visit(CharLiteralExpr n, A arg);
197:
198: public R visit(DoubleLiteralExpr n, A arg);
199:
200: public R visit(BooleanLiteralExpr n, A arg);
201:
202: public R visit(NullLiteralExpr n, A arg);
203:
204: public R visit(MethodCallExpr n, A arg);
205:
206: public R visit(NameExpr n, A arg);
207:
208: public R visit(ObjectCreationExpr n, A arg);
209:
210: public R visit(QualifiedNameExpr n, A arg);
211:
212: public R visit(SuperMemberAccessExpr n, A arg);
213:
214: public R visit(ThisExpr n, A arg);
215:
216: public R visit(SuperExpr n, A arg);
217:
218: public R visit(UnaryExpr n, A arg);
219:
220: public R visit(VariableDeclarationExpr n, A arg);
221:
222: public R visit(MarkerAnnotationExpr n, A arg);
223:
224: public R visit(SingleMemberAnnotationExpr n, A arg);
225:
226: public R visit(NormalAnnotationExpr n, A arg);
227:
228: public R visit(MemberValuePair n, A arg);
229:
230: //- Statements ----------------------------------------
231:
232: public R visit(ExplicitConstructorInvocationStmt n, A arg);
233:
234: public R visit(TypeDeclarationStmt n, A arg);
235:
236: public R visit(AssertStmt n, A arg);
237:
238: public R visit(BlockStmt n, A arg);
239:
240: public R visit(LabeledStmt n, A arg);
241:
242: public R visit(EmptyStmt n, A arg);
243:
244: public R visit(ExpressionStmt n, A arg);
245:
246: public R visit(SwitchStmt n, A arg);
247:
248: public R visit(SwitchEntryStmt n, A arg);
249:
250: public R visit(BreakStmt n, A arg);
251:
252: public R visit(ReturnStmt n, A arg);
253:
254: public R visit(IfStmt n, A arg);
255:
256: public R visit(WhileStmt n, A arg);
257:
258: public R visit(ContinueStmt n, A arg);
259:
260: public R visit(DoStmt n, A arg);
261:
262: public R visit(ForeachStmt n, A arg);
263:
264: public R visit(ForStmt n, A arg);
265:
266: public R visit(ThrowStmt n, A arg);
267:
268: public R visit(SynchronizedStmt n, A arg);
269:
270: public R visit(TryStmt n, A arg);
271:
272: public R visit(CatchClause n, A arg);
273:
274: }
|