Example #1
0
 public void QPatternObserverStart(
     EvalObserverFactoryNode evalObserverNode,
     MatchedEventMap beginState)
 {
 }
Example #2
0
 public void QPatternObserverEvaluateTrue(
     EvalObserverFactoryNode evalObserverNode,
     MatchedEventMap matchEvent)
 {
 }
Example #3
0
        public static void WalkStatement(StatementSpecRaw spec, ExprNodeSubselectDeclaredDotVisitor visitor)
        {
            // Look for expressions with sub-selects in select expression list and filter expression
            // Recursively compile the statement within the statement.
            foreach (SelectClauseElementRaw raw in spec.SelectClauseSpec.SelectExprList)
            {
                if (raw is SelectClauseExprRawSpec)
                {
                    SelectClauseExprRawSpec rawExpr = (SelectClauseExprRawSpec)raw;
                    rawExpr.SelectExpression.Accept(visitor);
                }
                else
                {
                    continue;
                }
            }
            if (spec.FilterRootNode != null)
            {
                spec.FilterRootNode.Accept(visitor);
            }
            if (spec.HavingExprRootNode != null)
            {
                spec.HavingExprRootNode.Accept(visitor);
            }
            if (spec.UpdateDesc != null)
            {
                if (spec.UpdateDesc.OptionalWhereClause != null)
                {
                    spec.UpdateDesc.OptionalWhereClause.Accept(visitor);
                }
                foreach (OnTriggerSetAssignment assignment in spec.UpdateDesc.Assignments)
                {
                    assignment.Expression.Accept(visitor);
                }
            }
            if (spec.OnTriggerDesc != null)
            {
                VisitSubselectOnTrigger(spec.OnTriggerDesc, visitor);
            }
            // Determine pattern-filter subqueries
            foreach (StreamSpecRaw streamSpecRaw in spec.StreamSpecs)
            {
                if (streamSpecRaw is PatternStreamSpecRaw)
                {
                    PatternStreamSpecRaw   patternStreamSpecRaw = (PatternStreamSpecRaw)streamSpecRaw;
                    EvalNodeAnalysisResult analysisResult       = EvalNodeUtil.RecursiveAnalyzeChildNodes(patternStreamSpecRaw.EvalFactoryNode);
                    foreach (EvalFactoryNode evalNode in analysisResult.ActiveNodes)
                    {
                        if (evalNode is EvalFilterFactoryNode)
                        {
                            EvalFilterFactoryNode filterNode = (EvalFilterFactoryNode)evalNode;
                            foreach (ExprNode filterExpr in filterNode.RawFilterSpec.FilterExpressions)
                            {
                                filterExpr.Accept(visitor);
                            }
                        }
                        else if (evalNode is EvalObserverFactoryNode)
                        {
                            int beforeCount = visitor.Subselects.Count;
                            EvalObserverFactoryNode observerNode = (EvalObserverFactoryNode)evalNode;
                            foreach (ExprNode param in observerNode.PatternObserverSpec.ObjectParameters)
                            {
                                param.Accept(visitor);
                            }
                            if (visitor.Subselects.Count != beforeCount)
                            {
                                throw new ExprValidationException("Subselects are not allowed within pattern observer parameters, please consider using a variable instead");
                            }
                        }
                    }
                }
            }

            // walk streams
            WalkStreamSpecs(spec, visitor);
        }
Example #4
0
 public void QPatternObserverQuit(EvalObserverFactoryNode evalObserverNode)
 {
 }
Example #5
0
 public void Visit(EvalObserverFactoryNode observer)
 {
     ProcObserverFactoryNode?.Invoke(observer);
 }