YamlToken enum

Represents the lexical tokens produced by a YAML tokenizer/parser.

These tokens correspond to structural elements defined by the YAML 1.2 specification. They are used by the JetLeaf YAML parser to construct higher-level nodes (mappings, sequences, scalars, documents, aliases, etc.).

Overview

YAML is composed of mappings (objects), sequences (lists), scalars (primitive values), and anchors/aliases. As the parser reads input text, it emits tokens indicating which structural event is occurring.

Token Types

  • MAPPING_START / MAPPING_END
    Mark the beginning and end of a YAML mapping (equivalent to JSON {}).

  • KEY / VALUE
    Represent a key–value pair inside a mapping.
    KEY precedes the mapping key, VALUE precedes the mapped value.

  • SEQUENCE_START / SEQUENCE_END
    Mark the beginning and end of a YAML sequence (equivalent to JSON []).

  • SCALAR
    Represents a scalar value such as a string, number, boolean, null, block scalar (| or >), or any plain scalar.

  • ALIAS
    Represents an alias node (*anchorName) referencing an anchored value.

  • DOCUMENT_START / DOCUMENT_END
    Correspond to YAML document markers:
    --- (start), ... (end).
    These are optional but meaningful in multi-document streams.

  • END_DOCUMENT
    Indicates that the parser has reached the logical end of input.
    This may occur after a DOCUMENT_END token or implicitly at EOF.

Usage

These tokens are consumed by higher-level readers that construct full document trees or perform streaming parsing.

See also

  • YAML 1.2 Specification
  • YamlParser
  • YamlDeserializationContext
Inheritance
Available extensions

Values

MAPPING_START → const YamlToken

Start of a YAML mapping (dictionary/object).

MAPPING_END → const YamlToken

End of a YAML mapping.

KEY → const YamlToken

Key inside a mapping.

VALUE → const YamlToken

Value corresponding to a key in a mapping or an element in a sequence.

SEQUENCE_START → const YamlToken

Start of a YAML sequence (array/list).

SEQUENCE_END → const YamlToken

End of a YAML sequence.

SCALAR → const YamlToken

A scalar (simple) value.

ALIAS → const YamlToken

An alias referencing an anchored value.

END_DOCUMENT → const YamlToken

Logical end of the YAML document or stream.

DOCUMENT_START → const YamlToken

Explicit YAML document start marker (---).

DOCUMENT_END → const YamlToken

Explicit YAML document end marker (...).

ANCHOR → const YamlToken

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

values → const List<YamlToken>
A constant List of the values in this enum, in order of their declaration.