Package com.netflix.infix

Source Code of com.netflix.infix.InfixCompiler

package com.netflix.infix;

import com.google.common.base.Predicate;
import com.netflix.infix.lang.infix.antlr.EventFilterParser;
import com.netflix.infix.lang.infix.antlr.PredicateTranslatable;

/**
* Compile an INFIX string into a Predicate
*
* @author elandau
*/
public class InfixCompiler implements PredicateCompiler {
    public Predicate<Object> compile(String input) throws Exception {
        EventFilterParser parser               = EventFilterParser.createParser(input);
        EventFilterParser.filter_return result = parser.filter();
       
        return ((PredicateTranslatable) result.getTree()).translate();
    }
}
TOP

Related Classes of com.netflix.infix.InfixCompiler

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.