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 voidvoidvoidvoidvoidMethods 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:
CompileExceptionIOException
-
traverseClassDeclaration
- Specified by:
traverseClassDeclarationin interfaceTraverser<RuntimeException>- Overrides:
traverseClassDeclarationin classAbstractTraverser<RuntimeException>
-
traverseInterfaceDeclaration
- Specified by:
traverseInterfaceDeclarationin interfaceTraverser<RuntimeException>- Overrides:
traverseInterfaceDeclarationin classAbstractTraverser<RuntimeException>
-
traverseFieldDeclaration
- Specified by:
traverseFieldDeclarationin interfaceTraverser<RuntimeException>- Overrides:
traverseFieldDeclarationin classAbstractTraverser<RuntimeException>
-
traverseLocalVariableDeclarationStatement
- Specified by:
traverseLocalVariableDeclarationStatementin interfaceTraverser<RuntimeException>- Overrides:
traverseLocalVariableDeclarationStatementin classAbstractTraverser<RuntimeException>
-