Stmt创建
This commit is contained in:
parent
42df1352d2
commit
8b97e99bb7
40
src/AST/Statement/StatementInterface.php
Normal file
40
src/AST/Statement/StatementInterface.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @filename StatementInterface.php
|
||||
* @author Jerry Yan <792602257@qq.com>
|
||||
* @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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user