コード例 #1
0
 public final function execute(OperandStack $values)
 {
     $rhs = $values->peek();
     $values->pop();
     $lhs = $values->peek();
     $result = $this->executeImplementation($lhs, $rhs);
     $values->replaceTop($result);
 }
コード例 #2
0
 public function execute(OperandStack $values)
 {
     $operand = $values->peek();
     $result = 1;
     while ($operand > 0) {
         $result *= $operand;
         $operand -= 1;
     }
     $values->replaceTop($result);
 }