Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Token

Hierarchy

Index

Constructors

constructor

  • new Token(image: string, offset: number, startLine: number, startColumn: number, endLine?: number, endColumn?: number): Token
  • Parameters

    • image: string

      the textual representation of the Token as it appeared in the text

    • offset: number

      offset of the first character of the Token

    • startLine: number

      line of the first character of the Token

    • startColumn: number

      column of the first character of the Token

    • Default value endLine: number = startLine

      line of the last character of the Token

    • Default value endColumn: number = startColumn + image.length - 1

      column of the last character of the Token

      Things to note:

      • "do" {startColumn : 1, endColumn: 2} --> the range is inclusive to exclusive 1...2 (2 chars long).
      • "\n" {startLine : 1, endLine: 1} --> a lineTerminator as the last character does not effect the Token's line numbering.
      • "'hello\tworld\uBBBB'" {image: "'hello\tworld\uBBBB'"} --> a Token's image is the "literal" text
                                                               (unicode escaping is untouched).
        

    Returns Token

Properties

endColumn

endColumn: number

column of the last character of the Token

Things to note: "do" {startColumn : 1, endColumn: 2} --> the range is inclusive to exclusive 1...2 (2 chars long). "\n" {startLine : 1, endLine: 1} --> a lineTerminator as the last character does not effect the Token's line numbering. "'hello\tworld\uBBBB'" {image: "'hello\tworld\uBBBB'"} --> a Token's image is the "literal" text (unicode escaping is untouched).

endLine

endLine: number

line of the last character of the Token

image

image: string

the textual representation of the Token as it appeared in the text

isInsertedInRecovery

isInsertedInRecovery: boolean

offset

offset: number

offset of the first character of the Token

startColumn

startColumn: number

column of the first character of the Token

startLine

startLine: number

line of the first character of the Token

Generated using TypeDoc