/** * @param Token $eofToken * * @return string */ public function unexpectedEOF(Token $eofToken) { $msgTemplate = 'unexpected end-of-file at at line %s, column %s'; $msg = sprintf($msgTemplate, $eofToken->getPosition()->getLine(), $eofToken->getPosition()->getColumn()); return $msg; }
/** * @return CharPosition */ public function getTextPosition() { $textPosition = $this->illegalToken->getPosition(); return $textPosition; }
/** * @param Token $token * @param int $type * @param string $value * * @return bool */ public function hasSameTypeAndValue(Token $token, $type, $value) { return $token->getType() === $type && $token->getValue() === $value; }