public SemanticStack Clone() { SemanticStack ss = new SemanticStack(); SemanticValue[] svs = vals.ToArray(); for (int i = svs.Length - 1; i >= 0; i--) { ss.Push(svs[i].Clone()); } return(ss); }
/// <summary> /// 开始一个流图结点的编译,继承最左前导块的语义与变量当前引用 /// </summary> /// <param name="node"></param> /// <param name="il"></param> private void BeginGraphNode(FlowGraphNode node) { if (node.SemanticStacks.Count > 0) { semanticStack = node.SemanticStacks[0].Clone(); } else { semanticStack = new SemanticStack(); } if (node.VarReferencesList.Count > 0) { varReferences = new Dictionary <string, DAGNode>(node.VarReferencesList[0]); } else { varReferences = new Dictionary <string, DAGNode>(); } }