ScannerImpl

class ScannerImpl(settings: LoadSettings, reader: StreamReader) : Scanner

Scanner produces tokens of the following types:

  • STREAM-START

  • STREAM-END

  • COMMENT

  • DIRECTIVE(name, value)

  • DOCUMENT-START

  • DOCUMENT-END

  • BLOCK-SEQUENCE-START

  • BLOCK-MAPPING-START

  • BLOCK-END

  • FLOW-SEQUENCE-START

  • FLOW-MAPPING-START

  • FLOW-SEQUENCE-END

  • FLOW-MAPPING-END

  • BLOCK-ENTRY

  • FLOW-ENTRY

  • KEY

  • VALUE

  • ALIAS(value)

  • ANCHOR(value)

  • TAG(value)

  • SCALAR(value, plain, style)

Read comments in the Scanner code for more details.

Constructors

Link copied to clipboard
constructor(settings: LoadSettings, reader: StreamReader)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun checkToken(vararg choices: Token.ID): Boolean

Check whether the next token is present.

Link copied to clipboard
open operator override fun hasNext(): Boolean
Link copied to clipboard
open operator override fun next(): Token

Return the next token, removing it from the queue.

Link copied to clipboard
open override fun peekToken(): Token

Return the next token, but do not delete it from the queue.

Link copied to clipboard
open override fun resetDocumentIndex()

Set the document index to 0 after a document end