Token
in package
Represents a range of characters represented by a lexical token within a Source.
Table of Contents
- AMP = '&'
- AT = '@'
- BANG = '!'
- BLOCK_STRING = 'BlockString'
- BRACE_L = '{'
- BRACE_R = '}'
- BRACKET_L = '['
- BRACKET_R = ']'
- COLON = ':'
- COMMENT = 'Comment'
- DOLLAR = '$'
- EOF = '<EOF>'
- EQUALS = '='
- FLOAT = 'Float'
- INT = 'Int'
- NAME = 'Name'
- PAREN_L = '('
- PAREN_R = ')'
- PIPE = '|'
- SOF = '<SOF>'
- SPREAD = '...'
- STRING = 'String'
- $column : int
- The 1-indexed column number at which this Token begins.
- $end : int
- The character offset at which this Node ends.
- $kind : string
- The kind of Token (see one of constants above).
- $line : int
- The 1-indexed line number on which this Token appears.
- $next : Token|null
- $prev : Token
- Tokens exist as nodes in a double-linked-list amongst all tokens including ignored tokens. <SOF> is always the first node and <EOF> the last.
- $start : int
- The character offset at which this Node begins.
- $value : string|null
- __construct() : mixed
- getDescription() : string
- toArray() : array<string|int, string|int|null>
Constants
AMP
public
mixed
AMP
= '&'
AT
public
mixed
AT
= '@'
BANG
public
mixed
BANG
= '!'
BLOCK_STRING
public
mixed
BLOCK_STRING
= 'BlockString'
BRACE_L
public
mixed
BRACE_L
= '{'
BRACE_R
public
mixed
BRACE_R
= '}'
BRACKET_L
public
mixed
BRACKET_L
= '['
BRACKET_R
public
mixed
BRACKET_R
= ']'
COLON
public
mixed
COLON
= ':'
COMMENT
public
mixed
COMMENT
= 'Comment'
DOLLAR
public
mixed
DOLLAR
= '$'
EOF
public
mixed
EOF
= '<EOF>'
EQUALS
public
mixed
EQUALS
= '='
FLOAT
public
mixed
FLOAT
= 'Float'
INT
public
mixed
INT
= 'Int'
NAME
public
mixed
NAME
= 'Name'
PAREN_L
public
mixed
PAREN_L
= '('
PAREN_R
public
mixed
PAREN_R
= ')'
PIPE
public
mixed
PIPE
= '|'
SOF
public
mixed
SOF
= '<SOF>'
SPREAD
public
mixed
SPREAD
= '...'
STRING
public
mixed
STRING
= 'String'
Properties
$column
The 1-indexed column number at which this Token begins.
public
int
$column
$end
The character offset at which this Node ends.
public
int
$end
$kind
The kind of Token (see one of constants above).
public
string
$kind
$line
The 1-indexed line number on which this Token appears.
public
int
$line
$next
public
Token|null
$next
$prev
Tokens exist as nodes in a double-linked-list amongst all tokens including ignored tokens. <SOF> is always the first node and <EOF> the last.
public
Token
$prev
$start
The character offset at which this Node begins.
public
int
$start
$value
public
string|null
$value
Methods
__construct()
public
__construct(string $kind, int $start, int $end, int $line, int $column[, Token|null $previous = null ][, mixed $value = null ]) : mixed
Parameters
- $kind : string
- $start : int
- $end : int
- $line : int
- $column : int
- $previous : Token|null = null
- $value : mixed = null
Return values
mixed —getDescription()
public
getDescription() : string
Return values
string —toArray()
public
toArray() : array<string|int, string|int|null>