List<String> queryTokens = tokenizeQuery(query);
LOG.trace("Tokenized query: " + queryTokens);
if (queryTokens.isEmpty())
return new EmptyExpression();
List<WildcardedExpression> expressions = new ArrayList<WildcardedExpression>();
if (queryTokens.get(0).equals("^")) {
expressions.add(new StartAnchor());
queryTokens.remove(0);
}
if (queryTokens.isEmpty())
return new EmptyExpression();
boolean endAnchorPresent = false;
if (queryTokens.get(queryTokens.size() - 1).equals("$")) {
endAnchorPresent = true;
queryTokens.remove(queryTokens.size() - 1);
}
if (queryTokens.isEmpty())
return new EmptyExpression();
for (String token : queryTokens) {
if (token.startsWith(".")) {
Wildcard wildcard = null;
if (token.length() == 1) {