コード例 #1
0
ファイル: Div.php プロジェクト: vpArth/interpreter.php
 protected function doInterpret(IContext $ctx, $l, $r)
 {
     if ($r == 0) {
         throw new DivisionByZero('Деление на 0');
     }
     $ctx->set($this, $l / $r);
 }
コード例 #2
0
ファイル: Pow.php プロジェクト: vpArth/interpreter.php
 protected function doInterpret(IContext $ctx, $l, $r)
 {
     $ctx->set($this, pow($l, $r));
 }
コード例 #3
0
ファイル: Value.php プロジェクト: vpArth/interpreter.php
 function interpret(IContext $context)
 {
     $context->set($this, $this->value);
 }