diff --git a/src/AST/Statement/StatementInterface.php b/src/AST/Statement/StatementInterface.php new file mode 100644 index 0000000..76a83bd --- /dev/null +++ b/src/AST/Statement/StatementInterface.php @@ -0,0 +1,40 @@ + + * @date 2021/2/22 13:56 + */ + + +namespace JerryYan\DSL\AST\Statement; + + +abstract class StatementInterface +{ + /** @var ?StatementInterface */ + protected $parent; + /** @var ?StatementInterface */ + protected $child; + + /** + * @param StatementInterface|null $parent + * @author Jerry Yan <792602257@qq.com> + * @date 2021/3/16 9:49 + */ + public function setParent(?StatementInterface $parent): void + { + $this->parent = $parent; + } + + /** + * @param StatementInterface|null $child + * @author Jerry Yan <792602257@qq.com> + * @date 2021/3/16 9:50 + */ + public function setChild(?StatementInterface $child): void + { + $this->child = $child; + } + + abstract public function validate(): bool; +}