-
Notifications
You must be signed in to change notification settings - Fork 10
/
SyntaxTree.php
45 lines (40 loc) · 1.13 KB
/
SyntaxTree.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;
/**
* Syntax tree is an abstract hierarchical representation of the query syntax,
* intended for easy conversion into different concrete formats.
*
* @see \QueryTranslator\Parsing::parse()
*/
class SyntaxTree
{
/**
* The root node of the syntax tree.
*
* @var \QueryTranslator\Values\Node
*/
public $rootNode;
/**
* Token sequence that was parsed into this syntax tree.
*
* @var \QueryTranslator\Values\TokenSequence
*/
public $tokenSequence;
/**
* An array of corrections performed while parsing the token sequence.
*
* @var \QueryTranslator\Values\Correction[]
*/
public $corrections;
/**
* @param \QueryTranslator\Values\Node $rootNode
* @param \QueryTranslator\Values\TokenSequence $tokenSequence
* @param \QueryTranslator\Values\Correction[] $corrections
*/
public function __construct(Node $rootNode, TokenSequence $tokenSequence, array $corrections)
{
$this->rootNode = $rootNode;
$this->tokenSequence = $tokenSequence;
$this->corrections = $corrections;
}
}