Package: org.codehaus.groovy.transform.tailrec

## [Groovy] Class StatementReplacer

- org.codehaus.groovy.transform.tailrec.StatementReplacer

-     @CompileStatic
      class StatementReplacer
      extends CodeVisitorSupport

  Tool for replacing Statement objects in an AST by other Statement instances. Within

  TailRecursive:
    it is used to swap ReturnStatements with looping back to RECUR label

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `private int` | `closureLevel`
    `private Closure<Statement>` | `replaceWith`
    `private Closure<Boolean>` | `when`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `StatementReplacer ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `replaceIn(ASTNode root)`
    `` | `void` | `visitBlockStatement(BlockStatement block)`
    `` | `void` | `visitClosureExpression(ClosureExpression expression)`
    `` | `void` | `visitDoWhileLoop(DoWhileStatement loop)`
    `` | `void` | `visitForLoop(ForStatement forLoop)`
    `` | `void` | `visitIfElse(IfStatement ifElse)`
    `` | `void` | `visitWhileLoop(WhileStatement loop)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CodeVisitorSupport` | `afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAssertStatement, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBlockStatement, visitBooleanExpression, visitBreakStatement, visitBytecodeExpression, visitCaseStatement, visitCastExpression, visitCatchStatement, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitEmptyStatement, visitExpressionStatement, visitFieldExpression, visitForLoop, visitGStringExpression, visitIfElse, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitReturnStatement, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitSwitch, visitSynchronizedStatement, visitTernaryExpression, visitThrowStatement, visitTryCatchFinally, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop`

- - ### Property Detail

    - #### private int closureLevel

    - #### private Closure<Statement> replaceWith

    - #### private Closure<Boolean> when

  - ### Constructor Detail

    - #### StatementReplacer()

  - ### Method Detail

    - #### void replaceIn(ASTNode root)

    - #### void visitBlockStatement(BlockStatement block)

    - #### void visitClosureExpression(ClosureExpression expression)

    - #### void visitDoWhileLoop(DoWhileStatement loop)

    - #### void visitForLoop(ForStatement forLoop)

    - #### void visitIfElse(IfStatement ifElse)

    - #### void visitWhileLoop(WhileStatement loop)