Gets the variables that make up the current expression
    :param expression:
    :return:
774204
def _get_expr_variables(expression: z3.ExprRef) -> List[z3.ExprRef]:
    
    result = []
    if not expression.children() and not isinstance(expression, z3.BitVecNumRef):
        result.append(expression)
    for child in expression.children():
        c_children = _get_expr_variables(child)
        result.extend(c_children)
    return result
226045
private static ExpressionPart getExpressionPart(String expressionPart,
                                                    ModelField currentFact) {
        if (currentFact == null) {
            return new ExpressionText(expressionPart);
        } else {
            return new ExpressionVariable(expressionPart,
                                          currentFact.getClassName(),
                                          currentFact.getType());
        }
    }
404586
protected Object getParsedExpression(final String expression) {
		try {
			return Ognl.parseExpression(expression);
		} catch (OgnlException ex) {
			throw new OgnlRuntimeException("Failed to parse the expression.[" + expression + "]", ex);
		}
	}
1204156
public static Set<String> getFreeVariables(Expression2 expression) {
    Set<String> freeVariables = Sets.newHashSet();
    ScopeSet scopes = getScopes(expression);
    for (int i = 0; i < expression.size(); i++) {
      Scope scope = scopes.getScope(i);
      String varName = getFreeVariable(expression, i, scope);
      if (varName != null) {
        freeVariables.add(varName);
      }
    }
    return freeVariables;
  }
856152
public void visitVariableExpression(VariableExpression expression) {
        String variableName = expression.getName();

        //-----------------------------------------------------------------------
        // SPECIAL CASES

        // "this" for static methods is the Class instance
        ClassNode classNode = controller.getClassNode();
        //if (controller.isInClosure()) classNode = controller.getOutermostClass();

        if (variableName.equals("this")) {
            if (controller.isStaticMethod() || (!controller.getCompileStack().isImplicitThis() && controller.isStaticContext())) {
                if (controller.isInClosure()) classNode = controller.getOutermostClass();
                visitClassExpression(new ClassExpression(classNode));
            } else {
                loadThis(expression);
            }
            return;
        }

        // "super" also requires special handling
        if (variableName.equals("super")) {
            if (controller.isStaticMethod()) {
                visitClassExpression(new ClassExpression(classNode.getSuperClass()));
            } else {
                loadThis(expression);
            }
            return;
        }

        BytecodeVariable variable = controller.getCompileStack().getVariable(variableName, false);
        if (variable == null) {
            processClassVariable(variableName);
        } else {
            controller.getOperandStack().loadOrStoreVariable(variable, expression.isUseReferenceDirectly());
        }
        if (!controller.getCompileStack().isLHS()) controller.getAssertionWriter().record(expression);
    }
15074
def _process_nested_expression(self, nested_expression) -> str:
        
        expression_is_list = isinstance(nested_expression, list)
        expression_size = len(nested_expression)
        if expression_is_list and expression_size == 1 and isinstance(nested_expression[0], list):
            return self._process_nested_expression(nested_expression[0])
        elements_are_leaves = [isinstance(element, str) for element in nested_expression]
        if all(elements_are_leaves):
            mapped_names = [self._map_name(name) for name in nested_expression]
        else:
            mapped_names = []
            for element, is_leaf in zip(nested_expression, elements_are_leaves):
                if is_leaf:
                    mapped_names.append(self._map_name(element))
                else:
                    mapped_names.append(self._process_nested_expression(element))
        if mapped_names[0] == "\\":
            # This means the predicate is lambda. NLTK wants the variable name to not be within parantheses.
            # Adding parentheses after the variable.
            arguments = [mapped_names[1]] + [f"({name})" for name in mapped_names[2:]]
        else:
            arguments = [f"({name})" for name in mapped_names[1:]]
        return f'({mapped_names[0]} {" ".join(arguments)})'
1224562
public Set<String> getVariableNames()
    {
        final ImmutableSet.Builder<String> sb = ImmutableSet.builder();
        for (final Expression expr : expressions)
            for (final Variable var : expr.getVariables())
                sb.add(var.getName());
        return sb.build();
    }
639218
function scopeExpression(expression) {
	return expression.replace(expressionRE, (match, name) =>
		(
			name === undefined ||
			name[0] === "$" ||
			globals.indexOf(name) !== -1
		) ?
			match :
			"data." + name
	);
}
188798
private List<String> getVariables(String routePath) {
		List<String> variables = new ArrayList<String>();

		Matcher matcher = Pattern.compile(Path.VAR_REGEXP).matcher(routePath);
		while (matcher.find()) {
			// group(0) always stands for the entire expression and we only want what is inside the {}
			variables.add(matcher.group(1));
		}

		return variables;
	}
321694
def all_variables

      return nil if @expressions.empty?

      @expressions.each_with_object({}) { |exp, h|
        h[exp.fei] = exp.variables if exp.variables
      }
    end
115867
public String getExpressionString() {
        StringBuffer buf = new StringBuffer();
        for (int i = 0; i < mElements.length; i++) {
            Object elem = mElements[i];
            if (elem instanceof String) {
                buf.append((String) elem);
            } else if (elem instanceof Expression) {
                buf.append("${");
                buf.append(((Expression) elem).getExpressionString());
                buf.append("}");
            }
        }
        return buf.toString();
    }
711252
private function parseExpression($expression)
    {
        // Check for URI operators
        $operator = '';

        if (isset(self::$operatorHash[$expression[0]])) {
            $operator = $expression[0];
            $expression = substr($expression, 1);
        }

        $values = explode(',', $expression);
        foreach ($values as &$value) {
            $value = trim($value);
            $varspec = array();
            $substrPos = strpos($value, ':');
            if ($substrPos) {
                $varspec['value'] = substr($value, 0, $substrPos);
                $varspec['modifier'] = ':';
                $varspec['position'] = (int) substr($value, $substrPos + 1);
            } elseif (substr($value, -1) == '*') {
                $varspec['modifier'] = '*';
                $varspec['value'] = substr($value, 0, -1);
            } else {
                $varspec['value'] = (string) $value;
                $varspec['modifier'] = '';
            }
            $value = $varspec;
        }

        return array(
            'operator' => $operator,
            'values'   => $values
        );
    }
949636
private function parseExpression($expression)
    {
        $result = array();

        if (isset(self::$operatorHash[$expression[0]])) {
            $result['operator'] = $expression[0];
            $expression = substr($expression, 1);
        } else {
            $result['operator'] = '';
        }

        foreach (explode(',', $expression) as $value) {
            $value = trim($value);
            $varspec = array();
            if ($colonPos = strpos($value, ':')) {
                $varspec['value'] = substr($value, 0, $colonPos);
                $varspec['modifier'] = ':';
                $varspec['position'] = (int) substr($value, $colonPos + 1);
            } elseif (substr($value, -1) == '*') {
                $varspec['modifier'] = '*';
                $varspec['value'] = substr($value, 0, -1);
            } else {
                $varspec['value'] = (string) $value;
                $varspec['modifier'] = '';
            }
            $result['values'][] = $varspec;
        }

        return $result;
    }
386506
public Object eval(String expression) {
    	expression = transform(expression);
    	Object result = calculate(expression);
        return result;
    }
636419
def _expression_to_string(expression):
    
    if isinstance(expression, BinaryExp):
        left = _expression_to_string(expression.op1)
        if isinstance(expression.op1, BinaryExp) and not (
                expression.op1.precedence > expression.precedence
                or expression.op1.precedence == expression.precedence
                and expression.associates in ('left', 'both')):
            left = '(' + left + ')'

        right = _expression_to_string(expression.op2)
        if isinstance(expression.op2, BinaryExp) and not (
                expression.precedence < expression.op2.precedence
                or expression.precedence == expression.op2.precedence
                and expression.associates in ('right', 'both')):
            right = '(' + right + ')'

        return left + expression.operator + right
    elif isinstance(expression, Function):
        return expression.name + '(' + _expression_to_string(expression.expression) + ')'
    elif isinstance(expression, Parameter):
        return str(expression)
    else:
        return format_parameter(expression)
1165939
def _merge_expressions(self, other):
        
        new_inputs = tuple(set(self.inputs).union(other.inputs))
        new_self_expr = self._rebind_variables(new_inputs)
        new_other_expr = other._rebind_variables(new_inputs)
        return new_self_expr, new_other_expr, new_inputs
1032388
def get_variables(self) -> Set[str]:
        
        variables = set()
        for cmd in self._cmd:
            for var in self.__formatter.parse(cmd):
                logger.debug("Checking variable: %s", var)
                # creates and requires are special class values
                if var[1] is not None and var[1] not in ["creates", "requires"]:
                    variables.add(var[1])
        return variables