| 1 |
<?php |
| 2 |
/** |
| 3 |
* This file is part of the Peast package |
| 4 |
* |
| 5 |
* (c) Marco Marchiò <[email protected]> |
| 6 |
* |
| 7 |
* For the full copyright and license information refer to the LICENSE file |
| 8 |
* distributed with this source code |
| 9 |
*/ |
| 10 |
namespace Peast\Syntax\Node; |
| 11 |
|
| 12 |
/** |
| 13 |
* A node that represents a BigInt literal. |
| 14 |
* |
| 15 |
* @author Marco Marchiò <[email protected]> |
| 16 |
*/ |
| 17 |
class BigIntLiteral extends Literal |
| 18 |
{ |
| 19 |
/** |
| 20 |
* Map of node properties |
| 21 |
* |
| 22 |
* @var array |
| 23 |
*/ |
| 24 |
protected $propertiesMap = array( |
| 25 |
"bigint" => false |
| 26 |
); |
| 27 |
|
| 28 |
/** |
| 29 |
* Node's value |
| 30 |
* |
| 31 |
* @var mixed |
| 32 |
*/ |
| 33 |
protected $bigint; |
| 34 |
|
| 35 |
/** |
| 36 |
* Sets node's value |
| 37 |
* |
| 38 |
* @param float $value Value |
| 39 |
* |
| 40 |
* @return $this |
| 41 |
*/ |
| 42 |
public function setValue($value) |
| 43 |
{ |
| 44 |
//Value, Raw and Bigint are always the same value |
| 45 |
$this->value = $this->raw = $this->bigint = $value; |
| 46 |
return $this; |
| 47 |
} |
| 48 |
|
| 49 |
/** |
| 50 |
* Returns node's value |
| 51 |
* |
| 52 |
* @return string |
| 53 |
*/ |
| 54 |
public function getBigint() |
| 55 |
{ |
| 56 |
return $this->bigint; |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Sets node's value |
| 61 |
* |
| 62 |
* @param string $bigint Value |
| 63 |
* |
| 64 |
* @return $this |
| 65 |
*/ |
| 66 |
public function setBigint($bigint) |
| 67 |
{ |
| 68 |
return $this->setValue($bigint); |
| 69 |
} |
| 70 |
} |