Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StringScanner

Scan characters in a string that allows tokenizers to look ahead through stream to perform lexical analysis.

Hierarchy

  • StringScanner

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • Creates an instance of this class.

    Parameters

    • content: string

      A text content to be read.

    Returns StringScanner

Properties

Static Eof

Eof: number = -1

Methods

column

  • column(): number
  • Gets the column in the current line

    Returns number

    The column in the current line in the stream

line

  • line(): number
  • Gets the current line number

    Returns number

    The current line number in the stream

peek

  • peek(): number
  • Returns the character from the top of the stream without moving the stream pointer.

    Returns number

    A character from the top of the stream or -1 if stream is empty.

read

  • read(): number
  • Reads character from the top of the stream. A read character or -1 if stream processed to the end.

    Returns number

reset

  • reset(): void
  • Resets scanner to the initial position

    Returns void

unread

  • unread(): void
  • Puts the one character back into the stream stream.

    Returns void

unreadMany

  • unreadMany(count: number): void
  • Pushes the specified number of characters to the top of the stream.

    Parameters

    • count: number

      A number of characcted to be pushed back.

    Returns void

Generated using TypeDoc