[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
Type | Name and description |
---|---|
int |
closureLevel |
Closure<Statement> |
replaceWith |
Closure<Boolean> |
when |
Constructor Summary
Constructor and description |
---|
StatementReplacer
() |
Methods Summary
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
Property Detail
int closureLevel
Closure<Statement> replaceWith
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)
© 2003-2020 The Apache Software Foundation
Licensed under the Apache license.
https://docs.groovy-lang.org/3.0.7/html/gapi/org/codehaus/groovy/transform/tailrec/StatementReplacer.html