This commit is contained in:
2020-12-18 18:59:57 +08:00
parent 7984c42f9e
commit 2dc04656a3
3 changed files with 60 additions and 23 deletions

View File

@ -21,6 +21,7 @@ abstract class ReaderInterface
protected $currentPosition = 0;
protected $currentLinePosition = 0;
protected $nextPosition = 0;
protected $currentToken = "";
/**
* 获取下一个字符
@ -30,14 +31,6 @@ abstract class ReaderInterface
*/
abstract public function getNextChar(): string;
/**
* 获取当前识别符
* @return string
* @author Jerry Yan <792602257@qq.com>
* @date 2020/12/18 12:06
*/
abstract public function getCurrentToken(): string;
/**
* 获取下一个识别符
* @return string
@ -93,4 +86,17 @@ abstract class ReaderInterface
{
$this->reset();
}
public function getCurrentPosition(): int
{
return $this->currentPosition;
}
public function getNextPosition(): int
{
return $this->nextPosition;
}
public function getCurrentToken(): string
{
return $this->currentToken;
}
}