new Tuple(lineno, t, value)
Creates an element of a tokenized input stream;
see factory method grammar.tuple().
Parameters:
| Name | Type | Argument | Description |
|---|---|---|---|
lineno |
number | input position. |
|
t |
module:Base~T |
<nullable> |
terminal, i.e., literal or token object.
|
value |
string |
|
- Source:
Properties:
| Name | Type | Argument | Description |
|---|---|---|---|
lineno |
number | input position. |
|
t |
module:Base~T |
<nullable> |
terminal, i.e., literal or token object.
|
value |
string |
|
Methods
-
escape(s)
-
Escapes non-ASCII and invisible characters using backslash. Similar to
Scanner.escape().Parameters:
Name Type Description sstring string to escape.
Returns:
double-quoted, escaped string.
- Type
- string
Example
escape(null) // returns empty string escape('x') // returns string containing "x" escape('\b') // returns string containing "\b" escape('y') // returns string containing "\x##" or "\u####" -
toString()
-
Displays position, terminal, and associated value.
Returns:
.
- Type
- string