/// <summary> /// Visit sub nodes of node /// </summary> /// <param name="node">Node to visit children from</param> private void VisitSubNodes(ISyntaxNode node) { foreach (ISyntaxNode subNode in node.GetSubNodes()) { subNode.AcceptVisitor(this); } }
/// <summary> /// Check if an node contains an yield /// </summary> /// <param name="node">Node to check</param> /// <returns>True if node contains yield, otherwise false</returns> private bool NodeContainsYield(ISyntaxNode node) { if (node is YieldStatement) { //Node itself is an yield return(true); } else { //Check subnodes foreach (ISyntaxNode subNode in node.GetSubNodes()) { if (NodeContainsYield(subNode)) { return(true); } } //No Yields found return(false); } }
/// <summary> /// Visit sub nodes of node /// </summary> /// <param name="node">Node to visit children from</param> private void VisitSubNodes(ISyntaxNode node) { foreach(ISyntaxNode subNode in node.GetSubNodes()) { subNode.AcceptVisitor(this); } }