class InlineParser {

    public List<String> evaluate() {
        final GroovyShell shell = new GroovyShell();
        return flattenSegments(Lists.transform(splitWithInlineExpression(), new Function<String, Object>() {
            
            @Override
            public Object apply(final String input) {
                StringBuilder expression = new StringBuilder(input);
                if (!input.startsWith("\"")) {
                    expression.insert(0, "\"");
                }
                if (!input.endsWith("\"")) {
                    expression.append("\"");
                }
                return shell.evaluate(expression.toString());
            }
        }));
    }

}