Exemplo n.º 1
0
 public Action_testRule()
 {
     _rulePattern = Rule_testRule.Instance;
     patternGraph = _rulePattern.patternGraph;
     DynamicMatch = myMatch;
     ReturnArray  = new object[0];
     matches      = new GRGEN_LGSP.LGSPMatchesList <Rule_testRule.Match_testRule, Rule_testRule.IMatch_testRule>(this);
 }
Exemplo n.º 2
0
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact <Rule_testRule.IMatch_testRule> matches;

            while (true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if (matches.Count <= 0)
                {
                    return(true);
                }
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
Exemplo n.º 3
0
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact <Rule_testRule.IMatch_testRule> matches;

            for (int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if (matches.Count <= 0)
                {
                    return(i >= min);
                }
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return(true);
        }
Exemplo n.º 4
0
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact <Rule_testRule.IMatch_testRule> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if (matches.Count <= 0)
            {
                return(false);
            }

            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }while(matches.Count > 0);
            return(true);
        }