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