public function readToken(): Token
    {
        // List of types is reverse-sorted by frequency for typical locator.
        $typeList = [
            Token::TYPE_UNESCAPED,
            Token::TYPE_SLASH,
            Token::TYPE_ESCAPED,
        ];
        $token = $this->matchNextToken($typeList);
        if (null === $token) {
            // Checking for known syntax errors.
            $errorTypeList = [
                Token::TYPE_ERROR_INVALID_ESCAPE,
            ];
            $token = $this->matchNextToken($errorTypeList);
        }
        if (null === $token) {
            throw new UnknownSyntaxException("Unknown syntax error in source text");
        }
        return $token;
    }
public function readToken(): Token
    {
        // List of types is reverse-sorted by frequency for typical locator.
        $typeList = [
            Token::TYPE_UNESCAPED,
            Token::TYPE_SLASH,
            Token::TYPE_ESCAPED,
        ];
        $token = $this->matchNextToken($typeList);
        if (null === $token) {
            // Checking for known syntax errors.
            $errorTypeList = [
                Token::TYPE_ERROR_INVALID_ESCAPE,
            ];
            $token = $this->matchNextToken($errorTypeList);
        }
        if (null === $token) {
            throw new UnknownSyntaxException("Unknown syntax error in source text");
        }
        return $token;
    }
public function readToken ( ) : Token { // List of types is reverse-sorted by frequency for typical locator. $ typeList = [ Token :: TYPE_UNESCAPED , Token :: TYPE_SLASH , Token :: TYPE_ESCAPED , ] ; $ token = $ this -> matchNextToken ( $ typeList ) ; if ( null === $ token ) { // Checking for known syntax errors. $ errorTypeList = [ Token :: TYPE_ERROR_INVALID_ESCAPE , ] ; $ token = $ this -> matchNextToken ( $ errorTypeList ) ; } if ( null === $ token ) { throw new UnknownSyntaxException ( "Unknown syntax error in source text" ) ; } return $ token ; }
Reads next token from text.

@return Token
Reads next token from text .