public static GRGEN_MODEL.OwnPownHome ownPownHome(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, int threadId)
 {
     GRGEN_MODEL.OwnPownHome oph = new GRGEN_MODEL.OwnPownHome();
     oph.ehe = "hahaha";
     oph.aha = "lalala";
     return(oph);
 }
Exemplo n.º 2
0
 public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact <Rule_testRule.IMatch_testRule> matches)
 {
     foreach (Rule_testRule.IMatch_testRule match in matches)
     {
         _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
     }
 }
Exemplo n.º 3
0
 public override object[] ApplyProcedureMethod(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, string name, object[] arguments)
 {
     switch (name)
     {
     default: throw new NullReferenceException("UEdge does not have the procedure method " + name + "!");
     }
 }
Exemplo n.º 4
0
        void GRGEN_LIBGR.IAction.Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCall filter)
        {
            if (filter.IsAutoSupplied)
            {
                switch (filter.Name)
                {
                case "keepFirst": matches.FilterKeepFirst((int)(filter.ArgumentExpressions[0] != null ? filter.ArgumentExpressions[0].Evaluate((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv) : filter.Arguments[0])); break;

                case "keepLast": matches.FilterKeepLast((int)(filter.ArgumentExpressions[0] != null ? filter.ArgumentExpressions[0].Evaluate((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv) : filter.Arguments[0])); break;

                case "keepFirstFraction": matches.FilterKeepFirstFraction((double)(filter.ArgumentExpressions[0] != null ? filter.ArgumentExpressions[0].Evaluate((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv) : filter.Arguments[0])); break;

                case "keepLastFraction": matches.FilterKeepLastFraction((double)(filter.ArgumentExpressions[0] != null ? filter.ArgumentExpressions[0].Evaluate((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv) : filter.Arguments[0])); break;

                case "removeFirst": matches.FilterRemoveFirst((int)(filter.ArgumentExpressions[0] != null ? filter.ArgumentExpressions[0].Evaluate((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv) : filter.Arguments[0])); break;

                case "removeLast": matches.FilterRemoveLast((int)(filter.ArgumentExpressions[0] != null ? filter.ArgumentExpressions[0].Evaluate((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv) : filter.Arguments[0])); break;

                case "removeFirstFraction": matches.FilterRemoveFirstFraction((double)(filter.ArgumentExpressions[0] != null ? filter.ArgumentExpressions[0].Evaluate((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv) : filter.Arguments[0])); break;

                case "removeLastFraction": matches.FilterRemoveLastFraction((double)(filter.ArgumentExpressions[0] != null ? filter.ArgumentExpressions[0].Evaluate((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv) : filter.Arguments[0])); break;

                default: throw new Exception("Unknown auto supplied filter name!");
                }
                return;
            }
            switch (filter.FullName)
            {
            default: throw new Exception("Unknown filter name!");
            }
        }
 public void finegrainChange(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_LIBGR.IGraphElement elemCalledOn)
 {
     Console.WriteLine("finegrainChange called");
     ((GRGEN_LIBGR.ISubactionAndOutputAdditionEnvironment)actionEnv).Recorder.External("add foo bar to " + ((GRGEN_LIBGR.INamedGraph)graph).GetElementName(elemCalledOn));
     dummy.Add("foo", "bar");
     ((GRGEN_LIBGR.IGraphProcessingEnvironment)actionEnv).TransactionManager.ExternalTypeChanged(new UndoDummy((GRGEN_MODEL.INB)elemCalledOn, "foo", graph));
 }
Exemplo n.º 6
0
 public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
 {
     GRGEN_LIBGR.IMatchesExact <Rule_testRule.IMatch_testRule> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
     if (matches.Count <= 0)
     {
         return(false);
     }
     _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
     return(true);
 }
Exemplo n.º 7
0
 object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
 {
     if (Apply(actionEnv))
     {
         return(ReturnArray);
     }
     else
     {
         return(null);
     }
 }
Exemplo n.º 8
0
 public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
 {
     GRGEN_LIBGR.IMatchesExact <Rule_testRule.IMatch_testRule> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
     if (matches.Count <= 0)
     {
         return(0);
     }
     foreach (Rule_testRule.IMatch_testRule match in matches)
     {
         _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
     }
     return(matches.Count);
 }
Exemplo n.º 9
0
 public List <object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
 {
     ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact <Rule_testRule.IMatch_testRule>)matches);
     while (AvailableReturnArrays.Count < matches.Count)
     {
         AvailableReturnArrays.Add(new object[0]);
     }
     ReturnArrayListForAll.Clear();
     for (int i = 0; i < matches.Count; ++i)
     {
         ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
     }
     return(ReturnArrayListForAll);
 }
Exemplo n.º 10
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.º 11
0
        List <object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);

            while (AvailableReturnArrays.Count < matchesCount)
            {
                AvailableReturnArrays.Add(new object[0]);
            }
            ReturnArrayListForAll.Clear();
            for (int i = 0; i < matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return(ReturnArrayListForAll);
        }
 public static GRGEN_MODEL.Own own(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, int threadId)
 {
     return(new GRGEN_MODEL.Own());
 }
 public static bool hurdur(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_MODEL.OwnPownHome a, int threadId)
 {
     return(a != null ? a.aha == null : true);
 }
        // may be employed by parallelized pattern matchers, only needed in case they are called from such one

        public OwnPownHome fn2(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv_, GRGEN_LIBGR.IGraph graph_, OwnPownHome var_oo, int threadId)
        {
            return(var_oo);
        }
 public static void hurdurProc(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_MODEL.OwnPownHome a)
 {
 }
 public static void bloProc(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_LIBGR.INode a, GRGEN_LIBGR.IEdge b, out GRGEN_MODEL.IN res)
 {
     res = ((GRGEN_MODEL.ExternalAttributeEvaluationGraph)graph).CreateNodeN();
 }
 public static void fooProc(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, int a, double b, GRGEN_MODEL.ENUM_Enu c, string d)
 {
 }
 public static GRGEN_MODEL.OwnPown ownPown(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, int threadId)
 {
     GRGEN_MODEL.OwnPown op = new GRGEN_MODEL.OwnPown();
     op.ehe = "hahaha";
     return(op);
 }
        // may be employed by parallelized pattern matchers, only needed in case they are called from such one

        public static bool foo(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, int a, double b, GRGEN_MODEL.ENUM_Enu c, string d, int threadId)
        {
            return(true);
        }
 public static void isnullProc(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, object a, out bool res)
 {
     res = a == null;
 }
 public static void barProc(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, object a, object b, out object res)
 {
     res = a ?? b ?? null;
 }
 public static object bar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, object a, object b, int threadId)
 {
     return(a ?? b ?? null);
 }
 public static void blaProc(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_MODEL.IN a, GRGEN_MODEL.IE b, out bool res1, out bool res2)
 {
     res1 = a.b;
     res2 = !a.b;
     return;
 }
 public static bool isnull(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, object a, int threadId)
 {
     return(a == null);
 }
 public static void harProc(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_MODEL.Own a, GRGEN_MODEL.OwnPown b, out GRGEN_MODEL.OwnPown res1, out GRGEN_MODEL.Own res2, out GRGEN_MODEL.IN res3)
 {
     res1 = b;
     res2 = b;
     res3 = ((GRGEN_MODEL.ExternalAttributeEvaluationGraph)graph).CreateNodeN();
 }
 public static bool bla(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_MODEL.IN a, GRGEN_MODEL.IE b, int threadId)
 {
     return(a.b);
 }
 public void pc2(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv_, GRGEN_LIBGR.IGraph graph_, GRGEN_LIBGR.IGraphElement elem_, string var_ss, Own var_oo, out string _out_param_0, out Own _out_param_1)
 {
     _out_param_0 = var_ss;
     _out_param_1 = var_oo;
     return;
 }
 public static GRGEN_MODEL.IN blo(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_LIBGR.INode a, GRGEN_LIBGR.IEdge b, int threadId)
 {
     return(((GRGEN_MODEL.ExternalAttributeEvaluationGraph)graph).CreateNodeN());
 }
 public string fn3(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv_, GRGEN_LIBGR.IGraph graph_, int threadId)
 {
     return(ehe);
 }
 public static GRGEN_MODEL.OwnPown har(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IGraph graph, GRGEN_MODEL.Own a, GRGEN_MODEL.OwnPown b, int threadId)
 {
     return(a != null ? (a.muh() ? (GRGEN_MODEL.OwnPown)a : b) : null);
 }