Exemplo n.º 1
0
            /// <summary>
            /// Gets list of direct child nodes.
            /// Cannot be <c>null</c>.
            /// </summary>
            public ReadOnlySpan <ILangElement> GetChildren(ILangElement element)
            {
                if (element != null)
                {
                    _childrenCount = 0;
                    element.VisitMe(this);
                    return(_children.AsSpan(0, _childrenCount));
                }

                //
                return(ReadOnlySpan <ILangElement> .Empty);
            }
Exemplo n.º 2
0
 /// <summary>
 /// Visit language element and all children recursively.
 /// Depth-first search.
 /// </summary>
 /// <param name="element">Any LanguageElement. Can be null.</param>
 public virtual void VisitElement(ILangElement element)
 {
     element?.VisitMe(this);
 }