Search in sources :

Example 11 with NextStateElement

use of io.siddhi.query.api.execution.query.input.state.NextStateElement in project siddhi by siddhi-io.

the class SiddhiQLBaseVisitorImpl method visitPattern_source_chain.

/**
 * {@inheritDoc}
 * <p>The default implementation returns the result of calling
 * {@link #visitChildren} on {@code ctx}.</p>
 *
 * @param ctx
 */
@Override
public Object visitPattern_source_chain(@NotNull SiddhiQLParser.Pattern_source_chainContext ctx) {
    if (ctx.pattern_source_chain().size() == 1) {
        StateElement stateElement = ((StateElement) visit(ctx.pattern_source_chain(0)));
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else if (ctx.pattern_source_chain().size() == 2) {
        NextStateElement nextStateElement = new NextStateElement(((StateElement) visit(ctx.pattern_source_chain(0))), ((StateElement) visit(ctx.pattern_source_chain(1))));
        populateQueryContext(nextStateElement, ctx);
        return nextStateElement;
    } else if (ctx.pattern_source() != null) {
        StateElement stateElement = ((StateElement) visit(ctx.pattern_source()));
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else {
        throw newSiddhiParserException(ctx);
    }
}
Also used : NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(io.siddhi.query.api.execution.query.input.state.EveryStateElement) StreamStateElement(io.siddhi.query.api.execution.query.input.state.StreamStateElement) NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) AbsentStreamStateElement(io.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) StateElement(io.siddhi.query.api.execution.query.input.state.StateElement) CountStateElement(io.siddhi.query.api.execution.query.input.state.CountStateElement)

Example 12 with NextStateElement

use of io.siddhi.query.api.execution.query.input.state.NextStateElement in project siddhi by siddhi-io.

the class SiddhiQLBaseVisitorImpl method visitRight_absent_pattern_source.

@Override
public Object visitRight_absent_pattern_source(SiddhiQLParser.Right_absent_pattern_sourceContext ctx) {
    // ;
    if (ctx.right_absent_pattern_source().size() == 1 && ctx.every_absent_pattern_source() == null && ctx.every_pattern_source_chain() == null) {
        // EVERY? '('right_absent_pattern_source')'
        StateElement stateElement = (StateElement) visit(ctx.right_absent_pattern_source(0));
        if (ctx.EVERY() != null) {
            stateElement = new EveryStateElement(stateElement);
        }
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else {
        NextStateElement nextStateElement = new NextStateElement((StateElement) visit(ctx.getChild(0)), (StateElement) visit(ctx.getChild(2)));
        populateQueryContext(nextStateElement, ctx);
        return nextStateElement;
    }
}
Also used : NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(io.siddhi.query.api.execution.query.input.state.EveryStateElement) StreamStateElement(io.siddhi.query.api.execution.query.input.state.StreamStateElement) NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) AbsentStreamStateElement(io.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) StateElement(io.siddhi.query.api.execution.query.input.state.StateElement) CountStateElement(io.siddhi.query.api.execution.query.input.state.CountStateElement) EveryStateElement(io.siddhi.query.api.execution.query.input.state.EveryStateElement)

Example 13 with NextStateElement

use of io.siddhi.query.api.execution.query.input.state.NextStateElement in project siddhi by wso2.

the class SiddhiQLBaseVisitorImpl method visitRight_absent_sequence_source.

@Override
public Object visitRight_absent_sequence_source(SiddhiQLParser.Right_absent_sequence_sourceContext ctx) {
    if (ctx.right_absent_sequence_source().size() == 1 && ctx.basic_absent_pattern_source() == null && ctx.sequence_source_chain() == null) {
        // '('right_absent_pattern_source')'
        StateElement stateElement = (StateElement) visit(ctx.right_absent_sequence_source(0));
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else {
        NextStateElement nextStateElement = new NextStateElement((StateElement) visit(ctx.getChild(0)), (StateElement) visit(ctx.getChild(2)));
        populateQueryContext(nextStateElement, ctx);
        return nextStateElement;
    }
}
Also used : NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(io.siddhi.query.api.execution.query.input.state.EveryStateElement) StreamStateElement(io.siddhi.query.api.execution.query.input.state.StreamStateElement) NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) AbsentStreamStateElement(io.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) StateElement(io.siddhi.query.api.execution.query.input.state.StateElement) CountStateElement(io.siddhi.query.api.execution.query.input.state.CountStateElement)

Example 14 with NextStateElement

use of io.siddhi.query.api.execution.query.input.state.NextStateElement in project siddhi by wso2.

the class SiddhiQLBaseVisitorImpl method visitLeft_absent_sequence_source.

@Override
public Object visitLeft_absent_sequence_source(SiddhiQLParser.Left_absent_sequence_sourceContext ctx) {
    if (ctx.left_absent_sequence_source().size() == 1 && ctx.basic_absent_pattern_source() == null && ctx.sequence_source_chain() == null) {
        // '('left_absent_pattern_source')'
        StateElement stateElement = (StateElement) visit(ctx.left_absent_sequence_source(0));
        populateQueryContext(stateElement, ctx);
        return stateElement;
    } else {
        NextStateElement nextStateElement = new NextStateElement((StateElement) visit(ctx.getChild(0)), (StateElement) visit(ctx.getChild(2)));
        populateQueryContext(nextStateElement, ctx);
        return nextStateElement;
    }
}
Also used : NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(io.siddhi.query.api.execution.query.input.state.EveryStateElement) StreamStateElement(io.siddhi.query.api.execution.query.input.state.StreamStateElement) NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) AbsentStreamStateElement(io.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) StateElement(io.siddhi.query.api.execution.query.input.state.StateElement) CountStateElement(io.siddhi.query.api.execution.query.input.state.CountStateElement)

Example 15 with NextStateElement

use of io.siddhi.query.api.execution.query.input.state.NextStateElement in project siddhi by wso2.

the class SiddhiQLBaseVisitorImpl method visitEvery_absent_sequence_source_chain.

@Override
public Object visitEvery_absent_sequence_source_chain(SiddhiQLParser.Every_absent_sequence_source_chainContext ctx) {
    // every_absent_sequence_source_chain
    // : EVERY? absent_sequence_source_chain',' sequence_source_chain
    // | EVERY? sequence_source   ',' absent_sequence_source_chain
    // ;
    StateElement stateElement1;
    StateElement stateElement2;
    if (ctx.EVERY() != null) {
        stateElement1 = new EveryStateElement((StateElement) visit(ctx.getChild(1)));
    } else {
        stateElement1 = (StateElement) visit(ctx.getChild(0));
    }
    stateElement2 = (StateElement) visit(ctx.getChild(ctx.getChildCount() - 1));
    populateQueryContext(stateElement1, ctx);
    populateQueryContext(stateElement2, ctx);
    NextStateElement nextStateElement = new NextStateElement(stateElement1, stateElement2);
    populateQueryContext(nextStateElement, ctx);
    return nextStateElement;
}
Also used : NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) EveryStateElement(io.siddhi.query.api.execution.query.input.state.EveryStateElement) StreamStateElement(io.siddhi.query.api.execution.query.input.state.StreamStateElement) NextStateElement(io.siddhi.query.api.execution.query.input.state.NextStateElement) AbsentStreamStateElement(io.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement) StateElement(io.siddhi.query.api.execution.query.input.state.StateElement) CountStateElement(io.siddhi.query.api.execution.query.input.state.CountStateElement) EveryStateElement(io.siddhi.query.api.execution.query.input.state.EveryStateElement)

Aggregations

AbsentStreamStateElement (io.siddhi.query.api.execution.query.input.state.AbsentStreamStateElement)20 CountStateElement (io.siddhi.query.api.execution.query.input.state.CountStateElement)20 EveryStateElement (io.siddhi.query.api.execution.query.input.state.EveryStateElement)20 NextStateElement (io.siddhi.query.api.execution.query.input.state.NextStateElement)20 StateElement (io.siddhi.query.api.execution.query.input.state.StateElement)20 StreamStateElement (io.siddhi.query.api.execution.query.input.state.StreamStateElement)20 OperationNotSupportedException (io.siddhi.core.exception.OperationNotSupportedException)2 EntryValveProcessor (io.siddhi.core.query.input.stream.single.EntryValveProcessor)2 SingleStreamRuntime (io.siddhi.core.query.input.stream.single.SingleStreamRuntime)2 AbsentLogicalPostStateProcessor (io.siddhi.core.query.input.stream.state.AbsentLogicalPostStateProcessor)2 AbsentLogicalPreStateProcessor (io.siddhi.core.query.input.stream.state.AbsentLogicalPreStateProcessor)2 AbsentStreamPostStateProcessor (io.siddhi.core.query.input.stream.state.AbsentStreamPostStateProcessor)2 AbsentStreamPreStateProcessor (io.siddhi.core.query.input.stream.state.AbsentStreamPreStateProcessor)2 CountPostStateProcessor (io.siddhi.core.query.input.stream.state.CountPostStateProcessor)2 CountPreStateProcessor (io.siddhi.core.query.input.stream.state.CountPreStateProcessor)2 LogicalPostStateProcessor (io.siddhi.core.query.input.stream.state.LogicalPostStateProcessor)2 LogicalPreStateProcessor (io.siddhi.core.query.input.stream.state.LogicalPreStateProcessor)2 PreStateProcessor (io.siddhi.core.query.input.stream.state.PreStateProcessor)2 StreamPostStateProcessor (io.siddhi.core.query.input.stream.state.StreamPostStateProcessor)2 StreamPreStateProcessor (io.siddhi.core.query.input.stream.state.StreamPreStateProcessor)2