-
Notifications
You must be signed in to change notification settings - Fork 10
/
Token.php
45 lines (40 loc) · 858 Bytes
/
Token.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace QueryTranslator\Values;
/**
* Token represents a sequence of characters which forms a syntactic unit.
*/
class Token
{
/**
* Token type constant.
*
* Categorizes the token for the purpose of parsing.
* Defined by the language implementation.
*
* @var string
*/
public $type;
/**
* Token lexeme is a part of the input string recognized as token.
*
* @var string
*/
public $lexeme;
/**
* Position of the lexeme in the input string.
*
* @var int
*/
public $position;
/**
* @param string $type
* @param string $lexeme
* @param int $position
*/
public function __construct($type, $lexeme, $position)
{
$this->type = $type;
$this->lexeme = $lexeme;
$this->position = $position;
}
}