public class TransformerConfiguration extends Object
CpsTransformerCpsTransformer.setConfiguration(TransformerConfiguration)| Constructor and Description |
|---|
TransformerConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
org.codehaus.groovy.ast.ClassNode |
getClosureType() |
TransformerConfiguration |
withClosureType(Class<? extends groovy.lang.Closure> c) |
TransformerConfiguration |
withClosureType(org.codehaus.groovy.ast.ClassNode closureType) |
TransformerConfiguration |
withSafepoint(Class clazz,
String methodName)
Inserts a safepoint into transformed program.
|
public org.codehaus.groovy.ast.ClassNode getClosureType()
public TransformerConfiguration withClosureType(org.codehaus.groovy.ast.ClassNode closureType)
public TransformerConfiguration withClosureType(Class<? extends groovy.lang.Closure> c)
public TransformerConfiguration withSafepoint(Class clazz, String methodName)
At every loop head and at the entry of a function, CPS-transformed program will call the specified no-arg static public method that returns void. This is useful to pause the execution of un-cooperative CPS transformed programs.
A safepoint method can run some computation and return normally to keep the CPS interpreter going, or it can suspend the execution of a program.
Copyright © 2011–2019. All rights reserved.