Package org.codehaus.janino.samples
Class DeclarationCounter
java.lang.Object
org.codehaus.janino.util.AbstractTraverser<RuntimeException>
org.codehaus.janino.samples.DeclarationCounter
- All Implemented Interfaces:
Traverser<RuntimeException>
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
void
void
void
Methods inherited from class org.codehaus.janino.util.AbstractTraverser
traverseAbstractCompilationUnit, traverseAbstractTypeBodyDeclaration, traverseAbstractTypeDeclaration, traverseAlternateConstructorInvocation, traverseAmbiguousName, traverseAnnotation, traverseAnonymousClassDeclaration, traverseArrayAccessExpression, traverseArrayCreationReference, traverseArrayInitializerOrRvalue, traverseArrayLength, traverseArrayType, traverseAssertStatement, traverseAssignment, traverseAtom, traverseBinaryOperation, traverseBlock, traverseBooleanLiteral, traverseBooleanRvalue, traverseBreakableStatement, traverseBreakStatement, traverseCast, traverseCharacterLiteral, traverseClassInstanceCreationReference, traverseClassLiteral, traverseCompilationUnit, traverseConditionalExpression, traverseConstructorDeclarator, traverseConstructorInvocation, traverseContinuableStatement, traverseContinueStatement, traverseCrement, traverseDoStatement, traverseElementValue, traverseElementValueArrayInitializer, traverseEmptyStatement, traverseEnumConstant, traverseExpressionStatement, traverseFieldAccess, traverseFieldAccessExpression, traverseFloatingPointLiteral, traverseForEachStatement, traverseFormalParameter, traverseFormalParameters, traverseForStatement, traverseFunctionDeclarator, traverseIfStatement, traverseImportDeclaration, traverseInitializer, traverseInstanceof, traverseIntegerLiteral, traverseInvocation, traverseLabeledStatement, traverseLambdaExpression, traverseLiteral, traverseLocalClassDeclaration, traverseLocalClassDeclarationStatement, traverseLocalVariableAccess, traverseLocalVariableDeclaratorResource, traverseLocated, traverseLvalue, traverseMarkerAnnotation, traverseMemberAnnotationTypeDeclaration, traverseMemberClassDeclaration, traverseMemberEnumDeclaration, traverseMemberInterfaceDeclaration, traverseMethodDeclarator, traverseMethodInvocation, traverseMethodReference, traverseModularCompilationUnit, traverseNamedClassDeclaration, traverseNewAnonymousClassInstance, traverseNewArray, traverseNewClassInstance, traverseNewInitializedArray, traverseNormalAnnotation, traverseNullLiteral, traversePackage, traversePackageMemberAnnotationTypeDeclaration, traversePackageMemberClassDeclaration, traversePackageMemberEnumDeclaration, traversePackageMemberInterfaceDeclaration, traverseParameterAccess, traverseParenthesizedExpression, traversePrimitiveType, traverseQualifiedThisReference, traverseReferenceType, traverseReturnStatement, traverseRvalue, traverseRvalueMemberType, traverseSimpleLiteral, traverseSimpleType, traverseSingleElementAnnotation, traverseSingleStaticImportDeclaration, traverseSingleTypeImportDeclaration, traverseStatement, traverseStaticImportOnDemandDeclaration, traverseStringLiteral, traverseSuperclassFieldAccessExpression, traverseSuperclassMethodInvocation, traverseSuperConstructorInvocation, traverseSwitchStatement, traverseSynchronizedStatement, traverseTextBlock, traverseThisReference, traverseThrowStatement, traverseTryStatement, traverseType, traverseTypeImportOnDemandDeclaration, traverseUnaryOperation, traverseVariableAccessResource, traverseWhileStatement, visitAbstractCompilationUnit, visitAnnotation, visitAtom, visitBlockStatement, visitElementValue, visitImportDeclaration, visitTypeBodyDeclaration, visitTypeDeclaration
-
Constructor Details
-
DeclarationCounter
public DeclarationCounter()
-
-
Method Details
-
main
- Throws:
CompileException
IOException
-
traverseClassDeclaration
- Specified by:
traverseClassDeclaration
in interfaceTraverser<RuntimeException>
- Overrides:
traverseClassDeclaration
in classAbstractTraverser<RuntimeException>
-
traverseInterfaceDeclaration
- Specified by:
traverseInterfaceDeclaration
in interfaceTraverser<RuntimeException>
- Overrides:
traverseInterfaceDeclaration
in classAbstractTraverser<RuntimeException>
-
traverseFieldDeclaration
- Specified by:
traverseFieldDeclaration
in interfaceTraverser<RuntimeException>
- Overrides:
traverseFieldDeclaration
in classAbstractTraverser<RuntimeException>
-
traverseLocalVariableDeclarationStatement
- Specified by:
traverseLocalVariableDeclarationStatement
in interfaceTraverser<RuntimeException>
- Overrides:
traverseLocalVariableDeclarationStatement
in classAbstractTraverser<RuntimeException>
-