Token

Token

new Token(type, content, aliasopt, matchedStropt)

Source:

Creates a new token.

Parameters:
Name Type Attributes Default Description
type string

See type

content string | TokenStream

See content

alias string | Array.<string> <optional>

The alias(es) of the token.

matchedStr string <optional>
""

A copy of the full string this token was created from.

Members

alias :string|Array.<string>

Source:
See:

The alias(es) of the token.

Type:
  • string | Array.<string>

content :string|TokenStream

Source:

The strings or tokens contained by this token.

This will be a token stream if the pattern matched also defined an inside grammar.

Type:

type :string

Source:
See:

The type of the token.

This is usually the key of a pattern in a Grammar.

Type:
  • string