Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GenericWhitespaceState

A whitespace state ignores whitespace (such as blanks and tabs), and returns the tokenizer's next token. By default, all characters from 0 to 32 are whitespace.

Hierarchy

  • GenericWhitespaceState

Implements

Index

Constructors

constructor

  • Constructs a whitespace state with a default idea of what characters are, in fact, whitespace.

    Returns GenericWhitespaceState

Methods

clearWhitespaceChars

  • clearWhitespaceChars(): void

nextToken

  • Ignore whitespace (such as blanks and tabs), and return the tokenizer's next token.

    Parameters

    • scanner: IScanner

      A textual string to be tokenized.

    • tokenizer: ITokenizer

      A tokenizer class that controls the process.

    Returns Token

    The next token from the top of the stream.

setWhitespaceChars

  • setWhitespaceChars(fromSymbol: number, toSymbol: number, enable: boolean): void
  • Establish the given characters as whitespace to ignore.

    Parameters

    • fromSymbol: number

      First character index of the interval.

    • toSymbol: number

      Last character index of the interval.

    • enable: boolean

      true if this state should ignore characters in the given range.

    Returns void

Generated using TypeDoc