public Matcher(XmlToken parent, string name, XmlNodeType nodeType, Func <ParseContext, Maybe <T> > selector, Action <T> matchAction)
 {
     _Parent      = parent;
     _Name        = name;
     _NodeType    = nodeType;
     _Selector    = selector;
     _MatchAction = matchAction;
 }
            private static IEnumerable <XmlToken> ParseElement(XmlReader reader)
            {
                if (reader.NodeType == XmlNodeType.None && reader.EOF != true)
                {
                    reader.Read();
                }

                yield return(XmlToken.FromReader(reader));

                bool isEmptyElement = reader.IsEmptyElement;

                if (reader.HasAttributes)
                {
                    while (reader.MoveToNextAttribute())
                    {
                        yield return(XmlToken.FromReader(reader));
                    }
                }

                if (isEmptyElement != true)
                {
                    while (ReadPastWhiteSpace(reader))
                    {
                        if (reader.NodeType == XmlNodeType.EndElement)
                        {
                            yield return(XmlToken.FromReader(reader));

                            break;
                        }

                        if (reader.NodeType == XmlNodeType.Text)
                        {
                            yield return(XmlToken.FromReader(reader));
                        }

                        if (reader.NodeType == XmlNodeType.Element)
                        {
                            foreach (var token in ParseElement(reader))
                            {
                                yield return(token);
                            }
                        }
                    }
                }
                else
                {
                    yield return(XmlToken.EndElement);
                }
            }
 public UponBuilder(XmlToken parent)
 {
     _Parent = parent;
 }
 public ParseError(string message, XmlToken token)
 {
     Message = message;
     Token   = token;
 }