janino.net

org.codehaus.janino.util
Class Traverser

  extended by org.codehaus.janino.util.Traverser
Direct Known Subclasses:
DeclarationCounter

public class Traverser
extends

This class traverses the subnodes of an AST. Derived classes may override individual methods to process specific nodes, e.g.:

     LocalClassDeclaration lcd = ...;
     lcd.accept(new Traverser() {
         int n = 0;
         public void traverseMethodDeclarator(Java.MethodDeclarator md) {
             ++this.n;
             super.traverseMethodDeclarator(md);
         }
     }.comprehensiveVisitor());


Constructor Summary
Traverser()
           
 
Method Summary
 Visitor.ComprehensiveVisitor comprehensiveVisitor()
           
 void traverseAbstractTypeBodyDeclaration(Java.AbstractTypeBodyDeclaration atbd)
           
 void traverseAbstractTypeDeclaration(Java.AbstractTypeDeclaration atd)
           
 void traverseAlternateConstructorInvocation(Java.AlternateConstructorInvocation aci)
           
 void traverseAmbiguousName(Java.AmbiguousName an)
           
 void traverseAnnotation(Java.Annotation a)
           
 void traverseAnonymousClassDeclaration(Java.AnonymousClassDeclaration acd)
           
 void traverseArrayAccessExpression(Java.ArrayAccessExpression aae)
           
 void traverseArrayInitializerOrRvalue(Java.ArrayInitializerOrRvalue aiorv)
           
 void traverseArrayLength(Java.ArrayLength al)
           
 void traverseArrayType(Java.ArrayType at)
           
 void traverseAssertStatement(Java.AssertStatement as)
           
 void traverseAssignment(Java.Assignment a)
           
 void traverseAtom(Java.Atom a)
           
 void traverseBasicType(Java.BasicType bt)
           
 void traverseBinaryOperation(Java.BinaryOperation bo)
           
 void traverseBlock(Java.Block b)
           
 void traverseBooleanLiteral(Java.BooleanLiteral bl)
           
 void traverseBooleanRvalue(Java.BooleanRvalue brv)
           
 void traverseBreakableStatement(Java.BreakableStatement bs)
           
 void traverseBreakStatement(Java.BreakStatement bs)
           
 void traverseCast(Java.Cast c)
           
 void traverseCharacterLiteral(Java.CharacterLiteral cl)
           
 void traverseClassDeclaration(Java.ClassDeclaration cd)
           
 void traverseClassLiteral(Java.ClassLiteral cl)
           
 void traverseCompilationUnit(Java.CompilationUnit cu)
           
 void traverseConditionalExpression(Java.ConditionalExpression ce)
           
 void traverseConstructorDeclarator(Java.ConstructorDeclarator cd)
           
 void traverseConstructorInvocation(Java.ConstructorInvocation ci)
           
 void traverseContinuableStatement(Java.ContinuableStatement cs)
           
 void traverseContinueStatement(Java.ContinueStatement cs)
           
 void traverseCrement(Java.Crement c)
           
 void traverseDoStatement(Java.DoStatement ds)
           
 void traverseElementValue(Java.ElementValue ev)
           
 void traverseElementValueArrayInitializer(Java.ElementValueArrayInitializer evai)
           
 void traverseEmptyStatement(Java.EmptyStatement es)
           
 void traverseExpressionStatement(Java.ExpressionStatement es)
           
 void traverseFieldAccess(Java.FieldAccess fa)
           
 void traverseFieldAccessExpression(Java.FieldAccessExpression fae)
           
 void traverseFieldDeclaration(Java.FieldDeclaration fd)
           
 void traverseFloatingPointLiteral(Java.FloatingPointLiteral fpl)
           
 void traverseForEachStatement(Java.ForEachStatement fes)
           
 void traverseFormalParameter(Java.FunctionDeclarator.FormalParameter formalParameter)
           
 void traverseFormalParameters(Java.FunctionDeclarator.FormalParameters formalParameters)
           
 void traverseForStatement(Java.ForStatement fs)
           
 void traverseFunctionDeclarator(Java.FunctionDeclarator fd)
           
 void traverseIfStatement(Java.IfStatement is)
           
 void traverseImportDeclaration(Java.CompilationUnit.ImportDeclaration id)
           
 void traverseInitializer(Java.Initializer i)
           
 void traverseInstanceof(Java.Instanceof io)
           
 void traverseIntegerLiteral(Java.IntegerLiteral il)
           
 void traverseInterfaceDeclaration(Java.InterfaceDeclaration id)
           
 void traverseInvocation(Java.Invocation i)
           
 void traverseLabeledStatement(Java.LabeledStatement ls)
           
 void traverseLiteral(Java.Literal l)
           
 void traverseLocalClassDeclaration(Java.LocalClassDeclaration lcd)
           
 void traverseLocalClassDeclarationStatement(Java.LocalClassDeclarationStatement lcds)
           
 void traverseLocalVariableAccess(Java.LocalVariableAccess lva)
           
 void traverseLocalVariableDeclarationStatement(Java.LocalVariableDeclarationStatement lvds)
           
 void traverseLocated(Java.Located l)
           
 void traverseLvalue(Java.Lvalue lv)
           
 void traverseMarkerAnnotation(Java.MarkerAnnotation ma)
           
 void traverseMemberClassDeclaration(Java.MemberClassDeclaration mcd)
           
 void traverseMemberInterfaceDeclaration(Java.MemberInterfaceDeclaration mid)
           
 void traverseMethodDeclarator(Java.MethodDeclarator md)
           
 void traverseMethodInvocation(Java.MethodInvocation mi)
           
 void traverseNamedClassDeclaration(Java.NamedClassDeclaration ncd)
           
 void traverseNewAnonymousClassInstance(Java.NewAnonymousClassInstance naci)
           
 void traverseNewArray(Java.NewArray na)
           
 void traverseNewClassInstance(Java.NewClassInstance nci)
           
 void traverseNewInitializedArray(Java.NewInitializedArray nia)
           
 void traverseNormalAnnotation(Java.NormalAnnotation na)
           
 void traverseNullLiteral(Java.NullLiteral nl)
           
 void traversePackage(Java.Package p)
           
 void traversePackageMemberClassDeclaration(Java.PackageMemberClassDeclaration pmcd)
           
 void traversePackageMemberInterfaceDeclaration(Java.PackageMemberInterfaceDeclaration pmid)
           
 void traverseParameterAccess(Java.ParameterAccess pa)
           
 void traverseParenthesizedExpression(Java.ParenthesizedExpression pe)
           
 void traverseQualifiedThisReference(Java.QualifiedThisReference qtr)
           
 void traverseReferenceType(Java.ReferenceType rt)
           
 void traverseReturnStatement(Java.ReturnStatement rs)
           
 void traverseRvalue(Java.Rvalue rv)
           
 void traverseRvalueMemberType(Java.RvalueMemberType rmt)
           
 void traverseSimpleLiteral(Java.SimpleConstant sl)
           
 void traverseSimpleType(Java.SimpleType st)
           
 void traverseSingleElementAnnotation(Java.SingleElementAnnotation sea)
           
 void traverseSingleStaticImportDeclaration(Java.CompilationUnit.SingleStaticImportDeclaration stid)
           
 void traverseSingleTypeImportDeclaration(Java.CompilationUnit.SingleTypeImportDeclaration stid)
           
 void traverseStatement(Java.Statement s)
           
 void traverseStaticImportOnDemandDeclaration(Java.CompilationUnit.StaticImportOnDemandDeclaration siodd)
           
 void traverseStringLiteral(Java.StringLiteral sl)
           
 void traverseSuperclassFieldAccessExpression(Java.SuperclassFieldAccessExpression scfae)
           
 void traverseSuperclassMethodInvocation(Java.SuperclassMethodInvocation smi)
           
 void traverseSuperConstructorInvocation(Java.SuperConstructorInvocation sci)
           
 void traverseSwitchStatement(Java.SwitchStatement ss)
           
 void traverseSynchronizedStatement(Java.SynchronizedStatement ss)
           
 void traverseThisReference(Java.ThisReference tr)
           
 void traverseThrowStatement(Java.ThrowStatement ts)
           
 void traverseTryStatement(Java.TryStatement ts)
           
 void traverseType(Java.Type t)
           
 void traverseTypeImportOnDemandDeclaration(Java.CompilationUnit.TypeImportOnDemandDeclaration tiodd)
           
 void traverseUnaryOperation(Java.UnaryOperation uo)
           
 void traverseWhileStatement(Java.WhileStatement ws)
           
 
Methods inherited from class java.lang.
, , , , , , , , , ,
 

Constructor Detail

Traverser

public Traverser()
Method Detail

comprehensiveVisitor

public Visitor.ComprehensiveVisitor comprehensiveVisitor()
See Also:
Traverser

traverseCompilationUnit

public void traverseCompilationUnit(Java.CompilationUnit cu)
See Also:
Traverser

traverseSingleTypeImportDeclaration

public void traverseSingleTypeImportDeclaration(Java.CompilationUnit.SingleTypeImportDeclaration stid)
See Also:
Traverser

traverseTypeImportOnDemandDeclaration

public void traverseTypeImportOnDemandDeclaration(Java.CompilationUnit.TypeImportOnDemandDeclaration tiodd)
See Also:
Traverser

traverseSingleStaticImportDeclaration

public void traverseSingleStaticImportDeclaration(Java.CompilationUnit.SingleStaticImportDeclaration stid)
See Also:
Traverser

traverseStaticImportOnDemandDeclaration

public void traverseStaticImportOnDemandDeclaration(Java.CompilationUnit.StaticImportOnDemandDeclaration siodd)
See Also:
Traverser

traverseImportDeclaration

public void traverseImportDeclaration(Java.CompilationUnit.ImportDeclaration id)
See Also:
Traverser

traverseAnonymousClassDeclaration

public void traverseAnonymousClassDeclaration(Java.AnonymousClassDeclaration acd)
See Also:
Traverser

traverseLocalClassDeclaration

public void traverseLocalClassDeclaration(Java.LocalClassDeclaration lcd)
See Also:
Traverser

traversePackageMemberClassDeclaration

public void traversePackageMemberClassDeclaration(Java.PackageMemberClassDeclaration pmcd)
See Also:
Traverser

traverseMemberInterfaceDeclaration

public void traverseMemberInterfaceDeclaration(Java.MemberInterfaceDeclaration mid)
See Also:
Traverser

traversePackageMemberInterfaceDeclaration

public void traversePackageMemberInterfaceDeclaration(Java.PackageMemberInterfaceDeclaration pmid)
See Also:
Traverser

traverseMemberClassDeclaration

public void traverseMemberClassDeclaration(Java.MemberClassDeclaration mcd)
See Also:
Traverser

traverseConstructorDeclarator

public void traverseConstructorDeclarator(Java.ConstructorDeclarator cd)
See Also:
Traverser

traverseInitializer

public void traverseInitializer(Java.Initializer i)
See Also:
Traverser

traverseMethodDeclarator

public void traverseMethodDeclarator(Java.MethodDeclarator md)
See Also:
Traverser

traverseFieldDeclaration

public void traverseFieldDeclaration(Java.FieldDeclaration fd)
See Also:
Traverser

traverseLabeledStatement

public void traverseLabeledStatement(Java.LabeledStatement ls)
See Also:
Traverser

traverseBlock

public void traverseBlock(Java.Block b)
See Also:
Traverser

traverseExpressionStatement

public void traverseExpressionStatement(Java.ExpressionStatement es)
See Also:
Traverser

traverseIfStatement

public void traverseIfStatement(Java.IfStatement is)
See Also:
Traverser

traverseForStatement

public void traverseForStatement(Java.ForStatement fs)
See Also:
Traverser

traverseForEachStatement

public void traverseForEachStatement(Java.ForEachStatement fes)
See Also:
Traverser

traverseWhileStatement

public void traverseWhileStatement(Java.WhileStatement ws)
See Also:
Traverser

traverseTryStatement

public void traverseTryStatement(Java.TryStatement ts)
See Also:
Traverser

traverseSwitchStatement

public void traverseSwitchStatement(Java.SwitchStatement ss)
See Also:
Traverser

traverseSynchronizedStatement

public void traverseSynchronizedStatement(Java.SynchronizedStatement ss)
See Also:
Traverser

traverseDoStatement

public void traverseDoStatement(Java.DoStatement ds)
See Also:
Traverser

traverseLocalVariableDeclarationStatement

public void traverseLocalVariableDeclarationStatement(Java.LocalVariableDeclarationStatement lvds)
See Also:
Traverser

traverseReturnStatement

public void traverseReturnStatement(Java.ReturnStatement rs)
See Also:
Traverser

traverseThrowStatement

public void traverseThrowStatement(Java.ThrowStatement ts)
See Also:
Traverser

traverseBreakStatement

public void traverseBreakStatement(Java.BreakStatement bs)
See Also:
Traverser

traverseContinueStatement

public void traverseContinueStatement(Java.ContinueStatement cs)
See Also:
Traverser

traverseAssertStatement

public void traverseAssertStatement(Java.AssertStatement as)
See Also:
Traverser

traverseEmptyStatement

public void traverseEmptyStatement(Java.EmptyStatement es)
See Also:
Traverser

traverseLocalClassDeclarationStatement

public void traverseLocalClassDeclarationStatement(Java.LocalClassDeclarationStatement lcds)
See Also:
Traverser

traversePackage

public void traversePackage(Java.Package p)
See Also:
Traverser

traverseArrayLength

public void traverseArrayLength(Java.ArrayLength al)
See Also:
Traverser

traverseAssignment

public void traverseAssignment(Java.Assignment a)
See Also:
Traverser

traverseUnaryOperation

public void traverseUnaryOperation(Java.UnaryOperation uo)
See Also:
Traverser

traverseBinaryOperation

public void traverseBinaryOperation(Java.BinaryOperation bo)
See Also:
Traverser

traverseCast

public void traverseCast(Java.Cast c)
See Also:
Traverser

traverseClassLiteral

public void traverseClassLiteral(Java.ClassLiteral cl)
See Also:
Traverser

traverseConditionalExpression

public void traverseConditionalExpression(Java.ConditionalExpression ce)
See Also:
Traverser

traverseCrement

public void traverseCrement(Java.Crement c)
See Also:
Traverser

traverseInstanceof

public void traverseInstanceof(Java.Instanceof io)
See Also:
Traverser

traverseMethodInvocation

public void traverseMethodInvocation(Java.MethodInvocation mi)
See Also:
Traverser

traverseSuperclassMethodInvocation

public void traverseSuperclassMethodInvocation(Java.SuperclassMethodInvocation smi)
See Also:
Traverser

traverseLiteral

public void traverseLiteral(Java.Literal l)
See Also:
Traverser

traverseIntegerLiteral

public void traverseIntegerLiteral(Java.IntegerLiteral il)
See Also:
Traverser

traverseFloatingPointLiteral

public void traverseFloatingPointLiteral(Java.FloatingPointLiteral fpl)
See Also:
Traverser

traverseBooleanLiteral

public void traverseBooleanLiteral(Java.BooleanLiteral bl)
See Also:
Traverser

traverseCharacterLiteral

public void traverseCharacterLiteral(Java.CharacterLiteral cl)
See Also:
Traverser

traverseStringLiteral

public void traverseStringLiteral(Java.StringLiteral sl)
See Also:
Traverser

traverseNullLiteral

public void traverseNullLiteral(Java.NullLiteral nl)
See Also:
Traverser

traverseSimpleLiteral

public void traverseSimpleLiteral(Java.SimpleConstant sl)
See Also:
Traverser

traverseNewAnonymousClassInstance

public void traverseNewAnonymousClassInstance(Java.NewAnonymousClassInstance naci)
See Also:
Traverser

traverseNewArray

public void traverseNewArray(Java.NewArray na)
See Also:
Traverser

traverseNewInitializedArray

public void traverseNewInitializedArray(Java.NewInitializedArray nia)
See Also:
Traverser

traverseArrayInitializerOrRvalue

public void traverseArrayInitializerOrRvalue(Java.ArrayInitializerOrRvalue aiorv)
See Also:
Traverser

traverseNewClassInstance

public void traverseNewClassInstance(Java.NewClassInstance nci)
See Also:
Traverser

traverseParameterAccess

public void traverseParameterAccess(Java.ParameterAccess pa)
See Also:
Traverser

traverseQualifiedThisReference

public void traverseQualifiedThisReference(Java.QualifiedThisReference qtr)
See Also:
Traverser

traverseThisReference

public void traverseThisReference(Java.ThisReference tr)
See Also:
Traverser

traverseArrayType

public void traverseArrayType(Java.ArrayType at)
See Also:
Traverser

traverseBasicType

public void traverseBasicType(Java.BasicType bt)
See Also:
Traverser

traverseReferenceType

public void traverseReferenceType(Java.ReferenceType rt)
See Also:
Traverser

traverseRvalueMemberType

public void traverseRvalueMemberType(Java.RvalueMemberType rmt)
See Also:
Traverser

traverseSimpleType

public void traverseSimpleType(Java.SimpleType st)
See Also:
Traverser

traverseAlternateConstructorInvocation

public void traverseAlternateConstructorInvocation(Java.AlternateConstructorInvocation aci)
See Also:
Traverser

traverseSuperConstructorInvocation

public void traverseSuperConstructorInvocation(Java.SuperConstructorInvocation sci)
See Also:
Traverser

traverseAmbiguousName

public void traverseAmbiguousName(Java.AmbiguousName an)
See Also:
Traverser

traverseArrayAccessExpression

public void traverseArrayAccessExpression(Java.ArrayAccessExpression aae)
See Also:
Traverser

traverseFieldAccess

public void traverseFieldAccess(Java.FieldAccess fa)
See Also:
Traverser

traverseFieldAccessExpression

public void traverseFieldAccessExpression(Java.FieldAccessExpression fae)
See Also:
Traverser

traverseSuperclassFieldAccessExpression

public void traverseSuperclassFieldAccessExpression(Java.SuperclassFieldAccessExpression scfae)
See Also:
Traverser

traverseLocalVariableAccess

public void traverseLocalVariableAccess(Java.LocalVariableAccess lva)
See Also:
Traverser

traverseParenthesizedExpression

public void traverseParenthesizedExpression(Java.ParenthesizedExpression pe)
See Also:
Traverser

traverseElementValueArrayInitializer

public void traverseElementValueArrayInitializer(Java.ElementValueArrayInitializer evai)
See Also:
Traverser

traverseElementValue

public void traverseElementValue(Java.ElementValue ev)
See Also:
Traverser

traverseSingleElementAnnotation

public void traverseSingleElementAnnotation(Java.SingleElementAnnotation sea)
See Also:
Traverser

traverseAnnotation

public void traverseAnnotation(Java.Annotation a)
See Also:
Traverser

traverseNormalAnnotation

public void traverseNormalAnnotation(Java.NormalAnnotation na)
See Also:
Traverser

traverseMarkerAnnotation

public void traverseMarkerAnnotation(Java.MarkerAnnotation ma)
See Also:
Traverser

traverseClassDeclaration

public void traverseClassDeclaration(Java.ClassDeclaration cd)
See Also:
Traverser

traverseAbstractTypeDeclaration

public void traverseAbstractTypeDeclaration(Java.AbstractTypeDeclaration atd)
See Also:
Traverser

traverseNamedClassDeclaration

public void traverseNamedClassDeclaration(Java.NamedClassDeclaration ncd)
See Also:
Traverser

traverseInterfaceDeclaration

public void traverseInterfaceDeclaration(Java.InterfaceDeclaration id)
See Also:
Traverser

traverseFunctionDeclarator

public void traverseFunctionDeclarator(Java.FunctionDeclarator fd)
See Also:
Traverser

traverseFormalParameters

public void traverseFormalParameters(Java.FunctionDeclarator.FormalParameters formalParameters)
See Also:
Traverser

traverseFormalParameter

public void traverseFormalParameter(Java.FunctionDeclarator.FormalParameter formalParameter)
See Also:
Traverser

traverseAbstractTypeBodyDeclaration

public void traverseAbstractTypeBodyDeclaration(Java.AbstractTypeBodyDeclaration atbd)
See Also:
Traverser

traverseStatement

public void traverseStatement(Java.Statement s)
See Also:
Traverser

traverseBreakableStatement

public void traverseBreakableStatement(Java.BreakableStatement bs)
See Also:
Traverser

traverseContinuableStatement

public void traverseContinuableStatement(Java.ContinuableStatement cs)
See Also:
Traverser

traverseRvalue

public void traverseRvalue(Java.Rvalue rv)
See Also:
Traverser

traverseBooleanRvalue

public void traverseBooleanRvalue(Java.BooleanRvalue brv)
See Also:
Traverser

traverseInvocation

public void traverseInvocation(Java.Invocation i)
See Also:
Traverser

traverseConstructorInvocation

public void traverseConstructorInvocation(Java.ConstructorInvocation ci)
See Also:
Traverser

traverseLvalue

public void traverseLvalue(Java.Lvalue lv)
See Also:
Traverser

traverseType

public void traverseType(Java.Type t)
See Also:
Traverser

traverseAtom

public void traverseAtom(Java.Atom a)
See Also:
Traverser

traverseLocated

public void traverseLocated(Java.Located l)
See Also:
Traverser

janino.net