Overview

Namespaces

  • BN
    • Collections
    • Compiler
      • Grammar
      • Parser
        • Operator
        • Token
      • Postfix
        • Operands
        • Operator
        • Token
      • Scanner
        • Converter
      • Token
  • Demo
  • None

Classes

  • AtLeastN
  • FixedCount
  • Operands
  • OperandsSummary
  • Overview
  • Namespace
  • Class
  • Tree
 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: 
BN-PHP - Big Number data type for PHP API documentation generated by ApiGen 2.8.0