Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SimpleLazyToken

see

IToken

see

LazyToken

A Less complex LazyToken used to increase performance. Instances of SimpleLazyToken will not actually inherit from it using prototype inheritance. Instead they will be simple JS Objects (Simple Structures) { startOffset : 10, endOffset : 16, tokenType : 66, cacheData : cacheData }

The additional computed properties (startLine/StartColumn/...) of the IToken interface can be computed using The provided Utility methods (getImage, getStartColumn, getEndLine, ...)

This makes SimpleLazyTokens slightly less convenient, however this can produce a substantial increase in performance which may be relevant in certain use cases where performance is of paramount concern.

Hierarchy

  • SimpleLazyToken

Implements

Index

Constructors

constructor

Properties

Protected cacheData

endOffset

endOffset: number

startOffset

startOffset: number

tokenType

tokenType: number

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 ')'"

Generated using TypeDoc