mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-11 05:36:09 +00:00
f8e9ac7e2a
It's an evaluator, not a parser. Change-Id: Ib6d33e8423ea72709cf5a33f4397ba33e352ea80
30 lines
625 B
PHP
30 lines
625 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter\Parser;
|
|
|
|
/**
|
|
* 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 evaluator.
|
|
*/
|
|
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(): ?AFPTreeNode {
|
|
return $this->rootNode;
|
|
}
|
|
}
|