Class: LexElement

LexElement(role, value, inverse)

A lexical element declaring a syntax rule

Constructor

new LexElement(role, value, inverse)

Parameters:
Name Type Description
role LexRole

A role of the lexical element

value string

lexical value.

inverse boolean

inverse the conditional expression for the lexical analyzing.

Source:

Methods

getTokenValue(token) → {string|null}

Get the value of token.

Get the value of token.

Parameters:
Name Type Description
token Token

A token to be tested.

Source:
Returns:

the token value.

Type
string | null

isMatch(token) → {boolean}

Test the token matches to this.

Test the token matches to this.

Parameters:
Name Type Description
token Token

A token to be tested.

Source:
Returns:

the token matches or not.

Type
boolean