Dumper

class Dumper(appendable: Appendable = StringBuilder(), withExtras: Boolean = true, withProperties: Boolean = true) : Visitor

Utility class for dumping AST.

Example usage:

Dumper.dump(node)

Sample output for the code val x = "":

Node.KotlinFile
Node.Declaration.PropertyDeclaration
Node.Keyword.Val{text="val"}
Node.Variable
Node.Expression.NameExpression{text="x"}
Node.Expression.StringLiteralExpression{raw=false}

Constructors

Link copied to clipboard
constructor(appendable: Appendable = StringBuilder(), withExtras: Boolean = true, withProperties: Boolean = true)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun dump(node: Node)

Dumps the given AST node.

Link copied to clipboard
fun traverse(rootNode: Node)

Traverses the given AST node and its descendants depth-first order and calls the protected visit method for each node.