mediawiki-extensions-AbuseF.../includes/parser/AFPSyntaxTree.php

40 lines
708 B
PHP
Raw Normal View History

<?php
/**
* A class representing a whole AST generated by AFPTreeParser, holding AFPTreeNode's and a list
* of custom variable names.
*/
class AFPSyntaxTree {
/**
* @var AFPTreeNode|null
*/
private $rootNode;
/**
* @var string[]
*/
private $variableNames;
/**
* @param string[] $variableNames
* @param AFPTreeNode|null $root
*/
public function __construct( array $variableNames, AFPTreeNode $root = null ) {
$this->rootNode = $root;
$this->variableNames = $variableNames;
}
/**
* @return AFPTreeNode|null
*/
public function getRoot() {
return $this->rootNode;
}
/**
* @return string[]
*/
public function getVariableNames() {
return $this->variableNames;
}
}