Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Token

A token represents a logical chunk of a string. For example, a typical tokenizer would break the string "1.23 <= 12.3" into three tokens: the number 1.23, a less-than-or-equal symbol, and the number 12.3. A token is a receptacle, and relies on a tokenizer to decide precisely how to divide a string into tokens.

Hierarchy

  • Token

Index

Constructors

Accessors

Methods

Constructors

constructor

  • Constructs this token with type and value.

    Parameters

    • type: TokenType

      The type of this token.

    • value: string

      The token string value.

    Returns Token

Accessors

type

  • The token type.

    Returns TokenType

value

  • get value(): string
  • The token value.

    Returns string

Methods

equals

  • equals(obj: any): boolean
  • Parameters

    • obj: any

    Returns boolean

Generated using TypeDoc