use of org.apache.camel.language.simple.ast.SimpleFunctionExpression in project camel by apache.
the class SimpleBackwardsCompatibleParser method doParseExpression.
private static Expression doParseExpression(String expression, boolean allowEscape) {
// should have no function tokens
for (int i = 0; i < expression.length(); i++) {
SimpleToken token = SimpleTokenizer.nextToken(expression, i, allowEscape, TokenType.functionStart, TokenType.functionEnd);
if (token.getType().getType() == TokenType.functionStart || token.getType().getType() == TokenType.functionEnd) {
return null;
}
}
// okay there is no function tokens, then try to parse it as a simple function expression
SimpleToken token = new SimpleToken(new SimpleTokenType(TokenType.functionStart, expression), 0);
SimpleFunctionExpression function = new SimpleFunctionExpression(token);
function.addText(expression);
return function.createExpression(expression, false);
}
Aggregations