| 1 | <?php |
||
| 7 | class OperandStack |
||
| 8 | { |
||
| 9 | /** @var \SplStack */ |
||
| 10 | private $stack; |
||
| 11 | |||
| 12 | 15 | public function __construct(\SplStack $storage = null) |
|
| 16 | |||
| 17 | /** |
||
| 18 | * @param OperandInterface $operand |
||
| 19 | */ |
||
| 20 | 11 | public function push(OperandInterface $operand) |
|
| 24 | |||
| 25 | /** |
||
| 26 | * @return OperandInterface |
||
| 27 | */ |
||
| 28 | 9 | public function pop() |
|
| 32 | |||
| 33 | /** |
||
| 34 | * @return OperandInterface|null |
||
| 35 | */ |
||
| 36 | 12 | public function top() |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | 13 | public function isEmpty() |
|
| 50 | } |
||
| 51 |