Class: Tuple

Base~ Tuple

Represents an element of a tokenized input stream.


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. null is reserved for unrecognizable input.

value string

t's representation in the input.

Properties:
Name Type Argument Description
lineno number

input position.

t module:Base~T <nullable>

terminal, i.e., literal or token object. null is reserved for unrecognizable input.

value string

t's representation in the input.

Source:

Methods


escape(s)

Escapes non-ASCII and invisible characters using backslash. Similar to Scanner.escape().

Parameters:
Name Type Description
s string

string to escape.

Source:
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.

Source:
Returns:

.

Type
string