@Override
    public StateInputStream visitSequence_stream(@NotNull SiddhiQLParser.Sequence_streamContext ctx) {
//        sequence_stream
//        :every_sequence_source_chain within_time?
//        |every_absent_sequence_source_chain within_time?
//        ;

        StateInputStream stateInputStream;
        TimeConstant within = null;
        if (ctx.within_time() != null) {
            within = (TimeConstant) visit(ctx.within_time());
        }
        if (ctx.every_sequence_source_chain() != null) {
            stateInputStream = new StateInputStream(
                    StateInputStream.Type.SEQUENCE,
                    (StateElement) visitEvery_sequence_source_chain(ctx.every_sequence_source_chain()),
                    within);
        } else {
            stateInputStream = new StateInputStream(
                    StateInputStream.Type.SEQUENCE,
                    (StateElement) visitEvery_absent_sequence_source_chain(ctx.every_absent_sequence_source_chain()),
                    within);
        }
        populateQueryContext(stateInputStream, ctx);
        return stateInputStream;
    }
{@inheritDoc}
<p>The default implementation returns the result of calling
{@link #visitChildren} on {@code ctx}.</p>

@param ctx
modules/siddhi-query-compiler/src/main/java/io/siddhi/query/compiler/internal/SiddhiQLBaseVisitorImpl.java