TreeSitterParser class final
Pure-Dart incremental parser facade following Tree-sitter's tree API.
Constructors
- TreeSitterParser(TreeSitterGrammar grammar, {TreeSitterParserRuntimeHooks? runtimeHooks})
-
TreeSitterParser.fromRaw(TreeSitterRawHandle<
TreeSitterParser> raw) -
factory
- TreeSitterParser.unbound({TreeSitterParserRuntimeHooks? runtimeHooks})
Properties
- cancellationToken → TreeSitterCancellationToken?
-
no setter
- grammar → TreeSitterGrammar
-
Compatibility accessor for callers that require an assigned language.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasOutstandingParse → bool
-
Whether an opt-in timeout, cancellation token, or progress callback
halted the most recent parse before it produced a tree.
no setter
-
includedRanges
→ List<
TreeSitterRange> -
no setter
- isDisposed → bool
-
no setter
- language → TreeSitterGrammar?
-
The currently assigned language, or null for a newly-created parser.
no setter
- logger → TreeSitterLogger?
-
no setter
- runtimeHooks → TreeSitterParserRuntimeHooks?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeoutMicros → int
-
no setter
Methods
-
dispose(
) → void -
intoRaw(
) → TreeSitterRawHandle< TreeSitterParser> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parse(
String source, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree -
parseBytesWithEncoding(
Uint8List bytes, TreeSitterInputEncoding encoding, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree? -
Native
ts_parser_parse_string_encodingvalue semantics. -
parseCustomEncodingWith(
TreeSitterByteInputCallback read, TreeSitterCustomDecoder decode, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree - Parses bytes through a caller-defined Tree-sitter 0.25 decoder.
-
parseCustomEncodingWithOptions(
TreeSitterByteInputCallback read, TreeSitterCustomDecoder decode, TreeSitterParseOptions options, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree? -
parseNativeInput(
TreeSitterNativeInput input, {TreeSitterParseOptions? options, TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree? -
Parses the exact native
TSInputvalue projection. -
parseOrNull(
String source, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree? -
Native
Parser::parseresult semantics for an unbound parser. -
parseUtf16BeCodeUnits(
List< int> codeUnits, {TreeSitterTree? oldTree, Iterable<TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree - Parses UTF-16 code units whose in-memory bytes are big-endian.
-
parseUtf16BeWith(
TreeSitterUtf16InputCallback read, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree -
parseUtf16BeWithOptions(
TreeSitterUtf16InputCallback read, TreeSitterParseOptions options, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree? -
parseUtf16CodeUnits(
List< int> codeUnits, {TreeSitterTree? oldTree, Iterable<TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree - Parses UTF-16 code units and reports public node bytes in UTF-16 bytes.
-
parseUtf16LeCodeUnits(
List< int> codeUnits, {TreeSitterTree? oldTree, Iterable<TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree -
parseUtf16LeWith(
TreeSitterUtf16InputCallback read, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree -
parseUtf16LeWithOptions(
TreeSitterUtf16InputCallback read, TreeSitterParseOptions options, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree? -
parseUtf16With(
TreeSitterUtf16InputCallback read, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree - Parses callback-driven UTF-16 input until the callback returns empty.
-
parseUtf8Bytes(
Uint8List bytes, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree -
Parses exact UTF-8 bytes without normalizing malformed input through a
Dart String. Every public byte range remains relative to
bytes. -
parseUtf8BytesWithOptions(
Uint8List bytes, TreeSitterParseOptions options, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree? - Byte-native counterpart of parseWithOptions.
-
parseUtf8With(
TreeSitterUtf8InputCallback read, {bool annotateLocals = true}) → TreeSitterTree - Parses callback-driven UTF-8 input until the callback returns empty.
-
parseWithOptions(
String source, TreeSitterParseOptions options, {TreeSitterTree? oldTree, Iterable< TreeSitterInputEdit> edits = const [], bool annotateLocals = true}) → TreeSitterTree? - Native nullable parse-with-options contract. Returning true from the callback halts this parse and returns null.
-
printDotGraphs(
TreeSitterDebugGraphSink sink) → void - Starts parser debug-graph emission into a managed text sink.
-
reset(
) → void - Clears resumable parse state. Completed parses and configuration remain.
-
setCancellationToken(
TreeSitterCancellationToken? token) → void -
setDebugGraphSink(
TreeSitterDebugGraphSink? sink) → void -
setIncludedRanges(
Iterable< TreeSitterRange> ranges) → void -
setLanguage(
TreeSitterGrammar language) → void - Assigns a language after validating Tree-sitter's supported ABI window.
-
setLogger(
TreeSitterLogger? logger) → void -
setNativeLanguage(
TreeSitterGrammar? language) → bool -
Native
ts_parser_set_languagesemantics, including its nullable input. -
setTimeoutMicros(
int value) → void -
setWasmStore(
TreeSitterWasmStore? store) → void -
stopPrintingDotGraphs(
) → void - Stops parser debug-graph emission without affecting parser state.
-
takeWasmStore(
) → TreeSitterWasmStore? -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- fullDocumentRange → const TreeSitterRange
- Tree-sitter's public sentinel for an unrestricted parser input range.