private function getInteger(Token $token)
{
$value = $token->getValue();
if (preg_match('/([^\\d]_[^\\d])|(_$)/', $value)) {
throw new ParseException('Invalid integer number: underscore must be surrounded by at least one digit', $this->currentLine, $token->getValue());
}
$value = str_replace('_', '', $value);
if (preg_match('/^0\\d+/', $value)) {
throw new ParseException('Invalid integer number: leading zeros are not allowed', $this->currentLine, $token->getValue());
}
return (int) $value;
}