janino.net

org.codehaus.janino.samples
Class DeclarationCounter

  extended by org.codehaus.janino.util.Traverser
      extended by org.codehaus.janino.samples.DeclarationCounter

public class DeclarationCounter
extends Traverser

An example application for the Traverser: Reads, scans and parses the files named on the command line and counts several kinds of declarations.


Constructor Summary
DeclarationCounter()
           
 
Method Summary
static void main([] args)
           
 void traverseClassDeclaration(Java.ClassDeclaration cd)
           
 void traverseFieldDeclaration(Java.FieldDeclaration fd)
           
 void traverseInterfaceDeclaration(Java.InterfaceDeclaration id)
           
 void traverseLocalVariableDeclarationStatement(Java.LocalVariableDeclarationStatement lvds)
           
 
Methods inherited from class org.codehaus.janino.util.Traverser
comprehensiveVisitor, traverseAbstractTypeBodyDeclaration, traverseAbstractTypeDeclaration, traverseAlternateConstructorInvocation, traverseAmbiguousName, traverseAnnotation, traverseAnonymousClassDeclaration, traverseArrayAccessExpression, traverseArrayInitializerOrRvalue, traverseArrayLength, traverseArrayType, traverseAssertStatement, traverseAssignment, traverseAtom, traverseBasicType, traverseBinaryOperation, traverseBlock, traverseBooleanLiteral, traverseBooleanRvalue, traverseBreakableStatement, traverseBreakStatement, traverseCast, traverseCharacterLiteral, traverseClassLiteral, traverseCompilationUnit, traverseConditionalExpression, traverseConstructorDeclarator, traverseConstructorInvocation, traverseContinuableStatement, traverseContinueStatement, traverseCrement, traverseDoStatement, traverseElementValue, traverseElementValueArrayInitializer, traverseEmptyStatement, traverseExpressionStatement, traverseFieldAccess, traverseFieldAccessExpression, traverseFloatingPointLiteral, traverseForEachStatement, traverseFormalParameter, traverseFormalParameters, traverseForStatement, traverseFunctionDeclarator, traverseIfStatement, traverseImportDeclaration, traverseInitializer, traverseInstanceof, traverseIntegerLiteral, traverseInvocation, traverseLabeledStatement, traverseLiteral, traverseLocalClassDeclaration, traverseLocalClassDeclarationStatement, traverseLocalVariableAccess, traverseLocated, traverseLvalue, traverseMarkerAnnotation, traverseMemberClassDeclaration, traverseMemberInterfaceDeclaration, traverseMethodDeclarator, traverseMethodInvocation, traverseNamedClassDeclaration, traverseNewAnonymousClassInstance, traverseNewArray, traverseNewClassInstance, traverseNewInitializedArray, traverseNormalAnnotation, traverseNullLiteral, traversePackage, traversePackageMemberClassDeclaration, traversePackageMemberInterfaceDeclaration, traverseParameterAccess, traverseParenthesizedExpression, traverseQualifiedThisReference, traverseReferenceType, traverseReturnStatement, traverseRvalue, traverseRvalueMemberType, traverseSimpleLiteral, traverseSimpleType, traverseSingleElementAnnotation, traverseSingleStaticImportDeclaration, traverseSingleTypeImportDeclaration, traverseStatement, traverseStaticImportOnDemandDeclaration, traverseStringLiteral, traverseSuperclassFieldAccessExpression, traverseSuperclassMethodInvocation, traverseSuperConstructorInvocation, traverseSwitchStatement, traverseSynchronizedStatement, traverseThisReference, traverseThrowStatement, traverseTryStatement, traverseType, traverseTypeImportOnDemandDeclaration, traverseUnaryOperation, traverseWhileStatement
 
Methods inherited from class java.lang.
, , , , , , , , , ,
 

Constructor Detail

DeclarationCounter

public DeclarationCounter()
Method Detail

main

public static void main([] args)
                 throws CompileException,
                        
Throws:
CompileException

traverseClassDeclaration

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

traverseInterfaceDeclaration

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

traverseFieldDeclaration

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

traverseLocalVariableDeclarationStatement

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

janino.net