Lines Matching refs:stack

207 			$stack = $this->nfx( $matches[3] );
208 if ( false === $stack ) {
212 $stack_count = count( $stack );
214 $token = $stack[ $i ];
217 $stack[ $i ] = $this->variables[ $token ];
223 $this->functions[ $function_name ] = array( 'args' => $args, 'func' => $stack );
272 $stack = new EvalMath_Stack();
298 $stack->push( '_' );
314 …while ( $stack->count > 0 && ( $o2 = $stack->last() ) && in_array( $o2, $ops, true ) && ( $ops_r[ …
316 $output[] = $stack->pop();
319 $stack->push( $op ); // Finally put OUR operator onto the stack.
327 while ( '(' !== ( $o2 = $stack->pop() ) ) {
336 …if ( 1 === preg_match( '/^(' . self::$name_pattern . ')\($/', (string) $stack->last( 2 ), $matches…
340 $arg_count = $stack->pop();
341 $stack->pop(); // $fn
376 while ( '(' !== ( $o2 = $stack->pop() ) ) {
386 …if ( 0 === preg_match( '/^(' . self::$name_pattern . ')\($/', (string) $stack->last( 2 ), $matches…
390 $stack->push( $stack->pop() + 1 );
392 $stack->push( '(' );
397 $stack->push( '(' ); // That was easy.
408 $stack->push( $value );
409 $stack->push( 1 );
410 $stack->push( '(' );
425 if ( '(' !== $stack->last() || 1 !== $stack->last( 2 ) ) {
429 …if ( 1 === preg_match( '/^(' . self::$name_pattern . ')\($/', (string) $stack->last( 3 ), $matches…
430 $stack->pop(); // (
431 $stack->pop(); // 1
432 $stack->pop(); // $fn
480 while ( ! is_null( $op = $stack->pop() ) ) {
505 $stack = new EvalMath_Stack();
515 $op1 = $stack->pop();
534 $arg = $stack->pop();
559 $stack->push( $result );
566 $arg = $stack->pop();
574 $stack->push( $this->pfx( $this->functions[ $function_name ]['func'], $args ) );
579 $op2 = $stack->pop();
583 $op1 = $stack->pop();
589 $stack->push( $op1 + $op2 );
592 $stack->push( $op1 - $op2 );
595 $stack->push( $op1 * $op2 );
601 $stack->push( $op1 / $op2 );
604 $stack->push( pow( $op1, $op2 ) );
607 $stack->push( (int) ( $op1 > $op2 ) );
610 $stack->push( (int) ( $op1 < $op2 ) );
614 …$stack->push( (int) ( $op1 == $op2 ) ); // Don't use === as the variable type can differ (int/doub…
620 $stack->push( -1 * $stack->pop() );
625 $stack->push( $token );
627 $stack->push( $this->variables[ $token ] );
629 $stack->push( $variables[ $token ] );
636 if ( 1 !== $stack->count ) {
639 return $stack->pop();
739 protected $stack = array(); variable in EvalMath_Stack
757 $this->stack[ $this->count ] = $value;
771 return $this->stack[ $this->count ];
786 return $this->stack[ $this->count - $n ];