Package: groovy.console.ui

## [Groovy] Class AstNodeToScriptVisitor

- groovy.console.ui.AstNodeToScriptVisitor

- All Implemented Interfaces and Traits:
    GroovyClassVisitor, GroovyCodeVisitor, IPrimaryClassNodeOperation

      @AutoFinal
      @CompileStatic
      class AstNodeToScriptVisitor
      extends Object
      implements GroovyClassVisitor, GroovyCodeVisitor, IPrimaryClassNodeOperation

  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, boolean showScriptClass)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `call(SourceUnit source, GeneratorContext context, ClassNode classNode)`
    `` | `Object` | `indented(Closure block)`
    `` | `void` | `print(Object parameter)`
    `` | `Object` | `printDoubleBreak()`
    `` | `Object` | `printLineBreak()`
    `` | `Object` | `println(Object parameter)`
    `` | `void` | `visitAnnotationNode(AnnotationNode node)`
    `` | `void` | `visitArgumentlistExpression(ArgumentListExpression expression, boolean showTypesIgnored)`
    `` | `void` | `visitArgumentlistExpression(ArgumentListExpression expression)`
    `` | `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)`
    `` | `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` | `visitLambdaExpression(LambdaExpression expression)`
    `` | `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` | `visitMethodReferenceExpression(MethodReferenceExpression 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)`
    `` | `void` | `visitWhileLoop(WhileStatement statement)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Property Detail

    - #### String _indent

    - #### Stack<String> classNameStack

    - #### boolean readyToIndent

    - #### boolean scriptHasBeenVisited

    - #### boolean showScriptClass

    - #### boolean showScriptFreeForm

  - ### Constructor Detail

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

  - ### Method Detail

    - #### @Override
      void call(SourceUnit source, GeneratorContext context, ClassNode classNode)

    - #### Object indented(Closure block)

    - #### void print(Object parameter)

    - #### Object printDoubleBreak()

    - #### Object printLineBreak()

    - #### Object println(Object parameter)

    - #### void visitAnnotationNode(AnnotationNode node)

    - #### @Deprecated
      void visitArgumentlistExpression(ArgumentListExpression expression, boolean showTypesIgnored)

    - #### @Override
      void visitArgumentlistExpression(ArgumentListExpression expression)

    - #### @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)

    - #### @Override
      void visitConstantExpression(ConstantExpression expression, boolean unwrapQuotes)

    - #### @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 visitLambdaExpression(LambdaExpression expression)

    - #### @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 visitMethodReferenceExpression(MethodReferenceExpression 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)

    - #### @Override
      void visitVariableExpression(VariableExpression expression, boolean spacePad)

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