From 8b97e99bb75043382389a232ffee4b261d34f6b7 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 17 Mar 2021 12:09:59 +0800 Subject: [PATCH] =?UTF-8?q?Stmt=E5=88=9B=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AST/Statement/StatementInterface.php | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/AST/Statement/StatementInterface.php 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; +}