public static bool ApplyXGRS_createEdge(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.INode var_n1, GRGEN_LIBGR.INode var_n2, ref GRGEN_LIBGR.IEdge var_e)
		{
			// it is recommended to create an edge as in the function below, immediately adding it to the graph
			// then you must work with LGSPNodes, casting the INodes you receive as parameters to that concrete type (inheriting from INode)
			var_e = GRGEN_MODEL.E.TypeInstance.CreateEdge(var_n1, var_n2);
			procEnv.graph.AddEdge(var_e); 
			return true;
		}
 public static bool ApplyXGRS_foo(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, int var_v1, double var_v2, GRGEN_MODEL.ENUM_Enu var_v3, string var_v4, bool var_v5, ref int var_r1, ref double var_r2, ref GRGEN_MODEL.ENUM_Enu var_r3, ref string var_r4, ref bool var_r5)
 {
     var_r1 = var_v1;
     var_r2 = var_v2;
     var_r3 = var_v3;
     var_r4 = var_v4;
     var_r5 = var_v5;
     return true;
 }
 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;
 }
コード例 #4
0
ファイル: StdModel.cs プロジェクト: ArsenShnurkov/GrGen
		public static GRGEN_MODEL.@Node CreateNode(GRGEN_LGSP.LGSPNamedGraph graph, string nodeName)
		{
			GRGEN_MODEL.@Node node;
			if(poolLevel == 0)
				node = new GRGEN_MODEL.@Node();
			else
			{
				node = pool[--poolLevel];
				node.lgspInhead = null;
				node.lgspOuthead = null;
				node.lgspFlags &= ~(uint) GRGEN_LGSP.LGSPElemFlags.HAS_VARIABLES;
				// implicit initialization, container creation of Node
			}
			graph.AddNode(node, nodeName);
			return node;
		}
 public static void Filter_filterBass_auto(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact<Rule_filterBass.IMatch_filterBass> matches)
 {
     if(matches.Count<2)
     	return;
     List<Rule_filterBass.IMatch_filterBass> matchesArray = matches.ToList();
     for(int i = 0; i < matchesArray.Count; ++i)
     {
         if(matchesArray[i] == null)
         	continue;
         for(int j = i + 1; j < matchesArray.Count; ++j)
         {
             if(matchesArray[j] == null)
             	continue;
             if(GRGEN_LIBGR.SymmetryChecker.AreSymmetric(matchesArray[i], matchesArray[j], procEnv.graph))
             	matchesArray[j] = null;
         }
     }
     matches.FromList();
 }
コード例 #6
0
		public @GRGEN_MODEL.@writesTo CreateEdgewritesTo(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target, string edgeName)
		{
			return @[email protected](this, source, target, edgeName);
		}
 public static void Filter_f2(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact<Rule_filterBass.IMatch_filterBass> matches)
 {
     // inspect matches carefully and manipulate as needed
     IEnumerator<Rule_filterBass.IMatch_filterBass> e = matches.GetEnumeratorExact();
     while(e.MoveNext())
     {
         Rule_filterBass.IMatch_filterBass match = e.Current;
         if(match.node_n.i != 42)
             break;
     }
 }
 public static void Filter_f1(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact<Rule_filterBase.IMatch_filterBase> matches)
 {
     // just let pass
 }
コード例 #9
0
		public @GRGEN_MODEL.@methodBodyContains CreateEdgemethodBodyContains(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target, string edgeName)
		{
			return @[email protected](this, source, target, edgeName);
		}
 public static bool ApplyXGRS_bla(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_MODEL.IN var_v1, GRGEN_MODEL.IE var_v2, ref GRGEN_MODEL.IN var_r1, ref GRGEN_MODEL.IE var_r2)
 {
     var_r1 = var_v1;
     var_r2 = var_v2;
     return true;
 }
コード例 #11
0
		public @GRGEN_MODEL.@bindsTo CreateEdgebindsTo(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target)
		{
			return @[email protected](this, source, target);
		}
コード例 #12
0
ファイル: StdModel.cs プロジェクト: ArsenShnurkov/GrGen
		public static GRGEN_MODEL.@UEdge CreateEdge(GRGEN_LGSP.LGSPNamedGraph graph, GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target, string edgeName)
		{
			GRGEN_MODEL.@UEdge edge;
			if(poolLevel == 0)
				edge = new GRGEN_MODEL.@UEdge(source, target);
			else
			{
				edge = pool[--poolLevel];
				edge.lgspFlags &= ~(uint) GRGEN_LGSP.LGSPElemFlags.HAS_VARIABLES;
				edge.lgspSource = source;
				edge.lgspTarget = target;
				// implicit initialization, container creation of UEdge
			}
			graph.AddEdge(edge, edgeName);
			return edge;
		}
 public static bool ApplyXGRS_bar(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, object var_v1, object var_v2, ref object var_r1)
 {
     var_r1 = var_v1 ?? var_v2;
     return true;
 }
コード例 #14
0
ファイル: StdModel.cs プロジェクト: ArsenShnurkov/GrGen
		public @UEdge(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target)
			: base(GRGEN_MODEL.EdgeType_UEdge.typeVar, source, target)
		{
			// implicit initialization, container creation of UEdge
		}
コード例 #15
0
ファイル: StdModel.cs プロジェクト: ArsenShnurkov/GrGen
		private @UEdge(GRGEN_MODEL.@UEdge oldElem, GRGEN_LGSP.LGSPNode newSource, GRGEN_LGSP.LGSPNode newTarget)
			: base(GRGEN_MODEL.EdgeType_UEdge.typeVar, newSource, newTarget)
		{
		}
コード例 #16
0
		public static GRGEN_MODEL.@MethodSignature CreateNode(GRGEN_LGSP.LGSPNamedGraph graph, string nodeName)
		{
			GRGEN_MODEL.@MethodSignature node;
			if(poolLevel == 0)
				node = new GRGEN_MODEL.@MethodSignature();
			else
			{
				node = pool[--poolLevel];
				node.lgspInhead = null;
				node.lgspOuthead = null;
				node.lgspFlags &= ~(uint) GRGEN_LGSP.LGSPElemFlags.HAS_VARIABLES;
				// implicit initialization, container creation of MethodSignature
				// explicit initializations of Entity for target MethodSignature
				// explicit initializations of Declaration for target MethodSignature
				// explicit initializations of Feature for target MethodSignature
				// explicit initializations of MethodSignature for target MethodSignature
			}
			graph.AddNode(node, nodeName);
			return node;
		}
コード例 #17
0
		public static GRGEN_MODEL.@Class CreateNode(GRGEN_LGSP.LGSPGraph graph)
		{
			GRGEN_MODEL.@Class node;
			if(poolLevel == 0)
				node = new GRGEN_MODEL.@Class();
			else
			{
				node = pool[--poolLevel];
				node.lgspInhead = null;
				node.lgspOuthead = null;
				node.lgspFlags &= ~(uint) GRGEN_LGSP.LGSPElemFlags.HAS_VARIABLES;
				// implicit initialization, container creation of Class
				// explicit initializations of Entity for target Class
				// explicit initializations of Declaration for target Class
				// explicit initializations of Class for target Class
			}
			graph.AddNode(node);
			return node;
		}
コード例 #18
0
		public @GRGEN_MODEL.@classContainsClass CreateEdgeclassContainsClass(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target, string edgeName)
		{
			return @[email protected](this, source, target, edgeName);
		}
 public static void Filter_f3(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact<Rule_filterBass.IMatch_filterBass> matches)
 {
     // inspect matches carefully and manipulate as needed, 
     // transforming to a List<IMatch> for easier manipulation and back to an IMatchesExact if needed
     List<Rule_filterBass.IMatch_filterBass> matchesArray = matches.ToList();
     matchesArray.Reverse();
     Rule_filterBass.IMatch_filterBass match = matchesArray[matchesArray.Count-1];
     matchesArray[matchesArray.Count - 1] = null; // setting to null is an efficient way to delete, better than List.RemoveAt
     ++match.node_n.i;
     matchesArray.Add(match);
     matchesArray.Reverse();
     matches.FromList();
 }
コード例 #20
0
ファイル: StdModel.cs プロジェクト: ArsenShnurkov/GrGen
		public StdIndexSet(GRGEN_LGSP.LGSPGraph graph)
		{
		}
 public static void Filter_f4(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact<Rule_filterHass.IMatch_filterHass> matches, System.Int32 i, System.String s)
 {
     // inspect matches carefully and manipulate as needed, depending on input parameters
     // transforming to a List<IMatch> for easier manipulation and back to an IMatchesExact if needed
     List<Rule_filterHass.IMatch_filterHass> matchesArray = matches.ToList();
     for(int j = 0; j < matchesArray.Count; ++j)
     {
         Rule_filterHass.IMatch_filterHass match = matchesArray[j];
         if(match.node_n.i < i)
         {
             matchesArray[j] = null; // setting to null is an efficient way to delete, better than List.RemoveAt
         }
         if(match.node_n.s != s)
         {
             match.node_n.s = s;
         }
     }
     matches.FromList();
 }
コード例 #22
0
ファイル: StdModel.cs プロジェクト: ArsenShnurkov/GrGen
		public void FillAsClone(GRGEN_LGSP.LGSPGraph originalGraph, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
		{
		}
 public static bool ApplyXGRS_isnull(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, object var_v1)
 {
     return var_v1 == null;
 }
コード例 #24
0
		public ProgramGraphsOriginalIndexSet(GRGEN_LGSP.LGSPGraph graph)
		{
		}
 public static bool ApplyXGRS_blo(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.INode var_v1, GRGEN_LIBGR.IEdge var_v2, ref GRGEN_LIBGR.INode var_r1, ref GRGEN_LIBGR.IEdge var_r2)
 {
     var_r1 = var_v1;
     var_r2 = var_v2;
     return true;
 }
コード例 #26
0
ファイル: StdModel.cs プロジェクト: ArsenShnurkov/GrGen
		public @GRGEN_MODEL.@UEdge CreateEdgeUEdge(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target)
		{
			return @[email protected](this, source, target);
		}
コード例 #27
0
		public @GRGEN_MODEL.@references CreateEdgereferences(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target, string edgeName)
		{
			return @[email protected](this, source, target, edgeName);
		}
コード例 #28
0
ファイル: StdModel.cs プロジェクト: ArsenShnurkov/GrGen
		public @GRGEN_MODEL.@UEdge CreateEdgeUEdge(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target, string edgeName)
		{
			return @[email protected](this, source, target, edgeName);
		}
 public static void Filter_nomnomnom(GRGEN_LGSP.LGSPGraphProcessingEnvironment procEnv, GRGEN_LIBGR.IMatchesExact<Rule_filterBase.IMatch_filterBase> matches)
 {
     // eat away the single match of the empty rule
     matches.RemoveMatch(0);
 }
コード例 #30
0
		public @GRGEN_MODEL.@calls CreateEdgecalls(GRGEN_LGSP.LGSPNode source, GRGEN_LGSP.LGSPNode target)
		{
			return @[email protected](this, source, target);
		}