Exemplo n.º 1
0
 public SubruleDebuggingConfigurationRule(SubruleDebuggingEvent sde, string graphElementName,
                                          SubruleDebuggingDecision sdd, SequenceExpression ifClause)
 {
     this.debuggingEvent  = sde;
     this.nameToMatch     = graphElementName;
     this.decisionOnMatch = sdd;
     this.ifClause        = ifClause;
 }
Exemplo n.º 2
0
 public SubruleDebuggingConfigurationRule(SubruleDebuggingEvent sde, string message,
                                          SubruleMesssageMatchingMode smmm, SubruleDebuggingDecision sdd)
 {
     this.debuggingEvent      = sde;
     this.messageMatchingMode = smmm;
     this.messageToMatch      = message;
     this.decisionOnMatch     = sdd;
 }
Exemplo n.º 3
0
 public SubruleDebuggingConfigurationRule(SubruleDebuggingEvent sde, IAction action,
                                          SubruleDebuggingDecision sdd, SequenceExpression ifClause)
 {
     this.debuggingEvent  = sde;
     this.actionToMatch   = action;
     this.decisionOnMatch = sdd;
     this.ifClause        = ifClause;
 }
Exemplo n.º 4
0
 public SubruleDebuggingConfigurationRule(SubruleDebuggingEvent sde, GrGenType graphElementType,
                                          bool only, SubruleDebuggingDecision sdd, SequenceExpression ifClause)
 {
     this.debuggingEvent  = sde;
     this.typeToMatch     = graphElementType;
     this.onlyThisType    = only;
     this.decisionOnMatch = sdd;
     this.ifClause        = ifClause;
 }
Exemplo n.º 5
0
 public SubruleDebuggingDecision Decide(SubruleDebuggingEvent sde, object data, IGraphProcessingEnvironment procEnv, out SubruleDebuggingConfigurationRule cr)
 {
     foreach (SubruleDebuggingConfigurationRule rule in configurationRules)
     {
         SubruleDebuggingDecision result = rule.Decide(sde, data, procEnv);
         if (result != SubruleDebuggingDecision.Undefined)
         {
             cr = rule;
             return(result);
         }
     }
     cr = null;
     return(SubruleDebuggingDecision.Undefined);
 }
Exemplo n.º 6
0
        private SubruleDebuggingConfigurationRule EditOrCreateRule(SubruleDebuggingConfigurationRule cr)
        {
            // edit or keep type
            SubruleDebuggingEvent sde = DetermineEventTypeToConfigure(cr);

            if (sde == SubruleDebuggingEvent.Undefined)
            {
                return(null);
            }

            // for Add, Rem, Emit, Halt, Highlight
            string message = null;
            SubruleMesssageMatchingMode smmm = SubruleMesssageMatchingMode.Undefined;

            // for Match
            IAction action = null;

            // for New, Delete, Retype, SetAttributes
            string    graphElementName = null;
            GrGenType graphElementType = null;
            bool      only             = false;

            if (sde == SubruleDebuggingEvent.Add || sde == SubruleDebuggingEvent.Rem || sde == SubruleDebuggingEvent.Emit ||
                sde == SubruleDebuggingEvent.Halt || sde == SubruleDebuggingEvent.Highlight)
            {
                // edit or keep message matching mode and message
                smmm = DetermineMessageAndMessageMatchingMode(cr,
                                                              out message);
                if (smmm == SubruleMesssageMatchingMode.Undefined)
                {
                    return(null);
                }
            }
            else if (sde == SubruleDebuggingEvent.Match)
            {
                // edit ok keep action name
                action = DetermineAction(cr);
                if (action == null)
                {
                    return(null);
                }
            }
            else if (sde == SubruleDebuggingEvent.New || sde == SubruleDebuggingEvent.Delete ||
                     sde == SubruleDebuggingEvent.Retype || sde == SubruleDebuggingEvent.SetAttributes)
            {
                // edit or keep choice of type, exact type, name
                bool abort = DetermineMatchGraphElementMode(cr,
                                                            out graphElementName, out graphElementType, out only);
                if (abort)
                {
                    return(null);
                }
            }

            // edit or keep decision action
            SubruleDebuggingDecision sdd = DetermineDecisionAction(cr);

            if (sdd == SubruleDebuggingDecision.Undefined)
            {
                return(null);
            }

            // edit or keep condition if type action or graph change
            SequenceExpression ifClause = null;

            if (sde != SubruleDebuggingEvent.Add && sde != SubruleDebuggingEvent.Rem && sde != SubruleDebuggingEvent.Retype &&
                sde != SubruleDebuggingEvent.Halt && sde != SubruleDebuggingEvent.Highlight)
            {
                ifClause = DetermineCondition(cr, sde, action, graphElementType);
            }

            if (sde == SubruleDebuggingEvent.Add || sde == SubruleDebuggingEvent.Rem || sde == SubruleDebuggingEvent.Emit ||
                sde == SubruleDebuggingEvent.Halt || sde == SubruleDebuggingEvent.Highlight)
            {
                return(new SubruleDebuggingConfigurationRule(sde, message, smmm, sdd));
            }
            else if (sde == SubruleDebuggingEvent.Match)
            {
                return(new SubruleDebuggingConfigurationRule(sde, action, sdd, ifClause));
            }
            else if (sde == SubruleDebuggingEvent.New || sde == SubruleDebuggingEvent.Delete ||
                     sde == SubruleDebuggingEvent.Retype || sde == SubruleDebuggingEvent.SetAttributes)
            {
                if (graphElementName != null)
                {
                    return(new SubruleDebuggingConfigurationRule(sde, graphElementName, sdd, ifClause));
                }
                else
                {
                    return(new SubruleDebuggingConfigurationRule(sde, graphElementType, only, sdd, ifClause));
                }
            }

            return(null);
        }
Exemplo n.º 7
0
 public SubruleDebuggingConfigurationRule(SubruleDebuggingEvent sde, GrGenType graphElementType,
     bool only, SubruleDebuggingDecision sdd, SequenceExpression ifClause)
 {
     this.debuggingEvent = sde;
     this.typeToMatch = graphElementType;
     this.onlyThisType = only;
     this.decisionOnMatch = sdd;
     this.ifClause = ifClause;
 }
Exemplo n.º 8
0
 public SubruleDebuggingConfigurationRule(SubruleDebuggingEvent sde, string graphElementName,
     SubruleDebuggingDecision sdd, SequenceExpression ifClause)
 {
     this.debuggingEvent = sde;
     this.nameToMatch = graphElementName;
     this.decisionOnMatch = sdd;
     this.ifClause = ifClause;
 }
Exemplo n.º 9
0
 public SubruleDebuggingConfigurationRule(SubruleDebuggingEvent sde, IAction action,
     SubruleDebuggingDecision sdd, SequenceExpression ifClause)
 {
     this.debuggingEvent = sde;
     this.actionToMatch = action;
     this.decisionOnMatch = sdd;
     this.ifClause = ifClause;
 }
Exemplo n.º 10
0
 public SubruleDebuggingConfigurationRule(SubruleDebuggingEvent sde, string message, 
     SubruleMesssageMatchingMode smmm, SubruleDebuggingDecision sdd)
 {
     this.debuggingEvent = sde;
     this.messageMatchingMode = smmm;
     this.messageToMatch = message;
     this.decisionOnMatch = sdd;
 }