EX - The exception that the "traverse*()" and "visit*()" methods may throwpublic class Traverser<EX extends Throwable> extends Object
traverse*()" methods to
process specific nodes.
Example:
LocalClassDeclaration lcd = ...;
new Traverser() {
int n = 0;
protected void
traverseMethodDeclarator(MethodDeclarator md) {
++this.n;
super.traverseMethodDeclarator(md);
}
}.visitTypeDeclaration(lcd);
visitAnnotation(Java.Annotation),
visitAtom(Java.Atom),
visitBlockStatement(Java.BlockStatement),
visitElementValue(Java.ElementValue),
visitImportDeclaration(Java.CompilationUnit.ImportDeclaration),
visitTypeBodyDeclaration(Java.TypeBodyDeclaration),
visitTypeDeclaration(Java.TypeDeclaration),
traverseCompilationUnit(Java.CompilationUnit)| Constructor and Description |
|---|
Traverser() |
public void visitImportDeclaration(Java.CompilationUnit.ImportDeclaration id) throws EX extends Throwable
public void visitTypeDeclaration(Java.TypeDeclaration td) throws EX extends Throwable
public void visitTypeBodyDeclaration(Java.TypeBodyDeclaration tbd) throws EX extends Throwable
public void visitBlockStatement(Java.BlockStatement bs) throws EX extends Throwable
public void visitElementValue(Java.ElementValue ev) throws EX extends Throwable
public void visitAnnotation(Java.Annotation a) throws EX extends Throwable
public void traverseCompilationUnit(Java.CompilationUnit cu) throws EX extends Throwable
protected void traverseSingleTypeImportDeclaration(Java.CompilationUnit.SingleTypeImportDeclaration stid) throws EX extends Throwable
protected void traverseTypeImportOnDemandDeclaration(Java.CompilationUnit.TypeImportOnDemandDeclaration tiodd) throws EX extends Throwable
protected void traverseSingleStaticImportDeclaration(Java.CompilationUnit.SingleStaticImportDeclaration stid) throws EX extends Throwable
protected void traverseStaticImportOnDemandDeclaration(Java.CompilationUnit.StaticImportOnDemandDeclaration siodd) throws EX extends Throwable
protected void traverseImportDeclaration(Java.CompilationUnit.ImportDeclaration id) throws EX extends Throwable
protected void traverseAnonymousClassDeclaration(Java.AnonymousClassDeclaration acd) throws EX extends Throwable
protected void traverseLocalClassDeclaration(Java.LocalClassDeclaration lcd) throws EX extends Throwable
protected void traversePackageMemberClassDeclaration(Java.AbstractPackageMemberClassDeclaration pmcd) throws EX extends Throwable
protected void traverseMemberInterfaceDeclaration(Java.MemberInterfaceDeclaration mid) throws EX extends Throwable
protected void traversePackageMemberInterfaceDeclaration(Java.PackageMemberInterfaceDeclaration pmid) throws EX extends Throwable
protected void traverseMemberClassDeclaration(Java.MemberClassDeclaration mcd) throws EX extends Throwable
protected void traverseConstructorDeclarator(Java.ConstructorDeclarator cd) throws EX extends Throwable
protected void traverseInitializer(Java.Initializer i) throws EX extends Throwable
protected void traverseMethodDeclarator(Java.MethodDeclarator md) throws EX extends Throwable
protected void traverseFieldDeclaration(Java.FieldDeclaration fd) throws EX extends Throwable
protected void traverseLabeledStatement(Java.LabeledStatement ls) throws EX extends Throwable
protected void traverseBlock(Java.Block b) throws EX extends Throwable
protected void traverseExpressionStatement(Java.ExpressionStatement es) throws EX extends Throwable
protected void traverseIfStatement(Java.IfStatement is) throws EX extends Throwable
protected void traverseForStatement(Java.ForStatement fs) throws EX extends Throwable
protected void traverseForEachStatement(Java.ForEachStatement fes) throws EX extends Throwable
protected void traverseWhileStatement(Java.WhileStatement ws) throws EX extends Throwable
protected void traverseTryStatement(Java.TryStatement ts) throws EX extends Throwable
protected void traverseSwitchStatement(Java.SwitchStatement ss) throws EX extends Throwable
protected void traverseSynchronizedStatement(Java.SynchronizedStatement ss) throws EX extends Throwable
protected void traverseDoStatement(Java.DoStatement ds) throws EX extends Throwable
protected void traverseLocalVariableDeclarationStatement(Java.LocalVariableDeclarationStatement lvds) throws EX extends Throwable
protected void traverseReturnStatement(Java.ReturnStatement rs) throws EX extends Throwable
protected void traverseThrowStatement(Java.ThrowStatement ts) throws EX extends Throwable
protected void traverseBreakStatement(Java.BreakStatement bs) throws EX extends Throwable
protected void traverseContinueStatement(Java.ContinueStatement cs) throws EX extends Throwable
protected void traverseAssertStatement(Java.AssertStatement as) throws EX extends Throwable
protected void traverseEmptyStatement(Java.EmptyStatement es) throws EX extends Throwable
protected void traverseLocalClassDeclarationStatement(Java.LocalClassDeclarationStatement lcds) throws EX extends Throwable
protected void traversePackage(Java.Package p) throws EX extends Throwable
protected void traverseArrayLength(Java.ArrayLength al) throws EX extends Throwable
protected void traverseAssignment(Java.Assignment a) throws EX extends Throwable
protected void traverseUnaryOperation(Java.UnaryOperation uo) throws EX extends Throwable
protected void traverseBinaryOperation(Java.BinaryOperation bo) throws EX extends Throwable
protected void traverseClassLiteral(Java.ClassLiteral cl) throws EX extends Throwable
protected void traverseConditionalExpression(Java.ConditionalExpression ce) throws EX extends Throwable
protected void traverseCrement(Java.Crement c) throws EX extends Throwable
protected void traverseInstanceof(Java.Instanceof io) throws EX extends Throwable
protected void traverseMethodInvocation(Java.MethodInvocation mi) throws EX extends Throwable
protected void traverseSuperclassMethodInvocation(Java.SuperclassMethodInvocation smi) throws EX extends Throwable
protected void traverseLiteral(Java.Literal l) throws EX extends Throwable
protected void traverseIntegerLiteral(Java.IntegerLiteral il) throws EX extends Throwable
protected void traverseFloatingPointLiteral(Java.FloatingPointLiteral fpl) throws EX extends Throwable
protected void traverseBooleanLiteral(Java.BooleanLiteral bl) throws EX extends Throwable
protected void traverseCharacterLiteral(Java.CharacterLiteral cl) throws EX extends Throwable
protected void traverseStringLiteral(Java.StringLiteral sl) throws EX extends Throwable
protected void traverseNullLiteral(Java.NullLiteral nl) throws EX extends Throwable
protected void traverseSimpleLiteral(Java.SimpleConstant sl) throws EX extends Throwable
protected void traverseNewAnonymousClassInstance(Java.NewAnonymousClassInstance naci) throws EX extends Throwable
protected void traverseNewArray(Java.NewArray na) throws EX extends Throwable
protected void traverseNewInitializedArray(Java.NewInitializedArray nia) throws EX extends Throwable
protected void traverseArrayInitializerOrRvalue(Java.ArrayInitializerOrRvalue aiorv) throws EX extends Throwable
protected void traverseNewClassInstance(Java.NewClassInstance nci) throws EX extends Throwable
protected void traverseParameterAccess(Java.ParameterAccess pa) throws EX extends Throwable
protected void traverseQualifiedThisReference(Java.QualifiedThisReference qtr) throws EX extends Throwable
protected void traverseThisReference(Java.ThisReference tr) throws EX extends Throwable
protected void traverseArrayType(Java.ArrayType at) throws EX extends Throwable
protected void traversePrimitiveType(Java.PrimitiveType bt) throws EX extends Throwable
protected void traverseReferenceType(Java.ReferenceType rt) throws EX extends Throwable
protected void traverseRvalueMemberType(Java.RvalueMemberType rmt) throws EX extends Throwable
protected void traverseSimpleType(Java.SimpleType st) throws EX extends Throwable
protected void traverseAlternateConstructorInvocation(Java.AlternateConstructorInvocation aci) throws EX extends Throwable
protected void traverseSuperConstructorInvocation(Java.SuperConstructorInvocation sci) throws EX extends Throwable
protected void traverseAmbiguousName(Java.AmbiguousName an) throws EX extends Throwable
protected void traverseArrayAccessExpression(Java.ArrayAccessExpression aae) throws EX extends Throwable
protected void traverseFieldAccess(Java.FieldAccess fa) throws EX extends Throwable
protected void traverseFieldAccessExpression(Java.FieldAccessExpression fae) throws EX extends Throwable
protected void traverseSuperclassFieldAccessExpression(Java.SuperclassFieldAccessExpression scfae) throws EX extends Throwable
protected void traverseLocalVariableAccess(Java.LocalVariableAccess lva) throws EX extends Throwable
protected void traverseParenthesizedExpression(Java.ParenthesizedExpression pe) throws EX extends Throwable
protected void traverseElementValueArrayInitializer(Java.ElementValueArrayInitializer evai) throws EX extends Throwable
protected void traverseElementValue(Java.ElementValue ev) throws EX extends Throwable
protected void traverseSingleElementAnnotation(Java.SingleElementAnnotation sea) throws EX extends Throwable
protected void traverseAnnotation(Java.Annotation a) throws EX extends Throwable
protected void traverseNormalAnnotation(Java.NormalAnnotation na) throws EX extends Throwable
protected void traverseMarkerAnnotation(Java.MarkerAnnotation ma) throws EX extends Throwable
protected void traverseClassDeclaration(Java.AbstractClassDeclaration cd) throws EX extends Throwable
protected void traverseAbstractTypeDeclaration(Java.AbstractTypeDeclaration atd) throws EX extends Throwable
protected void traverseNamedClassDeclaration(Java.NamedClassDeclaration ncd) throws EX extends Throwable
protected void traverseInterfaceDeclaration(Java.InterfaceDeclaration id) throws EX extends Throwable
protected void traverseFunctionDeclarator(Java.FunctionDeclarator fd) throws EX extends Throwable
protected void traverseFormalParameters(Java.FunctionDeclarator.FormalParameters formalParameters) throws EX extends Throwable
protected void traverseFormalParameter(Java.FunctionDeclarator.FormalParameter formalParameter) throws EX extends Throwable
protected void traverseAbstractTypeBodyDeclaration(Java.AbstractTypeBodyDeclaration atbd) throws EX extends Throwable
protected void traverseStatement(Java.Statement s) throws EX extends Throwable
protected void traverseBreakableStatement(Java.BreakableStatement bs) throws EX extends Throwable
protected void traverseContinuableStatement(Java.ContinuableStatement cs) throws EX extends Throwable
protected void traverseRvalue(Java.Rvalue rv) throws EX extends Throwable
protected void traverseBooleanRvalue(Java.BooleanRvalue brv) throws EX extends Throwable
protected void traverseInvocation(Java.Invocation i) throws EX extends Throwable
protected void traverseConstructorInvocation(Java.ConstructorInvocation ci) throws EX extends Throwable
protected void traverseEnumConstant(Java.EnumConstant ec) throws EX extends Throwable
protected void traversePackageMemberEnumDeclaration(Java.PackageMemberEnumDeclaration pmed) throws EX extends Throwable
protected void traverseMemberEnumDeclaration(Java.MemberEnumDeclaration med) throws EX extends Throwable
protected void traversePackageMemberAnnotationTypeDeclaration(Java.PackageMemberAnnotationTypeDeclaration pmatd) throws EX extends Throwable
protected void traverseMemberAnnotationTypeDeclaration(Java.MemberAnnotationTypeDeclaration matd) throws EX extends Throwable
protected void traverseLvalue(Java.Lvalue lv) throws EX extends Throwable