Hierarchy

Implements

Index

Constructors

constructor

Properties

DEFAULT_INITIAL_BUFFER_SIZE

DEFAULT_INITIAL_BUFFER_SIZE: number = 100

INITIAL_CALL_STACK_SIZE

INITIAL_CALL_STACK_SIZE: number = 10

_data

_data: List<T> = new List<T>()

dynamically-sized buffer of elements

_eof

_eof: any = null

Track object returned by nextElement upon end of stream; Return it later when they ask for LT passed end of input.

_lastMarker

_lastMarker: number
Track the last mark() call result value for use in rewind().

_markDepth

_markDepth: number
tracks how deep mark() calls are nested

_p

_p: number = 0

index of next element to fill

range

range: number = 0

How deep have we gone?

Protected tokens

tokens: ITokenStream

If this tree (root) was created from a token stream, track it.

uniqueNavigationNodes

uniqueNavigationNodes: boolean = false

Accessors

count

  • get count(): number

endOfFile

  • get endOfFile(): any
  • set endOfFile(value: any): void

index

  • get index(): number

previousElement

  • get previousElement(): any

sourceName

  • get sourceName(): string
  • Returns string

tokenStream

treeAdaptor

treeSource

  • get treeSource(): any
  • Returns any

Methods

clear

  • clear(): void

consume

  • consume(): void

dequeue

  • dequeue(): any

enqueue

  • enqueue(o: any): void

fill

  • fill(n: number): void
  • add n elements to buffer

    Parameters

    • n: number

    Returns void

get

  • get(i: number): any
  • Return element {@code i} elements ahead of current element. {@code i==0} gets current element. This is not an absolute index into {@link #data} since {@code p} defines the start of the real list.

    Parameters

    • i: number

    Returns any

getKnownPositionElement

  • getKnownPositionElement(allowApproximateLocation: boolean): any
  • Returns an element containing position information. If {@code allowApproximateLocation} is {@code false}, then this method will return the {@code LT(1)} element if it contains position information, and otherwise return {@code null}. If {@code allowApproximateLocation} is {@code true}, then this method will return the last known element containing position information.

    see

    #hasPositionInformation

    Parameters

    • allowApproximateLocation: boolean

    Returns any

hasPositionInformation

  • hasPositionInformation(node: any): boolean

implements

  • implements(): any[]
  • Returns any[]

isEndOfFile

  • isEndOfFile(o: any): boolean

la

  • la(i: number): number

lb

  • lb(k: number): any

lt

  • lt(k: number): any

mark

  • mark(): number

nextElement

  • nextElement(): any

peek

  • peek(): any

pop

  • pop(): number
  • Seek back to previous index saved during last push() call. Return top of stack (return index).

    Returns number

push

  • push(index: number): void
  • Make stream jump to a new location, saving old location. Switch back with pop().

    Parameters

    • index: number

    Returns void

release

  • release(marker: number): void

replaceChildren

  • replaceChildren(parent: any, startChildIndex: number, stopChildIndex: number, t: any): void

reset

  • reset(): void

rewind

  • rewind(): void

rewind2

  • rewind2(marker: number): void

seek

  • seek(index: number): void
  • Seek to a 0-indexed absolute token index. Normally used to seek backwards in the buffer. Does not force loading of nodes. To preserve backward compatibility, this method allows seeking past the end of the currently buffered data. In this case, the input pointer will be moved but the data will only actually be loaded upon the next call to {@link #consume} or {@link #LT} for {@code k>0}.

    Parameters

    • index: number

    Returns void

syncAhead

  • syncAhead(need: number): void
  • Make sure we have 'need' elements from current position p. Last valid p index is data.size()-1. p+need-1 is the data index 'need' elements ahead. If we need 1 element, (p+1-1)==p must be < data.size().

    Parameters

    • need: number

    Returns void

toString

  • toString(): string
  • Return string of current buffer contents; non-destructive

    Returns string

toString1

  • toString1(start: any, stop: any): string
  • Parameters

    • start: any
    • stop: any

    Returns string

toTokenTypeString

  • toTokenTypeString(): string
  • For debugging; destructive: moves tree iterator to end.

    Returns string

Generated using TypeDoc