use of io.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseTableDefinition.
public static TableDefinition parseTableDefinition(String tableDefinition) throws SiddhiParserException {
CharStream input = CharStreams.fromString(tableDefinition);
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_table_final();
SiddhiQLVisitor eval = new SiddhiQLBaseVisitorImpl();
return (TableDefinition) eval.visit(tree);
}
use of io.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseAggregationDefinition.
public static AggregationDefinition parseAggregationDefinition(String aggregationDefinition) throws SiddhiParserException {
CharStream input = CharStreams.fromString(aggregationDefinition);
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_aggregation_final();
SiddhiQLVisitor eval = new SiddhiQLBaseVisitorImpl();
return (AggregationDefinition) eval.visit(tree);
}
use of io.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseTimeConstantDefinition.
public static TimeConstant parseTimeConstantDefinition(String timeConstantDefinition) throws SiddhiParserException {
CharStream input = CharStreams.fromString(timeConstantDefinition);
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 io.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseStreamDefinition.
public static StreamDefinition parseStreamDefinition(String streamDefinition) {
CharStream input = CharStreams.fromString(streamDefinition);
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_stream_final();
SiddhiQLVisitor eval = new SiddhiQLBaseVisitorImpl();
return (StreamDefinition) eval.visit(tree);
}
use of io.siddhi.query.compiler.internal.SiddhiQLBaseVisitorImpl in project siddhi by wso2.
the class SiddhiCompiler method parseOnDemandQuery.
public static OnDemandQuery parseOnDemandQuery(String onDemandQueryString) throws SiddhiParserException {
CharStream input = CharStreams.fromString(onDemandQueryString);
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();
OnDemandQuery onDemandQuery = (OnDemandQuery) eval.visit(tree);
return onDemandQuery;
}
Aggregations