If the expression is wrapped in ImplicitTypeAsExpressions, this will will unwrap them back
down to the original expression.

@param expression
@return
979670
public static Expression getUnwrappedExpression( Expression expression )
  {
    while( expression instanceof ImplicitTypeAsExpression )
    {
      expression = ((ImplicitTypeAsExpression) expression).getLHS();
    }
    return expression;
  }
121897
@Nullable
    protected <T> T resolveExpression(String context, String expression, Class<T> type) {
        if (environment.containsProperty(expression)) {
            return environment.getProperty(expression, type)
                    .orElseThrow(() ->
                            new ConfigurationException("Could not resolve expression: [" + expression + "] in placeholder ${" + context + "}"));
        }
        if (NameUtils.isEnvironmentName(expression)) {
            String envVar = System.getenv(expression);
            if (StringUtils.isNotEmpty(envVar)) {
                return conversionService.convert(envVar, type)
                        .orElseThrow(() ->
                                new ConfigurationException("Could not resolve expression: [" + expression + "] in placeholder ${" + context + "}"));
            }
        }
        return null;
    }
386506
public Object eval(String expression) {
    	expression = transform(expression);
    	Object result = calculate(expression);
        return result;
    }
1342363
public static Statement throwExpression(final Expression expression) {
    expression.checkAssignableTo(THROWABLE_TYPE);
    return new Statement() {
      @Override
      protected void doGen(CodeBuilder adapter) {
        expression.gen(adapter);
        adapter.throwException();
      }
    };
  }
819529
private boolean markAsDeadCode(XExpression expression) {
		if (expression instanceof XBlockExpression) {
			final XBlockExpression block = (XBlockExpression) expression;
			final EList<XExpression> expressions = block.getExpressions();
			if (!expressions.isEmpty()) {
				markAsDeadCode(expressions.get(0));
				return true;
			}
		}
		if (expression != null) {
			error("Unreachable expression.", expression, null, IssueCodes.UNREACHABLE_CODE); //$NON-NLS-1$
			return true;
		}
		return false;
	}
578975
static boolean isExpression(String expression) {

        if (null == expression) {
            return false;
        }

        //check to see if attribute has an expression
        int start = expression.indexOf("#{");
        return start != -1 && expression.indexOf('}', start+2) != -1;
    }
951692
public static boolean evaluate(final String expression) {
        final Deque<String> operators = new ArrayDeque<>();
        final Deque<String> values = new ArrayDeque<>();
        final boolean result;

        char currentCharacter;
        int currentCharacterIndex = 0;

        try {
            while (currentCharacterIndex < expression.length()) {
                currentCharacter = expression.charAt(currentCharacterIndex);

                if (SeparatorToken.OPEN_PARENTHESIS.value == currentCharacter) {
                    operators.push(SeparatorToken.OPEN_PARENTHESIS.toString());
                    currentCharacterIndex += moveCursor(SeparatorToken.OPEN_PARENTHESIS.toString());
                } else if (SeparatorToken.SPACE.value == currentCharacter) {
                    currentCharacterIndex += moveCursor(SeparatorToken.SPACE.toString());
                } else if (SeparatorToken.CLOSE_PARENTHESIS.value == currentCharacter) {
                    evaluateSubexpression(operators, values);
                    currentCharacterIndex += moveCursor(SeparatorToken.CLOSE_PARENTHESIS.toString());
                } else if (!Character.isDigit(currentCharacter)) {
                    final String parsedNonDigit = parseNonDigits(expression, currentCharacterIndex);
                    if (isBoolean(parsedNonDigit)) {
                        values.push(replaceBooleanStringByIntegerRepresentation(parsedNonDigit));
                    } else {
                        operators.push(validateOperator(parsedNonDigit));
                    }
                    currentCharacterIndex += moveCursor(parsedNonDigit);
                } else if (Character.isDigit(currentCharacter)) {
                    final String parsedDigits = parseDigits(expression, currentCharacterIndex);
                    values.push(parsedDigits);
                    currentCharacterIndex += moveCursor(parsedDigits);
                }
            }

            result = Boolean.valueOf(evaluateExpressionStack(operators, values));

            if (log.isDebugEnabled()) {
                log.debug("Boolean expression {} evaluates to {}", expression, result);
            }
        } catch (final NoSuchElementException e) {
            throw new CitrusRuntimeException("Unable to parse boolean expression '" + expression + "'. Maybe expression is incomplete!", e);
        }

        return result;
    }
833165
private Expression tryToWrapInSoyExpression(Expression expr) {
    switch (expr.resultType().getSort()) {
      case Type.BOOLEAN:
        return SoyExpression.forBool(expr);
      case Type.INT:
        return SoyExpression.forInt(BytecodeUtils.numericConversion(expr, Type.LONG_TYPE));
      case Type.LONG:
        return SoyExpression.forInt(expr);
      case Type.DOUBLE:
        return SoyExpression.forFloat(expr);
      case Type.OBJECT:
        if (expr.resultType().equals(BytecodeUtils.STRING_TYPE)) {
          return SoyExpression.forString(expr);
        }
        break;
      default:
        break;
    }
    // TODO(sameb): Maybe wrap List/SoyValue types too, as 'unknown' parameter types?
    return expr;
  }
362596
private static Expression getExpression(String expression) {
		if (isTemplate(expression)) {
			logger.warn("#{...} syntax is not required for this run-time expression "
					+ "and is deprecated in favor of a simple expression string");
			return new SpelExpressionParser().parseExpression(expression, PARSER_CONTEXT);
		}
		return new SpelExpressionParser().parseExpression(expression);
	}
117351
public B cardinality(String expression) {
    LoopCardinality cardinality = getCreateSingleChild(LoopCardinality.class);
    cardinality.setTextContent(expression);

    return myself;
  }
175109
@NonNull
    public static Expression negated(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new CompoundExpression(Arrays.asList(expression), CompoundExpression.OpType.Not);
    }
13295
function (expression, types) {
        var args = types.split(" | "),
            i, len, found = false;

        for (i=0, len=args.length; i < len && !found && expression.hasNext(); i++) {
            found = this.isType(expression, args[i]);
        }

        return found;
    }
160347
public static ExprString toExprString(Expression expr) {
	if (expr instanceof ExprString) return (ExprString) expr;
	if (expr instanceof Literal) return expr.getFactory().createLitString(((Literal) expr).getString(), expr.getStart(), expr.getEnd());
	return new CastString(expr);
    }
597941
public static String strip(final String expression) {
        final String expr = StringUtils.trimToEmpty(expression);
        final Matcher matcher = DELIMITED_EXPR.matcher(expr);
        return matcher.matches() ? matcher.group(1) : expr;
    }
1244736
public static ParsedExpression parse(String expression) {
        ParsedExpression pe = (ParsedExpression)PARSED_CACHE.get(expression);

        if(pe != null)
            return pe;

        try {
            NetUIELParser learn = new NetUIELParser(new StringReader(expression));

            ParsedExpression expr = learn.parse();
            expr.seal();

            /* infrequent; this should only happen when there is a cache miss */
            synchronized(PARSED_CACHE) {
                PARSED_CACHE.put(expression, expr);
            }

            return expr;
        } catch(ParseException e) {
            String msg = "Error occurred parsing expression \"" + expression + "\".";
            LOGGER.error(msg, e);
            throw new ExpressionParseException(msg, e);
        } catch(TokenMgrError tm) {
            String msg = "Error occurred parsing expression \"" + expression + "\".";
            LOGGER.error(msg, tm);
            throw new ExpressionParseException(msg, tm);
        }
    }
93005
public String getKey(String expression) {
    if (expression == null || expression.length() == 0) { return null; }
    for (int i = 0; i < expression.length(); i++) {
      char c = expression.charAt(i);
      if (c == Nested || c == IndexedStart) {
        return null;
      } else if (c == MappedStart) {
        int end = expression.indexOf(MappedEnd, i);
        if (end < 0) { throw new IllegalArgumentException("Missing End Delimiter"); }
        return expression.substring(i + 1, end);
      }
    }
    return null;
  }
336775
private Object getLiteralValue(Expression expression) {
		if (!(expression instanceof Literal)) {
			throw new IllegalArgumentException("Expression " + expression + " is not a Literal.");
		}
		return ((Literal) expression).getValue();
	}