Package-level declarations

Types

Link copied to clipboard
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.

Link copied to clipboard
data class ChildNodeTransformer<Source, Target, Child>(val name: String, val get: (Source) -> Any?, val setter: (Target, Child?) -> Unit?)

Information on how to retrieve a child node.

Link copied to clipboard
class GenericNode(parent: Node? = null) : Node

A generic AST node. We use it to represent parts of a source tree that we don't know how to translate yet.

Link copied to clipboard
annotation class Mapped(val path: String = "")

A child of an AST node that is automatically populated from a source tree.

Link copied to clipboard
class NodeTransformer<Source, Output : Node>(val constructor: (Source, ASTTransformer, NodeTransformer<Source, Output>) -> Output?, val children: MutableMap<String, ChildNodeTransformer<Source, *, *>?> = mutableMapOf(), var finalizer: (Output) -> Unit = {}, var skipChildren: Boolean = false, var childrenSetAtConstruction: Boolean = false)

Transformer that, given a tree node, will instantiate the corresponding transformed node.

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard