Esempio n. 1
0
 /**
  * Constructor...
  *
  * @param \vc\Tokens\Token $token The token that was encountered
  * @param Array $search The list of tokens being searched for
  * @param Array $allowed The list of allowed tokens
  */
 public function __construct(\vc\Tokens\Token $token, array $search, array $allowed = array())
 {
     parent::__construct(sprintf('Unexpected Token (%s) on line %d', $token->getName(), $token->getLine()));
     $this->addData("Encountered Token", $token->getName());
     $this->addData("Token Line", $token->getLine());
     $this->addData("Token Content", $token->getContent());
     $this->addData("Searching for Tokens", implode(", ", array_map(array('\\vc\\Tokens\\Token', 'getTokenName'), $search)));
     $this->addData("Allowed Tokens", implode(", ", array_map(array('\\vc\\Tokens\\Token', 'getTokenName'), $allowed)));
 }
Esempio n. 2
0
 /**
  * Constructor...
  *
  * @param Array $search The list of tokens being searched for
  * @param Array $allowed The list of allowed tokens
  */
 public function __construct(array $search, array $allowed = array())
 {
     parent::__construct("Unexpected End of Tokens");
     $this->addData("Searching for Tokens", implode(", ", array_map(array('\\vc\\Tokens\\Token', 'getTokenName'), $search)));
     $this->addData("Allowed Tokens", implode(", ", array_map(array('\\vc\\Tokens\\Token', 'getTokenName'), $allowed)));
 }
Esempio n. 3
0
 /**
  * Constructor...
  *
  * @param String $symbol The token value that was encountered
  */
 public function __construct($symbol)
 {
     parent::__construct("Unrecognized Token");
     $this->addData("Symbol", $symbol);
 }
Esempio n. 4
0
 /**
  * Logs that a file could not be parsed
  *
  * @param \r8\FileSys\File $file The file that was parsed
  * @param \vc\Tokens\Exception $err The error that occurred
  * @return NULL
  */
 public function errorParsingFile(\r8\FileSys\File $file, \vc\Tokens\Exception $err)
 {
     $this->log->warning(sprintf('Unable to parse file (%s) becase of error: %s', $file->getPath(), $err->getMessage()), 'PARSE_ERR');
 }