You've already forked MyDSL
基础内容
This commit is contained in:
44
src/Reader/ReaderInterface.php
Normal file
44
src/Reader/ReaderInterface.php
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user