ASTTransformer
open class ASTTransformer(val issues: MutableList<Issue> = mutableListOf(), val allowGenericNode: Boolean = true)
Implementation of a tree-to-tree transformation. For each source node type, we can register a transformer that knows how to produce a transformed node. Then, this transformer can read metadata in the transformed node to recursively transform and assign children. If no node transformer is provided for a source node type, a GenericNode is created, and the processing of the subtree stops there.
Functions
Link copied to clipboard
Link copied to clipboard
inline fun <S : Any, T : Node> registerNodeTransformer(crossinline transformer: S.(ASTTransformer) -> T?): NodeTransformer<S, T>
fun <S : Any, T : Node> registerNodeTransformer(kclass: KClass<S>, transformer: (S) -> T?): NodeTransformer<S, T>
fun <S : Any, T : Node> registerNodeTransformer(kclass: KClass<S>, transformer: (S, ASTTransformer) -> T?): NodeTransformer<S, T>
fun <S : Any, T : Node> registerNodeTransformer(kclass: KClass<S>, transformer: (S, ASTTransformer, NodeTransformer<S, T>) -> T?): NodeTransformer<S, T>
fun <S : Any, T : Node> registerNodeTransformer(source: KClass<S>, target: KClass<T>, parameterConverters: List<ParameterConverter> = emptyList()): NodeTransformer<S, T>