Parser

actual class Parser : AutoCloseable(source)

A class that is used to produce a syntax tree from source code.

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

expect class Parser(source)

A class that is used to produce a syntax tree from source code.

actual class Parser(source)

A class that is used to produce a syntax tree from source code.

actual class Parser(source)

A class that is used to produce a syntax tree from source code.

Constructors

Link copied to clipboard
actual constructor(language: Language)
actual constructor()

Create a new instance with a certain language, or null if empty.

expect constructor(language: Language)
expect constructor()

Create a new instance with a certain language, or null if empty.

actual constructor(language: Language)
actual constructor()

Create a new instance with a certain language, or null if empty.

actual constructor(language: Language)
actual constructor()

Create a new instance with a certain language, or null if empty.

Types

Link copied to clipboard
actual enum LogType : Enum<Parser.LogType>

The type of a log message.

expect enum LogType : Enum<Parser.LogType>

The type of a log message.

actual enum LogType : Enum<Parser.LogType>

The type of a log message.

actual enum LogType : Enum<Parser.LogType>

The type of a log message.

Properties

Link copied to clipboard

The ranges of text that the parser will include when parsing.

The ranges of text that the parser will include when parsing.

The ranges of text that the parser will include when parsing.

The ranges of text that the parser should include when parsing.

Link copied to clipboard
actual var language: Language?

The language that the parser will use for parsing.

expect var language: Language?

The language that the parser will use for parsing.

actual var language: Language?

The language that the parser will use for parsing.

actual var language: Language?

The language that the parser will use for parsing.

Link copied to clipboard
actual var logger: LogFunction?

The logger that the parser will use during parsing.

expect var logger: LogFunction?

The logger that the parser will use during parsing.

actual var logger: LogFunction?

The logger that the parser will use during parsing.

actual var logger: LogFunction?

The logger that the parser will use during parsing.

Link copied to clipboard
@get:JvmName(name = "getTimeoutMicros")
@set:JvmName(name = "setTimeoutMicros")
actual var timeoutMicros: ULong

The maximum duration in microseconds that parsing should be allowed to take before halting.

expect var timeoutMicros: ULong

The maximum duration in microseconds that parsing should be allowed to take before halting.

@get:JvmName(name = "getTimeoutMicros")
@set:JvmName(name = "setTimeoutMicros")
actual var timeoutMicros: ULong

The maximum duration in microseconds that parsing should be allowed to take before halting.

actual var timeoutMicros: ULong

The maximum duration in microseconds that parsing should be allowed to take before halting.

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
actual external fun parse(oldTree: Tree?, callback: ParseCallback): Tree

Parse source code from a callback and create a syntax tree.

actual external fun parse(source: String, oldTree: Tree?): Tree

Parse a source code string and create a syntax tree.

expect fun parse(oldTree: Tree? = null, callback: ParseCallback): Tree

Parse source code from a callback and create a syntax tree.

expect fun parse(source: String, oldTree: Tree? = null): Tree

Parse a source code string and create a syntax tree.

actual external fun parse(oldTree: Tree?, callback: ParseCallback): Tree

Parse source code from a callback and create a syntax tree.

actual external fun parse(source: String, oldTree: Tree?): Tree

Parse a source code string and create a syntax tree.

actual fun parse(oldTree: Tree?, callback: ParseCallback): Tree

Parse source code from a callback and create a syntax tree.

actual fun parse(source: String, oldTree: Tree?): Tree

Parse a source code string and create a syntax tree.

Link copied to clipboard
actual external fun reset()

Instruct the parser to start the next parse from the beginning.

expect fun reset()

Instruct the parser to start the next parse from the beginning.

actual external fun reset()

Instruct the parser to start the next parse from the beginning.

actual fun reset()

Instruct the parser to start the next parse from the beginning.

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