use of org.wso2.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseFunctionDefinition.
public static FunctionDefinition parseFunctionDefinition(String source) throws SiddhiParserException {
ANTLRInputStream input = new ANTLRInputStream(source);
SiddhiQLLexer lexer = new SiddhiQLLexer(input);
lexer.removeErrorListeners();
lexer.addErrorListener(SiddhiErrorListener.INSTANCE);
CommonTokenStream tokens = new CommonTokenStream(lexer);
SiddhiQLParser parser = new SiddhiQLParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(SiddhiErrorListener.INSTANCE);
ParseTree tree = parser.definition_function_final();
SiddhiQLVisitor eval = new SiddhiQLBaseVisitorImpl();
return (FunctionDefinition) eval.visit(tree);
}
use of org.wso2.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseTimeConstantDefinition.
public static TimeConstant parseTimeConstantDefinition(String source) throws SiddhiParserException {
ANTLRInputStream input = new ANTLRInputStream(source);
SiddhiQLLexer lexer = new SiddhiQLLexer(input);
lexer.removeErrorListeners();
lexer.addErrorListener(SiddhiErrorListener.INSTANCE);
CommonTokenStream tokens = new CommonTokenStream(lexer);
SiddhiQLParser parser = new SiddhiQLParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(SiddhiErrorListener.INSTANCE);
ParseTree tree = parser.time_value();
SiddhiQLVisitor eval = new SiddhiQLBaseVisitorImpl();
return (TimeConstant) eval.visit(tree);
}
use of org.wso2.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseStoreQuery.
public static StoreQuery parseStoreQuery(String storeQuery) throws SiddhiParserException {
ANTLRInputStream input = new ANTLRInputStream(storeQuery);
SiddhiQLLexer lexer = new SiddhiQLLexer(input);
lexer.removeErrorListeners();
lexer.addErrorListener(SiddhiErrorListener.INSTANCE);
CommonTokenStream tokens = new CommonTokenStream(lexer);
SiddhiQLParser parser = new SiddhiQLParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(SiddhiErrorListener.INSTANCE);
ParseTree tree = parser.store_query_final();
SiddhiQLVisitor eval = new SiddhiQLBaseVisitorImpl();
return (StoreQuery) eval.visit(tree);
}
use of org.wso2.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parse.
public static SiddhiApp parse(String source) {
ANTLRInputStream input = new ANTLRInputStream(source);
SiddhiQLLexer lexer = new SiddhiQLLexer(input);
lexer.removeErrorListeners();
lexer.addErrorListener(SiddhiErrorListener.INSTANCE);
CommonTokenStream tokens = new CommonTokenStream(lexer);
SiddhiQLParser parser = new SiddhiQLParser(tokens);
// parser.setErrorHandler(new BailErrorStrategy());
parser.removeErrorListeners();
parser.addErrorListener(SiddhiErrorListener.INSTANCE);
ParseTree tree = parser.parse();
SiddhiQLVisitor eval = new SiddhiQLBaseVisitorImpl();
return (SiddhiApp) eval.visit(tree);
}
use of org.wso2.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseQuery.
public static Query parseQuery(String source) throws SiddhiParserException {
ANTLRInputStream input = new ANTLRInputStream(source);
SiddhiQLLexer lexer = new SiddhiQLLexer(input);
lexer.removeErrorListeners();
lexer.addErrorListener(SiddhiErrorListener.INSTANCE);
CommonTokenStream tokens = new CommonTokenStream(lexer);
SiddhiQLParser parser = new SiddhiQLParser(tokens);
parser.removeErrorListeners();
parser.addErrorListener(SiddhiErrorListener.INSTANCE);
ParseTree tree = parser.query_final();
SiddhiQLVisitor eval = new SiddhiQLBaseVisitorImpl();
return (Query) eval.visit(tree);
}
Aggregations