public bool ChildOf(YSymbol symbol) { // Performance note: O(n) where n is the number of childs! foreach (var node in symbol.Nodes) { if (node == this) { return(true); } } return(false); }
public bool ParentOf(YSymbol symbol) { // Note: O(n)! foreach (var node in Nodes) { if (node == symbol) { return(true); } } return(false); }