Пример #1
0
 /**
  * @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;
 }
Пример #2
0
 /**
  * @return CharPosition
  */
 public function getTextPosition()
 {
     $textPosition = $this->illegalToken->getPosition();
     return $textPosition;
 }
Пример #3
0
 /**
  * @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;
 }