public List<SquigglyNode> parse(String filter) {
        filter = StringUtils.trim(filter);

        if (StringUtils.isEmpty(filter)) {
            return Collections.emptyList();
        }

        // get it from the cache if we can
        List<SquigglyNode> cachedNodes = CACHE.getIfPresent(filter);

        if (cachedNodes != null) {
            return cachedNodes;
        }


        SquigglyExpressionLexer lexer = ThrowingErrorListener.overwrite(new SquigglyExpressionLexer(new ANTLRInputStream(filter)));
        SquigglyExpressionParser parser = ThrowingErrorListener.overwrite(new SquigglyExpressionParser(new CommonTokenStream(lexer)));

        Visitor visitor = new Visitor();
        List<SquigglyNode> nodes = Collections.unmodifiableList(visitor.visit(parser.parse()));

        CACHE.put(filter, nodes);
        return nodes;
    }
public List < SquigglyNode > parse ( String filter ) { filter = StringUtils . trim ( filter ) ; if ( StringUtils . isEmpty ( filter ) ) { return Collections . emptyList ( ) ; } List < SquigglyNode > cachedNodes = CACHE . getIfPresent ( filter ) ; if ( cachedNodes != null ) { return cachedNodes ; } SquigglyExpressionLexer lexer = ThrowingErrorListener . overwrite ( new SquigglyExpressionLexer ( new ANTLRInputStream ( filter ) ) ) ; SquigglyExpressionParser parser = ThrowingErrorListener . overwrite ( new SquigglyExpressionParser ( new CommonTokenStream ( lexer ) ) ) ; Visitor visitor = new Visitor ( ) ; List < SquigglyNode > nodes = Collections . unmodifiableList ( visitor . visit ( parser . parse ( ) ) ) ; CACHE . put ( filter , nodes ) ; return nodes ; }
Parse a filter expression.

@param filter the filter expression
@return compiled nodes