Пример #1
0
        public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
        {
            GRGEN_LGSP.LGSPGraph graph    = actionEnv.graph;
            Match_testRule       curMatch = (Match_testRule)_curMatch;

            GRGEN_LGSP.LGSPNode node_a = curMatch._node_a;
            GRGEN_LGSP.LGSPNode node_f = curMatch._node_f;
            GRGEN_LGSP.LGSPNode node_m = curMatch._node_m;
            graph.SettingAddedNodeNames(testRule_addedNodeNames);
            GRGEN_LGSP.LGSPNode        node_are  = graph.Retype(node_a, GRGEN_MODEL.NodeType_D2211_2222_31.typeVar);
            GRGEN_MODEL.ID2211_2222_31 inode_are = (GRGEN_MODEL.ID2211_2222_31)node_are;
            GRGEN_LGSP.LGSPNode        node_fre  = graph.Retype(node_f, GRGEN_MODEL.NodeType_D231_4121.typeVar);
            GRGEN_MODEL.ID231_4121     inode_fre = (GRGEN_MODEL.ID231_4121)node_fre;
            GRGEN_LGSP.LGSPNode        node_mre  = graph.Retype(node_m, GRGEN_MODEL.NodeType_D11_2221.typeVar);
            GRGEN_MODEL.ID11_2221      inode_mre = (GRGEN_MODEL.ID11_2221)node_mre;
            graph.SettingAddedEdgeNames(testRule_addedEdgeNames);
            {             // eval_0
                int tempvar_0 = (int )1234;
                graph.ChangingNodeAttribute(node_are, GRGEN_MODEL.NodeType_D2211_2222_31.AttributeType_d2211_2222_31, GRGEN_LIBGR.AttributeChangeType.Assign, tempvar_0, null);
                inode_are.@d2211_2222_31 = tempvar_0;
                graph.ChangedNodeAttribute(node_are, GRGEN_MODEL.NodeType_D2211_2222_31.AttributeType_d2211_2222_31);
                int tempvar_1 = (int )5678;
                graph.ChangingNodeAttribute(node_fre, GRGEN_MODEL.NodeType_D231_4121.AttributeType_d231_4121, GRGEN_LIBGR.AttributeChangeType.Assign, tempvar_1, null);
                inode_fre.@d231_4121 = tempvar_1;
                graph.ChangedNodeAttribute(node_fre, GRGEN_MODEL.NodeType_D231_4121.AttributeType_d231_4121);
                int tempvar_2 = (int )9012;
                graph.ChangingNodeAttribute(node_mre, GRGEN_MODEL.NodeType_D11_2221.AttributeType_d11_2221, GRGEN_LIBGR.AttributeChangeType.Assign, tempvar_2, null);
                inode_mre.@d11_2221 = tempvar_2;
                graph.ChangedNodeAttribute(node_mre, GRGEN_MODEL.NodeType_D11_2221.AttributeType_d11_2221);
            }
            return;
        }
        public static bool ApplyXGRS_huh(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv)
        {
            object x = procEnv.GetVariableValue("x");

            GRGEN_LGSP.LGSPGraph   graph   = procEnv.graph;
            GRGEN_LGSP.LGSPActions actions = procEnv.curActions;
            object a = procEnv.GetVariableValue("a");

            GRGEN_MODEL.N node_a = (GRGEN_MODEL.N)a;
            int           val_x  = (int)x;

            // announce change so that debugger can show new value or transaction manager can record it and roll it back
            graph.ChangingNodeAttribute(node_a, GRGEN_MODEL.NodeType_N.AttributeType_i, GRGEN_LIBGR.AttributeChangeType.Assign, val_x, null);
            node_a.i = val_x;
            // add reflexive edge
            GRGEN_MODEL.E someEdge = GRGEN_MODEL.E.CreateEdge(graph, node_a, node_a);
            // here you could do other nifty things like deleting nodes, retyping graph elements, or calling rules
            return(false);
        }