Returns an instance of SoqlExpression interface, dependent on
the given string, an plain Expression (fieldname), Function() or
AggregateFunction()

@param $left
@return mixed
345626
private function buildLeftExpression($left)
    {
        if(self::CONTEXT_HAVING === $this->getContext())
        {
            return $this->parser->parseLeftHavingSoql($left);
        }
        return $this->parser->parseLeftWhereSoql($left);
    }
1145419
private function getCommonPrefixString($left, $right)
    {
        for ($i = 1; $i < strlen($left); $i++) {
            if (substr_compare($left, $right, 0, $i) !== 0) {
                return substr($left, 0, $i - 1);
            }
        }
        return substr($left, 0, $i);
    }
777276
public function shallowEquals(Atomic $other)
    {
        return strtolower($this->getKey()) === strtolower($other->getKey())
            && !($other instanceof ObjectLike && $this instanceof ObjectLike);
    }
1288412
function where($left, $operator = Query::EQUAL, $right = null, $quote = null) {
		if (func_num_args() === 1) {
			return $this->addAnd($left);
		}
		return $this->addAnd($left, $right, $operator, $quote);
	}
1346579
public function leftJoin($table, $criteria = null, $alias = null)
    {
        return $this->join($table, $criteria, self::LEFT_JOIN, $alias);
    }
1115851
public function getWhereExpression()
    {
        if (!count($this->filters)) {
            return null;
        }

        $wrapExpr = $this->qb->expr()->andX();
        $config = $this->config->getConfig($this->contentType);
        $searchExpr = $this->qb->expr()->orX();
        $searchKeys = array_keys($config);

        /** @var Filter $filter */
        foreach ($this->filters as $filter) {
            if (in_array($filter->getKey(), $searchKeys, true)) {
                $searchExpr->add($filter->getExpression());
            } else {
                $wrapExpr->add($filter->getExpression());
            }
        }
        $wrapExpr->add($searchExpr);

        return $wrapExpr;
    }
1022826
protected function getFirstTableAlias(
        /*# string */ $left
    )/*# : string */ {
        if (false !== strpos($left, '.')) { // alias exists
            return '';
        } else { // prepend first table alias
            $tables = &$this->getClause('TABLE');
            reset($tables);
            $alias = key($tables);
            return (is_int($alias) ? $tables[$alias][0] : $alias) . '.';
        }
    }
3792
private static function doOperation( $token, $left, $right ) {
		if ( in_array( $token, [ 'in', 'not-in', 'within', 'not-within' ] ) ) {
			if ( !$right instanceof Range ) {
				$right = new Range( $right );
			}
		}
		switch ( $token ) {
			case 'or':
				return $left || $right;
			case 'and':
				return $left && $right;
			case 'is':
				return $left == $right;
			case 'is-not':
				return $left != $right;
			case 'in':
				return $right->isNumberIn( $left );
			case 'not-in':
				return !$right->isNumberIn( $left );
			case 'within':
				return $right->isNumberWithin( $left );
			case 'not-within':
				return !$right->isNumberWithin( $left );
			case 'mod':
				if ( is_int( $left ) ) {
					return (int)fmod( $left, $right );
				}

				return fmod( $left, $right );
			case ',':
				if ( $left instanceof Range ) {
					$range = $left;
				} else {
					$range = new Range( $left );
				}
				$range->add( $right );

				return $range;
			case '..':
				return new Range( $left, $right );
			default:
				throw new Error( "Invalid RPN token" );
		}
	}
555708
protected function opAdd($left, $right)
    {
        if ($strLeft = $this->coerceString($left)) {
            if ($right[0] === Type::T_STRING) {
                $right[1] = '';
            }

            $strLeft[2][] = $right;

            return $strLeft;
        }

        if ($strRight = $this->coerceString($right)) {
            if ($left[0] === Type::T_STRING) {
                $left[1] = '';
            }

            array_unshift($strRight[2], $left);

            return $strRight;
        }

        return null;
    }
463936
public function left ( $count = 0 ) {
        $this->_currentPosition = array(
                                        $this->_currentPosition[0] - $count,
                                        $this->_currentPosition[1],
                                       );
        return $this;
    }
872215
private function doubleExponentiation($leftOperand, $rightOperand)
    {
        // (x^a)^b -> x^(ab) for a, b numbers
        if ($leftOperand instanceof ExpressionNode && $leftOperand->getOperator() == '^') {

            $factory = new MultiplicationNodeFactory();
            $power = $factory->makeNode($leftOperand->getRight(), $rightOperand);

            $base = $leftOperand->getLeft();
            return self::makeNode($base,  $power);
        }

        // No simplification found
        return null;
    }
1201272
public function leftJoinOn($table, $where)
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 2 must be a string
            ->test(2, 'string');
        
        $where = func_get_args();
        $table = array_shift($where);
        
        $this->join[] = array(self::LEFT, $table, $where, false);
        
        return $this;
    }
144267
public static <A extends Comparable<? super A>> ComparableExpression<A> max(CollectionExpression<?,A> left) {
        return Expressions.comparableOperation((Class) left.getParameter(0), Ops.QuantOps.MAX_IN_COL, (Expression<?>) left);
    }
906321
protected function queryBetween($left, $right)
    {
        $sortableField = static::getSortableField();
        $query = static::applySortableGroup($this->newQuery(), $this);

        return $query->where($sortableField, '>', $left)->where($sortableField, '<', $right);
    }
833232
public function getExpression()
    {
        $returnValue = null;

        
		common_Logger::i('Evaluating rule '.$this->getLabel().'('.$this->getUri().')', array('Generis Rule'));
         if(empty($this->expression)){
         	$property = new core_kernel_classes_Property(RulesRdf::PROPERTY_RULE_IF);
         	$this->expression = new core_kernel_rules_Expression($this->getUniquePropertyValue($property)->getUri() ,__METHOD__);
        }
        $returnValue = $this->expression;
        

        return $returnValue;
    }
561339
protected function valueEquals($left, $right)
    {
        if ($left instanceof EqualityComparable) {
            return $left->isEqualTo($right, $this);
        } elseif ($right instanceof EqualityComparable) {
            return $right->isEqualTo($left, $this);
        }

        switch (gettype($left)) {
            case 'array':
                return $this->arrayEquals($left, $right);
            case 'object':
                return $this->objectEquals($left, $right);
        }

        return $left === $right;
    }
762997
public function getDSQLExpression($expression)
    {
        if (!$this->owner->persistence || !$this->owner->persistence instanceof Persistence\SQL) {
            throw new Exception([
                'Field must have SQL persistence if it is used as part of expression',
                'persistence'=> $this->owner->persistence ?? null,
            ]);
        }

        return $this->owner->persistence->getFieldSQLExpression($this, $expression);
    }