Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VirtualToken

A special kind of Token which does not really exist in the input (hence the 'Virtual' prefix). These type of Tokens can be used as special markers: for example, EOF (end-of-file).

Hierarchy

Implements

Index

Constructors

constructor

Properties

endColumn

endColumn: number

Column of the last character of the Token.

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 = false

startColumn

startColumn: number

Column of the first character of the Token.

startLine

startLine: number

Line of the first character of the Token.

startOffset

startOffset: number

Offset of the first character of the Token.

Static LABEL

LABEL: string = undefined

A "human readable" Label for a Token. Subclasses of Token may define their own static LABEL property. This label will be used in error messages and drawing syntax diagrams.

For example a Token constructor may be called LCurly, which is short for LeftCurlyBrackets, These names are either too short or too unwieldy to be used in error messages.

Imagine : "expecting LCurly but found ')'" or "expecting LeftCurlyBrackets but found ')'"

However if a static property LABEL with the value '{' exists on LCurly class, that error message will be: "expecting '{' but found ')'"

Accessors

endOffset

  • get endOffset(): number

offset

  • get offset(): number
  • set offset(newOffset: number): void
  • deprecated

    An Alias for getting the startOffset. this is deprecated and remains only to be backwards compatiable. This API will be removed in future version of Chevrotain.

    Returns number

  • deprecated

    An Alias for setting the startOffset. this is deprecated and remains only to be backwards compatiable. This API will be removed in future version of Chevrotain.

    Parameters

    • newOffset: number

    Returns void

Generated using TypeDoc