TreeCursor

A class that can be used to efficiently walk a syntax tree.

NOTE: If you're targeting Android SDK level < 33, you must use or close the instance to free up resources.

expect class TreeCursor(source)

A class that can be used to efficiently walk a syntax tree.

actual class TreeCursor(source)

A class that can be used to efficiently walk a syntax tree.

actual class TreeCursor(source)

A class that can be used to efficiently walk a syntax tree.

Properties

Link copied to clipboard
@get:JvmName(name = "getCurrentDepth")
actual val currentDepth: UInt

The depth of the cursor's current node relative to the original node that the cursor was constructed with.

expect val currentDepth: UInt

The depth of the cursor's current node relative to the original node that the cursor was constructed with.

@get:JvmName(name = "getCurrentDepth")
actual val currentDepth: UInt

The depth of the cursor's current node relative to the original node that the cursor was constructed with.

actual val currentDepth: UInt

The depth of the cursor's current node relative to the original node that the cursor was constructed with.

Link copied to clipboard
@get:JvmName(name = "getCurrentDescendantIndex")
actual val currentDescendantIndex: UInt

The index of the cursor's current node out of all the descendants of the original node that the cursor was constructed with.

The index of the cursor's current node out of all the descendants of the original node that the cursor was constructed with.

@get:JvmName(name = "getCurrentDescendantIndex")
actual val currentDescendantIndex: UInt

The index of the cursor's current node out of all the descendants of the original node that the cursor was constructed with.

The index of the cursor's current node out of all the descendants of the original node that the cursor was constructed with.

Link copied to clipboard
@get:JvmName(name = "getCurrentFieldId")
actual val currentFieldId: UShort

The field ID of the tree cursor's current node, or 0.

The field ID of the tree cursor's current node, or 0.

@get:JvmName(name = "getCurrentFieldId")
actual val currentFieldId: UShort

The field ID of the tree cursor's current node, or 0.

The field ID of the tree cursor's current node, or 0.

Link copied to clipboard

The field name of the tree cursor's current node, if available.

The field name of the tree cursor's current node, if available.

The field name of the tree cursor's current node, if available.

The field name of the tree cursor's current node, if available.

Link copied to clipboard
actual val currentNode: Node

The current node of the cursor.

expect val currentNode: Node

The current node of the cursor.

actual val currentNode: Node

The current node of the cursor.

actual val currentNode: Node

The current node of the cursor.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
actual fun copy(): TreeCursor

Create a shallow copy of the tree cursor.

expect fun copy(): TreeCursor

Create a shallow copy of the tree cursor.

actual fun copy(): TreeCursor

Create a shallow copy of the tree cursor.

actual fun copy(): TreeCursor

Create a shallow copy of the tree cursor.

Link copied to clipboard
@JvmName(name = "gotoDescendant")
actual external fun gotoDescendant(index: UInt)

Move the cursor to the node that is the nth descendant of the original node that the cursor was constructed with, where 0 represents the original node itself.

expect fun gotoDescendant(index: UInt)

Move the cursor to the node that is the nth descendant of the original node that the cursor was constructed with, where 0 represents the original node itself.

@JvmName(name = "gotoDescendant")
actual external fun gotoDescendant(index: UInt)

Move the cursor to the node that is the nth descendant of the original node that the cursor was constructed with, where 0 represents the original node itself.

actual fun gotoDescendant(index: UInt)

Move the cursor to the node that is the nth descendant of the original node that the cursor was constructed with, where 0 represents the original node itself.

Link copied to clipboard
actual external fun gotoFirstChild(): Boolean

Move the cursor to the first child of its current node.

expect fun gotoFirstChild(): Boolean

Move the cursor to the first child of its current node.

actual external fun gotoFirstChild(): Boolean

Move the cursor to the first child of its current node.

actual fun gotoFirstChild(): Boolean

Move the cursor to the first child of its current node.

Link copied to clipboard
@JvmName(name = "gotoFirstChildForByte")
actual fun gotoFirstChildForByte(byte: UInt): UInt?

Move the cursor to the first child of its current node that extends beyond the given byte offset.

expect fun gotoFirstChildForByte(byte: UInt): UInt?

Move the cursor to the first child of its current node that extends beyond the given byte offset.

@JvmName(name = "gotoFirstChildForByte")
actual fun gotoFirstChildForByte(byte: UInt): UInt?

Move the cursor to the first child of its current node that extends beyond the given byte offset.

actual fun gotoFirstChildForByte(byte: UInt): UInt?

Move the cursor to the first child of its current node that extends beyond the given byte offset.

Link copied to clipboard
@JvmName(name = "gotoFirstChildForPoint")
actual fun gotoFirstChildForPoint(point: Point): UInt?

Move the cursor to the first child of its current node that extends beyond the given point offset.

expect fun gotoFirstChildForPoint(point: Point): UInt?

Move the cursor to the first child of its current node that extends beyond the given point offset.

@JvmName(name = "gotoFirstChildForPoint")
actual fun gotoFirstChildForPoint(point: Point): UInt?

Move the cursor to the first child of its current node that extends beyond the given point offset.

actual fun gotoFirstChildForPoint(point: Point): UInt?

Move the cursor to the first child of its current node that extends beyond the given point offset.

Link copied to clipboard
actual external fun gotoLastChild(): Boolean

Move the cursor to the last child of its current node.

expect fun gotoLastChild(): Boolean

Move the cursor to the last child of its current node.

actual external fun gotoLastChild(): Boolean

Move the cursor to the last child of its current node.

actual fun gotoLastChild(): Boolean

Move the cursor to the last child of its current node.

Link copied to clipboard
actual external fun gotoNextSibling(): Boolean

Move the cursor to the next sibling of its current node.

expect fun gotoNextSibling(): Boolean

Move the cursor to the next sibling of its current node.

actual external fun gotoNextSibling(): Boolean

Move the cursor to the next sibling of its current node.

actual fun gotoNextSibling(): Boolean

Move the cursor to the next sibling of its current node.

Link copied to clipboard
actual external fun gotoParent(): Boolean

Move the cursor to the parent of its current node.

expect fun gotoParent(): Boolean

Move the cursor to the parent of its current node.

actual external fun gotoParent(): Boolean

Move the cursor to the parent of its current node.

actual fun gotoParent(): Boolean

Move the cursor to the parent of its current node.

Link copied to clipboard
actual external fun gotoPreviousSibling(): Boolean

Move the cursor to the previous sibling of its current node.

Move the cursor to the previous sibling of its current node.

actual external fun gotoPreviousSibling(): Boolean

Move the cursor to the previous sibling of its current node.

Move the cursor to the previous sibling of its current node.

Link copied to clipboard
actual external fun reset(node: Node)

Reset the cursor to start at a different node.

actual external fun reset(cursor: TreeCursor)

Reset the cursor to start at the same position as another cursor.

expect fun reset(node: Node)

Reset the cursor to start at a different node.

expect fun reset(cursor: TreeCursor)

Reset the cursor to start at the same position as another cursor.

actual external fun reset(node: Node)

Reset the cursor to start at a different node.

actual external fun reset(cursor: TreeCursor)

Reset the cursor to start at the same position as another cursor.

actual fun reset(node: Node)

Reset the cursor to start at a different node.

actual fun reset(cursor: TreeCursor)

Reset the cursor to start at the same position as another cursor.

toString
Link copied to clipboard
open override fun toString(): String
open override fun toString(): String
open override fun toString(): String