1: <?php
2:
3: namespace BN\Compiler\Postfix\Operands;
4:
5: use BN\Collections\Stack;
6:
7: class FixedCount extends Operands
8: {
9: protected function popOperands(Stack $stack)
10: {
11: $operands = array();
12: $count = 0;
13: while (!$stack->isEmpty()) {
14: $operands[] = $stack->pop();
15: if (++$count == $this->operandsCount) {
16: break;
17: }
18: }
19: return $operands;
20: }
21:
22: protected function isOperandsCountValid($operandsCount)
23: {
24: return $operandsCount == $this->operandsCount;
25: }
26: }
27: