Package: groovy.inspect.swingui

## [Groovy] Class AstNodeToScriptVisitor

- groovy.inspect.swingui.AstNodeToScriptVisitor

- All Implemented Interfaces and Traits:
    GroovyClassVisitor, GroovyCodeVisitor

      class AstNodeToScriptVisitor
      extends PrimaryClassNodeOperation

  An adapter from ASTNode tree to source code.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `String` | `_indent`
    `Stack<String>` | `classNameStack`
    `boolean` | `readyToIndent`
    `boolean` | `scriptHasBeenVisited`
    `boolean` | `showScriptClass`
    `boolean` | `showScriptFreeForm`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `AstNodeToScriptVisitor (Writer writer, boolean showScriptFreeForm = true, boolean showScriptClass = true)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `call(org.codehaus.groovy.control.SourceUnit source, GeneratorContext context, ClassNode classNode)`
    `` | `def` | `indented(Closure block)`
    `` | `void` | `print(def parameter)`
    `` | `def` | `printDoubleBreak()`
    `` | `def` | `printLineBreak()`
    `` | `def` | `println(def parameter)`
    `` | `void` | `visitAnnotationNode(AnnotationNode node)`
    `` | `void` | `visitArgumentlistExpression(ArgumentListExpression expression, boolean showTypes = false)`
    `` | `void` | `visitArrayExpression(ArrayExpression expression)`
    `` | `void` | `visitAssertStatement(AssertStatement statement)`
    `` | `void` | `visitAttributeExpression(AttributeExpression attributeExpression)`
    `` | `void` | `visitBinaryExpression(BinaryExpression expression)`
    `` | `void` | `visitBitwiseNegationExpression(BitwiseNegationExpression expression)`
    `` | `void` | `visitBlockStatement(BlockStatement block)`
    `` | `void` | `visitBooleanExpression(BooleanExpression expression)`
    `` | `void` | `visitBreakStatement(BreakStatement statement)`
    `` | `void` | `visitBytecodeExpression(BytecodeExpression expression)`
    `` | `void` | `visitCaseStatement(CaseStatement statement)`
    `` | `void` | `visitCastExpression(CastExpression expression)`
    `` | `void` | `visitCatchStatement(CatchStatement statement)`
    `` | `void` | `visitClass(ClassNode node)`
    `` | `void` | `visitClassExpression(ClassExpression expression)`
    `` | `void` | `visitClosureExpression(ClosureExpression expression)`
    `` | `void` | `visitClosureListExpression(ClosureListExpression expression)`
    `` | `void` | `visitConstantExpression(ConstantExpression expression, boolean unwrapQuotes = false)`
    `` | `void` | `visitConstructor(ConstructorNode node)`
    `` | `void` | `visitConstructorCallExpression(ConstructorCallExpression expression)`
    `` | `void` | `visitContinueStatement(ContinueStatement statement)`
    `` | `void` | `visitDeclarationExpression(DeclarationExpression expression)`
    `` | `void` | `visitDoWhileLoop(DoWhileStatement statement)`
    `` | `void` | `visitExpressionStatement(ExpressionStatement statement)`
    `` | `void` | `visitField(FieldNode node)`
    `` | `void` | `visitFieldExpression(FieldExpression expression)`
    `` | `void` | `visitForLoop(ForStatement statement)`
    `` | `void` | `visitGStringExpression(GStringExpression expression)`
    `` | `void` | `visitIfElse(IfStatement ifElse)`
    `` | `void` | `visitImport(ImportNode node)`
    `` | `void` | `visitListExpression(ListExpression expression)`
    `` | `void` | `visitMapEntryExpression(MapEntryExpression expression)`
    `` | `void` | `visitMapExpression(MapExpression expression)`
    `` | `void` | `visitMethod(MethodNode node)`
    `` | `void` | `visitMethodCallExpression(MethodCallExpression expression)`
    `` | `void` | `visitMethodPointerExpression(MethodPointerExpression expression)`
    `` | `void` | `visitNotExpression(NotExpression expression)`
    `` | `void` | `visitPackage(PackageNode packageNode)`
    `` | `void` | `visitPostfixExpression(PostfixExpression expression)`
    `` | `void` | `visitPrefixExpression(PrefixExpression expression)`
    `` | `void` | `visitProperty(PropertyNode node)`
    `` | `void` | `visitPropertyExpression(PropertyExpression expression)`
    `` | `void` | `visitRangeExpression(RangeExpression expression)`
    `` | `void` | `visitReturnStatement(ReturnStatement statement)`
    `` | `void` | `visitShortTernaryExpression(ElvisOperatorExpression expression)`
    `` | `void` | `visitSpreadExpression(SpreadExpression expression)`
    `` | `void` | `visitSpreadMapExpression(SpreadMapExpression expression)`
    `` | `void` | `visitStaticMethodCallExpression(StaticMethodCallExpression expression)`
    `` | `void` | `visitSwitch(SwitchStatement statement)`
    `` | `void` | `visitSynchronizedStatement(SynchronizedStatement statement)`
    `` | `void` | `visitTernaryExpression(TernaryExpression expression)`
    `` | `void` | `visitThrowStatement(ThrowStatement statement)`
    `` | `void` | `visitTryCatchFinally(TryCatchStatement statement)`
    `` | `void` | `visitTupleExpression(TupleExpression expression)`
    `` | `void` | `visitType(ClassNode classNode)` Prints out the type, safely handling arrays.
    `` | `void` | `visitUnaryMinusExpression(UnaryMinusExpression expression)`
    `` | `void` | `visitUnaryPlusExpression(UnaryPlusExpression expression)`
    `` | `void` | `visitVariableExpression(VariableExpression expression, boolean spacePad = true)`
    `` | `void` | `visitWhileLoop(WhileStatement statement)`

- - ### Property Detail

    - #### String _indent

    - #### Stack<String> classNameStack

    - #### boolean readyToIndent

    - #### boolean scriptHasBeenVisited

    - #### boolean showScriptClass

    - #### boolean showScriptFreeForm

  - ### Constructor Detail

    - #### AstNodeToScriptVisitor(Writer writer, boolean showScriptFreeForm = true, boolean showScriptClass = true)

  - ### Method Detail

    - #### void call(org.codehaus.groovy.control.SourceUnit source, GeneratorContext context, ClassNode classNode)

    - #### def indented(Closure block)

    - #### void print(def parameter)

    - #### def printDoubleBreak()

    - #### def printLineBreak()

    - #### def println(def parameter)

    - #### void visitAnnotationNode(AnnotationNode node)

    - #### void visitArgumentlistExpression(ArgumentListExpression expression, boolean showTypes = false)

    - #### @Override void visitArrayExpression(ArrayExpression expression)

    - #### @Override void visitAssertStatement(AssertStatement statement)

    - #### @Override void visitAttributeExpression(AttributeExpression attributeExpression)

    - #### @Override void visitBinaryExpression(BinaryExpression expression)

    - #### @Override void visitBitwiseNegationExpression(BitwiseNegationExpression expression)

    - #### @Override void visitBlockStatement(BlockStatement block)

    - #### @Override void visitBooleanExpression(BooleanExpression expression)

    - #### @Override void visitBreakStatement(BreakStatement statement)

    - #### @Override void visitBytecodeExpression(BytecodeExpression expression)

    - #### @Override void visitCaseStatement(CaseStatement statement)

    - #### @Override void visitCastExpression(CastExpression expression)

    - #### @Override void visitCatchStatement(CatchStatement statement)

    - #### @Override void visitClass(ClassNode node)

    - #### @Override void visitClassExpression(ClassExpression expression)

    - #### @Override void visitClosureExpression(ClosureExpression expression)

    - #### @Override void visitClosureListExpression(ClosureListExpression expression)

    - #### void visitConstantExpression(ConstantExpression expression, boolean unwrapQuotes = false)

    - #### @Override void visitConstructor(ConstructorNode node)

    - #### @Override void visitConstructorCallExpression(ConstructorCallExpression expression)

    - #### @Override void visitContinueStatement(ContinueStatement statement)

    - #### @Override void visitDeclarationExpression(DeclarationExpression expression)

    - #### @Override void visitDoWhileLoop(DoWhileStatement statement)

    - #### @Override void visitExpressionStatement(ExpressionStatement statement)

    - #### @Override void visitField(FieldNode node)

    - #### @Override void visitFieldExpression(FieldExpression expression)

    - #### @Override void visitForLoop(ForStatement statement)

    - #### @Override void visitGStringExpression(GStringExpression expression)

    - #### @Override void visitIfElse(IfStatement ifElse)

    - #### void visitImport(ImportNode node)

    - #### @Override void visitListExpression(ListExpression expression)

    - #### @Override void visitMapEntryExpression(MapEntryExpression expression)

    - #### @Override void visitMapExpression(MapExpression expression)

    - #### @Override void visitMethod(MethodNode node)

    - #### @Override void visitMethodCallExpression(MethodCallExpression expression)

    - #### @Override void visitMethodPointerExpression(MethodPointerExpression expression)

    - #### @Override void visitNotExpression(NotExpression expression)

    - #### void visitPackage(PackageNode packageNode)

    - #### @Override void visitPostfixExpression(PostfixExpression expression)

    - #### @Override void visitPrefixExpression(PrefixExpression expression)

    - #### @Override void visitProperty(PropertyNode node)

    - #### @Override void visitPropertyExpression(PropertyExpression expression)

    - #### @Override void visitRangeExpression(RangeExpression expression)

    - #### @Override void visitReturnStatement(ReturnStatement statement)

    - #### @Override void visitShortTernaryExpression(ElvisOperatorExpression expression)

    - #### @Override void visitSpreadExpression(SpreadExpression expression)

    - #### @Override void visitSpreadMapExpression(SpreadMapExpression expression)

    - #### @Override void visitStaticMethodCallExpression(StaticMethodCallExpression expression)

    - #### @Override void visitSwitch(SwitchStatement statement)

    - #### @Override void visitSynchronizedStatement(SynchronizedStatement statement)

    - #### @Override void visitTernaryExpression(TernaryExpression expression)

    - #### @Override void visitThrowStatement(ThrowStatement statement)

    - #### @Override void visitTryCatchFinally(TryCatchStatement statement)

    - #### @Override void visitTupleExpression(TupleExpression expression)

    - #### void visitType(ClassNode classNode)

      Prints out the type, safely handling arrays.

      Parameters:
        classNode

    - #### @Override void visitUnaryMinusExpression(UnaryMinusExpression expression)

    - #### @Override void visitUnaryPlusExpression(UnaryPlusExpression expression)

    - #### void visitVariableExpression(VariableExpression expression, boolean spacePad = true)

    - #### @Override void visitWhileLoop(WhileStatement statement)