You've already forked MyDSL
抽象
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user