<abstract> new Token(name, pat)
Creates a token symbol; should only be used by factory method.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | token name.
Empty string is reserved for |
pat |
RegExp | pattern for token; empty |
- Source:
Properties:
| Name | Type | Argument | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pat |
RegExp | pattern for token; empty |
|||||||||||||
screen |
Array.<Lit> |
<optional> |
contains literals with values matching the pattern, if any. |
||||||||||||
prec |
Object | precedence. Properties
|
|||||||||||||
used |
boolean | true if used in a grammar. |
|||||||||||||
name |
string | name for a token, representation for a literal.
Empty string is reserved for |
Extends
Methods
-
dump()
-
Displays description and precedence, if any.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- string
-
toString()
-
Displays name of a token or
$error.Returns:
- Type
- string