$hex =
$this->scanner->
getHex();
if (empty($hex)) { $this->
parseError('Expected &#xHEX;, got &#x%s',
$tok);
// We unconsume because we don't know what parser rules might
// be in effect for the remaining chars. For example. '&#>'
// might result in a specific parsing rule inside of tag
// contexts, while not inside of pcdata context.
$this->scanner->
unconsume(2
);
return '&';
} $entity = CharacterReference::
lookupHex($hex);
} // Decimal encoding.
// [0-9]+;
else { // Convert from decimal to char.
$numeric =
$this->scanner->
getNumeric();
if (false ===
$numeric) { $this->
parseError('Expected &#DIGITS;, got &#%s',
$tok);
$this->scanner->
unconsume(2
);
return '&';
}