public override Tree Evaluate(Tree tree, TregexMatcher tregex) { int newIndex = Coindexer.GenerateIndex(); foreach (TsurgeonMatcher child in ChildMatcher) { Tree node = child.Evaluate(tree, tregex); node.Label().SetValue(node.Label().Value() + CoindexationIntroductionString + newIndex); } return(tree); }
/// <summary> /// Returns null if one of the surgeries eliminates the tree entirely. /// The operated-on tree is not to be trusted in this instance. /// </summary> public override Tree Evaluate(Tree tree, TregexMatcher tregex) { if (Coindexer != null) { Coindexer.SetLastIndex(tree); } foreach (TsurgeonMatcher child in ChildMatcher) { tree = child.Evaluate(tree, tregex); if (tree == null) { return(null); } } return(tree); }