基础内容

This commit is contained in:
2020-12-17 16:13:32 +08:00
parent 31009d24c6
commit 9484b3c098
21 changed files with 343 additions and 1 deletions

View File

@ -0,0 +1,44 @@
<?php
/**
* @filename ReaderInterface.php
* @author Jerry Yan <792602257@qq.com>
* @date 2020/12/17 14:58
*/
namespace JerryYan\DSL\Reader;
/**
* 解析器需要使用到的读取类
* @package JerryYan\DSL\Reader
* @author Jerry Yan <792602257@qq.com>
* @date 2020/12/17 15:37
*/
abstract class ReaderInterface
{
protected $currentLine = 0;
protected $currentPosition = 0;
protected $currentLinePosition = 0;
#abstract public function getNextChar(): ?string;
#abstract public function getCurrentToken(): ?string;
#abstract public function getNextToken(): ?string;
#abstract public function moveToNextToken(): ?string;
/**
* 跳过当前行
* @return bool
* @author Jerry Yan <792602257@qq.com>
* @date 2020/12/17 15:43
*/
#abstract public function skipCurrentLine(): bool;
/**
* 从当前位置跳到结束位置
* @param string $end
* @return bool
* @author Jerry Yan <792602257@qq.com>
* @date 2020/12/17 15:43
*/
#abstract public function skipUntil(string $end="*/"): bool;
}