public void Visit(object t, object parent, int childIndex, IDictionary unusedlabels) { // the unusedlabels arg is null as visit on token type doesn't set. labels.Clear(); if (owner._Parse(t, pattern, labels)) { visitor.Visit(t, parent, childIndex, labels); } }
/// <summary>Do the recursive work for visit</summary> protected void _Visit(object t, object parent, int childIndex, int ttype, ContextVisitor visitor) { if (t == null) { return; } if (adaptor.GetNodeType(t) == ttype) { visitor.Visit(t, parent, childIndex, null); } int n = adaptor.GetChildCount(t); for (int i = 0; i < n; i++) { object child = adaptor.GetChild(t, i); _Visit(child, t, i, ttype, visitor); } }