Package org.codehaus.janino
Class UnparseVisitor
java.lang.Object
org.codehaus.janino.UnparseVisitor
- All Implemented Interfaces:
Visitor.AnnotationVisitor,Visitor.AtomVisitor,Visitor.BlockStatementVisitor,Visitor.ComprehensiveVisitor,Visitor.ElementValueArrayInitializerVisitor,Visitor.ElementValueVisitor,Visitor.ImportVisitor,Visitor.LvalueVisitor,Visitor.RvalueVisitor,Visitor.TypeBodyDeclarationVisitor,Visitor.TypeDeclarationVisitor,Visitor.TypeVisitor
A visitor that unparses (un-compiles) an AST to a
Writer. See
main(String[]) for a usage example.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Flushes all generated code.static voidTesting of parsing/unparsing.static voidunparse(Java.CompilationUnit cu, Writer w) Unparse the givenJava.CompilationUnitto the givenWriter.voidvoidvoidvoidvoidvoidE.g.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidE.g.voidvoidvoidvoidvoidvoidvoidvoidvoidE.g.voidvoidvoidvoidE.g.voidvoidvoidvoidE.g.voidvoidvoidvoidvoidE.g.voidE.g.voidE.g.voidvoidvoidvoidvoidvoidvoidvoidvoidE.g.voidE.g.voidvoidvoidvoidvoidvoidvoidvoidvoidE.g.voidE.g.voidE.g.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidE.g.voidvoid
-
Constructor Details
-
UnparseVisitor
-
-
Method Details
-
main
Testing of parsing/unparsing.Reads compilation units from the files named on the command line and unparses them to
System.out.- Throws:
Exception
-
unparse
Unparse the givenJava.CompilationUnitto the givenWriter. -
close
public void close()Flushes all generated code. -
unparseCompilationUnit
-
visitSingleTypeImportDeclaration
Description copied from interface:Visitor.ImportVisitorE.g. 'import pkg.Type'.- Specified by:
visitSingleTypeImportDeclarationin interfaceVisitor.ImportVisitor
-
visitTypeImportOnDemandDeclaration
public void visitTypeImportOnDemandDeclaration(Java.CompilationUnit.TypeImportOnDemandDeclaration tiodd) Description copied from interface:Visitor.ImportVisitorE.g. 'import pkg.*'.- Specified by:
visitTypeImportOnDemandDeclarationin interfaceVisitor.ImportVisitor
-
visitSingleStaticImportDeclaration
public void visitSingleStaticImportDeclaration(Java.CompilationUnit.SingleStaticImportDeclaration ssid) Description copied from interface:Visitor.ImportVisitorE.g. 'import static pkg.Type.member'.- Specified by:
visitSingleStaticImportDeclarationin interfaceVisitor.ImportVisitor
-
visitStaticImportOnDemandDeclaration
public void visitStaticImportOnDemandDeclaration(Java.CompilationUnit.StaticImportOnDemandDeclaration siodd) Description copied from interface:Visitor.ImportVisitorE.g. 'import static pkg.Type.*'.- Specified by:
visitStaticImportOnDemandDeclarationin interfaceVisitor.ImportVisitor
-
visitLocalClassDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitorE.g. 'class LocalClass { ... }'.- Specified by:
visitLocalClassDeclarationin interfaceVisitor.TypeDeclarationVisitor
-
visitMemberClassDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitorE.g. 'public class TopLevelClass { public class MemberClass { ... } }'.- Specified by:
visitMemberClassDeclarationin interfaceVisitor.TypeBodyDeclarationVisitor- Specified by:
visitMemberClassDeclarationin interfaceVisitor.TypeDeclarationVisitor
-
visitMemberInterfaceDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitorE.g. 'public class TopLevelClass { public interface MemberInterface { ... } }'.- Specified by:
visitMemberInterfaceDeclarationin interfaceVisitor.TypeBodyDeclarationVisitor- Specified by:
visitMemberInterfaceDeclarationin interfaceVisitor.TypeDeclarationVisitor
-
visitPackageMemberClassDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitorE.g. 'public class TopLevelClass { ... }'.- Specified by:
visitPackageMemberClassDeclarationin interfaceVisitor.TypeDeclarationVisitor
-
visitPackageMemberInterfaceDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitorE.g. 'public TopLevelInterface { ... }'.- Specified by:
visitPackageMemberInterfaceDeclarationin interfaceVisitor.TypeDeclarationVisitor
-
visitConstructorDeclarator
Description copied from interface:Visitor.TypeBodyDeclarationVisitorE.g. 'public MyClass(...) { ... }'.- Specified by:
visitConstructorDeclaratorin interfaceVisitor.TypeBodyDeclarationVisitor
-
visitMethodDeclarator
Description copied from interface:Visitor.TypeBodyDeclarationVisitorE.g. 'public void meth(...) { ... }'.- Specified by:
visitMethodDeclaratorin interfaceVisitor.TypeBodyDeclarationVisitor
-
visitFieldDeclaration
Description copied from interface:Visitor.TypeBodyDeclarationVisitorE.g. 'public int field;'.- Specified by:
visitFieldDeclarationin interfaceVisitor.BlockStatementVisitor- Specified by:
visitFieldDeclarationin interfaceVisitor.TypeBodyDeclarationVisitor
-
visitInitializer
Description copied from interface:Visitor.TypeBodyDeclarationVisitorE.g. 'public class MyClass { static { ... } }'.- Specified by:
visitInitializerin interfaceVisitor.BlockStatementVisitor- Specified by:
visitInitializerin interfaceVisitor.TypeBodyDeclarationVisitor
-
visitBlock
- Specified by:
visitBlockin interfaceVisitor.BlockStatementVisitor
-
visitBreakStatement
- Specified by:
visitBreakStatementin interfaceVisitor.BlockStatementVisitor
-
visitContinueStatement
- Specified by:
visitContinueStatementin interfaceVisitor.BlockStatementVisitor
-
visitAssertStatement
- Specified by:
visitAssertStatementin interfaceVisitor.BlockStatementVisitor
-
visitDoStatement
- Specified by:
visitDoStatementin interfaceVisitor.BlockStatementVisitor
-
visitEmptyStatement
- Specified by:
visitEmptyStatementin interfaceVisitor.BlockStatementVisitor
-
visitExpressionStatement
- Specified by:
visitExpressionStatementin interfaceVisitor.BlockStatementVisitor
-
visitForStatement
- Specified by:
visitForStatementin interfaceVisitor.BlockStatementVisitor
-
visitIfStatement
- Specified by:
visitIfStatementin interfaceVisitor.BlockStatementVisitor
-
visitLabeledStatement
- Specified by:
visitLabeledStatementin interfaceVisitor.BlockStatementVisitor
-
visitLocalClassDeclarationStatement
- Specified by:
visitLocalClassDeclarationStatementin interfaceVisitor.BlockStatementVisitor
-
visitLocalVariableDeclarationStatement
- Specified by:
visitLocalVariableDeclarationStatementin interfaceVisitor.BlockStatementVisitor
-
visitReturnStatement
- Specified by:
visitReturnStatementin interfaceVisitor.BlockStatementVisitor
-
visitSwitchStatement
- Specified by:
visitSwitchStatementin interfaceVisitor.BlockStatementVisitor
-
visitSynchronizedStatement
- Specified by:
visitSynchronizedStatementin interfaceVisitor.BlockStatementVisitor
-
visitThrowStatement
- Specified by:
visitThrowStatementin interfaceVisitor.BlockStatementVisitor
-
visitTryStatement
- Specified by:
visitTryStatementin interfaceVisitor.BlockStatementVisitor
-
visitWhileStatement
- Specified by:
visitWhileStatementin interfaceVisitor.BlockStatementVisitor
-
unparseVariableDeclarator
-
unparseFormalParameter
-
visitMethodInvocation
- Specified by:
visitMethodInvocationin interfaceVisitor.RvalueVisitor
-
visitAlternateConstructorInvocation
- Specified by:
visitAlternateConstructorInvocationin interfaceVisitor.BlockStatementVisitor
-
visitSuperConstructorInvocation
- Specified by:
visitSuperConstructorInvocationin interfaceVisitor.BlockStatementVisitor
-
visitNewClassInstance
- Specified by:
visitNewClassInstancein interfaceVisitor.RvalueVisitor
-
visitAssignment
- Specified by:
visitAssignmentin interfaceVisitor.RvalueVisitor
-
visitAmbiguousName
- Specified by:
visitAmbiguousNamein interfaceVisitor.LvalueVisitor
-
visitArrayAccessExpression
- Specified by:
visitArrayAccessExpressionin interfaceVisitor.LvalueVisitor
-
visitArrayLength
- Specified by:
visitArrayLengthin interfaceVisitor.RvalueVisitor
-
visitArrayType
- Specified by:
visitArrayTypein interfaceVisitor.TypeVisitor
-
visitBasicType
- Specified by:
visitBasicTypein interfaceVisitor.TypeVisitor
-
visitBinaryOperation
- Specified by:
visitBinaryOperationin interfaceVisitor.RvalueVisitor
-
visitCast
- Specified by:
visitCastin interfaceVisitor.RvalueVisitor
-
visitClassLiteral
- Specified by:
visitClassLiteralin interfaceVisitor.RvalueVisitor
-
visitConditionalExpression
- Specified by:
visitConditionalExpressionin interfaceVisitor.RvalueVisitor
-
visitCrement
- Specified by:
visitCrementin interfaceVisitor.RvalueVisitor
-
visitFieldAccess
- Specified by:
visitFieldAccessin interfaceVisitor.LvalueVisitor
-
visitFieldAccessExpression
- Specified by:
visitFieldAccessExpressionin interfaceVisitor.LvalueVisitor
-
visitSuperclassFieldAccessExpression
- Specified by:
visitSuperclassFieldAccessExpressionin interfaceVisitor.LvalueVisitor
-
visitInstanceof
- Specified by:
visitInstanceofin interfaceVisitor.RvalueVisitor
-
visitIntegerLiteral
- Specified by:
visitIntegerLiteralin interfaceVisitor.RvalueVisitor
-
visitFloatingPointLiteral
- Specified by:
visitFloatingPointLiteralin interfaceVisitor.RvalueVisitor
-
visitBooleanLiteral
- Specified by:
visitBooleanLiteralin interfaceVisitor.RvalueVisitor
-
visitCharacterLiteral
- Specified by:
visitCharacterLiteralin interfaceVisitor.RvalueVisitor
-
visitStringLiteral
- Specified by:
visitStringLiteralin interfaceVisitor.RvalueVisitor
-
visitNullLiteral
- Specified by:
visitNullLiteralin interfaceVisitor.RvalueVisitor
-
visitLocalVariableAccess
- Specified by:
visitLocalVariableAccessin interfaceVisitor.LvalueVisitor
-
visitNewArray
- Specified by:
visitNewArrayin interfaceVisitor.RvalueVisitor
-
visitNewInitializedArray
- Specified by:
visitNewInitializedArrayin interfaceVisitor.RvalueVisitor
-
visitPackage
- Specified by:
visitPackagein interfaceVisitor.AtomVisitor
-
visitParameterAccess
- Specified by:
visitParameterAccessin interfaceVisitor.RvalueVisitor
-
visitQualifiedThisReference
- Specified by:
visitQualifiedThisReferencein interfaceVisitor.RvalueVisitor
-
visitReferenceType
- Specified by:
visitReferenceTypein interfaceVisitor.TypeVisitor
-
visitRvalueMemberType
- Specified by:
visitRvalueMemberTypein interfaceVisitor.TypeVisitor
-
visitSimpleType
- Specified by:
visitSimpleTypein interfaceVisitor.TypeVisitor
-
visitSuperclassMethodInvocation
- Specified by:
visitSuperclassMethodInvocationin interfaceVisitor.RvalueVisitor
-
visitThisReference
- Specified by:
visitThisReferencein interfaceVisitor.RvalueVisitor
-
visitUnaryOperation
- Specified by:
visitUnaryOperationin interfaceVisitor.RvalueVisitor
-
visitParenthesizedExpression
- Specified by:
visitParenthesizedExpressionin interfaceVisitor.LvalueVisitor
-
visitAnonymousClassDeclaration
Description copied from interface:Visitor.TypeDeclarationVisitorE.g. 'new Superclass() { ... }'.- Specified by:
visitAnonymousClassDeclarationin interfaceVisitor.TypeDeclarationVisitor
-
visitNewAnonymousClassInstance
- Specified by:
visitNewAnonymousClassInstancein interfaceVisitor.RvalueVisitor
-
visitMarkerAnnotation
- Specified by:
visitMarkerAnnotationin interfaceVisitor.AnnotationVisitor
-
visitNormalAnnotation
- Specified by:
visitNormalAnnotationin interfaceVisitor.AnnotationVisitor
-
visitSingleElementAnnotation
- Specified by:
visitSingleElementAnnotationin interfaceVisitor.AnnotationVisitor
-
visitElementValueArrayInitializer
- Specified by:
visitElementValueArrayInitializerin interfaceVisitor.ElementValueArrayInitializerVisitor
-