Class InputBufferAbstract

Non-blocking token stream buffer.

Hierarchy

Constructors

Properties

capacity: number
column: number

The one-based column number of the current lookahead token, relative to the current line in the stream.

id: string

An informative identifier for this token stream, or undefined if this stream is unidentified.

index: number
limit: number
line: number

The one-based line number of the current lookahead token, relative to the start of the stream.

mark: Mark

The position of the current lookahead token, relative to the start of the stream.

offset: number

The byte offset of the current lookahead token, relative to the start of the stream.

remaining: number
settings: InputSettings

The InputSettings used to configure the behavior of input consumers that read from this Input.

Methods

  • Returns a partial Input equivalent to this Input, if part is true; returns a final Input equivalent to this Input if part is false. The caller's reference to this Input should be replaced by the returned Input

    Parameters

    • part: boolean

    Returns InputBuffer

  • Returns an independently positioned view into the token stream, initialized with identical state to this Input.

    Returns InputBuffer

    Throws

    Error if this Input reader cannot be cloned.

  • Parameters

    • index: number

    Returns number

  • Parameters

    • index: number

    Returns boolean

  • Returns the current lookahead token, if this Input is in the cont state.

    Returns number

    Throws

    [[InputException]] if this Input is not in the cont state.

  • Returns true when a [[head lookahead]] token is immediately available. i.e. this Input is in the cont state.

    Returns boolean

  • Returns true when no lookahead token is currently available, and no additional input will ever become available, i.e. this Input is in the done state.

    Returns boolean

  • Returns true when no lookahead token is currently available, but additional input may be available at some point in the future, i.e. this Input is in the empty state.

    Returns boolean

  • Returns true when no lookahead token is currently available due to an error with the token stream. i.e. this Input is in the error state. When true, trap() will return the input error

    Returns boolean

  • Returns true if this is a partial Input will that enter the empty state after it consumes the last available input token.

    Returns boolean

  • Sets the position of this Input to the given mark. Rewinds to the start of this Input, if mark is undefined.

    Parameters

    Returns InputBuffer

    Throws

    [[InputException]] if this Input does not support seeking, or is unable to reposition to the mark.

  • Parameters

    • index: number
    • token: number

    Returns void

  • Advances to the next token, if this Input is in the cont state.

    Parameters

    • Optional offset: number

    Returns InputBuffer

    Throws

    Error if this Input is not in the cont state.

  • Returns the input error when in the error state

    Returns Error

    Throws

    InputException if the Input is not the _error_state

  • Returns an Input equivalent to this Input, but logically identified by the given–possibly undefined–id. The caller's reference to this Input should be replaced by the returned Input.

    Parameters

    • id: string

    Returns InputBuffer

  • Parameters

    • index: number

    Returns InputBuffer

  • Parameters

    • limit: number

    Returns InputBuffer

  • Returns an Input equivalent to this Input, but logically positioned at the given mark. The physical position in the input stream is not modified. The caller's reference to this Input should be replaced by the returned Input.

    Parameters

    Returns InputBuffer

  • Returns a clone of this Input with the given settings.

    Parameters

    Returns InputBuffer

    Throws

    Error if this Input reader cannot be cloned.

  • Returns an InputBuffer in the done state.

    Returns InputBuffer

  • Returns an InputBuffer in the empty state.

    Returns InputBuffer

  • Returns an InputBuffer in the error state that traps the given error.

    Parameters

    • error: Error

    Returns InputBuffer

Generated using TypeDoc