Esempio n. 1
0
        DocumentElement ParseChild()
        {
            DocumentElement        result   = null;
            List <DocumentElement> children = null;

            while (_lookahead.Type != TokenType.LeftBracketWithSlash)
            {
                var element = ParseElement();

                if (result == null)
                {
                    result = element;
                    continue;
                }

                if (children == null)
                {
                    children = new List <DocumentElement>()
                    {
                        result
                    }
                }
                ;

                children.Add(element);
            }

            if (children != null)
            {
                result = new DocumentElementGroup(children.ToArray());
            }

            return(result);
        }
    }
Esempio n. 2
0
 internal Tag(string name, Parameter parameter, DocumentElement child)
 {
     Name      = name ?? throw new ArgumentNullException(nameof(name));
     Parameter = parameter;
     Child     = child;
 }