Farkle


Token Type

A token is an instance of a `Terminal`. Tokens carry post-processed terminals, as well as their position in the text.

Constructors

Constructor Description

Token(position, symbol, data)

Full Usage: Token(position, symbol, data)

Parameters:
Returns: Token
position : Position
symbol : Terminal
data : obj
Returns: Token

Instance members

Instance member Description

this.Data

Full Usage: this.Data

Returns: obj

The object the `PostProcessor` created for this token.

Returns: obj

this.IsEOF

Full Usage: this.IsEOF

Returns: bool

Whether the token signifies that input ended. When this property is set to true, the `Token.Symbol` and `Token.Data` properties have undefined values.

Returns: bool

this.Position

Full Usage: this.Position

Returns: Position

The `Position` of the token in the input string.

Returns: Position

this.Symbol

Full Usage: this.Symbol

Returns: Terminal

The `Terminal` whose instance is this token.

Returns: Terminal

Static members

Static member Description

Token.CreateEOF(position)

Full Usage: Token.CreateEOF(position)

Parameters:
Returns: Token

Creates a token that signifies the end of input at the given position.

position : Position
Returns: Token