summaryrefslogtreecommitdiff
blob: ffca3eb906b33292f4d1e6854e469ca3ca21abb3 (plain)
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
<?php

/**
 * A class representing a whole AST generated by AFPTreeParser, holding AFPTreeNode's. This wrapper
 * could be expanded in the future. For now, it's mostly useful for typehints, and to have an
 * evalTree function in the CachingParser.
 */
class AFPSyntaxTree {
	/**
	 * @var AFPTreeNode|null
	 */
	private $rootNode;

	/**
	 * @param AFPTreeNode|null $root
	 */
	public function __construct( AFPTreeNode $root = null ) {
		$this->rootNode = $root;
	}

	/**
	 * @return AFPTreeNode|null
	 */
	public function getRoot() {
		return $this->rootNode;
	}
}