本文整理匯總了PHP中Token::resolve方法的典型用法代碼示例。如果您正苦於以下問題:PHP Token::resolve方法的具體用法?PHP Token::resolve怎麽用?PHP Token::resolve使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Token
的用法示例。
在下文中一共展示了Token::resolve方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resolve
/**
* Resolves all tokens in this scope.
*
* @param int $i The current token index
* @param array $tokens The tokens being parsed
* @throws \gettext\pluralparser\ParseException If this token cannot be resolved
*/
public function resolve(&$i = 0, array &$tokens = null)
{
if (!$this->isResolved()) {
parent::resolve($i, $tokens);
$this->resolve0();
}
}
示例2: resolve
/**
* Removes the next token from the scope.
*
* @param int $i The current token index
* @param array $tokens The tokens being parsed
* @throws \gettext\pluralparser\ParseException If this token cannot be resolved
*/
public function resolve(&$i = 0, array &$tokens = null)
{
if (!$this->isResolved()) {
parent::resolve($i, $tokens);
if ($i + 1 < count($tokens)) {
$this->value = array_splice($tokens, $i + 1, 1)[0];
if (!is_int($this->value)) {
$this->value->resolve($i, $tokens);
}
} else {
throw new \gettext\pluralparser\ParseException('No value to negate');
}
}
}
示例3: resolve
/**
* Removes the left and right tokens from the scope.
*
* @param int $i The current token index
* @param array $tokens The tokens being parsed
* @throws \gettext\pluralparser\ParseException If this token cannot be resolved
*/
public function resolve(&$i = 0, array &$tokens = null)
{
if (!$this->isResolved()) {
parent::resolve($i, $tokens);
if ($i > 0 && $i + 1 < count($tokens)) {
$this->rhs = array_splice($tokens, $i + 1, 1)[0];
$this->lhs = array_splice($tokens, $i - 1, 1)[0];
if (!is_int($this->rhs)) {
$this->rhs->resolve($i, $tokens);
}
$i--;
} else {
throw new \gettext\pluralparser\ParseException($this->operator . 'without arguments');
}
}
}