Determine if there is operator token in operato stack

@return boolean
557906
private function hasOperatorInStack()
    {
        $hasOperatorInStack = false;
        if(!$this->operatorStack->isEmpty()) {
            $top = $this->operatorStack->top();
            if(Token::T_OPERATOR == $top->getType()) {
                $hasOperatorInStack = true;
            }
        }

        return $hasOperatorInStack;
    }
320824
private function _checkNeedBraces() {
		if ($this->_isActive('needBraces')) {
			$stmt = strtolower($this->_currentStatement);
			if (in_array($stmt, array(
				'if',
				'elseif',
				'do',
				'for',
				'foreach'
			)) || ($stmt === "while" && !$this->statementStack->getParentStackItem()->afterDoStatement)) {
				if (!$this->tokenizer->checkNextValidToken(T_BRACES_OPEN)) {
					$msg = $this->_getMessage('NEED_BRACES', $stmt);
					$this->_writeError('needBraces', $msg);
				}
			} else if ($stmt === "else") {
				if (!$this->tokenizer->checkNextValidToken(T_BRACES_OPEN) && !$this->tokenizer->checkNextValidToken(T_IF)) {
					$msg = $this->_getMessage('NEED_BRACES', $stmt);
					$this->_writeError('needBraces', $msg);
				}
			}

			if ($stmt === "while") {
				$this->statementStack->getCurrentStackItem()->afterDoStatement = false;
			}
		}
	}
277935
protected function isBranchToken()
	{
		return in_array($this->tokens[$this->i][0], [T_ELSE, T_ELSEIF, T_IF], true);
	}
699655
private function _validateBinaryOperand($cellID, &$operand, &$stack) {
		if (is_array($operand)) {
			if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) {
				do {
					$operand = array_pop($operand);
				} while (is_array($operand));
			}
		}
		//	Numbers, matrices and booleans can pass straight through, as they're already valid
		if (is_string($operand)) {
			//	We only need special validations for the operand if it is a string
			//	Start by stripping off the quotation marks we use to identify true excel string values internally
			if ($operand > '' && $operand{0} == '"') { $operand = self::_unwrapResult($operand); }
			//	If the string is a numeric value, we treat it as a numeric, so no further testing
			if (!is_numeric($operand)) {
				//	If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations
				if ($operand > '' && $operand{0} == '#') {
					$stack->push('Value', $operand);
					$this->_debugLog->writeDebugLog('Evaluation Result is ', $this->_showTypeDetails($operand));
					return FALSE;
				} elseif (!PHPExcel_Shared_String::convertToNumberIfFraction($operand)) {
					//	If not a numeric or a fraction, then it's a text string, and so can't be used in mathematical binary operations
					$stack->push('Value', '#VALUE!');
					$this->_debugLog->writeDebugLog('Evaluation Result is a ', $this->_showTypeDetails('#VALUE!'));
					return FALSE;
				}
			}
		}

		//	return a true if the value of the operand is one that we can use in normal binary operations
		return TRUE;
	}
834914
protected function lexOperationType(): ?string
    {
        $token = $this->expect(TokenKindEnum::NAME);
        $value = $token->getValue();

        if (isOperation($value)) {
            return $value;
        }

        throw $this->unexpected($token);
    }
765300
public static function checkToken()
    {
        $token = Input::postString('CML_TOKEN');
        if (empty($token)) return false;
        if ($token !== self::getToken()) return false;
        unset($_COOKIE['CML_TOKEN']);
        return true;
    }
60000
public static function StackCalculus ($operand_left, $operator, $operand_right) {
		$operand_left	*= 1.0;
		$operand_right	*= 1.0;
		switch ($operator) {
			case '+':
				return $operand_left + $operand_right;
			case '-':
				return $operand_left - $operand_right;
			case '*':
				return $operand_left * $operand_right;
			case '/':
				if ($operand_right == 0) {
					return false;
				}
				return $operand_left / $operand_right;
			case '%':
				return $operand_left % $operand_right;
		}
	}
1141393
private function parseExpression($return = false)
    {
        //push sentinel
        $this->operatorStack->push(null);

        $token = $this->parseToken();

        while ($token->test(Token::OPERATOR, [$this->binaryOperators, 'isOperator'])) {
            $this->pushOperator(
                $this->binaryOperators->getOperator($token->getValue())
            );
            $token = $this->parseToken();
        }
        while ($this->operatorStack->top() !== null) {
            $this->popOperator();
        }
        //pop sentinel
        $this->operatorStack->pop();

        //A conditional is marked by '?' (punctuation, not operator) so it breaks the loop above.
        if ($token->test(Token::PUNCTUATION, '?')) {
            $this->parseConditional();
        }

        if ($return) {
            return $this->operandStack->pop();
        }

        return null;
    }
989433
public function isDelimiter()
    {
        for ($i = count($this->tokens) - 1; $i >= 0; $i--) {
            $t = $this->tokens[$i];
            if ($t[0] === null || $t[0] === 'COMMENT') {
                continue;
            } elseif ($t[0] === 'OPENER' || $t[0] === 'OPERATOR') {
                return true;
            } elseif ($t[0] === 'IDENT') {
                switch ($t[1]) {
                    // named operators
                    case 'lt':
                    case 'gt':
                    case 'le':
                    case 'ge':
                    case 'eq':
                    case 'ne':
                    case 'cmp':
                    case 'and':
                    case 'or':
                    case 'xor':
                    // other keywords/functions
                    case 'if':
                    case 'elsif':
                    case 'while':
                    case 'unless':
                    case 'split':
                    case 'print':
                        return true;
                }
            }
            return false;
        }
        return true;
    }
1185450
protected function doConvert() {
		$expectOperator = true;

		// Iterate through all tokens, saving the operators and operands to a
		// stack per Dijkstra's shunting yard algorithm.
		/** @var Operator $token */
		while ( false !== ( $token = $this->nextToken() ) ) {
			// In this grammar, there are only binary operators, so every valid
			// rule string will alternate between operator and operand tokens.
			$expectOperator = !$expectOperator;

			if ( $token instanceof Expression ) {
				// Operand
				if ( $expectOperator ) {
					$token->error( 'unexpected operand' );
				}
				$this->operands[] = $token;
				continue;
			} else {
				// Operator
				if ( !$expectOperator ) {
					$token->error( 'unexpected operator' );
				}
				// Resolve higher precedence levels
				$lastOp = end( $this->operators );
				while ( $lastOp && self::$precedence[$token->name] <= self::$precedence[$lastOp->name] ) {
					$this->doOperation( $lastOp );
					array_pop( $this->operators );
					$lastOp = end( $this->operators );
				}
				$this->operators[] = $token;
			}
		}

		// Finish off the stack
		while ( $op = array_pop( $this->operators ) ) {
			$this->doOperation( $op );
		}

		// Make sure the result is sane. The first case is possible for an empty
		// string input, the second should be unreachable.
		if ( !count( $this->operands ) ) {
			$this->error( 'condition expected' );
		} elseif ( count( $this->operands ) > 1 ) {
			$this->error( 'missing operator or too many operands' );
		}

		$value = $this->operands[0];
		if ( $value->type !== 'boolean' ) {
			$this->error( 'the result must have a boolean type' );
		}

		return $this->operands[0]->rpn;
	}
537252
public function hasBeenSignaled()
    {
        $this->requireProcessIsTerminated(__FUNCTION__);

        if (!$this->enhanceSigchildCompatibility && $this->isSigchildEnabled()) {
            throw new RuntimeException('This PHP has been compiled with --enable-sigchild. Term signal can not be retrieved.');
        }

        return $this->processInformation['signaled'];
    }
599385
protected function nextOperand()
    {
        if (isset($this->operands[$this->operandsCount])) {
            $operand = $this->operands[$this->operandsCount];
            if (!$operand->isMultiple()) {
                $this->operandsCount++;
            }
            return $operand;
        }

        return null;
    }
690857
public function process()
    {
        $operands = $this->getOperands();

        if ($operands->containsNull() === true) {
            return null;
        }

        if ($operands->exclusivelyMultipleOrOrdered() === false) {
            $msg = "The Random operator only accepts values with multiple or ordered cardinality.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_CARDINALITY);
        }

        $operand = $operands[0];
        $maxIndex = count($operand) - 1;

        return $operand[mt_rand(0, $maxIndex)];
    }
1252466
protected function current_token(){
		if( !isset($this->tok) ){
			$this->tok = current( $this->input );
			$this->t = self::token_to_symbol( $this->tok );
		} 
		return $this->tok;
	}
619660
public function process()
    {
        $operands = $this->getOperands();

        if (count($operands) === 0) {
            return null;
        }

        if ($operands->exclusivelySingleOrMultiple() === false) {
            $msg = "The Multiple operator only accepts operands with single or omultiple cardinality.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_CARDINALITY);
        }

        $refType = null;
        $returnValue = null;

        foreach ($operands as $operand) {

            if (is_null($operand) || ($operand instanceof MultipleContainer && $operand->isNull())) {
                // As per specs, ignore.
                continue;
            } else {
                if ($refType !== null) {
                    // A reference type as already been identified.
                    if (CommonUtils::inferBaseType($operand) === $refType) {
                        // $operand can be added to $returnValue.
                        static::appendValue($returnValue, $operand);
                    } else {
                        // baseType mismatch.
                        $msg = "The Multiple operator only accepts values with a similar baseType.";
                        throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_BASETYPE);
                    }
                } elseif (($discoveryType = CommonUtils::inferBaseType($operand)) !== false) {
                    // First value being identified as non-null.
                    $refType = $discoveryType;
                    $returnValue = new MultipleContainer($refType);
                    static::appendValue($returnValue, $operand);
                }
            }
        }

        return $returnValue;
    }
633760
private function parseItem()
    {
        $subparser = new StringValue($this->parser, ($this->level + 1));
        $subparser->parse();

        $key = $subparser->getValue();

        $this->debug('key: ' . var_export($key, true));

        if ($this->tokenIs(T_DOUBLE_ARROW)) {
            // We MUST have an key when double arrow is encountered.
            if ($key === null) {
                $this->bailUnexpectedToken();
            }

            $this->pushStack($key);
            $this->parseValue();
            $this->popStack();
        } elseif ($this->tokenIs(',') || $this->tokenIs(')') || $this->tokenIs(']')) {
            // String item without key.
            $this->debug('String item without key.');
            $this->pushStack($this->counter++);
            $this->parser->setValue($this->parser->getStack(), $key);
            $this->popStack();
        }

        if ($this->tokenIs(',')) {
            $this->getNextToken();
            return true;
        }
        if ($this->tokenIs(')') || $this->tokenIs(']')) {
            $this->debug('closing bracket.');
            $this->getNextToken();

            return false;
        }

        return true;
    }
681689
public static boolean hasOperator (@Nullable final IJSExpression aExpr)
  {
    return aExpr instanceof JSOpUnary || aExpr instanceof JSOpBinary || aExpr instanceof JSOpTernary;
  }