A Token object like we'd use in ANTLR 2.x; has an actual string created and associated with this object. These objects are needed for imaginary tree nodes that have payload objects. We need to create a Token object that has a string; the tree node will point at this token. CommonToken has indexes into a char stream and hence cannot be used to introduce new strings.

Hierarchy

  • ClassicToken

Implements

Index

Constructors

constructor

  • new ClassicToken(type: number, text: string, channel: number): ClassicToken
  • Parameters

    • type: number
    • text: string
    • channel: number

    Returns ClassicToken

Properties

channel

channel: number = TokenChannels.default

charPositionInLine

charPositionInLine: number

index

index: number

What token number is this from 0..n-1 tokens

inputStream

inputStream: ICharStream = null

line

line: number

startIndex

startIndex: number = -1

stopIndex

stopIndex: number = -1

text

text: string

type

type: number

Accessors

tokenIndex

  • get tokenIndex(): number
  • set tokenIndex(value: number): void
  • Returns number

  • Parameters

    • value: number

    Returns void

Methods

implements

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

toString

  • toString(): string
  • Returns string

Generated using TypeDoc