mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-03 18:16:15 +00:00
40 lines
708 B
PHP
40 lines
708 B
PHP
|
<?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;
|
||
|
}
|
||
|
}
|