new Token(name, pat)
Creates a token symbol for BNF;
see factory method grammar.token().
Sets .expect to contain this.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | token name. |
pat |
RegExp | for a token. |
- Mixes In:
- Source:
Properties:
| Name | Type | Argument | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
expect |
module:EBNF~Set | set of terminals which a node
expects to see as |
|||||||||||||
follow |
module:EBNF~Set |
<nullable> |
see |
||||||||||||
name |
string | name for the token.
Empty string is reserved for |
|||||||||||||
used |
boolean | true if used in a grammar. |
|||||||||||||
prec |
Object | precedence. Properties
|
|||||||||||||
pat |
RegExp | pattern for token; empty |
|||||||||||||
screen |
Array.<Lit> |
<optional> |
contains literals with values matching the pattern, if any. |
Extends
Methods
-
dump()
-
Displays description and precedence, if any.
- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- string
-
toString()
-
Displays name of a token or
$error.- Inherited From:
- Overrides:
- Source:
Returns:
- Type
- string